From ff2359af303e84fd08c81ab7d53b410d552ac661 Mon Sep 17 00:00:00 2001 From: s13k Date: Sun, 24 Nov 2024 19:27:05 +0200 Subject: [PATCH] fix(tools): Prevent dragonfly.logrotate to stop logrotate service (#4176) Update dragonfly.logrotate If multiple logs are being rotated and one of them fails (due to exit 1), the other logs that follow won't be rotated either, unless logrotate is run again. If you want to prevent the rotation of a specific log file and not affect the rest of the logs, you'll want to handle the condition properly to ensure that logrotate doesn't abort due to the failure of the prerotate script. To prevent the rotation of a specific log file without causing issues for other logs, you can use exit 0 to prevent rotation cleanly or design your prerotate script to handle conditions carefully. Signed-off-by: s13k --- tools/packaging/debian/dragonfly.logrotate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/packaging/debian/dragonfly.logrotate b/tools/packaging/debian/dragonfly.logrotate index 2047f613e..f8f9270c1 100644 --- a/tools/packaging/debian/dragonfly.logrotate +++ b/tools/packaging/debian/dragonfly.logrotate @@ -15,7 +15,7 @@ prerotate if lsof -t $1 > /dev/null; then # file is open. Skipping rotation." - exit 1 + exit 0 fi endscript