From owner-svn-src-all@FreeBSD.ORG Wed Aug 27 09:19:23 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 937696A6; Wed, 27 Aug 2014 09:19:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7307F382B; Wed, 27 Aug 2014 09:19:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7R9JNTV054140; Wed, 27 Aug 2014 09:19:23 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7R9JNeF054138; Wed, 27 Aug 2014 09:19:23 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201408270919.s7R9JNeF054138@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Wed, 27 Aug 2014 09:19:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270698 - in head: etc share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 09:19:23 -0000 Author: hrs Date: Wed Aug 27 09:19:22 2014 New Revision: 270698 URL: http://svnweb.freebsd.org/changeset/base/270698 Log: - Use $local_startup to load rc.conf.d/* scripts. - Document support of rc.conf.d//* introduced in r270392. Discussed with: bapt Modified: head/etc/rc.subr head/share/man/man5/rc.conf.5 Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Wed Aug 27 08:05:57 2014 (r270697) +++ head/etc/rc.subr Wed Aug 27 09:19:22 2014 (r270698) @@ -1270,7 +1270,7 @@ run_rc_script() # 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,22 +1289,21 @@ load_rc_config() 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 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Wed Aug 27 08:05:57 2014 (r270697) +++ head/share/man/man5/rc.conf.5 Wed Aug 27 09:19:22 2014 (r270698) @@ -63,20 +63,37 @@ The file is used to override settings in .Pa /etc/rc.conf for historical reasons. +.Pp In addition to .Pa /etc/rc.conf.local you can also place smaller configuration files for each .Xr rc 8 script in the .Pa /etc/rc.conf.d -directory or in the -.Pa ${LOCALBASE}/etc/rc.conf.d -directory, which will be included by the +directory or +.Ao Ar dir Ac Ns Pa /rc.conf.d +directories specified in +.Va local_startup , +which will be included by the .Va load_rc_config function. For jail configurations you could use the file .Pa /etc/rc.conf.d/jail to store jail specific configuration options. +If +.Va local_startup +contains +.Pa /usr/local/etc/rc.d +and +.Pa /opt/conf , +.Pa /usr/local/rc.conf.d/jail +and +.Pa /opt/conf/rc.conf.d/jail +will be loaded. +If +.Ao Ar dir Ac Ns Pa /rc.conf.d/ Ns Ao Ar name Ac +is a directory, +all of files in the directory will be loaded. Also see the .Va rc_conf_files variable below.