From owner-freebsd-current Fri Mar 22 21:46:31 2002 Delivered-To: freebsd-current@freebsd.org Received: from smtp-send.myrealbox.com (smtp-send.myrealbox.com [192.108.102.143]) by hub.freebsd.org (Postfix) with ESMTP id 5252837B417 for ; Fri, 22 Mar 2002 21:46:28 -0800 (PST) Received: from localhost qhwt@smtp-send.myrealbox.com [211.18.232.150] by smtp-send.myrealbox.com with Novell NIMS $Revision: 2.88 $ on Novell NetWare; Fri, 22 Mar 2002 22:46:23 -0700 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.0i X-Dispatcher: imput version 20000228(IM140) Lines: 24 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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