mirror of https://github.com/fail2ban/fail2ban
BF: stop all communications before stopping the jails (Close gh-7)
It is necessary because otherwise if jails actions try to communicate to the server we are getting a lockup since threads are locked_tent/expose_banned_ips
parent
fbce415622
commit
16322440ed
|
@ -107,9 +107,15 @@ class Server:
|
|||
self.__loggingLock.release()
|
||||
|
||||
def quit(self):
|
||||
self.stopAllJail()
|
||||
# Stop communication
|
||||
# Stop communication first because if jail's unban action
|
||||
# tries to communicate via fail2ban-client we get a lockup
|
||||
# among threads. So the simplest resolution is to stop all
|
||||
# communications first (which should be ok anyways since we
|
||||
# are exiting)
|
||||
# See https://github.com/fail2ban/fail2ban/issues/7
|
||||
self.__asyncServer.stop()
|
||||
# Now stop all the jails
|
||||
self.stopAllJail()
|
||||
|
||||
def addJail(self, name, backend):
|
||||
self.__jails.add(name, backend)
|
||||
|
|
Loading…
Reference in New Issue