aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/functions
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>1999-02-03 19:34:29 +0000
committerBill Nottingham <notting@redhat.com>1999-02-03 19:34:29 +0000
commit78f1af4fcbcc1193db5e9db036359e14cc98afd9 (patch)
treed4e80f4f61ef4d6f7d436b49ac7f113182a82ca9 /rc.d/init.d/functions
parentd503a6fe70268f6b451a80b3fc89641f33491e9e (diff)
downloadinitscripts-78f1af4fcbcc1193db5e9db036359e14cc98afd9.tar
initscripts-78f1af4fcbcc1193db5e9db036359e14cc98afd9.tar.gz
initscripts-78f1af4fcbcc1193db5e9db036359e14cc98afd9.tar.bz2
initscripts-78f1af4fcbcc1193db5e9db036359e14cc98afd9.tar.xz
initscripts-78f1af4fcbcc1193db5e9db036359e14cc98afd9.zip
more initlog changes; wait a little longer for kill -TERM
Diffstat (limited to 'rc.d/init.d/functions')
-rwxr-xr-xrc.d/init.d/functions22
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"