Source-Changes-HG archive

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

[src/trunk]: src/etc/rc.d use the recently added hw.disknames value from sysc...



details:   https://anonhg.NetBSD.org/src/rev/95142603bb8d
branches:  trunk
changeset: 521276:95142603bb8d
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sun Jan 27 14:16:33 2002 +0000

description:
use the recently added hw.disknames value from sysctl(8) to determine
the list of currently configured disk devices, and start raid parity
rebuilds on devices which match "raid[0-9]*"

diffstat:

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

diffs (46 lines):

diff -r b9f17194bb19 -r 95142603bb8d etc/rc.d/raidframe
--- a/etc/rc.d/raidframe        Sun Jan 27 14:09:38 2002 +0000
+++ b/etc/rc.d/raidframe        Sun Jan 27 14:16:33 2002 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: raidframe,v 1.5 2000/11/17 05:43:46 lukem Exp $
+# $NetBSD: raidframe,v 1.6 2002/01/27 14:16:33 lukem Exp $
 #
 
 # PROVIDE: disks
@@ -13,7 +13,7 @@
 
 raidframe_start()
 {
-       # Configure raid devices.
+       # Configure non-auto-configured raid devices.
        # Ensure order by globbing raid[0-9].conf before raid[0-9][0-9].conf.
        #
        for cfg in /etc/raid[0-9].conf /etc/raid[0-9][0-9].conf ; do
@@ -23,18 +23,15 @@
                raidctl -c $cfg $dev
        done
 
-       # 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
+       # Initiate parity/mirror reconstruction as needed, in the background.
        #
        (
-               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
+               for dev in `sysctl -n hw.disknames`; do
+                       case $dev in
+                       raid[0-9]*)
+                               raidctl -P $dev
+                               ;;
+                       esac
                done
        ) &
 }



Home | Main Index | Thread Index | Old Index