2007-11-06 19:27:26 +00:00
|
|
|
#! /bin/sh /usr/share/dpatch/dpatch-run
|
|
|
|
## 00_close_log.dpatch by Yaroslav Halchenko <debian@onerussian.com>
|
|
|
|
##
|
|
|
|
## All lines beginning with `## DP:' are a description of the patch.
|
|
|
|
## DP: post release patches
|
|
|
|
|
|
|
|
@DPATCH@
|
2007-11-06 19:37:32 +00:00
|
|
|
diff -urNad fail2ban~/server/server.py fail2ban/server/server.py
|
|
|
|
--- fail2ban~/server/server.py 2007-11-06 14:26:10.000000000 -0500
|
|
|
|
+++ fail2ban/server/server.py 2007-11-06 14:33:46.000000000 -0500
|
|
|
|
@@ -314,12 +314,17 @@
|
2007-11-06 19:27:26 +00:00
|
|
|
else:
|
|
|
|
# Target should be a file
|
|
|
|
try:
|
|
|
|
- open(target, "a")
|
|
|
|
+ open(target, "a").close()
|
|
|
|
hdlr = logging.FileHandler(target)
|
|
|
|
except IOError:
|
|
|
|
logSys.error("Unable to log to " + target)
|
|
|
|
return False
|
|
|
|
self.__logTarget = target
|
|
|
|
+ # Removes previous handlers
|
|
|
|
+ for handler in logging.getLogger("fail2ban").handlers:
|
|
|
|
+ # Closes the handler.
|
|
|
|
+ handler.close()
|
|
|
|
+ logging.getLogger("fail2ban").removeHandler(handler)
|
|
|
|
# set a format which is simpler for console use
|
|
|
|
formatter = logging.Formatter("%(asctime)s %(name)-16s: %(levelname)-6s %(message)s")
|
|
|
|
# tell the handler to use this format
|