From d0f6a7bb13abbe5c4a93ff09ead83c7e91bf5a11 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Thu, 24 May 2012 10:58:23 +0000 Subject: [PATCH] - fix --- contrib/gnunet_janitor.py.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/gnunet_janitor.py.in b/contrib/gnunet_janitor.py.in index f68ff1cb2..056ab9bc4 100644 --- a/contrib/gnunet_janitor.py.in +++ b/contrib/gnunet_janitor.py.in @@ -34,6 +34,9 @@ import signal if os.name == 'nt': from win32com.client import GetObject WMI = GetObject('winmgmts:') + killsignal = signal.SIGTERM # any valid value will result in TerminateProcess() +else: + killsignal = signal.SIGKILL def get_process_list (): result = [] @@ -60,7 +63,7 @@ def main (): if re.match (r'gnunet-service-arm', p[1]): print ("killing arm process {0:5} {1}".format (p[0], p[1])) try: - os.kill (int (p[0]), signal.SIGKILL) + os.kill (int (p[0]), killsignal) except OSError as e: print ("failed: {0}".format (e)) pass @@ -68,7 +71,7 @@ def main (): if not re.match (r'gnunet-service-arm', p[1]): print ("killing non-arm process {0:5} {1}".format (p[0], p[1])) try: - os.kill (int (p[0]), signal.SIGKILL) + os.kill (int (p[0]), killsignal) except OSError as e: print ("failed: {0}".format (e)) pass -- 2.25.1