32-bit and Python 2.4 support.
[util-vserver.git] / scripts / vserver.functions
index d5eeda5..a4dc8ed 100644 (file)
@@ -346,6 +346,13 @@ function _generateInitOptions
            INITCMD_PREPARE=( $_FAKE_RUNLEVEL 3 /var/run/utmp )
            ;;
 
+       (xarch)
+           test -n "$RUNLEVEL_START" || RUNLEVEL_START=3
+           INITCMD_START=( /etc/rc.multi )
+           INITCMD_STOP=( /etc/rc.shutdown )
+           INITCMD_PREPARE=( $_FAKE_RUNLEVEL "$RUNLEVEL_START" /var/run/utmp )
+           ;;
+
        (x) ;;
        (*) panic "Unknown init-style '$INITSTYLE'; aborting";;
     esac
@@ -374,10 +381,12 @@ function _generateInitOptions
 function _generateFlagOptions
 {
     local vdir=$1
+    local file
 
     CHCONTEXT_FLAG_OPTS=()
 
-    test ! -e "$vdir"/flags || \
+    findFile file "$vdir"/cflags "$vdir"/flags ""
+    test -z "$file" || \
     while read flag; do
        case x"$flag" in
            (x|x\#*)            ;;
@@ -391,7 +400,7 @@ function _generateFlagOptions
                                      --flag "$flag" )
                ;;
        esac
-    done <"$vdir"/flags
+    done <"$file"
 
     isAvoidNamespace "$vdir" || {
        USE_VNAMESPACE=1
@@ -952,7 +961,7 @@ function mountVserver
         _namespaceCleanup "$cfgdir"
 
     isAvoidNamespace "$cfgdir" || \
-       $_SECURE_MOUNT --rbind -n "$vdir" "/"
+       $_SECURE_MOUNT --rbind -n -o dev "$vdir" "/"
 }
 
 function _umountVserverInternal
@@ -1037,7 +1046,7 @@ function initWait
            rc=$?
 
            if test "$rc" -ne 0 -a "$rc" -ne 1; then
-               $_VPS axf | $_EGREP -e "^[^ \t]+[ \t]+$S_CONTEXT[ \t]+" >&4
+               $_VPS axf | $_EGREP -e "^[ \t]*[^ \t]+[ \t]+$S_CONTEXT[ \t]+" >&4
                killContext "$S_CONTEXT" 9
            fi
 
@@ -1454,7 +1463,7 @@ function _handleCgroup
     if test -r "$dir"/name; then
        read name < "$dir"/name
     else
-       read name < "$vdir"/name
+       name="$VSERVER_NAME"
     fi
 
     if test "$action" = "attach"; then