From fc7c0e4364bcbc5345b755ac4ef37f5b08868a02 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Thu, 30 Jun 2005 06:17:58 +0000 Subject: [PATCH] use vwait infrastructure git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2111 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/scripts/vserver.stop | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/util-vserver/scripts/vserver.stop b/util-vserver/scripts/vserver.stop index 4100a9b..53be835 100644 --- a/util-vserver/scripts/vserver.stop +++ b/util-vserver/scripts/vserver.stop @@ -36,8 +36,13 @@ function cleanup $_RM -f "$sync_fifo" $_RMDIR $($_DIRNAME "$sync_fifo") } + + test ! -d "$vwait_statdir" || + $_RM -rf "$vwait_statdir" } +vwait_statdir= +vwait_pid= sync_fifo= trap "cleanup" EXIT @@ -48,7 +53,7 @@ generateOptions "$VSERVER_DIR" set +e vshelper.doDestroy "$VSERVER_DIR" "$S_CONTEXT" -initSync "$VSERVER_DIR" sync_fifo +initSync "$VSERVER_DIR" "$S_CONTEXT" sync_fifo prepareStop "$VSERVER_DIR" cd "$VSERVER_DIR"/vdir/ @@ -58,6 +63,7 @@ cd "$VSERVER_DIR"/vdir/ test -z "$OPTION_DEFAULTTTY" || setDefaultTTY "$VSERVER_DIR" 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 @@ -78,7 +84,7 @@ else "${INITCMD_STOP[@]}" || fail=1 fi -test -n "$fail" || waitForSync "$VSERVER_DIR" "$sync_fifo" +test -n "$fail" || waitForSync "$VSERVER_DIR" "$sync_fifo" "$vwait_statdir" vshelper.doDestroy "$VSERVER_DIR" "$S_CONTEXT" sendKillSequence "$S_CONTEXT" "${INITKILL_SEQ[@]}" -- 1.8.1.5