Index: libexec/rc/rc.conf =================================================================== --- libexec/rc/rc.conf +++ libexec/rc/rc.conf @@ -61,6 +61,7 @@ local_startup="/usr/local/etc/rc.d" # startup script dirs. script_name_sep=" " # Change if your startup scripts' names contain spaces rc_conf_files="/etc/rc.conf /etc/rc.conf.local" +rc_conf_dirs="/etc/rc.conf.d" # ZFS support zfs_enable="NO" # Set to YES to automatically mount ZFS file systems @@ -718,13 +719,20 @@ ############################################################## ### Define source_rc_confs, the mechanism used by /etc/rc.* ## -### scripts to source rc_conf_files overrides safely. ## +### scripts to source rc_conf_files and rc_conf_dirs ## +### overrides safely. ## ############################################################## if [ -z "${source_rc_confs_defined}" ]; then source_rc_confs_defined=yes source_rc_confs() { local i sourced_files + + for i in $(find ${rc_conf_dirs} -type f -maxdepth 1 -name '*.conf' -and -not -name '.*'); do + sourced_files="${sourced_files}:$i:" + . ${i} + done + for i in ${rc_conf_files}; do case ${sourced_files} in *:$i:*) @@ -738,6 +746,11 @@ esac done # Re-do process to pick up [possibly] redefined $rc_conf_files + for i in $(find ${rc_conf_dirs} -type f -maxdepth 1 -name '*.conf' -and -not -name '.*'); do + sourced_files="${sourced_files}:$i:" + . ${i} + done + for i in ${rc_conf_files}; do case ${sourced_files} in *:$i:*)