From: Daniel Hokka Zakrisson Date: Tue, 12 Sep 2006 11:09:15 +0000 (+0000) Subject: - Fix obsolete nice usage. X-Git-Tag: release-0.30.211~60 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ccb6aff8218b761cab25da6a5fda09baf602871;p=util-vserver.git - Fix obsolete nice usage. - 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 --- diff --git a/scripts/legacy/vserver b/scripts/legacy/vserver index fe93fef..e944617 100755 --- a/scripts/legacy/vserver +++ b/scripts/legacy/vserver @@ -514,7 +514,7 @@ elif [ "$2" = "start" ] ; then 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 --git a/scripts/vserver.functions b/scripts/vserver.functions index 7a9b6a8..0f812d4 100644 --- a/scripts/vserver.functions +++ b/scripts/vserver.functions @@ -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 ) }