Author: des
Date: Sat Aug 23 10:51:37 2014
New Revision: 270392
URL: http://svnweb.freebsd.org/changeset/base/270392

Log:
  Add support for /etc/rc.conf.d/<service> subdirectories.  This is
  particularly useful for services such as "network" (netif) where each
  interface can now have its own separate configuration file.
  Add /etc/rc.conf.d to the mtree file so it is always present.
  
  MFC after:    3 days

Modified:
  head/etc/mtree/BSD.root.dist
  head/etc/rc.subr

Modified: head/etc/mtree/BSD.root.dist
==============================================================================
--- head/etc/mtree/BSD.root.dist        Sat Aug 23 10:49:02 2014        
(r270391)
+++ head/etc/mtree/BSD.root.dist        Sat Aug 23 10:51:37 2014        
(r270392)
@@ -62,6 +62,8 @@
         ..
         ppp
         ..
+        rc.conf.d
+        ..
         rc.d
         ..
         security

Modified: head/etc/rc.subr
==============================================================================
--- head/etc/rc.subr    Sat Aug 23 10:49:02 2014        (r270391)
+++ head/etc/rc.subr    Sat Aug 23 10:51:37 2014        (r270392)
@@ -1290,8 +1290,16 @@ load_rc_config()
                _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 /etc/rc.conf.d/"$_name"/* ; do
+                       if [ -f "$_rc" ] ; then
+                               debug "Sourcing $_rc"
+                               . "$_rc"
+                       fi
+               done
        fi
 
        # Set defaults if defined.
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to