X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2Ffunctions;h=c1be17f0bffdf6a4cc8df73aaa82238b1fc2a1bb;hb=007433b918ceb99a1136e23ac7859064f62614ec;hp=fe7521b769504d05ebf509c84cf2e2e522f85de4;hpb=fd418eca216cdda6b991a1abb7e39e40ec0301c5;p=util-vserver.git diff --git a/scripts/functions b/scripts/functions index fe7521b..c1be17f 100644 --- a/scripts/functions +++ b/scripts/functions @@ -294,11 +294,7 @@ function _setVserverDir function _setVserverName { - if test -e "$VSERVER_DIR"/name; then - read VSERVER_NAME <"$VSERVER_DIR"/name - else - VSERVER_NAME=$(basename "$VSERVER_DIR") - fi + VSERVER_NAME=$(basename "$VSERVER_DIR") } function _pkgMountBindDir() @@ -601,10 +597,16 @@ function getVserverStatus read _gvs_ctx <"$1"/run eval "$2"=\$_gvs_ctx - 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") @@ -994,7 +996,11 @@ function vshelper.doInit local xid xid=$($_VSERVER_INFO "$1" CONTEXT false) && test -n "$xid" || { - warning $"vshelper.init: can not determine xid of vserver '$vserver'; returned value was '$xid'" + warning $"vshelper.init: can not determine xid of vserver '$vserver'; returned value was '$xid' + +This usually means that you're using an init-less init-style, but the +guest isn't configured to start any service. Try enabling a service, +changing the init-style, or making the contexts persistent." return 1 }