rc.d scripts can be missed if they aren't ordered with respect to the early-late divider

Brooks Davis brooks at freebsd.org
Fri Apr 29 19:48:17 UTC 2011


On Fri, Apr 29, 2011 at 11:56:58AM -0700, Doug Barton wrote:
> 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.

Looks good to me.  I'll admit I find ':' separators more unixy, but it
truly doesn't matter.

-- Brooks

> 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/
> 

> 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}

> _______________________________________________
> freebsd-rc at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-rc
> To unsubscribe, send any mail to "freebsd-rc-unsubscribe at freebsd.org"

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20110429/1328bf31/attachment-0001.pgp


More information about the freebsd-rc mailing list