Author: dougb
Date: Fri Apr 29 21:10:41 2011
New Revision: 221227
URL: http://svn.freebsd.org/changeset/base/221227

Log:
  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

Modified:
  head/etc/rc

Modified: head/etc/rc
==============================================================================
--- head/etc/rc Fri Apr 29 21:09:03 2011        (r221226)
+++ head/etc/rc Fri Apr 29 21:10:41 2011        (r221227)
@@ -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}
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to