From 8956723c3bb83c0cfbace61bae5bd01a82a2912d Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Fri, 26 Mar 1999 07:59:07 +0000 Subject: fix killproc foo SIGNAL so it works sanely --- rc.d/init.d/functions | 13 ++++++------- 1 file 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. -- cgit v1.2.1