Date: Wed, 20 Dec 2006 11:53:03 -0800 From: Doug Barton <dougb@FreeBSD.org> To: "[LoN]Kamikaze" <LoN_Kamikaze@gmx.de> Cc: freebsd-rc@FreeBSD.org, bug-followup@FreeBSD.org Subject: Re: misc/106902: Suggest, setting nameservers in rc.conf Message-ID: <4589949F.5030409@FreeBSD.org> In-Reply-To: <458989A8.8060007@gmx.de> References: <200612201824.kBKIOOKS030531@freefall.freebsd.org> <458989A8.8060007@gmx.de>
next in thread | previous in thread | raw e-mail | index | archive | help
[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) ;; <my home network>.*) 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4589949F.5030409>