Browse Source

Flush logs at USR1 signal

pull/979/head
Teubel György 10 years ago
parent
commit
0254cbf7fb
  1. 1
      ChangeLog
  2. 5
      fail2ban/server/server.py

1
ChangeLog

@ -62,6 +62,7 @@ ver. 0.9.2 (2014/XX/XXX) - wanna-be-released
- empty or "basic" works as-is
- "cymru" additionally prints (ASN, Country RIR) per banned IP
(requires dnspython or dnspython3)
- Flush log at USR1 signal
- Enhancements:
* Enable multiport for firewallcmd-new action. Closes gh-834

5
fail2ban/server/server.py

@ -71,12 +71,17 @@ class Server:
logSys.debug("Caught signal %d. Exiting" % signum)
self.quit()
def __sigUSR1Handler(self, signum, fname):
logSys.debug("Caught signal %d. Flushing logs" % signum)
self.flushLogs()
def start(self, sock, pidfile, force = False):
logSys.info("Starting Fail2ban v" + version.version)
# Install signal handlers
signal.signal(signal.SIGTERM, self.__sigTERMhandler)
signal.signal(signal.SIGINT, self.__sigTERMhandler)
signal.signal(signal.SIGUSR1, self.__sigUSR1handler)
# Ensure unhandled exceptions are logged
sys.excepthook = excepthook

Loading…
Cancel
Save