From: Enrico Scholz Date: Tue, 16 Mar 2004 03:47:45 +0000 (+0000) Subject: added a more efficient stop method for fakeinit vservers X-Git-Tag: VERSION_0_10~304 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=041aeae35801a5ecd1a9c0ce56e2fdcfd54aac9a;p=util-vserver.git added a more efficient stop method for fakeinit vservers git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1270 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/util-vserver/scripts/vserver.stop b/util-vserver/scripts/vserver.stop index 8dc7512..207d7a0 100644 --- a/util-vserver/scripts/vserver.stop +++ b/util-vserver/scripts/vserver.stop @@ -32,7 +32,12 @@ execScriptlets "$VSERVER_DIR" "$VSERVER_NAME" pre-stop cd "$VSERVER_DIR"/vdir/ -if $_VSERVER_INFO - FEATURE migrate; then +if test "$_IS_FAKEINIT" && \ + $_VSERVER_INFO - FEATURE vkill && \ + initpid=$($_VSERVER_INFO "$S_CONTEXT" INITPID 2>/dev/null); then + $_VKILL -s INT -- "$initpid" && "${INITCMD_STOP_SYNC[@]}" || : +elif $_VSERVER_INFO - FEATURE migrate; then + "${NICE_CMD[@]}" \ ${USE_VNAMESPACE:+$_VNAMESPACE --enter "$S_CONTEXT" -- } \ $_VCONTEXT $SILENT_OPT --migrate --chroot --xid "$S_CONTEXT" -- \ "${INITCMD_STOP[@]}" && "${INITCMD_STOP_SYNC[@]}" || :