- Make sure the correct nice value is used, even if the parent
process has a different one.
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2295
94cd875c-1c1d-0410-91d2-
eb244daf1a30
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
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 )
}