From owner-svn-src-head@FreeBSD.ORG Fri Apr 29 21:10:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AFFA106564A; Fri, 29 Apr 2011 21:10:41 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B1088FC16; Fri, 29 Apr 2011 21:10:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TLAfKm015736; Fri, 29 Apr 2011 21:10:41 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3TLAfp4015734; Fri, 29 Apr 2011 21:10:41 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201104292110.p3TLAfp4015734@svn.freebsd.org> From: Doug Barton Date: Fri, 29 Apr 2011 21:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221227 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2011 21:10:41 -0000 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}