From owner-freebsd-current@FreeBSD.ORG Mon Nov 5 03:19:51 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92A4716A469 for ; Mon, 5 Nov 2007 03:19:51 +0000 (UTC) (envelope-from askbill@conducive.net) Received: from conducive.net (conducive.net [203.194.153.81]) by mx1.freebsd.org (Postfix) with ESMTP id 5FC0913C4A6 for ; Mon, 5 Nov 2007 03:19:51 +0000 (UTC) (envelope-from askbill@conducive.net) Received: from cm218-253-81-177.hkcable.com.hk ([218.253.81.177]:62489 helo=pb.local) by conducive.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1IosUz-000OrW-NW for freebsd-current@freebsd.org; Mon, 05 Nov 2007 03:19:37 +0000 Message-ID: <472E8BC8.5050606@conducive.net> Date: Sun, 04 Nov 2007 22:19:36 -0500 From: =?UTF-8?B?6Z+T5a625qiZIEJpbGwgSGFja2Vy?= User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.2) Gecko/20070221 SeaMonkey/1.1.1 MIME-Version: 1.0 To: freebsd-current@freebsd.org References: <20071104224615.2EA9145010@ptavv.es.net> In-Reply-To: <20071104224615.2EA9145010@ptavv.es.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PATCH] Overriding rc.conf in loader X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2007 03:19:51 -0000 Kevin Oberman wrote: >> From: Marcin Wisnicki >> Date: Sun, 4 Nov 2007 20:50:03 +0000 (UTC) >> Sender: owner-freebsd-current@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. Clearly a need for that. This PowerBook 17" has 'many' round the world trips on it, as does the '96 vintage Kapok that preceeded it, and a 486-class Thinkpad before that. At the end of the day those toggles should be no more difficult w/o reboot on FreeBSD than they are on OS X ('nuf said..) or were even on OS/2 // eCS (swap config.sys w/o 'apparent' reboot). And most are NOT more difficult. In nay case, I don't know that the proposed patch is particularly relevant to that need. Mind - I like the concept. My pet 'hot button' the BSD box that comes up to sshd, quasi-multi, and with a usable 'fix the fat fingered comma fault' editor. And 'mined' - static compiled into /bin - is nice to have even if I *am* within arm's length. ;-) Bill