From db3a9d9001f9adbabfb940396961228ffb960d01 Mon Sep 17 00:00:00 2001 From: lostcontrol Date: Thu, 31 Mar 2005 16:04:52 +0000 Subject: [PATCH] =?UTF-8?q?-=20Fixed=20exception=20if=20trying=20to=20kill?= =?UTF-8?q?=20Fail2Ban=20with=20a=20fail2ban.pid=20file=20present.=20Thank?= =?UTF-8?q?s=20to=20K=EF=BF=BDvin=20Drapel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@99 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- fail2ban.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fail2ban.py b/fail2ban.py index d7ee42df..bc2f1f80 100755 --- a/fail2ban.py +++ b/fail2ban.py @@ -203,7 +203,12 @@ def killPID(pid): """ Kills the process with the given PID using the INT signal (same effect as +). """ - return os.kill(pid, 2) + try: + return os.kill(pid, 2) + except OSError: + logSys.error("Can not kill process " + `pid` + ". Please check that " + + "Fail2Ban is not running and remove the file " + + "'/tmp/fail2ban.pid'") if __name__ == "__main__":