Default all processes to run with nice=0.
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 30 Jun 2010 18:37:43 +0000 (20:37 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 21 Jul 2010 15:59:53 +0000 (17:59 +0200)
This should work much better for the CFS

src/initscripts/init.d/functions

index ea840d1..00cd6fa 100644 (file)
@@ -438,7 +438,7 @@ loadproc()
 {
        local pidfile=""
        local forcestart=""
-       local nicelevel="10"
+       local nicelevel=""
 
 # This will ensure compatibility with previous LFS Bootscripts
        if [ -n "${PIDFILE}" ]; then
@@ -500,7 +500,13 @@ loadproc()
                esac
        fi
 
-       nice -n "${nicelevel}" "${@}"
+       local cmd="${@}"
+
+       if [ -n "${nicelevel}" ]; then
+               cmd="nice -n "${nicelevel}" ${cmd}"
+       fi
+
+       ${cmd}
        evaluate_retval # This is "Probably" not LSB compliant, but required to be compatible with older bootscripts
        return 0
 }