From: Claudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Date: Wed, 8 Jun 2011 11:57:58 +0000 (+0200)
Subject: remote_kill wasn't working as hot with nowait
X-Git-Tag: nepi_v2_1~32^2~3
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=e5f88dd6b4e18cdba05caf852b69db9eab8fbed4;p=nepi.git

remote_kill wasn't working as hot with nowait
---

diff --git a/src/nepi/testbeds/planetlab/rspawn.py b/src/nepi/testbeds/planetlab/rspawn.py
index 9bc4c42f..618235b9 100644
--- a/src/nepi/testbeds/planetlab/rspawn.py
+++ b/src/nepi/testbeds/planetlab/rspawn.py
@@ -210,11 +210,12 @@ for x in 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 ; do
     sleep 1.8
 done
 if [ `ps --ppid %(ppid)d -o pid | grep -c %(pid)d` != '0' ]; then
-    %(sudo)s kill -9 %(pid)d
+    %(sudo)s kill -9 -- -%(pid)d || /bin/true
+    %(sudo)s kill -9 %(pid)d || /bin/true
 fi
 """
     if nowait:
-        cmd = "{ %s } >/dev/null 2>/dev/null </dev/null &" % (cmd,)
+        cmd = "( %s ) >/dev/null 2>/dev/null </dev/null &" % (cmd,)
 
     (out,err),proc = server.popen_ssh_command(
         cmd % {
@@ -232,6 +233,5 @@ fi
     
     # wait, don't leave zombies around
     proc.wait()
-