Bug 13277 - fail2ban fails to stop properly and causes slow computer shutdown
Summary: fail2ban fails to stop properly and causes slow computer shutdown
Status: RESOLVED OLD
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 4
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Remco Rijnders
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-28 18:35 CEST by François Andriot
Modified: 2015-10-27 06:58 CET (History)
1 user (show)

See Also:
Source RPM: fail2ban-0.8.13-2.mga4.src.rpm
CVE:
Status comment:


Attachments

Description François Andriot 2014-04-28 18:35:34 CEST
Hello,
I'm running the "fail2ban" utility on Mageia 4 (source package: fail2ban-0.8.13-2.mga4.src.rpm)

I've created my "jail.local" configuration file as follow (only 1 jail configured, which is copy/paste from the example in "jail.conf"):

$ cat /etc/fail2ban/jail.local 
# Fail2Ban configuration file

[ssh-iptables]

enabled  = true
filter   = sshd
action   = iptables[name=SSH, port=ssh, protocol=tcp]
           sendmail-whois[name=SSH, dest=XXXXXXXXXXX@XXXXX.XXX, sender=fail2ban@XXXXXX.XXX]
logpath  = /var/log/auth.log
maxretry = 3




The daemon starts and works as expected.
However, stopping it is another story.

Stopping the service with command:
# systemctl stop fail2ban.service
Takes a long time (about 2 minutes) to complete.

My "/var/log/messages" file shows that it does not stop correctly :

Apr 28 18:30:22 arcadia fail2ban.server[1602]: INFO Stopping all jails
Apr 28 18:30:22 arcadia fail2ban[1602]: ERROR 'Failed to stop monitor on /var/log/auth.log': connection error#012Traceback (most recent call last):#012  File "/usr/bin/fail2ban-server", line 132, in start#012    self.__conf["force"])#012  File "/usr/share/fail2ban/server/server.py", line 87, in start#012    self.__asyncServer.start(sock, force)#012  File "/usr/share/fail2ban/server/asyncserver.py", line 143, in start#012    asyncore.loop(use_poll = False) # fixes the "Unexpected communication problem" issue on Python 2.6 and 3.0#012  File "/usr/lib64/python2.7/asyncore.py", line 216, in loop#012    poll_fun(timeout, map)#012  File "/usr/lib64/python2.7/asyncore.py", line 145, in poll#012    r, w, e = select.select(r, w, e, timeout)#012  File "/usr/share/fail2ban/server/server.py", line 55, in __sigTERMhandler#012    self.quit()#012  File "/usr/share/fail2ban/server/server.py", line 108, in quit#012    self.stopAllJail()#012  File "/usr/share/fail2ban/server/server.py", line 147, in stopAllJail#012    self.stopJail(jail)#012  File "/usr/share/fail2ban/server/server.py", line 137, in stopJail#012    self.__jails.get(name).stop()#012  File "/usr/share/fail2ban/server/jail.py", line 137, in stop#012    self.__filter.stop()#012  File "/usr/share/fail2ban/server/filtergamin.py", line 125, in stop#012    self.__cleanup()#012  File "/usr/share/fail2ban/server/filtergamin.py", line 132, in __cleanup#012    self.monitor.stop_watch(path.getFileName())#012  File "/usr/lib64/python2.7/site-packages/gamin.py", line 203, in stop_watch#012    obj.cancel()#012  File "/usr/lib64/python2.7/site-packages/gamin.py", line 125, in cancel#012    (self.path)))#012GaminException: 'Failed to stop monitor on /var/log/auth.log': connection error
Apr 28 18:30:22 arcadia fail2ban.server[1602]: INFO Stopping all jails
Apr 28 18:31:52 arcadia systemd[1]: fail2ban.service stopping timed out. Killing.
Apr 28 18:31:52 arcadia systemd[1]: Stopped fail2ban attack scanner.
Apr 28 18:31:52 arcadia systemd[1]: Unit fail2ban.service entered failed state.


Reproducible: yes, every time

The noticeable problem is that it makes my computer slow to poweroff.
François Andriot 2014-04-28 18:38:55 CEST

Source RPM: (none) => fail2ban-0.8.13-2.mga4.src.rpm

David Walser 2014-04-30 19:52:06 CEST

Assignee: bugsquad => remco

Comment 1 Kristoffer Grundström 2014-10-03 15:53:11 CEST
I can't seem to find the auth.log in /var/log even after a fresh installation of Mageia 4 on my Toshiba Satellite L755-1DR laptop. Is it supposed to be created with the jail.local file when it's used?

CC: (none) => kristoffer.grundstrom1983

Comment 2 Samuel Verschelde 2015-09-21 13:21:14 CEST
Mageia 4 changed to end-of-life (EOL) status on 2015-09-19. It is is no longer 
maintained, which means that it will not receive any further security or bug 
fix updates.

Package Maintainer: If you wish for this bug to remain open because you plan to 
fix it in a currently maintained version, simply change the 'version' to a later 
Mageia version.

Bug Reporter: Thank you for reporting this issue and we are sorry that we weren't 
able to fix it before Mageia 4's end of life. If you are able to reproduce it 
against a later version of Mageia, you are encouraged to click on "Version" and 
change it against that version of Mageia. If it's valid in several versions, 
select the highest and add MGAxTOO in whiteboard for each other valid release.
Example: it's valid in cauldron and Mageia 5, set to cauldron and add MGA5TOO.

Although we aim to fix as many bugs as possible during every release's lifetime, 
sometimes those efforts are overtaken by events. Often a more recent Mageia 
release includes newer upstream software that fixes bugs or makes them obsolete.

If you would like to help fixing bugs in the future, don't hesitate to join the
packager team via our mentoring program [1] or join the teams that fit you 
most [2].

[1] https://wiki.mageia.org/en/Becoming_a_Mageia_Packager
[2] http://www.mageia.org/contribute/
Comment 3 Marja Van Waes 2015-10-27 06:58:17 CET
As announced over a month ago, Mageia 4 changed to end-of-life (EOL) status on 2015-09-19. It is is no longer maintained, which means that it will not receive any further security or bug fix updates.

This issue may have been fixed in a later Mageia release, so, if you still see it and didn't already do so: please upgrade to Mageia 5 (or, if you read this much later than this is written: make sure you run a currently maintained Mageia version)

If you are able to reproduce it against a maintained version of Mageia, you are encouraged to 
1. reopen this bug report, by changing the "Status" from "RESOLVED - OLD" to "REOPENED"
2. click on "Version" and change it against that version of Mageia. If you know it's valid in several versions, select the highest and add MGAxTOO in whiteboard for each other valid release.
Example: it's valid in cauldron and Mageia 5, set to cauldron and add MGA5TOO.
3. give as much relevant information as possible. If you're not an experienced bug reporter and have some time: please read this page:
https://wiki.mageia.org/en/How_to_report_a_bug_properly

If you see a similar issue, but are _not_sure_ it is the same, with the same cause, then please file a new bug report and mention this one in it (please include the bug number, too). 


If you would like to help fixing bugs in the future, don't hesitate to join the
packager team via our mentoring program [1] or join the teams that fit you 
most [2].
[1] https://wiki.mageia.org/en/Becoming_a_Mageia_Packager
[2] http://www.mageia.org/contribute/

Status: NEW => RESOLVED
Resolution: (none) => OLD


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