From owner-freebsd-rc@FreeBSD.ORG Wed Dec 20 20:20:05 2006 Return-Path: X-Original-To: freebsd-rc@FreeBSD.org Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E376016A47C for ; Wed, 20 Dec 2006 20:20:05 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.FreeBSD.org (Postfix) with SMTP id 7F25943CBD for ; Wed, 20 Dec 2006 20:19:51 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: (qmail 2851 invoked by uid 399); 20 Dec 2006 19:53:58 -0000 Received: from localhost (HELO ?192.168.0.5?) (dougb@dougbarton.us@127.0.0.1) by localhost with SMTP; 20 Dec 2006 19:53:58 -0000 X-Originating-IP: 127.0.0.1 Message-ID: <4589949F.5030409@FreeBSD.org> Date: Wed, 20 Dec 2006 11:53:03 -0800 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: "[LoN]Kamikaze" References: <200612201824.kBKIOOKS030531@freefall.freebsd.org> <458989A8.8060007@gmx.de> In-Reply-To: <458989A8.8060007@gmx.de> X-Enigmail-Version: 0.94.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@FreeBSD.org, bug-followup@FreeBSD.org Subject: Re: misc/106902: Suggest, setting nameservers in rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2006 20:20:06 -0000 [LoN]Kamikaze wrote: > Doug Barton wrote: >> Synopsis: Suggest, setting nameservers in rc.conf >> > > I don't see this as a generally useful idea, but perhaps you >> can say more about the conditions under which your resolv.conf >> changes, and why you need to rewrite it at boot time? >> >> Thanks, >> >> Doug > > While taking it around to other places I connect to different networks via wireless, so my rc.conf gets changed often by dhclient and vpnc. But at home I prefer to use cable LAN and there's no DHCP server running (it's a static network, no need for that). I can set the IP/subnet and the gateway in rc.conf, but I have to get the nameserver into the resolv.conf and there's simply not a convenient way to do this. > If I'd make it read only, I wouldn't be able to use wireless any more. And I like the idea of having the network configuration in one place (rc.conf). > Even if I want to reset it on runtime I only have to type > # rcstart resolv > (I'm using sysutils/bsdadminscripts), so for me it's a really just the most convenient way to reset the resolv.conf. > If someone else chimes in and says, "Yes, that sounds like a really useful idea that I can see XYZ applications for" then I'd be likely to say let's go ahead and add it. Meanwhile, I have a similar situation, and what I do to fix it is use an /etc/rc.local script that looks like this: #!/bin/sh PATH=/bin:/usr/bin:/sbin export PATH for ip in `ifconfig | awk '/inet / {print $2}'`; do case "${ip}" in 127.0.0.1|0.0.0.0) ;; .*) Do a bunch of stuff ;; *) Do other stuff ;; esac done exit 0 I obviously think rc.d is a great tool, but I don't think trying to shoehorn every system administration problem into it is a good idea. hth, Doug -- This .signature sanitized for your protection