Date: Wed, 12 Jun 2002 23:50:04 -0700 (PDT) From: Volker Stolz <stolz@i2.informatik.rwth-aachen.de> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/38778: dhclient infinite loop on ro /etc/resolv.conf Message-ID: <200206130650.g5D6o4F14394@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/38778; it has been noted by GNATS. From: Volker Stolz <stolz@i2.informatik.rwth-aachen.de> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206130650.g5D6o4F14394>