If $3 is set, the run file is expected to be cleaned up if the context does
authorDaniel Hokka Zakrisson <daniel@hozac.com>
Sun, 24 Aug 2008 20:09:08 +0000 (20:09 +0000)
committerDaniel Hokka Zakrisson <daniel@hozac.com>
Sun, 24 Aug 2008 20:09:08 +0000 (20:09 +0000)
not exist. Fix the previous change to handle this correctly.

git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2770 94cd875c-1c1d-0410-91d2-eb244daf1a30

scripts/functions

index 224e440..7b31944 100644 (file)
@@ -601,12 +601,16 @@ function getVserverStatus
     read _gvs_ctx <"$1"/run
     eval "$2"=\$_gvs_ctx
 
-    test "$1" = "$($_VUNAME -g --xid "$_gvs_ctx" context)" || return 1
-
-    test -n "$3"     || return 0
-    local _gvs_tmp
-    _getProcNumberCount "$_gvs_ctx" _gvs_tmp
-    eval "$3"=\$_gvs_tmp
+    if test "$1" = "$($_VUNAME -g --xid "$_gvs_ctx" context)"; then
+       test -n "$3" || return 0
+       local _gvs_tmp
+       _getProcNumberCount "$_gvs_ctx" _gvs_tmp
+       eval "$3"=\$_gvs_tmp
+    else
+       test -n "$3" || return 1
+       eval "$3"=0
+       _gvs_tmp=0
+    fi
 
     if test "$_gvs_tmp" = 0; then
        local runfile=$($_READLINK "$1/run")