From 78f1af4fcbcc1193db5e9db036359e14cc98afd9 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Wed, 3 Feb 1999 19:34:29 +0000 Subject: more initlog changes; wait a little longer for kill -TERM --- rc.d/init.d/functions | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'rc.d/init.d/functions') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index e69f27f4..525ecc6d 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -44,10 +44,8 @@ daemon() { # problems with the daemon, it also closes some security problems ulimit -c 0 - # - if [ $BOOTUP != "color" ]; then - echo -n $base - fi + # Echo daemon + [ $BOOTUP != "color" ] && echo -n $base # And start it up. nice -n $nicelevel initlog -q -c "$*" && success -n "$base startup" || failure -n "$base startup" @@ -78,19 +76,24 @@ killproc() { # Kill it. if [ "$pid" != "" ] ; then - echo -n "$base " + [ $BOOTUP != "color" ] && echo -n $base if [ "$notset" = 1 ] ; then # TERM first, then KILL if not dead kill -TERM $pid usleep 100000 if ps h $pid >/dev/null 2>&1 ; then - sleep 3 - kill -KILL $pid + sleep 1 + if ps h $pid >/dev/null 2>&1 + sleep 3 + kill -KILL $pid && success "$base shutdown" || failure "$base shutdown" + fi fi # use specified level only else - kill $killlevel $pid + kill $killlevel $pid && success "$base shutdown" || failure "$base shutdown" fi + else + failure -n "$base shutdown" fi # Remove pid file if any. @@ -173,6 +176,7 @@ echo_failure() { return 0 } +# Log that something succeeded success() { if [ "$1" = "-n" ]; then ECHOARGS="-n" @@ -189,6 +193,7 @@ success() { return 0 } +# Log that something failed failure() { if [ "$1" = "-n" ]; then ECHOARGS="-n" @@ -205,6 +210,7 @@ failure() { return 0 } +# Run some action. Log its output. action() { if [ "$1" = "-n" ]; then ECHOARGS="-n" -- cgit v1.2.1