Bug 240920 - RFE: logrotate config for fail2ban
RFE: logrotate config for fail2ban
Product: Fedora
Classification: Fedora
Component: fail2ban (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Axel Thimm
Fedora Extras Quality Assurance
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2007-05-22 17:09 EDT by Zing
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version: 0.8.0-7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-05-23 16:18:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Zing 2007-05-22 17:09:22 EDT
Description of problem:
could you add a logrotate cfg file for /var/log/fail2ban.log

Version-Release number of selected component (if applicable):
0.8.0-4.fc6 and devel

Additional Info:
Just want to put this here so I/we don't forget this RFE...

I'm actually not sure what the "proper" way to notify the new 0.8 daemon to
start logging to a new log file once logrotate has moved the current one away...
when I get a chance I'll take a look at it, unless someone else has done the
work already...  I'd like something similar to yum's logrotate by default (size
based vs time based) but whatever works.  thanks.
Comment 1 Jonathan Underwood 2007-05-23 05:54:16 EDT
Have you tried creating a file in /etc/logrotate.d called fail2ban and
containing this:
/var/log/fail2ban.log {
    size 30k
    create 0600 root root

If you can verify that that works, I'm sure Axel could add it to the rpm at some

Comment 2 Zing 2007-05-23 10:00:13 EDT
i should have mentioned i did try that config from yum logrotate, but in my
minimal testing it did _not_ work... fail2ban just kept logging to the old log
file: /var/log/fail2ban.log.1.

i think the checked in fix in cvs won't work, but I might be wrong in my quick
testing prior...
Comment 3 Zing 2007-05-23 15:22:33 EDT
i need to add a reload and this works for me:

--- fail2ban-logrotate.orig     2007-05-23 15:16:34.000000000 -0400
+++ fail2ban-logrotate  2007-05-23 15:17:09.000000000 -0400
@@ -3,4 +3,7 @@
     size 30k
     create 0600 root root
+    postrotate
+        /usr/bin/fail2ban-client reload 2> /dev/null || true
+    endscript

Note You need to log in before you can comment on or make changes to this bug.