diff options
Diffstat (limited to 'rc.d/init.d/functions')
-rwxr-xr-x | rc.d/init.d/functions | 22 |
1 files changed, 14 insertions, 8 deletions
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" |