aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2009-10-02 14:59:04 -0400
committerBill Nottingham <notting@redhat.com>2009-10-02 14:59:04 -0400
commited2f9c1150c240326ec4351f572787296ee2065c (patch)
tree2165c9b27b4c45e27ea7ff2330f852fe2559bdeb
parentb771b1fa9ef793050c19f743373c940097b05b6d (diff)
downloadinitscripts-ed2f9c1150c240326ec4351f572787296ee2065c.tar
initscripts-ed2f9c1150c240326ec4351f572787296ee2065c.tar.gz
initscripts-ed2f9c1150c240326ec4351f572787296ee2065c.tar.bz2
initscripts-ed2f9c1150c240326ec4351f572787296ee2065c.tar.xz
initscripts-ed2f9c1150c240326ec4351f572787296ee2065c.zip
Wrap /sbin/killall5 to catch some return codes. (#526539)
killall5 now returns '2' if there are no processes to kill; we don't want to treat that as 'failure'. Patch adapted from (<hdegoede@redhat.com>).
-rwxr-xr-xrc.d/init.d/halt13
1 files changed, 11 insertions, 2 deletions
diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt
index e32188c2..08263172 100755
--- a/rc.d/init.d/halt
+++ b/rc.d/init.d/halt
@@ -29,6 +29,15 @@ halt_crypto() {
return $fnval
}
+kill_all() {
+ /sbin/killall5 "$@"
+ rc=$?
+ if [ "$rc" == 1 ]; then
+ return 1
+ fi
+ return 0
+}
+
# See how we were called.
case "$0" in
*halt)
@@ -66,11 +75,11 @@ for i in /dev/.mdadm/*.pid; do
OMITARGS="$OMITARGS -o $(cat $i)"
done
-action $"Sending all processes the TERM signal..." /sbin/killall5 -15 $OMITARGS
+action $"Sending all processes the TERM signal..." kill_all -15 $OMITARGS
# No need to sleep and kill -9 if no processes to kill were found
if [ "$?" == 0 ]; then
sleep 2
- action $"Sending all processes the KILL signal..." /sbin/killall5 -9 $OMITARGS
+ action $"Sending all processes the KILL signal..." kill_all -9 $OMITARGS
fi
# Write to wtmp file before unmounting /var