Don't tell init to shutdown if we're called from vshelper, that should've already...
authorDaniel Hokka Zakrisson <daniel@hozac.com>
Sun, 25 Feb 2007 14:06:51 +0000 (14:06 +0000)
committerDaniel Hokka Zakrisson <daniel@hozac.com>
Sun, 25 Feb 2007 14:06:51 +0000 (14:06 +0000)
Kill init and other remaining processes from vshelper once the stop sync signal has arrived.

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

scripts/functions
scripts/vserver.stop
scripts/vshelper

index 8c89518..b08cc15 100644 (file)
@@ -1068,6 +1068,12 @@ function vshelper.doStopSync
        test ! -p "$VSHELPER_STOP_SYNC" || echo stopped > "$VSHELPER_STOP_SYNC"
 }
 
+function vshelper.isStopSync
+{
+       test -p "$VSHELPER_STOP_SYNC" || return 1
+       return 0
+}
+
 function _rpmFake.getCapFlags
 {
     local ctx=$1
index 4d637ea..335b99b 100644 (file)
@@ -66,9 +66,9 @@ fail=
 initWait          "$VSERVER_DIR" "$S_CONTEXT" vwait_statdir
 if test -n "$_IS_FAKEINIT" && \
    $_VSERVER_INFO - FEATURE vkill; then
-    $_VKILL -s INT --xid "$S_CONTEXT" -- 1 || fail=1
-    ## HACK: remove the 'initpid' stuff above when PID virtualization
-    ## is implemented
+    if ! vshelper.isStopSync; then
+       $_VKILL -s INT --xid "$S_CONTEXT" -- 1 || fail=1
+    fi
 elif $_VSERVER_INFO - FEATURE migrate; then
     "${NICE_CMD[@]}" \
     $_VCONTEXT $SILENT_OPT --migrate --chroot --xid "$S_CONTEXT" -- \
index b9dfdf9..7a7b2d4 100755 (executable)
@@ -73,6 +73,7 @@ function doInternalMethod
 
                    disown %%
                    vshelper.waitForStopSync "$sync_dir"
+                   spawn killContext "$XID"
                    ;;
                (swsusp)
                    ## TODO: any senseful action here? Perhaps shutdown scheduler for it?