From 9b0b706013d8f56deb89241de0c85caf51715889 Mon Sep 17 00:00:00 2001 From: GambleCodez Affiliates Date: Fri, 20 Feb 2026 18:01:57 -0600 Subject: [PATCH] Harden logrotate paths and avoid service restart on rotate --- .gitignore | 8 ++++++++ README.md | 1 + runewager.logrotate | 7 ++----- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 3c7c6fb..98b390e 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,11 @@ env.* # Legacy runtime state bot_state.json + +# Generated runtime backups +data/backups/* +!data/backups/.gitkeep + +# Service log artifacts +runewager-*.log +crash.log diff --git a/README.md b/README.md index 26b5f2d..6ce4000 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,7 @@ sudo apt-get install -y nodejs sudo useradd --system --create-home --shell /usr/sbin/nologin runewager || true sudo mkdir -p /var/www/html/Runewager sudo chown -R "$USER":"$USER" /var/www/html/Runewager +# Keep directory casing exactly as "Runewager" to match systemd paths # 3) Clone or update repo cd /var/www/html/Runewager diff --git a/runewager.logrotate b/runewager.logrotate index 1bc2d7a..c363d8d 100644 --- a/runewager.logrotate +++ b/runewager.logrotate @@ -1,4 +1,4 @@ -/var/www/runewager/logs/runewager-1.log /var/www/runewager/logs/crash.log { +/var/www/html/Runewager/logs/runewager*.log /var/www/html/Runewager/logs/crash.log /var/www/html/runewager/logs/runewager*.log /var/www/html/runewager/logs/crash.log { daily size 5M rotate 7 @@ -6,9 +6,6 @@ notifempty compress delaycompress + copytruncate create 0640 runewager runewager - sharedscripts - postrotate - /bin/systemctl try-restart runewager.service >/dev/null 2>&1 || true - endscript }