aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrc.d/init.d/halt12
1 files changed, 11 insertions, 1 deletions
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.