From b3041661b30ea32b6fb05839cb5071f032d5d27a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 25 Oct 2015 00:01:12 -0400 Subject: [PATCH] Correctly set syslog user as owner on dokku logs for non-debian systems On debian, rsyslog runs as root, so we don't want to force the non-existent syslog owner. Fix syntax error --- plugins/20_events/install | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/plugins/20_events/install b/plugins/20_events/install index 11dc4a218..c0be526c3 100755 --- a/plugins/20_events/install +++ b/plugins/20_events/install @@ -10,11 +10,26 @@ flag_rsyslog_needs_restart=n # This can be done unconditionally as mkdir -p # exits gracefully if the path already exists mkdir -m 775 -p "$DOKKU_LOGS_DIR" -chgrp dokku "$DOKKU_LOGS_DIR" +case "$DOKKU_DISTRO" in + debian) + chgrp dokku "$DOKKU_LOGS_DIR" + ;; + *) + chown syslog:dokku "$DOKKU_LOGS_DIR" + ;; +esac if [[ ! -f "$DOKKU_EVENTS_LOGFILE" ]]; then touch "$DOKKU_EVENTS_LOGFILE" - chgrp dokku "$DOKKU_EVENTS_LOGFILE" + case "$DOKKU_DISTRO" in + debian) + chgrp dokku "$DOKKU_EVENTS_LOGFILE" + ;; + *) + # chown syslog:root might not work on SUSE + chown syslog:dokku "$DOKKU_EVENTS_LOGFILE" + ;; + esac chmod 664 "$DOKKU_EVENTS_LOGFILE" fi