summaryrefslogtreecommitdiffstats
path: root/etc/rc
diff options
context:
space:
mode:
authordougb <dougb@FreeBSD.org>2011-04-29 21:10:41 +0000
committerdougb <dougb@FreeBSD.org>2011-04-29 21:10:41 +0000
commit271fabc97a777b0748ff774cc86bbdebb1f4a7a6 (patch)
treec433b517ea3057bcd22a7aa9c7404b73e39ea905 /etc/rc
parent22b381b7217c2644a04f90b803d07661633ac04c (diff)
downloadFreeBSD-src-271fabc97a777b0748ff774cc86bbdebb1f4a7a6.zip
FreeBSD-src-271fabc97a777b0748ff774cc86bbdebb1f4a7a6.tar.gz
Rather than trusting that nothing is going to sneak in before the
early_late_divider in the second run (and thus be skipped altogether), keep a list of the scripts run early, and use that list to skip things in the second run. This has the primary benefit of not skipping a local script that gets ordered too early in the second run. It also gives an opportunity to clean up/simplify the code a bit. Use a space-separated list rather than the more traditional colon for maximum insurance against creativity in local naming conventions. Reviewed by: brooks
Diffstat (limited to 'etc/rc')
-rw-r--r--etc/rc11
1 files changed, 4 insertions, 7 deletions
diff --git a/etc/rc b/etc/rc
index 7268ee1..cd22116 100644
--- a/etc/rc
+++ b/etc/rc
@@ -84,8 +84,10 @@ fi
#
files=`rcorder ${skip} /etc/rc.d/* 2>/dev/null`
+_rc_elem_done=' '
for _rc_elem in ${files}; do
run_rc_script ${_rc_elem} ${_boot}
+ _rc_elem_done="${_rc_elem_done}${_rc_elem} "
case "$_rc_elem" in
*/${early_late_divider}) break ;;
@@ -103,14 +105,9 @@ case ${local_startup} in
esac
files=`rcorder ${skip} /etc/rc.d/* ${local_rc} 2>/dev/null`
-_skip_early=1
for _rc_elem in ${files}; do
- case "$_skip_early" in
- 1) case "$_rc_elem" in
- */${early_late_divider}) _skip_early=0 ;;
- esac
- continue
- ;;
+ case "$_rc_elem_done" in
+ *" $_rc_elem "*) continue ;;
esac
run_rc_script ${_rc_elem} ${_boot}
OpenPOWER on IntegriCloud