Skip to content

Commit

Permalink
fix(tools): Prevent dragonfly.logrotate to stop logrotate service (#4176
Browse files Browse the repository at this point in the history
)

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 <[email protected]>
  • Loading branch information
s0xDk authored Nov 24, 2024
1 parent 6a7f345 commit ff2359a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/packaging/debian/dragonfly.logrotate
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
prerotate
if lsof -t $1 > /dev/null; then
# file is open. Skipping rotation."
exit 1
exit 0
fi
endscript

Expand Down

0 comments on commit ff2359a

Please sign in to comment.