From 6151d1172030104b744687fa1a0b1518e4edc7b0 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Wed, 26 Oct 2005 21:53:43 +0000 Subject: [PATCH] - Added a cleanup of firewall rules on emergency shutdown when unknown exception is catched. Thanks to Yaroslav Halchenko git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@210 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- fail2ban | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fail2ban b/fail2ban index 25777b3b..05213f9e 100755 --- a/fail2ban +++ b/fail2ban @@ -55,6 +55,12 @@ except Exception, e: logSys.error("Type: " + `type.__name__` + "\n" + "Value: " + `e.args` + "\n" + "TB: " + `tbStack`) + # Try to clean up after ourselves + # just for extreme caution - wrapping with try + try: + fail2ban.restoreFwRules() + except Exception: + pass # Remove the PID lock file. Should close #1239562 pidLock.remove() logging.shutdown()