svn commit: r219578 - head/etc

Kostik Belousov kostikbel at gmail.com
Sun Mar 13 09:47:41 UTC 2011


On Sat, Mar 12, 2011 at 09:13:08PM +0000, Doug Barton wrote:
> Author: dougb
> Date: Sat Mar 12 21:13:08 2011
> New Revision: 219578
> URL: http://svn.freebsd.org/changeset/base/219578
> 
> Log:
>   Use the allexport option in load_rc_config() in order to avoid having
>   to repeatedly read the conf files. Depending on what is enabled the
>   files are being read anywhere from 15, 30, or more times currently.
>   By loading the values in the environment this is reduced to 1, with
>   perhaps a couple more, again depending on what is enabled.
>   
>   The speed-up for boot and shutdown is negligible when rc.conf is
>   on local disk, noticable when accessing files over NFS, and dramatic
>   when pulling rc.conf values from a database.
>   
>   This change also includes a minor optimization to the conditional
>   for $_rc_conf_loaded.
> 
> Modified:
>   head/etc/rc.subr
> 
> Modified: head/etc/rc.subr
> ==============================================================================
> --- head/etc/rc.subr	Sat Mar 12 20:36:52 2011	(r219577)
> +++ head/etc/rc.subr	Sat Mar 12 21:13:08 2011	(r219578)
> @@ -998,9 +998,8 @@ load_rc_config()
>  		err 3 'USAGE: load_rc_config name'
>  	fi
>  
> -	if ${_rc_conf_loaded:-false}; then
> -		:
> -	else
> +	if [ -z "$_rc_conf_loaded" ]; then
> +		set -o allexport
>  		if [ -r /etc/defaults/rc.conf ]; then
>  			debug "Sourcing /etc/defaults/rc.conf"
>  			. /etc/defaults/rc.conf
> @@ -1010,6 +1009,7 @@ load_rc_config()
>  			. /etc/rc.conf
>  		fi
>  		_rc_conf_loaded=true
> +		set +o allexport
>  	fi
>  	if [ -f /etc/rc.conf.d/"$_name" ]; then
>  		debug "Sourcing /etc/rc.conf.d/${_name}"
As I read it, the change means that each process started by rc.d got
approximately 32kB of non-shared garbage data in its environment ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20110313/21cd4cda/attachment.pgp


More information about the svn-src-head mailing list