aboutsummaryrefslogtreecommitdiff
path: root/grs
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2015-07-10 08:56:42 -0400
committerAnthony G. Basile <blueness@gentoo.org>2015-07-10 08:56:42 -0400
commit1c5666dd6ae518dfd88409d248fdcc7fd4298b68 (patch)
tree3223a17cf2227ff2841b62532a5f3d514ce1d28d /grs
parentgrs/Daemon.py: document. (diff)
downloadgrss-1c5666dd6ae518dfd88409d248fdcc7fd4298b68.tar.gz
grss-1c5666dd6ae518dfd88409d248fdcc7fd4298b68.tar.bz2
grss-1c5666dd6ae518dfd88409d248fdcc7fd4298b68.zip
grs/Interpret.py: more aggressively send TERM/KILL signals.
Diffstat (limited to 'grs')
-rw-r--r--grs/Interpret.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/grs/Interpret.py b/grs/Interpret.py
index bea0bf2..4749561 100644
--- a/grs/Interpret.py
+++ b/grs/Interpret.py
@@ -4,6 +4,8 @@ import os
import re
import signal
import sys
+import time
+
from grs.Constants import CONST
from grs.Daemon import Daemon
from grs.Log import Log
@@ -44,8 +46,12 @@ class Interpret(Daemon):
if mypid == pid:
continue
try:
- os.kill(pid, signal.SIGTERM)
- os.kill(pid, signal.SIGKILL)
+ for i in range(10):
+ os.kill(pid, signal.SIGTERM)
+ time.sleep(0.2)
+ while True:
+ os.kill(pid, signal.SIGKILL)
+ time.sleep(0.2)
except ProcessLookupError:
pass
try: