summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorcperciva <cperciva@FreeBSD.org>2013-12-06 20:48:53 +0000
committercperciva <cperciva@FreeBSD.org>2013-12-06 20:48:53 +0000
commit3cc5015bda0c021b585f4d8f27107dbd446bc69d (patch)
tree35eae2e716f5a0700179d305f843c7614b6d2924 /etc
parentdd1133fe214392cdf359b2083c1c9c3d339c724b (diff)
downloadFreeBSD-src-3cc5015bda0c021b585f4d8f27107dbd446bc69d.zip
FreeBSD-src-3cc5015bda0c021b585f4d8f27107dbd446bc69d.tar.gz
MFC r258894: Make rc(8) re-source rc.conf upon receipt of SIGALRM.
The rc system aggressively caches the contents of /etc/rc.conf in order to improve boot performance; this produces arguably astonishing (non-)results if /etc/rc.conf is modified during the boot process. This commit provides a mechanism for explicitly requesting that rc.conf be reloaded. Approved by: re (rodrigc)
Diffstat (limited to 'etc')
-rw-r--r--etc/rc5
1 files changed, 5 insertions, 0 deletions
diff --git a/etc/rc b/etc/rc
index fd5ff85..21efc18 100644
--- a/etc/rc
+++ b/etc/rc
@@ -71,6 +71,11 @@ fi
. /etc/rc.subr
load_rc_config 'XXX'
+# If we receive a SIGALRM, re-source /etc/rc.conf; this allows rc.d
+# scripts to perform "boot-time configuration" including enabling and
+# disabling rc.d scripts which appear later in the boot order.
+trap "_rc_conf_loaded=false; load_rc_config 'XXX'" ALRM
+
skip="-s nostart"
if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then
skip="$skip -s nojail"
OpenPOWER on IntegriCloud