Return a sane value from kill_contexts.
authorDaniel Hokka Zakrisson <daniel@hozac.com>
Fri, 29 Dec 2006 20:34:03 +0000 (20:34 +0000)
committerDaniel Hokka Zakrisson <daniel@hozac.com>
Fri, 29 Dec 2006 20:34:03 +0000 (20:34 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2438 94cd875c-1c1d-0410-91d2-eb244daf1a30

sysv/util-vserver

index 8e54016..047ef45 100755 (executable)
@@ -29,6 +29,7 @@ function set_helper()
 
 function kill_contexts()
 {
+    local xid
     for xid in `ls -1 /proc/virtual`; do
        test "$xid" = "info" -o "$xid" = "status" && continue
        $_VATTRIBUTE --xid $xid --set --flag ~persistent
@@ -36,6 +37,12 @@ function kill_contexts()
        sleep 3
        $_VKILL --xid $xid -s 9
     done
+    local alive=0
+    for xid in `ls -1 /proc/virtual`; do
+       test "$xid" = "info" -o "$xid" = "status" && continue
+       let alive+=1
+    done
+    test $alive = 0
 }
 
 function start()