Fix sys_clone usage on sparc and s390, sparc returns parent pid in
[util-vserver.git] / scripts / vserver.functions
index 09c6ee3..0f812d4 100644 (file)
@@ -98,12 +98,13 @@ function _generateChbindOptions
 function _generateNiceCommand
 {
     local vdir=$1
-    local nice
+    local nice=0
+    local current_nice=`$_NICE`
 
-    test -r "$vdir/nice" || return 0;
-    read nice <"$vdir"/nice
+    test -r "$vdir/nice" && read nice <"$vdir"/nice
 
-    NICE_CMD=( $_NICE -$nice )
+    let nice=$nice-$current_nice || :
+    NICE_CMD=( $_NICE -n $nice )
 }
 
 
@@ -292,9 +293,7 @@ function _generateInitOptions
            ;;
 
        (xgentoo)
-           INITCMD_START=( /sbin/rc default  )
-           INITCMD_STOP=(  /sbin/rc shutdown )
-           ;;
+           panic "init-style '$INITSTYLE' is no longer supported; please use plain instead; aborting";;
 
        (x) ;;
        (*) panic "Unknown init-style '$INITSTYLE'; aborting";;
@@ -783,12 +782,14 @@ function umountVserver
 
     isAvoidNamespace "$cfgdir"    || return 0
     test -e "$cfgdir"/fstab -o \
-         -e "$cfgdir"/fstab.local || return 0
+         -e "$cfgdir"/fstab.local -o \
+         -e "$cfgdir"/fstab.remote || return 0
     test -n "$_HAVE_CHBIND_OPTIONS"  || _generateChbindOptions "$cfgdir"
     
     pushd "$vdir/" >/dev/null || return 1
-       _umountVserverInternal  "$cfgdir"/fstab.local                              || is_ok=
-       _umountVserverInternal  "$cfgdir"/fstab       $_CHBIND "${CHBIND_OPTS[@]}" || is_ok=
+       _umountVserverInternal  "$cfgdir"/fstab.remote $_CHBIND "${CHBIND_OPTS[@]}" || is_ok=
+       _umountVserverInternal  "$cfgdir"/fstab.local                               || is_ok=
+       _umountVserverInternal  "$cfgdir"/fstab                                     || is_ok=
     popd >/dev/null           || return 1
 
     test -n "$is_ok"