Merge remote-tracking branch 'origin/unstable' into unstable

This commit is contained in:
Weblate 2015-11-12 13:32:40 +01:00
commit f6a4bf9e77
3 changed files with 27 additions and 0 deletions

11
debian/logrotate vendored Normal file
View 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
}

3
debian/rules vendored
View file

@ -10,3 +10,6 @@
override_dh_installinit:
dh_installinit --name=yunohost-api
dh_installinit --name=yunohost-firewall --no-start
override_dh_systemd_enable:
dh_systemd_enable --name=yunohost-api

View file

@ -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