Bug 240920 - RFE: logrotate config for fail2ban
Summary: RFE: logrotate config for fail2ban
Alias: None
Product: Fedora
Classification: Fedora
Component: fail2ban (Show other bugs)
(Show other bugs)
Version: rawhide
Hardware: All Linux
Target Milestone: ---
Assignee: Axel Thimm
QA Contact: Fedora Extras Quality Assurance
Keywords: Reopened
Depends On:
TreeView+ depends on / blocked
Reported: 2007-05-22 21:09 UTC by Zing
Modified: 2007-11-30 22:12 UTC (History)
0 users

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

Attachments (Terms of Use)

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 {
    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 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 @@
     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.