[Python-modules-team] Bug#956681: /etc/logrotate.d/fail2ban cause logrotate failures when fail2ban isn't running.
Ron Varburg
ronvarburg at yahoo.com
Tue Apr 14 10:30:55 BST 2020
Package: fail2ban
Version: 0.10.2-2.1
Severity: normal
Tags: patch
The following patch:
1. Prevents logrotate failures when fail2ban doesn't run for any reason.
When fail2ban isn't running, fail2ban-client flushlogs exits with an error
code. I think announcing fail2ban isn't running should not be made by
making logrotate to fail.
2. Doesn't rotate empty log files.
--- a/etc/logrotate.d/fail2ban 2018-04-04 04:47:53.000000000 +0000
+++ b/etc/logrotate.d/fail2ban 2020-04-13 09:58:32.995426248 +0000
@@ -1,5 +1,6 @@
/var/log/fail2ban.log {
+ notifempty
weekly
rotate 4
compress
@@ -7,7 +8,7 @@
delaycompress
missingok
postrotate
- fail2ban-client flushlogs 1>/dev/null
+ fail2ban-client flushlogs 1>/dev/null || true
endscript
# If fail2ban runs as non-root it still needs to have write access
More information about the Python-modules-team
mailing list