#! /bin/sh /usr/share/dpatch/dpatch-run
## 16_nice.dpatch by Micah Anderson <Micah Anderson <micah@debian.org>>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad trunk~/scripts/legacy/vserver trunk/scripts/legacy/vserver
--- trunk~/scripts/legacy/vserver	2006-03-20 08:16:45.000000000 -0500
+++ trunk/scripts/legacy/vserver	2006-04-16 00:11:42.000000000 -0400
@@ -514,7 +514,7 @@
 			DOMAINOPT="--domainname $S_DOMAINNAME"
 		fi
 		if [ "$S_NICE" != "" ] ; then
-			NICECMD="nice -$S_NICE"
+			NICECMD="nice -n $S_NICE"
 		fi
 		mkdir -p $__PKGSTATEDIR
 		chmod 700 $__PKGSTATEDIR
diff -urNad trunk~/scripts/vserver.functions trunk/scripts/vserver.functions
--- trunk~/scripts/vserver.functions	2006-03-20 08:16:45.000000000 -0500
+++ trunk/scripts/vserver.functions	2006-04-16 00:11:42.000000000 -0400
@@ -98,12 +98,13 @@
 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 1
+    NICE_CMD=( $_NICE -n $nice )
 }
 
 
