Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Fail2ban refuses to stop
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Elleni
Veteran
Veteran


Joined: 23 May 2006
Posts: 1270

PostPosted: Tue Oct 24, 2017 12:50 am    Post subject: [solved] Fail2ban refuses to stop Reply with quote

I setup fail2ban with postfix-sasl jail. I also setup persistent bans as described here:
https://arno0x0x.wordpress.com/2015/12/30/fail2ban-permanent-persistent-bans/

and it works fine, only when trying to stop fail2ban, it fails.

/etc/init.d/fail2ban stop gives

1 process refused to stop.

Is this a known problem, and how can I solve this ?

After some tries, I get status of fail2ban service crashed, and can restart it afterwards.

Following error is seen in fail2ban.log:
Code:
2017-10-24 02:46:14,391 fail2ban.server         [24073]: INFO    Stopping all jails
2017-10-24 02:46:14,391 fail2ban.jail           [24073]: INFO    Jail 'postfix-sasl' stopped
2017-10-24 02:46:14,392 fail2ban.jail           [24073]: INFO    Jail 'postfix-sasl' stopped
2017-10-24 02:46:14,393 fail2ban                [24073]: ERROR   'postfix-sasl'
Traceback (most recent call last):
  File "/usr/lib64/python3.4/site-packages/fail2ban/server/jails.py", line 77, in __getitem__
    return self._jails[name]
KeyError: 'postfix-sasl'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/fail2ban-server", line 128, in start
    self.__conf["force"])
  File "/usr/lib64/python3.4/site-packages/fail2ban/server/server.py", line 117, in start
    self.__asyncServer.start(sock, force)
  File "/usr/lib64/python3.4/site-packages/fail2ban/server/asyncserver.py", line 158, in start
    asyncore.loop(use_poll=True) # workaround for the "Bad file descriptor" issue on Python 2.7, gh-161
  File "/usr/lib64/python3.4/asyncore.py", line 208, in loop
    poll_fun(timeout, map)
  File "/usr/lib64/python3.4/asyncore.py", line 186, in poll2
    r = pollster.poll(timeout)
  File "/usr/lib64/python3.4/site-packages/fail2ban/server/server.py", line 77, in __sigTERMhandler
    self.quit()
  File "/usr/lib64/python3.4/site-packages/fail2ban/server/server.py", line 138, in quit
    self.stopAllJail()
  File "/usr/lib64/python3.4/site-packages/fail2ban/server/server.py", line 180, in stopAllJail
    self.stopJail(jail)
  File "/usr/lib64/python3.4/site-packages/fail2ban/server/server.py", line 171, in stopJail
    self.delJail(name)
  File "/usr/lib64/python3.4/site-packages/fail2ban/server/server.py", line 154, in delJail
    self.__db.delJail(self.__jails[name])
  File "/usr/lib64/python3.4/site-packages/fail2ban/server/jails.py", line 79, in __getitem__
    raise UnknownJailException(name)
fail2ban.exceptions.UnknownJailException: 'postfix-sasl'
2017-10-24 02:46:14,394 fail2ban.server         [24073]: INFO    Stopping all jails


Last edited by Elleni on Thu Nov 02, 2017 8:10 pm; edited 1 time in total
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30888
Location: here

PostPosted: Tue Oct 24, 2017 6:24 am    Post subject: Reply with quote

Read here
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Elleni
Veteran
Veteran


Joined: 23 May 2006
Posts: 1270

PostPosted: Thu Nov 02, 2017 8:10 pm    Post subject: Reply with quote

Solved by adding --retry 80 in /etc/init.d/fail2ban.

Thanks for help :D

https://github.com/fail2ban/fail2ban/issues/1793
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum