Date: Wed, 4 Nov 2009 04:11:11 GMT From: Brian Scott <brian@bunyatech.com.au> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/140261: Improve flexibility of mdconfig2 startup script Message-ID: <200911040411.nA44BBYK081025@www.freebsd.org> Resent-Message-ID: <200911040420.nA44K1aN011348@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 140261 >Category: misc >Synopsis: Improve flexibility of mdconfig2 startup script >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Nov 04 04:20:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Brian Scott >Release: 7.2 >Organization: Bunya Technology >Environment: FreeBSD beasty.netlab.albury.tafe 7.2-STABLE FreeBSD 7.2-STABLE #4: Thu May 7 13:37:25 EST 2009 root@beasty.netlab.albury.tafe:/usr/obj/usr/src/sys/BEASTY i386 >Description: Configuring memory disk devices currently requires that the devices are numbered consecutively from 0 to be actioned during system startup by the mdconfig2 script. The first non-existent device number signals the end of the list. Subsequent removal of a device from rc.conf requires others to be renumbered to remove any gaps and fstab entries need to be adjusted to match the updated device numbers. This proposal is to (optionally) use a list to name those devices you want attached at startup. The current version of the script allows you to specify exactly this behavior: _mdconfig2_list="md23 md47 md5" This appears to be an unintended feature, the leading _ suggesting a private variable that isn't meant to be set. The proposed change introduces a new variable without the leading _ such that the existing behavior is maintained (use devices from 0 upwards until not found) if the setting isn't used. The private variable is still used to build a dynamic list or hold command line arguments. >How-To-Repeat: >Fix: --- /home/bscott/mdconfig2 2009-11-04 14:25:46.000000000 +1100 +++ /etc/rc.d/mdconfig2 2009-11-04 14:28:19.000000000 +1100 @@ -203,14 +203,15 @@ done } +load_rc_config $name +_mdconfig2_list="${mdconfig2_list}" + _mdconfig2_cmd="$1" if [ $# -gt 0 ]; then shift fi [ -n "$*" ] && _mdconfig2_list="$*" -load_rc_config $name - _mdconfig2_unit=0 if [ -z "${_mdconfig2_list}" ]; then while :; do >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911040411.nA44BBYK081025>