From 8ebfdd217c88c7cb4b0e7f4feb37bfd963757f05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Thu, 12 Nov 2015 13:14:38 +0100 Subject: [PATCH 1/2] [enh] Add logrotate configuration --- debian/logrotate | 11 +++++++++++ debian/yunohost-api.init | 13 +++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 debian/logrotate diff --git a/debian/logrotate b/debian/logrotate new file mode 100644 index 000000000..0bc07ca59 --- /dev/null +++ b/debian/logrotate @@ -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 +} diff --git a/debian/yunohost-api.init b/debian/yunohost-api.init index 0a27554d2..bd9f3a015 100755 --- a/debian/yunohost-api.init +++ b/debian/yunohost-api.init @@ -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 From ce57a406c11e8fa0fe1e37521f09339a783e2d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Thu, 12 Nov 2015 13:32:30 +0100 Subject: [PATCH 2/2] [fix] Enable yunohost-api systemd service manually --- debian/rules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/rules b/debian/rules index 311b79678..2208e0623 100755 --- a/debian/rules +++ b/debian/rules @@ -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