From 69aba0636105ee54639b95a94fc0813a6b969471 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Sun, 28 Jun 2015 23:25:50 +0100 Subject: [PATCH] Handle log rotation As requested by @josegonzalez. --- plugins/20_events/install | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/plugins/20_events/install b/plugins/20_events/install index 384154bc4..1d352792b 100755 --- a/plugins/20_events/install +++ b/plugins/20_events/install @@ -3,6 +3,9 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$(dirname $0)/../common/functions" DOKKU_RSYSLOG_FILTER=/etc/rsyslog.d/99-dokku.conf +DOKKU_LOGROTATE_FILE=/etc/logrotate.d/dokku + +flag_rsyslog_needs_restart=n if [[ ! -f "$DOKKU_EVENTS_LOGFILE" ]]; then touch "$DOKKU_EVENTS_LOGFILE" @@ -15,6 +18,29 @@ if [[ ! -f "$DOKKU_RSYSLOG_FILTER" ]]; then cat >"$DOKKU_RSYSLOG_FILTER" <"$DOKKU_LOGROTATE_FILE" </dev/null 2>&1 || true + endscript + create 664 syslog dokku +} +EOF + flag_rsyslog_needs_restart=y +fi + +if [[ "$flag_rsyslog_needs_restart" == "y" ]]; then service rsyslog restart fi