added defaulttty.c
[util-vserver.git] / util-vserver / scripts / vserver.stop
index b2365fe..129ce0b 100644 (file)
 # 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
+lock "$LOCKDIR"/vserver."$($_VSERVER_INFO "$VSERVER_DIR" CANONIFY)".startup
 
 if ! isVserverRunning "$VSERVER_DIR" S_CONTEXT; then
-    echo $"vserver '$VSERVER_NAME' is not running; aborting..." >&2
+    warning $"vserver '$VSERVER_NAME' is not running" >&2
     test "$OPTION_DEBUG" || exec 2>/dev/null >/dev/null
     umountVserver     "$VSERVER_DIR" || :
     disableInterfaces "$VSERVER_DIR" || :
     unlock
-    exit 1
+    exit 0
 fi
 
 function cleanup
@@ -47,6 +47,7 @@ set +e
 
 vshelper.doDestroy "$VSERVER_DIR" "$S_CONTEXT"
 initSync           "$VSERVER_DIR" sync_fifo
+prepareStop "$VSERVER_DIR"
 
 cd "$VSERVER_DIR"/vdir/
 execScriptlets    "$VSERVER_DIR" "$VSERVER_NAME" pre-stop