From owner-freebsd-bugs Wed Jun 12 23:50: 9 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 58C7F37B41E for ; Wed, 12 Jun 2002 23:50:04 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5D6o4F14394; Wed, 12 Jun 2002 23:50:04 -0700 (PDT) (envelope-from gnats) Date: Wed, 12 Jun 2002 23:50:04 -0700 (PDT) Message-Id: <200206130650.g5D6o4F14394@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Volker Stolz Subject: Re: bin/38778: dhclient infinite loop on ro /etc/resolv.conf Reply-To: Volker Stolz Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/38778; it has been noted by GNATS. From: Volker Stolz To: freebsd-gnats-submit@FreeBSD.org, cjm2@earthling.net Cc: Subject: Re: bin/38778: dhclient infinite loop on ro /etc/resolv.conf Date: Wed, 12 Jun 2002 10:24:13 +0200 This is really fun! If you set resolv.conf immutable, the dhclient-script will be *terminated* on issuing the echo ... >/etc/resolv.conf, i.e. no further instructions will be executed. The dhclient thinks the script failed (well, it did), and tries another time :-/ It's also worth noting that setting 'schg' is NOT the same as making /etc/resolv.conf ro; mounting /etc ro should be yet another case. Here's how to reproduce this w/o using dhclient: 1) Create a small shell-script test.sh: echo `date` >>foo echo "done!" 2) Create 'foo' and set immutable: touch foo chflags schg foo 3) Run test.sh and notice how the 2nd echo is never executed: bsd# sh test.sh test.sh: cannot create foo: error 1 How do I trap this event in sh? Using eval 'echo ... >>foo' doesn't work, either. Using eval 'echo ... >>foo &' works in a way, but isn't an option in dhsclient-script for worst-case scheduling... -- "Gemischte Materialien // Früher: Restmüll" Aufschrift auf einem Container, Informatik-Parkplatz To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message