From b5c5a907a530144edec13faa144c46146d3abada Mon Sep 17 00:00:00 2001 From: Helder Oliveira Date: Mon, 30 Oct 2023 17:40:29 +0000 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20journald=20amends?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install_native | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/install_native b/scripts/install_native index 5fe24d5..4e15a47 100644 --- a/scripts/install_native +++ b/scripts/install_native @@ -63,6 +63,7 @@ defaultPortRangeUDPStart=4300 defaultPortRangeUDPEnd=4399 defaultPortRangeTCP="$defaultPortRangeTCPStart-$defaultPortRangeTCPStart" defaultPortRangeUDP="$defaultPortRangeUDPStart-$defaultPortRangeUDPEnd" +defaultJournaldConfigFilePath="/etc/systemd/journald.conf" defaultLogRotateBinFilename="logrotate" defaultLogRotateConfigFile="/etc/logrotate.conf" defaultLogRotatePath="/etc/logrotate.d" @@ -190,12 +191,13 @@ hasFreePortRange() { } setupJournald() { - while read -rp "🤖 The Fleek Network Node streams a lot of text data that is stored in the log files. It can fill up the disk space quite quickly. The installer can set the journald configuration to limit the maximum usage and file size for system-wide logs, this will effectively override any settings you might currently have. Would you like the installer to make the changes for you? (yes/no)" answer; do + echo + while read -rp "🤖 The Fleek Network Node streams a lot of text data that is stored in the log files. It can fill up the disk space quite quickly. The installer can set the journald configuration to limit the maximum usage and file size for system-wide logs, but this will effectively override any settings you might currently have. Would you like the installer to make the changes for you? (yes/no) " answer; do if [[ "$answer" == [nN] || "$answer" == [nN][oO] ]]; then break elif [[ "$answer" == [yY] || "$answer" == [yY][eE][sS] ]]; then # The padding for [Journal] is intentional - cat < /etc/systemd/journald.conf + cat < /dev/null [Journal] Storage=persistent SystemMaxUse=1G @@ -225,13 +227,14 @@ setupLogrotate() { sudo mkdir -p "$defaultLogRotatePath" else echo "✅ The $defaultLogRotatePath exists!" + echo fi if [[ ! -f "$defaultLogRotateLightningConf" ]]; then sudo touch "$defaultLogRotateLightningConf" # warning: the identation for `/var/log/lightning/*.log` is intentional, do not change - cat > "$defaultLogRotateLightningConf" < /dev/null $defaultLogRotateLightningLogsPath { rotate 5 daily @@ -245,6 +248,7 @@ EOF echo "⚠️ WARNING: The $defaultLogRotateLightningConf exists but doesn't seem valid. You should check it manually!" else echo "✅ The $defaultLogRotateLightningConf exists!" + echo fi fi fi