Home | History | Annotate | Line # | Download | only in rc.d
raidframe revision 1.5
      1  1.1    lukem #!/bin/sh
      2  1.1    lukem #
      3  1.5    lukem # $NetBSD: raidframe,v 1.5 2000/11/17 05:43:46 lukem Exp $
      4  1.1    lukem #
      5  1.1    lukem 
      6  1.2  thorpej # PROVIDE: disks
      7  1.1    lukem 
      8  1.1    lukem . /etc/rc.subr
      9  1.1    lukem 
     10  1.1    lukem name="raidframe"
     11  1.1    lukem start_cmd="raidframe_start"
     12  1.1    lukem stop_cmd=":"
     13  1.1    lukem 
     14  1.1    lukem raidframe_start()
     15  1.1    lukem {
     16  1.5    lukem 	# Configure raid devices.
     17  1.5    lukem 	# Ensure order by globbing raid[0-9].conf before raid[0-9][0-9].conf.
     18  1.1    lukem 	#
     19  1.5    lukem 	for cfg in /etc/raid[0-9].conf /etc/raid[0-9][0-9].conf ; do
     20  1.5    lukem 		[ ! -f $cfg ] && continue
     21  1.5    lukem 		dev=${cfg##*/}
     22  1.5    lukem 		dev=${dev%%.conf}
     23  1.5    lukem 		raidctl -c $cfg $dev
     24  1.1    lukem 	done
     25  1.4    oster 
     26  1.5    lukem 	# Initiate parity/mirror reconstruction as needed.
     27  1.4    oster 	# Backgrounded, and sequentially ordered.
     28  1.4    oster 	#
     29  1.5    lukem 	# XXX:	this currently doesn't work for autoconfigured raid devices
     30  1.5    lukem 	#	that don't have a corresponding raidN.conf
     31  1.5    lukem 	#
     32  1.4    oster 	(
     33  1.5    lukem 		for cfg in /etc/raid[0-9].conf /etc/raid[0-9][0-9].conf ; do
     34  1.5    lukem 			[ ! -f $cfg ] && continue
     35  1.5    lukem 			dev=${cfg##*/}
     36  1.5    lukem 			dev=${dev%%.conf}
     37  1.5    lukem 			raidctl -P $dev
     38  1.5    lukem 		done
     39  1.4    oster 	) &
     40  1.1    lukem }
     41  1.1    lukem 
     42  1.3    lukem load_rc_config $name
     43  1.1    lukem run_rc_command "$1"
     44