aboutsummaryrefslogtreecommitdiff
path: root/contrib/gnunet_janitor.py.in
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gnunet_janitor.py.in')
-rw-r--r--contrib/gnunet_janitor.py.in8
1 files changed, 3 insertions, 5 deletions
diff --git a/contrib/gnunet_janitor.py.in b/contrib/gnunet_janitor.py.in
index 056ab9b..69186fd 100644
--- a/contrib/gnunet_janitor.py.in
+++ b/contrib/gnunet_janitor.py.in
@@ -30,13 +30,11 @@ import sys
import shutil
import time
import signal
+import terminate
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 = []
@@ -63,7 +61,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]), killsignal)
+ terminate.safe_terminate_process_by_pid (int (p[0]), 1)
except OSError as e:
print ("failed: {0}".format (e))
pass
@@ -71,7 +69,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]), killsignal)
+ terminate.safe_terminate_process_by_pid (int (p[0]), 1)
except OSError as e:
print ("failed: {0}".format (e))
pass