diff --git a/debian/changelog b/debian/changelog index b914294d..0db27b8d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +fail2ban (0.7.8-1~pre2) UNRELEASED; urgency=low + + * New upstream release + * Applied post-release changes to resolve issues with gamin and not closed + on reload log file + + -- Yaroslav Halchenko Wed, 21 Mar 2007 20:59:15 -0400 + fail2ban (0.7.7-1) unstable; urgency=low * New upstream release (included most of the debian-provided patches -- new diff --git a/debian/patches/00_close_log.dpatch b/debian/patches/00_close_log.dpatch new file mode 100644 index 00000000..176c7323 --- /dev/null +++ b/debian/patches/00_close_log.dpatch @@ -0,0 +1,34 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 00_close_log.dpatch by Yaroslav Halchenko +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: post release patches + +@DPATCH@ + +Index: server/server.py +=================================================================== +--- server/server.py (revision 562) ++++ server/server.py (revision 563) +@@ -326,15 +326,18 @@ + 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) + logSys.info("Logging to previous target " + self.__logTarget) + return False + self.__logTarget = target +- # Remove previous handler +- logging.getLogger("fail2ban").handlers = [] ++ # 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 diff --git a/debian/patches/00_gamin_cleanup.dpatch b/debian/patches/00_gamin_cleanup.dpatch new file mode 100644 index 00000000..c2f6c5ac --- /dev/null +++ b/debian/patches/00_gamin_cleanup.dpatch @@ -0,0 +1,26 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 00_gamin_cleanup.dpatch by Yaroslav Halchenko +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ + +--- server/filtergamin.py (revision 563) ++++ server/filtergamin.py (revision 565) +@@ -117,5 +117,15 @@ + time.sleep(self.getSleepTime()) + else: + time.sleep(self.getSleepTime()) ++ # Cleanup Gamin ++ self.__cleanup() + logSys.debug(self.jail.getName() + ": filter terminated") + return True ++ ++ ## ++ # Desallocates the resources used by Gamin. ++ ++ def __cleanup(self): ++ for path in Filter.getLogPath(self): ++ self.monitor.stop_watch(path) ++ del self.monitor diff --git a/debian/patches/00list b/debian/patches/00list index 7b3bdf7e..089cecf1 100644 --- a/debian/patches/00list +++ b/debian/patches/00list @@ -1,2 +1,4 @@ 00_mail-whois-lines 10_dbts_manpages +00_close_log +00_gamin_cleanup