misc/140261: Improve flexibility of mdconfig2 startup script

Brian Scott brian at bunyatech.com.au
Wed Nov 4 04:20:02 UTC 2009


>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 at 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:


More information about the freebsd-bugs mailing list