From 63c7ceb81d2a3e46c916a2e3c530fa7ec83f8c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 13 Sep 2015 10:57:51 +0300 Subject: [PATCH 1/2] logrotate: Remove outdated Fedora comment --- files/fail2ban-logrotate | 3 --- 1 file changed, 3 deletions(-) diff --git a/files/fail2ban-logrotate b/files/fail2ban-logrotate index a09870af..ef4da852 100644 --- a/files/fail2ban-logrotate +++ b/files/fail2ban-logrotate @@ -4,9 +4,6 @@ # # Debian: # https://github.com/fail2ban/fail2ban/blob/debian/debian/fail2ban.logrotate -# -# Fedora view: -# http://pkgs.fedoraproject.org/cgit/fail2ban.git/tree/fail2ban-logrotate /var/log/fail2ban.log { rotate 7 From 67a94733a9b3eec7e325dcdbbf411473770d36bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 13 Sep 2015 11:01:22 +0300 Subject: [PATCH 2/2] logrotate: Do not rotate empty logs As a useful side effect, prevents "Unable to contact server. Is it running?" mails from cron when fail2ban hasn't been (intentionally) running nor thus logging anything either. --- ChangeLog | 1 + files/fail2ban-logrotate | 1 + 2 files changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2fec408a..811473e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,7 @@ ver. 0.9.4 (2015/XX/XXX) - wanna-be-released - New Features: - Enhancements: + * Do not rotate empty log files ver. 0.9.3 (2015/08/01) - lets-all-stay-friends ---------- diff --git a/files/fail2ban-logrotate b/files/fail2ban-logrotate index ef4da852..8d94a8b3 100644 --- a/files/fail2ban-logrotate +++ b/files/fail2ban-logrotate @@ -8,6 +8,7 @@ /var/log/fail2ban.log { rotate 7 missingok + notifempty compress postrotate /usr/bin/fail2ban-client flushlogs 1>/dev/null || true