aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2004-09-29 02:26:03 +0000
committerBill Nottingham <notting@redhat.com>2004-09-29 02:26:03 +0000
commit91f2087cffbf3201d6b605191454d15ec127b976 (patch)
treefbc38fd119f8f97cc423abf75cf6b5a6345d1311
parente64228da9726e27c6330f99c45906548154b4a26 (diff)
downloadinitscripts-91f2087cffbf3201d6b605191454d15ec127b976.tar
initscripts-91f2087cffbf3201d6b605191454d15ec127b976.tar.gz
initscripts-91f2087cffbf3201d6b605191454d15ec127b976.tar.bz2
initscripts-91f2087cffbf3201d6b605191454d15ec127b976.tar.xz
initscripts-91f2087cffbf3201d6b605191454d15ec127b976.zip
fix checkpid logic, clean up potential errors (#134030)
-rwxr-xr-xrc.d/init.d/functions10
1 files changed, 5 insertions, 5 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index 819230fd..0f6dbfe6 100755
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -73,9 +73,9 @@ checkpid() {
local i
for i in $* ; do
- [ -d "/proc/$i" ] || return 1
+ [ -d "/proc/$i" ] && return 0
done
- return 0
+ return 1
}
@@ -193,12 +193,12 @@ killproc() {
if [ "$notset" -eq "1" ] ; then
if checkpid $pid 2>&1; then
# TERM first, then KILL if not dead
- kill -TERM $pid
+ kill -TERM $pid >/dev/null 2>&1
usleep 100000
if checkpid $pid && sleep 1 &&
checkpid $pid && sleep 3 &&
checkpid $pid ; then
- kill -KILL $pid
+ kill -KILL $pid >/dev/null 2>&1
usleep 100000
fi
fi
@@ -209,7 +209,7 @@ killproc() {
# use specified level only
else
if checkpid $pid; then
- kill $killlevel $pid
+ kill $killlevel $pid >/dev/null 2>&1
RC=$?
[ "$RC" -eq 0 ] && success $"$base $killlevel" || failure $"$base $killlevel"
fi