From 1c0967c9cd6948f410c14a691d28e2dd5d0ffdf0 Mon Sep 17 00:00:00 2001 From: Cristian Gafton Date: Sat, 13 Feb 1999 23:23:44 +0000 Subject: Attempt a fix for the raid stop code --- rc.d/init.d/halt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'rc.d') diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt index 198767c0..02621122 100755 --- a/rc.d/init.d/halt +++ b/rc.d/init.d/halt @@ -58,7 +58,17 @@ mount -n -o remount,ro / # turn off raid if [ -x /sbin/raidstop -a -f /etc/raidtab ]; then - runcmd "Turning off RAID" /sbin/raidstop -a + # we can not use raidstop -a here because this will only stop + # devices listed in the default config file which is not always + # the case. So we look only for the active raid devices + if [ -f /proc/mdstat ] ; then + mddevs=$(grep ^md /proc/mdstat | awk '{ print $1 }') + for mddev in $mddevs ; do + runcmd "Turning off RAID for $mddev" raidstop /dev/$mddev + done + unset mddev mddevs + fi + #runcmd "Turning off RAID" /sbin/raidstop -a fi # Remount read only anything that's left mounted. -- cgit v1.2.1