- Teach vcontext about usernames (if dietlibc is used).
[util-vserver.git] / scripts / vserver
index 006e7f7..0a8457f 100755 (executable)
@@ -57,6 +57,7 @@ Possible commands are:
 
     build <buildopts>*
                 ... builds a new vserver from scratch
+    delete      ... remove a vserver
 
     unify [-R]
                ... (de)unify vserver
@@ -199,7 +200,7 @@ test "$2" != start -o -n "$OPTION_NONAMESPACE" || isAvoidNamespace "$VSERVER_DIR
 
 . $__PKGLIBDIR/vserver.functions
 case "$2" in
-    (start|stop)
+    (start|stop|delete)
        shift 2
        . $__PKGLIBDIR/vserver.$cmd
        ;;
@@ -208,19 +209,20 @@ case "$2" in
        $cmd "$@"
        ;;
     (condrestart)
-       test ! isVserverRunning "$VSERVER_DIR" || restart
+       ! isVserverRunning "$VSERVER_DIR" || restart
        ;;
     (exec)
        shift 2
-       suexec root "$@"
+       suexec 0 "$@"
        ;;
     (chkconfig)
        shift 2
-       suexec root chkconfig "$@"
+       suexec 0 chkconfig "$@"
        ;;
     (enter)
+       OPTS_VCONTEXT_ENTER=( "${OPTS_VCONTEXT_ENTER[@]}" --vlogin )
        getEnterShell "$VSERVER_DIR"
-       suexec root "${ENTER_SHELL[@]}"
+       suexec 0 "${ENTER_SHELL[@]}"
        ;;
     (running)
        isVserverRunning "$VSERVER_DIR"
@@ -271,7 +273,7 @@ case "$2" in
        fi
        ;;
     (*)
-       echo $"Usage: $0 {start|stop|suexec|restart|condrestart|exec|enter|chkconfig|running|status}" >&2
+       echo $"Usage: $0 <vserver> {start|stop|suexec|restart|condrestart|exec|enter|chkconfig|running|status|delete}" >&2
        exit 2
        ;;
 esac