From owner-freebsd-rc@FreeBSD.ORG Fri Apr 29 18:57:41 2011 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 664CC106566B for ; Fri, 29 Apr 2011 18:57:41 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-5.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 527C814EE01; Fri, 29 Apr 2011 18:56:59 +0000 (UTC) Message-ID: <4DBB09FA.1040108@FreeBSD.org> Date: Fri, 29 Apr 2011 11:56:58 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 MIME-Version: 1.0 To: Ryan Stone References: <4DBB01D9.2060805@FreeBSD.org> In-Reply-To: <4DBB01D9.2060805@FreeBSD.org> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------060504090903010705010802" Cc: freebsd-rc@freebsd.org Subject: Re: rc.d scripts can be missed if they aren't ordered with respect to the early-late divider X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2011 18:57:41 -0000 This is a multi-part message in MIME format. --------------060504090903010705010802 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit The attached patch works, is probably cleaner than the existing code, and since the list of things run early is small is certainly no slower than the existing code. Using a space-separated list also has the advantage of not being limited to the format of filenames that it supports. I'll commit it later today unless I get an objection. -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --------------060504090903010705010802 Content-Type: text/plain; name="rc-save-early.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="rc-save-early.diff" Index: rc =================================================================== --- rc (revision 221216) +++ rc (working copy) @@ -84,8 +84,10 @@ # 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 @@ 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} --------------060504090903010705010802--