Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc/rc.d start all raid[0-9].conf and raid[0-9][0-9].conf, n...



details:   https://anonhg.NetBSD.org/src/rev/f0db9e753320
branches:  trunk
changeset: 499326:f0db9e753320
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Nov 17 05:43:46 2000 +0000

description:
start all raid[0-9].conf and raid[0-9][0-9].conf, not just raid[0-3].conf.
do in order, so that raidN.conf is started before raidNN.conf.

diffstat:

 etc/rc.d/raidframe |  30 ++++++++++++++++++------------
 1 files changed, 18 insertions(+), 12 deletions(-)

diffs (52 lines):

diff -r b0f5fa86db53 -r f0db9e753320 etc/rc.d/raidframe
--- a/etc/rc.d/raidframe        Fri Nov 17 05:07:45 2000 +0000
+++ b/etc/rc.d/raidframe        Fri Nov 17 05:43:46 2000 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: raidframe,v 1.4 2000/05/16 16:54:33 oster Exp $
+# $NetBSD: raidframe,v 1.5 2000/11/17 05:43:46 lukem Exp $
 #
 
 # PROVIDE: disks
@@ -13,23 +13,29 @@
 
 raidframe_start()
 {
-       #       Configure raid devices.
+       # Configure raid devices.
+       # Ensure order by globbing raid[0-9].conf before raid[0-9][0-9].conf.
        #
-       for dev in 0 1 2 3; do
-               if [ -f /etc/raid$dev.conf ]; then
-                       raidctl -c /etc/raid$dev.conf raid$dev
-               fi
+       for cfg in /etc/raid[0-9].conf /etc/raid[0-9][0-9].conf ; do
+               [ ! -f $cfg ] && continue
+               dev=${cfg##*/}
+               dev=${dev%%.conf}
+               raidctl -c $cfg $dev
        done
 
-       # Initiate parity/mirror reconstruction as needed.  
+       # Initiate parity/mirror reconstruction as needed.
        # Backgrounded, and sequentially ordered.
        #
+       # XXX:  this currently doesn't work for autoconfigured raid devices
+       #       that don't have a corresponding raidN.conf
+       #
        (
-               for dev in 0 1 2 3; do
-                       if [ -f /etc/raid$dev.conf ]; then
-                               raidctl -P raid$dev
-                       fi
-               done
+               for cfg in /etc/raid[0-9].conf /etc/raid[0-9][0-9].conf ; do
+                       [ ! -f $cfg ] && continue
+                       dev=${cfg##*/}
+                       dev=${dev%%.conf}
+                       raidctl -P $dev
+               done
        ) &
 }
 



Home | Main Index | Thread Index | Old Index