aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrc.d/init.d/functions13
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.