aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2009-09-21 13:25:50 -0400
committerBill Nottingham <notting@redhat.com>2009-09-21 13:25:50 -0400
commit970ccd69d57469c4d5b9fceed0a200965fabe2a8 (patch)
tree966aa9cafe439d177cd0bbca9df45345bac16b46 /rc.d/init.d
parent4782a8f6949384e93aff0b630cf0772b8eddb2ac (diff)
downloadinitscripts-970ccd69d57469c4d5b9fceed0a200965fabe2a8.tar
initscripts-970ccd69d57469c4d5b9fceed0a200965fabe2a8.tar.gz
initscripts-970ccd69d57469c4d5b9fceed0a200965fabe2a8.tar.bz2
initscripts-970ccd69d57469c4d5b9fceed0a200965fabe2a8.tar.xz
initscripts-970ccd69d57469c4d5b9fceed0a200965fabe2a8.zip
Don't kill mdmon on shutdown. (#524357, <hdegoede@redhat.com>)
Horray for bad kernel <-> userspace interactions.
Diffstat (limited to 'rc.d/init.d')
-rwxr-xr-xrc.d/init.d/halt18
1 files changed, 16 insertions, 2 deletions
diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt
index aa16737a..9d8bb152 100755
--- a/rc.d/init.d/halt
+++ b/rc.d/init.d/halt
@@ -57,9 +57,18 @@ esac
# Kill all processes.
[ "${BASH+bash}" = bash ] && enable kill
-action $"Sending all processes the TERM signal..." /sbin/killall5 -15
+# Find mdmon pid's and omit killing them
+OMITARGS=
+for i in /dev/.mdadm/*.pid; do
+ if [ "$i" = "mdadm.pid" -o ! -r "$i" ]; then
+ continue
+ fi
+ OMITARGS="$OMITARGS -o $(cat $i)"
+done
+
+action $"Sending all processes the TERM signal..." /sbin/killall5 -15 $OMITARGS
sleep 2
-action $"Sending all processes the KILL signal..." /sbin/killall5 -9
+action $"Sending all processes the KILL signal..." /sbin/killall5 -9 $OMITARGS
# Write to wtmp file before unmounting /var
/sbin/halt -w
@@ -141,6 +150,11 @@ mount | awk '{ print $3 }' | while read line; do
fstab-decode mount -n -o ro,remount $line
done
+# If we left mdmon's running wait for the raidsets to become clean
+if [ -n "$OMITARGS" ]; then
+ mdadm --wait-clean --scan
+fi
+
# Now halt or reboot.
echo $"$message"
if [ -f /fastboot ]; then