X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fscripts%2Fvserver.stop;h=b2365fe3637bccb26233755c4177991991bceeb3;hb=ad8bbbc806a25d166b211b211af6465fc424353e;hp=878a163870786a7dc99b86abe4b291ddd9188b13;hpb=8df6314090cda53869d92a1526081fa01fe2080b;p=util-vserver.git diff --git a/util-vserver/scripts/vserver.stop b/util-vserver/scripts/vserver.stop index 878a163..b2365fe 100644 --- a/util-vserver/scripts/vserver.stop +++ b/util-vserver/scripts/vserver.stop @@ -15,16 +15,23 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +lock "$LOCKDIR"/vserver."$(echo "$VSERVER_DIR" | tr -dc a-zA-Z0-9)".startup + if ! isVserverRunning "$VSERVER_DIR" S_CONTEXT; then echo $"vserver '$VSERVER_NAME' is not running; aborting..." >&2 test "$OPTION_DEBUG" || exec 2>/dev/null >/dev/null umountVserver "$VSERVER_DIR" || : disableInterfaces "$VSERVER_DIR" || : + unlock exit 1 fi function cleanup { + set +e + unlock + test ! -p "$sync_fifo" || { rm -f "$sync_fifo" rmdir $(dirname "$sync_fifo") @@ -45,6 +52,8 @@ cd "$VSERVER_DIR"/vdir/ execScriptlets "$VSERVER_DIR" "$VSERVER_NAME" pre-stop cd "$VSERVER_DIR"/vdir/ +test -z "$OPTION_DEFAULTTTY" || setDefaultTTY "$VSERVER_DIR" + fail= if test "$_IS_FAKEINIT" && \ $_VSERVER_INFO - FEATURE vkill && \