[PATCH] Overriding rc.conf in loader

Kevin Oberman oberman at es.net
Sun Nov 4 14:46:18 PST 2007


> From: Marcin Wisnicki <mwisnicki+freebsd at gmail.com>
> Date: Sun, 4 Nov 2007 20:50:03 +0000 (UTC)
> Sender: owner-freebsd-current at freebsd.org
> 
> On Sun, 04 Nov 2007 12:40:45 -0500, 韓家標 Bill Hacker wrote:
> 
> > Marcin Wisnicki wrote:
> >> Hi
> >> 
> >> I thought it would be nice if there was a way to override rc.conf
> >> variables during boot. Proposed patch implements this using kenv.
> >> 
> >> With it, you can override any rc variable from loader.conf by prefixing
> >> its name with 'rc.', some useful examples:
> >> 
> > Pardon my stupidity... but does this over-ride over rides with other
> > over rides...
> > 
> > or what?
> 
> Pretty much, yes. Assuming I didn't overlook something, the order of
> assignment is following:
> 
> 1. suck in /etc/defaults/rc.conf
> 2. try to set $rc_conf_files from kenv rc.rc_conf_files [*]
>    otherwise leave it as defined in defaults
> 3. source $rc_conf_files
> 4. source /etc/rc.conf.d/$name_of_script
> 5. for each kenv variable named rc.$var set $var [*]
> 
> lines marked by [*] are added by my patch
> 
> > 
> > ..and if so, ISTR there may be a better way already...
> > 
> 
> Not that I know of.

While I'm sure many will question the value of this if they use FreeBSD
only on servers, I think it is of some value for desktops and
substantial value for laptops where the environment is always changing.

For example, I might want to change network configuration or shutdown
the Bluetooth and WiFi when flying.
-- 
R. Kevin Oberman, Network Engineer
Energy Sciences Network (ESnet)
Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab)
E-mail: oberman at es.net			Phone: +1 510 486-8634
Key fingerprint:059B 2DDF 031C 9BA3 14A4  EADA 927D EBB3 987B 3751
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 224 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20071104/3c04f8b7/attachment.pgp


More information about the freebsd-current mailing list