From 197c767d7d3506e208063e1d24f3afb336e9335e Mon Sep 17 00:00:00 2001 From: Brian Orpin Date: Sun, 5 Feb 2023 19:36:44 +0000 Subject: [PATCH] Delete the folder /var/log/journal if present https://github.com/openenergymonitor/EmonScripts/issues/148#issuecomment-1418244722 If the folder is present, journald defaults to persistent journal files. If deleted, it reverts to volatile journal files by default. The size of the files is limited to 10% of available space on mount point. --- install.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install.sh b/install.sh index 6cee0e3..db8d4b3 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,13 @@ #!/usr/bin/env sh +# Under latest RPi-OS the folder /var/log/journal is created so journald reverts to persistent journal files +# Delete this folder and restart service +if [ -d /var/log/journal ]; then + echo "/var/log/journal present - remove for volatile journal files" + sudo rm -rf /var/log/journal + sudo systemctl restart systemd-journald +fi + systemctl -q is-active log2ram && { echo "ERROR: log2ram service is still running. Please run \"sudo service log2ram stop\" to stop it."; exit 1; } [ "$(id -u)" -eq 0 ] || { echo "You need to be ROOT (sudo can be used)"; exit 1; }