Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Mar 2002 14:46:31 +0900
From:      qhwt@myrealbox.com
To:        current@freebsd.org
Subject:   Dhclient with non-writable /etc/resolv.conf
Message-ID:  <20020323054631.GA3309.qhwt@myrealbox.com>

next in thread | raw e-mail | index | archive | help
After having updated to the world past 2002-02-19, dhclient started
very fast cycle of acquiring and releasing leases every time it was
attached to the local network, like it's attacking the DHCP server.
After all, it was /sbin/dhclient-script that failed trying to update
/etc/resolv.conf which had schg turned on (I needed this to prevent
ppp from replacing resolv.conf when my / was mounted read-write,
until I found 'resolv readonly' option in in ppp(1) manual).

The fix below also covers read-only root filesystem case.

--- /usr/src/contrib/isc-dhcp/client/scripts/freebsd	Thu Mar 21 14:49:53 2002
+++ /usr/src/contrib/isc-dhcp/client/scripts/freebsd	Thu Mar 21 15:03:53 2002
@@ -9,7 +9,8 @@
 fi
 
 make_resolv_conf() {
-  if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
+  if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ] && \
+    [ -w /etc/resolv.conf -o -w /etc -a ! -e /etc/resolv.conf ]; then
     echo search $new_domain_name >/etc/resolv.conf
     for nameserver in $new_domain_name_servers; do
       echo nameserver $nameserver >>/etc/resolv.conf

Regards.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020323054631.GA3309.qhwt>