misc/137470: [PATCH] /etc/rc.d/mdconfig2 : prioritize cli
parameters for _mdconfig2_list over the value in rc.conf
Mohd Izhar Firdaus Ismail
kagesenshi.87 at gmail.com
Thu Aug 6 05:00:15 UTC 2009
>Number: 137470
>Category: misc
>Synopsis: [PATCH] /etc/rc.d/mdconfig2 : prioritize cli parameters for _mdconfig2_list over the value in rc.conf
>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: Thu Aug 06 05:00:14 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Mohd Izhar Firdaus Ismail
>Release: 7.2-RELEASE
>Organization:
Inigo Consulting Sdn Bhd
>Environment:
FreeBSD hulk.inigo-tech.com 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Tue May 19 19:59:44 MYT 2009 kaeru at hulk.inigo-tech.com:/usr/obj/usr/src/sys/HULK amd64
>Description:
when _mdconfig2_list is specified in rc.conf, `/etc/rc.d/mdconfig2 start` ignored parameters passed to it (which supposed to be stored in _mdconfig2_list variable afterward).
>How-To-Repeat:
create 2 image files, and configure them to be automatically mounted by mdconfig2
add in rc.conf:
_mdconfig2_list="md5"
mdconfig_md5=" -t vnode -f /img/image.img"
mdconfig_md6=" -t vnode -f /img/image2.img"
add in fstab:
/dev/md5 /mnt/image ufs rw,noauto 0 0
/dev/md6 /mnt/image2 ufs rw,noauto 0 0
start mdconfig2:
$ /etc/rc.d/mdconfig2 start
Creating md5 device (vnode).
Mounting /dev/md5.
try to start/stop only md6:
$ /etc/rc.d/mdconfig2 start md6
/etc/rc.d/mdconfig2: ERROR: md5 already exists
[root at hulk /etc/rc.d]# /etc/rc.d/mdconfig2 stop md6
Umounting /dev/md5.
Destroying md5.
>Fix:
moving `load_rc_config $name` in the code to an earlier line fixes the problems
Patch attached with submission follows:
--- mdconfig2.orig 2009-08-06 12:33:04.000000000 +0800
+++ mdconfig2 2009-08-06 12:28:10.000000000 +0800
@@ -203,14 +203,14 @@
done
}
+load_rc_config $name
+
_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