summaryrefslogtreecommitdiffstats
path: root/etc/rc.subr
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2014-08-23 10:51:37 +0000
committerdes <des@FreeBSD.org>2014-08-23 10:51:37 +0000
commit5c129e9d8b23fdc4340d4fc5c0b9c9f117a5b122 (patch)
tree00a7b65fbc8b83cfa54b5c4411114be933b47eef /etc/rc.subr
parent2db4dceb4e3416d6c1345f9474ba21d049c8ea3d (diff)
downloadFreeBSD-src-5c129e9d8b23fdc4340d4fc5c0b9c9f117a5b122.zip
FreeBSD-src-5c129e9d8b23fdc4340d4fc5c0b9c9f117a5b122.tar.gz
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
Diffstat (limited to 'etc/rc.subr')
-rw-r--r--etc/rc.subr10
1 files changed, 9 insertions, 1 deletions
diff --git a/etc/rc.subr b/etc/rc.subr
index b6172db..f02ae14 100644
--- a/etc/rc.subr
+++ b/etc/rc.subr
@@ -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.
OpenPOWER on IntegriCloud