follow LSB behavior when starting/stopping a vserver (no error, when already running...
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Fri, 27 Aug 2004 21:06:45 +0000 (21:06 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Fri, 27 Aug 2004 21:06:45 +0000 (21:06 +0000)
adjusted some exit-codes

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

util-vserver/scripts/vserver
util-vserver/scripts/vserver.start
util-vserver/scripts/vserver.stop

index ef887f7..05adf2f 100755 (executable)
@@ -181,7 +181,7 @@ test -d "$VSERVER_DIR" || {
     echo $"\
 Can not find vserver-setup; please make sure that the vserver configuration
 is located at $VSERVER_DIR/."
-    exit 1
+    exit 5
 } >&2
 
 if test -e "$VSERVER_DIR"/name; then
@@ -257,8 +257,8 @@ case "$2" in
            fi
            exit 0
        else
-           msg $"Vserver '$vserver' is not running"
-           exit 1
+           msg $"Vserver '$vserver' is stopped"
+           exit 3
        fi
        ;;
     (*)
index 8c6301b..dbc5ca4 100644 (file)
@@ -19,8 +19,8 @@
 lock "$LOCKDIR"/vserver."$($_VSERVER_INFO "$VSERVER_DIR" CANONIFY)".startup
 
 if isVserverRunning "$VSERVER_DIR"; then
-    echo $"vserver '$VSERVER_NAME' already running; aborting..." >&2
-    exit 1
+    warning $"vserver '$VSERVER_NAME' already running"
+    exit 0
 fi
 
 function cleanup()
index 95781b4..05c5990 100644 (file)
 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