fail2ban logrotate scripts stops fail2ban logging
On a clean alpine 3.11.5 system:
after akp add fail2ban logrotate
the file /etc/logrotate.d/fail2ban
is installed and run by logrotate which is run by crond on a daily basis.
After a logrotate run, fail2ban no longer logs to /var/log/fail2ban.log
.
It looks like the post-rotate in /etc/logrotate.d/fail2ban
is not correct.
- Currently:
/usr/bin/fail2ban-client set logtarget /var/log/fail2ban.log 1>/dev/null || true
- Proposed:
/usr/bin/fail2ban-client flushlogs 1>/dev/null || true
Note:
- A
service fail2ban reload
does NOT start logging after a rotation. - A
service fail2ban restart
does start logging in /var/log/fail2ban.log