From owner-svn-src-all@FreeBSD.ORG Wed Aug 27 04:52:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08B3EBF9; Wed, 27 Aug 2014 04:52:03 +0000 (UTC) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.allbsd.org", Issuer "RapidSSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C33473056; Wed, 27 Aug 2014 04:52:01 +0000 (UTC) Received: from alph.d.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=56) by mail.allbsd.org (8.14.9/8.14.8) with ESMTP id s7R4pZql097426 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 27 Aug 2014 13:51:47 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.8/8.14.8) with ESMTP id s7R4pX4u004853; Wed, 27 Aug 2014 13:51:35 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Wed, 27 Aug 2014 13:48:00 +0900 (JST) Message-Id: <20140827.134800.2047075166971853210.hrs@allbsd.org> To: bapt@FreeBSD.org Subject: Re: svn commit: r270676 - head/etc From: Hiroki Sato In-Reply-To: <201408262233.s7QMXYfd056791@svn.freebsd.org> References: <201408262233.s7QMXYfd056791@svn.freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.6 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart0(Wed_Aug_27_13_48_00_2014_152)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Wed, 27 Aug 2014 13:51:55 +0900 (JST) X-Spam-Status: No, score=-97.9 required=13.0 tests=CONTENT_TYPE_PRESENT, RDNS_NONE,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Aug 2014 04:52:03 -0000 ----Security_Multipart0(Wed_Aug_27_13_48_00_2014_152)-- Content-Type: Multipart/Mixed; boundary="--Next_Part(Wed_Aug_27_13_48_00_2014_381)--" Content-Transfer-Encoding: 7bit ----Next_Part(Wed_Aug_27_13_48_00_2014_381)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Baptiste Daroussin wrote in <201408262233.s7QMXYfd056791@svn.freebsd.org>: ba> Author: bapt ba> Date: Tue Aug 26 22:33:34 2014 ba> New Revision: 270676 ba> URL: http://svnweb.freebsd.org/changeset/base/270676 ba> ba> Log: ba> Allow to configure services from ${LOCALBASE}/etc/rc.conf.d ba> ba> Reviewed by: bdrewery ba> MFC after: 1 week ba> Relnotes: yes ba> ba> Modified: ba> head/etc/rc.subr ba> ba> Modified: head/etc/rc.subr ba> ============================================================================== ba> --- head/etc/rc.subr Tue Aug 26 22:20:02 2014 (r270675) ba> +++ head/etc/rc.subr Tue Aug 26 22:33:34 2014 (r270676) ba> @@ -1301,6 +1301,10 @@ load_rc_config() ba> fi ba> done ba> fi ba> + if [ -f ${LOCALBASE:-/usr/local}/etc/rc.conf.d/"$_name" ]; then ba> + debug "Sourcing ${LOCALBASE:-/usr/local}/etc/rc.conf.d/${_name}" ba> + . ${LOCALBASE:-/usr/local}/etc/rc.conf.d/"$_name" ba> + fi This should hornor ${local_startup} instead of ${LOCALBASE} since it is not used in rc(8), and should be compatible with DES's commit in r270392. How about the attached patch? -- Hiroki ----Next_Part(Wed_Aug_27_13_48_00_2014_381)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="rc.subr.20140827-1.diff" Index: etc/rc.subr =================================================================== --- etc/rc.subr (revision 270695) +++ etc/rc.subr (working copy) @@ -1270,7 +1270,7 @@ # load_rc_config() { - local _name _rcvar_val _var _defval _v _msg _new + local _name _rcvar_val _var _defval _v _msg _new _d _name=$1 if [ -z "$_name" ]; then err 3 'USAGE: load_rc_config name' @@ -1289,23 +1289,22 @@ fi _rc_conf_loaded=true fi - if [ -f /etc/rc.conf.d/"$_name" ]; then - 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 /etc/rc.conf.d/"$_name"/* ; do - if [ -f "$_rc" ] ; then - debug "Sourcing $_rc" - . "$_rc" - fi - done - fi - if [ -f ${LOCALBASE:-/usr/local}/etc/rc.conf.d/"$_name" ]; then - debug "Sourcing ${LOCALBASE:-/usr/local}/etc/rc.conf.d/${_name}" - . ${LOCALBASE:-/usr/local}/etc/rc.conf.d/"$_name" - fi + for _d in /etc ${local_startup%*/rc.d}; do + if [ -f ${_d}/rc.conf.d/"$_name" ]; then + debug "Sourcing ${_d}/rc.conf.d/$_name" + . ${_d}/rc.conf.d/"$_name" + elif [ -d ${_d}/rc.conf.d/"$_name" ] ; then + local _rc + for _rc in ${_d}/rc.conf.d/"$_name"/* ; do + if [ -f "$_rc" ] ; then + debug "Sourcing $_rc" + . "$_rc" + fi + done + fi + done + # Set defaults if defined. for _var in $rcvar; do eval _defval=\$${_var}_defval ----Next_Part(Wed_Aug_27_13_48_00_2014_381)---- ----Security_Multipart0(Wed_Aug_27_13_48_00_2014_152)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEABECAAYFAlP9YwAACgkQTyzT2CeTzy0XwgCfawZi0t4DJ4ic1516gTQFwBh1 iAIAn19TvhrHvwmtVuB7/+1YA7lOzsrc =9Mtv -----END PGP SIGNATURE----- ----Security_Multipart0(Wed_Aug_27_13_48_00_2014_152)----