diff --git a/etc/mtree/BSD.root.dist b/etc/mtree/BSD.root.dist --- a/etc/mtree/BSD.root.dist +++ b/etc/mtree/BSD.root.dist @@ -52,6 +52,8 @@ cron.d .. defaults + rc.conf.d tags=package=rc + .. .. devd .. @@ -89,9 +91,9 @@ .. profile.d .. - rc.conf.d + rc.conf.d tags=package=rc .. - rc.d + rc.d tags=package=rc .. security .. diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -1987,10 +1987,18 @@ _rc_conf_loaded=true fi - # If a service name was specified, attempt to load - # service-specific configuration + # If a service name was specified, load any default configuration from + # /etc/defaults/rc.conf.d, then attempt to load user overrides from + # /etc/rc.conf.d and local startup dirs. if [ -n "$_name" ] ; then _loaded_services="${_loaded_services} ${_name}" + + local _default_d="/etc/defaults/rc.conf.d/$_name" + if [ -f "$_default_d" ]; then + debug "Sourcing $_default_d" + $_dot "$_default_d" + fi + for _d in /etc ${local_startup}; do _d=${_d%/rc.d} if [ -f ${_d}/rc.conf.d/"$_name" ]; then