From owner-freebsd-rc@FreeBSD.ORG Mon Aug 11 13:48:01 2014 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA3E3609 for ; Mon, 11 Aug 2014 13:48:01 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 8DC9D29CE for ; Mon, 11 Aug 2014 13:48:01 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id AF7387D9D for ; Mon, 11 Aug 2014 13:47:53 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id A155223F7; Mon, 11 Aug 2014 15:47:52 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: freebsd-rc@freebsd.org Subject: rc.conf.d improvement Date: Mon, 11 Aug 2014 15:47:52 +0200 Message-ID: <86a97bp27r.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2014 13:48:01 -0000 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable The attached patch does two things: 1) Add /etc/rc.conf.d to BSD.root.mtree so it's created during installation; 2) Modify rc.subr so that if /etc/rc.conf.d/ is a directory, all of the files it contains are included. Comments or objections? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=rc-conf-d.diff Index: etc/mtree/BSD.root.dist =================================================================== --- etc/mtree/BSD.root.dist (revision 269808) +++ etc/mtree/BSD.root.dist (working copy) @@ -60,6 +60,8 @@ .. ppp .. + rc.conf.d + .. rc.d .. security Index: etc/rc.subr =================================================================== --- etc/rc.subr (revision 269808) +++ etc/rc.subr (working copy) @@ -1290,8 +1290,14 @@ _rc_conf_loaded=true fi if [ -f /etc/rc.conf.d/"$_name" ]; then - debug "Sourcing /etc/rc.conf.d/${_name}" + debug "Sourcing /etc/rc.conf.d/$_name" . /etc/rc.conf.d/"$_name" + elif [ -d /etc/rc.conf.d/"$_name" ] ; then + local _rc + for _rc in $(/bin/ls /etc/rc.conf.d/"$_name") ; do + debug "Sourcing /etc/rc.conf.d/$_name/$_rc" + . "/etc/rc.conf.d/$_name/$_rc" + done fi # Set defaults if defined. --=-=-=--