mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Add logrotate configuration
This commit is contained in:
parent
acd1d051c2
commit
8ebfdd217c
2 changed files with 24 additions and 0 deletions
11
debian/logrotate
vendored
Normal file
11
debian/logrotate
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
/var/log/yunohost/*.log {
|
||||
weekly
|
||||
rotate 4
|
||||
delaycompress
|
||||
compress
|
||||
notifempty
|
||||
missingok
|
||||
postrotate
|
||||
invoke-rc.d yunohost-api rotate >/dev/null 2>&1
|
||||
endscript
|
||||
}
|
13
debian/yunohost-api.init
vendored
13
debian/yunohost-api.init
vendored
|
@ -75,6 +75,14 @@ do_reload() {
|
|||
return 0
|
||||
}
|
||||
|
||||
#
|
||||
# Function called when rotating logs
|
||||
#
|
||||
do_rotate() {
|
||||
start-stop-daemon --stop --signal USR1 --quiet --pidfile $PID --name $NAME
|
||||
return 0
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
|
||||
|
@ -118,6 +126,11 @@ case "$1" in
|
|||
;;
|
||||
esac
|
||||
;;
|
||||
rotate)
|
||||
log_daemon_msg "Re-opening $DESC log files" "$NAME"
|
||||
do_rotate
|
||||
log_end_msg $?
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|status|restart|reload}" >&2
|
||||
exit 3
|
||||
|
|
Loading…
Add table
Reference in a new issue