From 45b62de23133f687e205da704d031bd322dd6702 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Sun, 25 Feb 2007 14:06:51 +0000 Subject: [PATCH] Don't tell init to shutdown if we're called from vshelper, that should've already happened. 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 | 6 ++++++ scripts/vserver.stop | 6 +++--- scripts/vshelper | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/functions b/scripts/functions index 8c89518..b08cc15 100644 --- a/scripts/functions +++ b/scripts/functions @@ -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 diff --git a/scripts/vserver.stop b/scripts/vserver.stop index 4d637ea..335b99b 100644 --- a/scripts/vserver.stop +++ b/scripts/vserver.stop @@ -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" -- \ diff --git a/scripts/vshelper b/scripts/vshelper index b9dfdf9..7a7b2d4 100755 --- a/scripts/vshelper +++ b/scripts/vshelper @@ -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? -- 1.8.1.5