Fail2ban Update (epel) Breaks Logrotate

Home » CentOS » Fail2ban Update (epel) Breaks Logrotate
CentOS 1 Comment

Apologies, this is slightly off-topic being to do with an EPEL package, although it’s running on CentOS6, so I thought others here might have come across this issue.

I have five CentOS 6 systems running fail2ban from EPEL, and this package was updated in the last week from 0.9.2-1.el6 to 0.9.3-1.el6.

On all these systems, I received an error from logrotate this morning.

It appears that something has broken the flushlogs option in fail2ban-client:

[root@system ~]# cat /etc/logrotate.d/fail2ban
#
# Gentoo:
# http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-analyzer/fail2ban/files/fail2ban-logrotate?view=markup
#
# 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
missingok
compress
postrotate
/usr/bin/fail2ban-client flushlogs 1>/dev/null || true
endscript
}
[root@system ~]# /usr/bin/fail2ban-client flushlogs logs: rolled over Traceback (most recent call last):
File “/usr/bin/fail2ban-client”, line 470, in
if client.start(sys.argv):
File “/usr/bin/fail2ban-client”, line 440, in start
return self.__processCommand(args)
File “/usr/bin/fail2ban-client”, line 281, in __processCommand
return self.__processCmd([cmd])
File “/usr/bin/fail2ban-client”, line 185, in __processCmd
client.close()
File “/usr/lib/python2.6/site-packages/fail2ban/client/csocket.py”, line 55, in close
self.__csock.sendall(CSPROTO.CLOSE + CSPROTO.END)
File ““, line 1, in sendall socket.error: [Errno 32] Broken pipe
[root@system ~]#

Has anyone else found this today? And even better know how to fix it?

There doesn’t seem to be any current activity in epel-users, and I found the update announcement in epel-package-announce, but didn’t see anything about this in the “IMPORTANT incompatible changes” section.

Cheers Tony

One thought on - Fail2ban Update (epel) Breaks Logrotate

  • In article , Tony Mountifield wrote:

    OK, on further investigation, I found that the fail2ban service had not been restarted by the update script.

    So I restarted it, and got the same error as it was stopping, but it started up ok. After restarting, the error no longer occurs:

    [root@system ~]# ps -fC fail2ban-server root 7528 1 0 Sep23 ? 00:10:06 /usr/bin/python -Es /usr/bin/fail2ban-server -s /var/run/fail2ban/fail2ban.sock -p /var/run/fail2ban/fail2ban.pid -x -b
    [root@system ~]# service fail2ban restart Stopping fail2ban: Traceback (most recent call last):
    File “/usr/bin/fail2ban-client”, line 470, in
    if client.start(sys.argv):
    File “/usr/bin/fail2ban-client”, line 440, in start
    return self.__processCommand(args)
    File “/usr/bin/fail2ban-client”, line 281, in __processCommand
    return self.__processCmd([cmd])
    File “/usr/bin/fail2ban-client”, line 185, in __processCmd
    client.close()
    File “/usr/lib/python2.6/site-packages/fail2ban/client/csocket.py”, line 55, in close
    self.__csock.sendall(CSPROTO.CLOSE + CSPROTO.END)
    File ““, line 1, in sendall socket.error: [Errno 32] Broken pipe
    [FAILED]
    Starting fail2ban: [ OK ]
    [root@system ~]# ps -fC fail2ban-server root 11647 1 1 15:30 ? 00:00:00 /usr/bin/python -Es /usr/bin/fail2ban-server -s /var/run/fail2ban/fail2ban.sock -p /var/run/fail2ban/fail2ban.pid -x -b
    [root@system ~]# /usr/bin/fail2ban-client flushlogs logs: rolled over
    [root@system ~]#

    Hope this info is useful to others…

    Cheers Tony