]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
Turn off RAID devices using mdadm first, fallback to raidutils. Make raidutils stoppi...
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 4 Jul 2004 15:45:07 +0000 (15:45 +0000)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 4 Jul 2004 15:45:07 +0000 (15:45 +0000)
svn-id: @4309

rc.d/rc.shutdown

index 870f7fdeb78dad12d4ca6ae7d3746c1172405704..ca59fe17dd2ebc2e90d9d8383ed7db12d944843e 100755 (executable)
@@ -70,19 +70,29 @@ done
 
 run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
 
+goraidtab=1
+if [ -x /sbin/mdadm -a -f /etc/mdadm.conf ]; then
+       if (grep -qE "^([[:blank:]]|)ARRAY[[:blank:]]" /etc/mdadm.conf); then
+                   run_cmd "Turning off RAID devices" /sbin/mdadm --stop --scan
+                   rc=$?
+                   [ "$rc" -eq 0 ] && goraidtab=0
+       fi
+fi
+                                                                                                               
 # turn off raid
-if [ -x /sbin/raidstop -a -f /etc/raidtab ]; then
+if [ -x /sbin/raidstop -a -f /etc/raidtab -a "$goraidtab" -eq 1 ]; then
        # 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=$(awk '/^md.* active/ {print $1}' /proc/mdstat)
                for mddev in $mddevs ; do
-                       run_cmd "Turning off RAID for $mddev" raidstop /dev/$mddev
+                       show "Turning off RAID for %s" "$mddev"
+                       daemon /sbin/raidstop /dev/$mddev
                done
                unset mddev mddevs
        fi
-       #runcmd "Turning off RAID" /sbin/raidstop -a
+       # runcmd "Turning off RAID" /sbin/raidstop -a
 fi
 
 show "Remounting remaining filesystems ro mode"; busy
This page took 0.620278 seconds and 4 git commands to generate.