From: Daniel Hokka Zakrisson Date: Sun, 16 Mar 2008 03:30:22 +0000 (+0000) Subject: Fix vserver ... stop --rescue-init. X-Git-Tag: release-0.30.215~3 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c03c74dde26b0a0b3a17108b083a862b16fb0de;p=util-vserver.git Fix vserver ... stop --rescue-init. Use it in stopSleepingGuest, to prevent races and to do proper cleanup. If vserver ... stop has already been invoked, remove SC_HELPER from the context. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2704 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/scripts/vserver-build.functions b/scripts/vserver-build.functions index 4993c5c..3e2b4f9 100644 --- a/scripts/vserver-build.functions +++ b/scripts/vserver-build.functions @@ -282,5 +282,5 @@ function startSleepingGuest function stopSleepingGuest { local guest="$1" - $_VKILL --xid "$guest" -s INT -- 1 + $_VSERVER "$guest" stop --rescue-init } diff --git a/scripts/vserver.stop b/scripts/vserver.stop index 586adda..07e189f 100644 --- a/scripts/vserver.stop +++ b/scripts/vserver.stop @@ -50,7 +50,7 @@ OPTION_FORCE_SYNC=1 while test "$#" -gt 0; do case "$1" in - (--rescue-init) _IS_FAKEINIT=1;; + (--rescue-init) shift; _IS_FAKEINIT=1;; (--) shift; break;; (-*) panic $"vserver ... stop: unknown option '$1'";; esac @@ -70,6 +70,8 @@ cd "$VSERVER_DIR"/vdir/ test -z "$OPTION_DEFAULTTTY" || setDefaultTTY "$VSERVER_DIR" +$_VATTRIBUTE --set --xid "$S_CONTEXT" --flag !SC_HELPER + fail= initWait "$VSERVER_DIR" "$S_CONTEXT" vwait_statdir if test -n "$_IS_FAKEINIT" && \