diff --git a/setup/start.sh b/setup/start.sh index f35260b88..e90955a6e 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -80,13 +80,14 @@ sed -e "s/^#SystemMaxUse=.*$/SystemMaxUse=100M/" \ sed -e "s/^WatchdogSec=.*$/WatchdogSec=3min/" \ -i /lib/systemd/system/systemd-journald.service -# Give user access to system logs -usermod -a -G systemd-journal ${USER} -mkdir -p /var/log/journal # in some images, this directory is not created making system log to /run/systemd instead -chown root:systemd-journal /var/log/journal +usermod -a -G systemd-journal ${USER} # Give user access to system logs +if [[ ! -d /var/log/journal ]]; then # in some images, this directory is not created making system log to /run/systemd instead + mkdir -p /var/log/journal + chown root:systemd-journal /var/log/journal + chmod g+s /var/log/journal # sticky bit for group propagation +fi systemctl daemon-reload systemctl restart systemd-journald -setfacl -n -m u:${USER}:r /var/log/journal/*/system.journal # Give user access to nginx logs (uses adm group) usermod -a -G adm ${USER}