Get rid of the work directory on success.
[util-vserver.git] / scripts / functions
index aa5f9ce..6415353 100644 (file)
@@ -282,7 +282,7 @@ function set_init_cwd
     export INIT_CWD
 }
 
-function _getVserverDir
+function _setVserverDir
 {
     local vserver="$1"
     case "$vserver" in
@@ -292,6 +292,15 @@ function _getVserverDir
     esac
 }
 
+function _setVserverName
+{
+    if test -e "$VSERVER_DIR"/name; then
+       read VSERVER_NAME <"$VSERVER_DIR"/name
+    else
+       VSERVER_NAME=$(basename "$VSERVER_DIR")
+    fi
+}
+
 function _pkgMountBindDir()
 {
     test "$1" != "$2" || return 0
@@ -718,7 +727,7 @@ function setDefaultTTY
     else
        exec <$ttyname
     fi
-    exec   &>>$ttyname
+    exec    >>$ttyname 2>&1
 }
 
 ## Usage: killContext <XID> [<SIG>]
@@ -1068,6 +1077,12 @@ function vshelper.doStopSync
        test ! -p "$VSHELPER_STOP_SYNC" || echo stopped > "$VSHELPER_STOP_SYNC"
 }
 
+function vshelper.isStopSync
+{
+       test -p "$VSHELPER_STOP_SYNC" || return 1
+       return 0
+}
+
 function _rpmFake.getCapFlags
 {
     local ctx=$1