aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d
diff options
context:
space:
mode:
Diffstat (limited to 'rc.d/init.d')
-rwxr-xr-xrc.d/init.d/functions10
1 files changed, 8 insertions, 2 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index fcd61237..eca7f56f 100755
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -90,6 +90,7 @@ daemon() {
# A function to stop a program.
killproc() {
+ RC=0
# Test syntax.
if [ $# = 0 ]; then
echo "Usage: killproc {program} [signal]"
@@ -129,11 +130,15 @@ killproc() {
fi
fi
fi
- ps h $pid >/dev/null 2>&1 && failure "$base shutdown" || success "$base shutdown"
+ ps h $pid >/dev/null 2>&1
+ RC=$?
+ [ $RC -eq 0 ] && 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 $killlevel" || failure "$base $killlevel"
+ kill $killlevel $pid
+ RC=$?
+ [ $RC -eq 0 ] && success "$base $killlevel" || failure "$base $killlevel"
fi
fi
else
@@ -144,6 +149,7 @@ killproc() {
if [ "$notset" = "1" ]; then
rm -f /var/run/$base.pid
fi
+ return $RC
}
# A function to find the pid of a program.