diff options
author | Bill Nottingham <notting@redhat.com> | 1999-03-26 07:59:07 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 1999-03-26 07:59:07 +0000 |
commit | 8956723c3bb83c0cfbace61bae5bd01a82a2912d (patch) | |
tree | 746b690311439632947d3f9ffeea39b131206230 /rc.d/init.d | |
parent | 16c2d08386eaf4f2fc72797139e077d90960b91a (diff) | |
download | initscripts-8956723c3bb83c0cfbace61bae5bd01a82a2912d.tar initscripts-8956723c3bb83c0cfbace61bae5bd01a82a2912d.tar.gz initscripts-8956723c3bb83c0cfbace61bae5bd01a82a2912d.tar.bz2 initscripts-8956723c3bb83c0cfbace61bae5bd01a82a2912d.tar.xz initscripts-8956723c3bb83c0cfbace61bae5bd01a82a2912d.zip |
fix killproc foo SIGNAL so it works sanely
Diffstat (limited to 'rc.d/init.d')
-rwxr-xr-x | rc.d/init.d/functions | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index d6197770..14485d9c 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -95,11 +95,10 @@ killproc() { # Kill it. if [ "$pid" != "" ] ; then [ $BOOTUP = "verbose" ] && echo -n "$base " - if [ "$notset" = 1 ] ; then + if [ "$notset" = "1" ] ; then if ps h $pid>/dev/null 2>&1; then # TERM first, then KILL if not dead kill -TERM $pid - #&& success "$base shutdown" || failure "$base shutdown" usleep 100000 if ps h $pid >/dev/null 2>&1 ; then sleep 1 @@ -107,25 +106,25 @@ killproc() { sleep 3 if ps h $pid >/dev/null 2>&1 ; then kill -KILL $pid - #&& success "$base shutdown" || failure "$base shutdown" fi fi fi fi + ps h $pid >/dev/null 2>&1 && failure "$base shutdown" || success "$base shutdown" # use specified level only else if ps h $pid >/dev/null 2>&1; then - kill $killlevel $pid - #&& success "$base shutdown" || failure "$base shutdown" + kill $killlevel $pid && success "$base $killlevel" || failure "$base $killlevel" fi fi else failure "$base shutdown" fi - ps h $pid >/dev/null 2>&1 && failure "$base shutdown" || success "$base shutdown" # Remove pid file if any. - rm -f /var/run/$base.pid + if [ "$notset" = "1" ]; then + rm -f /var/run/$base.pid + fi } # A function to find the pid of a program. |