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
This commit is contained in:
Jose Diaz-Gonzalez
2015-10-25 00:01:12 -04:00
parent 66833f12a0
commit b3041661b3

View File

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