commit: b215ad5537db9c861b6d424b248239cfe7641b17 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> AuthorDate: Fri Jul 10 02:39:31 2015 +0000 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> CommitDate: Fri Jul 10 02:39:31 2015 +0000 URL: https://gitweb.gentoo.org/proj/grss.git/commit/?id=b215ad55
grs/Execute.py: improve signal exit code. grs/Execute.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/grs/Execute.py b/grs/Execute.py index f740924..9f59a6f 100644 --- a/grs/Execute.py +++ b/grs/Execute.py @@ -5,6 +5,7 @@ import signal import shlex import subprocess import sys +import time from grs.Constants import CONST class Execute(): @@ -28,8 +29,12 @@ class Execute(): f.write('SENDING SIGTERM to pid = %d\n' % pid) f.close() 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