Bug 240920

Summary: RFE: logrotate config for fail2ban
Product: [Fedora] Fedora Reporter: Zing <zing>
Component: fail2banAssignee: Axel Thimm <axel.thimm>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideKeywords: Reopened
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.8.0-7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-05-23 20:18:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Zing 2007-05-22 21:09:22 UTC
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 09:54:16 UTC
Have you tried creating a file in /etc/logrotate.d called fail2ban and
containing this:
/var/log/fail2ban.log {
    missingok
    notifempty
    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
point.



Comment 2 Zing 2007-05-23 14:00:13 UTC
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 19:22:33 UTC
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 @@
     notifempty
     size 30k
     create 0600 root root
+    postrotate
+        /usr/bin/fail2ban-client reload 2> /dev/null || true
+    endscript
 }