[Piuparts-commits] [SCM] piuparts git repository branch, piatti, updated. 0.44-805-gcb3c644

Andreas Beckmann debian at abeckmann.de
Tue Jun 19 08:54:37 UTC 2012


The following commit has been merged in the piatti branch:
commit a597dc4b10bf0a24cd010a5580abadf8e1e5c087
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Fri Jun 15 19:24:51 2012 +0200

    p-s: try harder to kill piuparts
    
    use SIGTERM and SIGKILL, too
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/piuparts-slave.py b/piuparts-slave.py
index 5e03ae5..e1e5450 100644
--- a/piuparts-slave.py
+++ b/piuparts-slave.py
@@ -463,10 +463,22 @@ def run_test_with_timeout(cmd, maxwait, kill_all=True):
                 time.sleep(0.5)
                 if p.poll() is not None:
                     break
+        if p.poll() is None:
+            print 'Sending SIGTERM...'
+            p.terminate()
+            # piuparts has 5 seconds to clean up after SIGTERM
+            for i in range(10):
+                time.sleep(0.5)
+                if p.poll() is not None:
+                    break
+        if p.poll() is None:
+            print 'Sending SIGKILL...'
+            p.kill()
         for pid in pids:
             if pid > 0:
                 try:
                     os.kill(pid, SIGKILL)
+                    print "Killed %d" % pid
                 except OSError:
                     pass
 

-- 
piuparts git repository



More information about the Piuparts-commits mailing list