From: Claudio-Daniel Freire Date: Thu, 28 Apr 2011 14:22:18 +0000 (+0200) Subject: rspawn.remote_kill fix: was not checking process status correctly X-Git-Tag: nepi_v2~109 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=3605f0aba604ee14a4edd0ee496f92acc2d37306;p=nepi.git rspawn.remote_kill fix: was not checking process status correctly --- diff --git a/src/nepi/testbeds/planetlab/rspawn.py b/src/nepi/testbeds/planetlab/rspawn.py index 6004462b..a1e0e43e 100644 --- a/src/nepi/testbeds/planetlab/rspawn.py +++ b/src/nepi/testbeds/planetlab/rspawn.py @@ -204,13 +204,13 @@ def remote_kill(pid, ppid, sudo = False, %(sudo)s kill %(pid)d for x in 1 2 3 4 5 6 7 8 9 0 ; do sleep 0.1 - if [ `ps --pid %(ppid)d -o pid | grep -c %(pid)d` == `0` ]; then + if [ `ps --ppid %(ppid)d -o pid | grep -c %(pid)d` == `0` ]; then break fi sleep 0.9 done -if [ `ps --pid %(ppid)d -o pid | grep -c %(pid)d` != `0` ]; then - %(sudo)s kill -9 %(pid)d %(ppid)d +if [ `ps --ppid %(ppid)d -o pid | grep -c %(pid)d` != `0` ]; then + %(sudo)s kill -9 %(pid)d fi """ % { 'ppid' : ppid,