Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Apr 2011 11:56:58 -0700
From:      Doug Barton <dougb@FreeBSD.org>
To:        Ryan Stone <rysto32@gmail.com>
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
Message-ID:  <4DBB09FA.1040108@FreeBSD.org>
In-Reply-To: <4DBB01D9.2060805@FreeBSD.org>
References:  <BANLkTi=FH4DeB-bH9Dcre_U-5J%2BP%2B3o_BA@mail.gmail.com> <4DBB01D9.2060805@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DBB09FA.1040108>