Skip to content

Commit

Permalink
Merge pull request #38 from nicolasbock/lp-1997192
Browse files Browse the repository at this point in the history
Add logrotate to snap
  • Loading branch information
wallyworld authored Apr 26, 2024
2 parents b4171cf + c490a2a commit 4f156bf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions logrotate/juju-db.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/var/snap/juju-db/common/logs/mongodb.log {
weekly
rotate 5
compress
delaycompress
missingok
notifempty
create 0644 root root
copytruncate
}
15 changes: 15 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ apps:
- system-observe
- mount-observe

logrotate:
command: usr/sbin/logrotate --verbose --state $SNAP_COMMON/logrotate.state $SNAP/etc/logrotate-juju-db.conf
daemon: simple
restart-condition: on-failure
timer: 00:00

mongod:
command: bin/mongod
plugs:
Expand Down Expand Up @@ -62,6 +68,7 @@ parts:
plugin: dump
source: snap/local/
source-type: local

mongo-tools:
source: https://github.com/mongodb/mongo-tools
source-type: git
Expand Down Expand Up @@ -173,3 +180,11 @@ parts:
do strip -s $file;
done
mv $SNAPCRAFT_PART_BUILD/build/install/bin $SNAPCRAFT_PART_INSTALL/
logrotate:
plugin: dump
source: logrotate
stage-packages:
- logrotate
organize:
juju-db.conf: etc/logrotate-juju-db.conf

0 comments on commit 4f156bf

Please sign in to comment.