From owner-freebsd-current@FreeBSD.ORG Wed Oct 27 21:32:43 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3802016A4CE for ; Wed, 27 Oct 2004 21:32:43 +0000 (GMT) Received: from dill.salatschuessel.net (pD95FD812.dip.t-dialin.net [217.95.216.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id AF96443D4C for ; Wed, 27 Oct 2004 21:32:41 +0000 (GMT) (envelope-from lehmann@ans-netz.de) Received: (qmail 96981 invoked by uid 89); 27 Oct 2004 21:33:09 -0000 Received: from unknown (HELO kartoffel.salatschuessel.net) (olivleh1@dill.salatschuessel.net@10.0.1.51) by dill.salatschuessel.net with SMTP; 27 Oct 2004 21:33:09 -0000 Date: Wed, 27 Oct 2004 23:33:09 +0200 From: Oliver Lehmann To: Gregory Neil Shapiro Message-Id: <20041027233309.122e4207.lehmann@ans-netz.de> In-Reply-To: <20041027210303.GZ95878@horsey.gshapiro.net> References: <20041027224512.2e3b2ae8.lehmann@ans-netz.de> <20041027204852.GY95878@horsey.gshapiro.net> <20041027230039.7a5d0150.lehmann@ans-netz.de> <20041027210303.GZ95878@horsey.gshapiro.net> X-Mailer: Sylpheed version 0.9.99 (GTK+ 1.2.10; i386-portbld-freebsd4.10) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit cc: freebsd-current@freebsd.org cc: mbr@freebsd.org Subject: Re: dhclient trashes my resolv.conf X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Wed, 27 Oct 2004 21:32:43 -0000 Gregory Neil Shapiro wrote: > > that looks more like a hack than a clear solution (and I didn't tested > > it) > > I personally disagree. IMHO, the whole reason for that function is > so users can override it (my setup prevents rewrites if the DNS servers > haven't changed). I thougt/think, it is just there to prevent redundant code (it is called twice in dhclient-script). I think sth. like that in /sbin/dhclient-script would be nice (if there is no other way to disable - oh yeah, there is chflags schg /etc/resolv.conf) . /etc/rc.subr load_rc_config dhclient make_resolv_conf() { case "$dhclient_keep_resolv_conf" in [Yy][Ee][Ss]) ;; *) if [ x"$new_domain_name_servers" != x ]; then if [ "x$new_domain_name" != x ]; then ( echo search $new_domain_name >/etc/resolv.conf ) exit_status=$? else ( rm -f /etc/resolv.conf ) exit_status=$? fi if [ $exit_status -ne 0 ]; then $LOGGER "WARNING: Unable to update resolv.conf: Error $exit_status" else for nameserver in $new_domain_name_servers; do ( echo nameserver $nameserver >>/etc/resolv.conf ) done fi fi ;; esac } And sth. like dhclient_keep_resolv_conf="NO" in defaults/rc.conf -- Oliver Lehmann http://www.pofo.de/ http://wishlist.ans-netz.de/