Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 May 2014 06:43:38 GMT
From:      Ganael Laplanche <ganael.laplanche@martymac.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   conf/189696: [Regression] mdconfig and mdconfig2 startup scripts
Message-ID:  <201405120643.s4C6hcKL019455@cgiserv.freebsd.org>
Resent-Message-ID: <201405120650.s4C6o0u6050139@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         189696
>Category:       conf
>Synopsis:       [Regression] mdconfig and mdconfig2 startup scripts
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 12 06:50:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Ganael Laplanche
>Release:        11-CURRENT
>Organization:
http://contribs.martymac.org
>Environment:
FreeBSD laptop.martymac.org 11.0-CURRENT FreeBSD 11.0-CURRENT #5 r265091M: Wed Apr 30 12:07:35 CEST 2014     martymac@laptop.martymac.org:/usr/obj/files/Src/sys/GENERIC  amd64
>Description:
Hi,

svn rev. 264243 introduced a regression in rc.d/mdconfig and mdconfig2 scripts.

The following configuration (within /etc/rc.conf) :

# Ramdisk
mdconfig_md0="-t swap -s 4096m" 
mdconfig_md0_owner="root:wheel"
mdconfig_md0_perms="1777" 
mdconfig_md0_cmd="mkdir /tmp/wrkdirs"

now leads to errors because of wrong list_vars arguments within the scripts.

With current arguments, the scripts catch too many md devices and now try to create md0, but also md0_owner, md0_perms and md0_cmd.
>How-To-Repeat:
Try the configuration above and do :

# /etc/rc.d/mdconfig start
# /etc/rc.d/mdconfig2 start

(or reboot)
>Fix:


Patch attached with submission follows:

--- etc/rc.d/mdconfig.orig	2014-04-30 14:20:23.000000000 +0200
+++ etc/rc.d/mdconfig	2014-05-07 18:33:57.000000000 +0200
@@ -182,7 +182,7 @@
 load_rc_config $name
 
 if [ -z "${_mdconfig_list}" ]; then
-	for _mdconfig_config in `list_vars mdconfig_md[0-9]\* |
+	for _mdconfig_config in `list_vars mdconfig_md*[[:digit:]] |
 		sort_lite -nk1.12`
 	do
 		_mdconfig_unit=${_mdconfig_config#mdconfig_md}
--- etc/rc.d/mdconfig2.orig	2014-04-30 14:20:26.000000000 +0200
+++ etc/rc.d/mdconfig2	2014-05-07 18:31:57.000000000 +0200
@@ -212,7 +212,7 @@
 load_rc_config $name
 
 if [ -z "${_mdconfig2_list}" ]; then
-	for _mdconfig2_config in `list_vars mdconfig_md[0-9]\* |
+	for _mdconfig2_config in `list_vars mdconfig_md*[[:digit:]] |
 		sort_lite -nk1.12`
 	do
 		_mdconfig2_unit=${_mdconfig2_config#mdconfig_md}


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405120643.s4C6hcKL019455>