From owner-freebsd-bugs@FreeBSD.ORG Sat Apr 5 23:30:01 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B9A6106566C for ; Sat, 5 Apr 2008 23:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3D3E68FC1F for ; Sat, 5 Apr 2008 23:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m35NU1RN033400 for ; Sat, 5 Apr 2008 23:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m35NU1ix033399; Sat, 5 Apr 2008 23:30:01 GMT (envelope-from gnats) Resent-Date: Sat, 5 Apr 2008 23:30:01 GMT Resent-Message-Id: <200804052330.m35NU1ix033399@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jürgen Unger Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9942C106564A for ; Sat, 5 Apr 2008 23:21:17 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 7C8F68FC16 for ; Sat, 5 Apr 2008 23:21:17 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m35NL6Au037705 for ; Sat, 5 Apr 2008 23:21:06 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m35NL60P037704; Sat, 5 Apr 2008 23:21:06 GMT (envelope-from nobody) Message-Id: <200804052321.m35NL60P037704@www.freebsd.org> Date: Sat, 5 Apr 2008 23:21:06 GMT From: Jürgen Unger To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: conf/122477: /etc/rc.d/mdconfig and mdconfig2 are ignoring additional parameter in some cases X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2008 23:30:01 -0000 >Number: 122477 >Category: conf >Synopsis: /etc/rc.d/mdconfig and mdconfig2 are ignoring additional parameter in some cases >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: Sat Apr 05 23:30:00 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Jürgen Unger >Release: 7.0-RELEASE and CURRENT >Organization: >Environment: FreeBSD test3.lab.jpru.de 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sat Apr 5 07:09:37 CEST 2008 root@test3.lab.jpru.de:/usr/obj/usr/src/sys/GENERIC i386 same on machine with current. >Description: in the case _mdconfig_list or _mdconfig2_list is set explicit in /etc/rc.conf because of non contingous device-numbers of md-devices, then it is impossible to activate a newly created and configured md-device with the following command (sample): /etc/rc.d/mdconfig2 start md4444 >How-To-Repeat: given is a set of configured md-devices with an _mdconfig2_list explicit set in /etc/rc.conf: _mdconfig2_list="md1001 md1002 md1003" create a new md-device with a file-backingstore: dd if=/dev/zero of=/somwhere/out/there/5555.img bs=1M count=100 mdconfig -a -t vnode -f /somewhere/out/there/5555.img -u 5555 newfs /dev/md5555 mdconfig -d -u 5555 add it to rc.conf: _mdconfig2_list="md1001 md1002 md1003 md5555" mdconfig_md5555="-t vnode -f /somewhere/out/there/5555.img" now try to use mdconfig2 to activate this configuration: /etc/rc.d/mdconfig2 start md5555 then he complains about md1001 already there where it only should process md5555. the below patches are fixing this while preserving the known behaviour in the common known cases. >Fix: test3# diff -u mdconfig.orig mdconfig --- mdconfig.orig 2008-02-24 18:53:19.000000000 +0100 +++ mdconfig 2008-04-06 02:50:19.000000000 +0200 @@ -174,14 +174,14 @@ done } +load_rc_config $name + _mdconfig_cmd="$1" if [ $# -gt 0 ]; then shift fi [ -n "$*" ] && _mdconfig_list="$*" -load_rc_config $name - _mdconfig_unit=0 if [ -z "${_mdconfig_list}" ]; then while :; do test3# diff -u mdconfig2.orig mdconfig2 --- mdconfig2.orig 2008-02-24 18:53:19.000000000 +0100 +++ mdconfig2 2008-04-06 02:48:50.000000000 +0200 @@ -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: