From 73315a42fef03bc144fdfd707b8a6d5905733109 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 28 Sep 2021 19:20:21 -0700 Subject: [PATCH] setup: fix journalctl configuration /var/log/journal/*/system.journal does not exist on some systems https://forum.cloudron.io/topic/4068/installation-failed-on-20-04-server https://forum.cloudron.io/topic/5731/time4vps-installation-error --- setup/start.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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}