From 970ccd69d57469c4d5b9fceed0a200965fabe2a8 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 21 Sep 2009 13:25:50 -0400 Subject: Don't kill mdmon on shutdown. (#524357, ) Horray for bad kernel <-> userspace interactions. --- rc.d/init.d/halt | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'rc.d') 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 -- cgit v1.2.1