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
This commit is contained in:
Dag-Erling Smørgrav 2014-08-23 10:51:37 +00:00
parent fe248ffb7f
commit 5407523fe5
2 changed files with 11 additions and 1 deletions

View File

@ -62,6 +62,8 @@
..
ppp
..
rc.conf.d
..
rc.d
..
security

View File

@ -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.