diff options
author | Donnie Barnes <djb@redhat.com> | 1997-10-28 20:50:52 +0000 |
---|---|---|
committer | Donnie Barnes <djb@redhat.com> | 1997-10-28 20:50:52 +0000 |
commit | d213a53ebdc9e1ac70bae7e75071e00ab681ab87 (patch) | |
tree | e7e4350aacf51a20bd5c1eef4eb0bd84d3540886 /rc.d | |
parent | 882b0864c515cef75fcd17ac4ce167ea59688e73 (diff) | |
download | initscripts-d213a53ebdc9e1ac70bae7e75071e00ab681ab87.tar initscripts-d213a53ebdc9e1ac70bae7e75071e00ab681ab87.tar.gz initscripts-d213a53ebdc9e1ac70bae7e75071e00ab681ab87.tar.bz2 initscripts-d213a53ebdc9e1ac70bae7e75071e00ab681ab87.tar.xz initscripts-d213a53ebdc9e1ac70bae7e75071e00ab681ab87.zip |
added the ability to 'nice' daemons
Diffstat (limited to 'rc.d')
-rwxr-xr-x | rc.d/init.d/functions | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 9fadf536..f40ace44 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -15,10 +15,13 @@ export PATH="/sbin:/usr/sbin:/bin:/usr/bin" # A function to start a program. daemon() { # Test syntax. - if [ $# = 0 ]; then - echo "Usage: daemon {program}" - return 1 - fi + case $1 in + '') echo '$0: Usage: daemon [+/-nicelevel] {program}' + return 1;; + -*|+*) nicelevel=$1 + shift;; + *) nicelevel=0;; + esac # Save basename. base=`basename $1` @@ -34,7 +37,7 @@ daemon() { ulimit -c 0 # And start it up. - $* + nice -n $nicelevel "$@" } # A function to stop a program. |