From owner-freebsd-current@FreeBSD.ORG Tue Oct 18 04:33:21 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org 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 447E916A41F for ; Tue, 18 Oct 2005 04:33:21 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id E263C43D46 for ; Tue, 18 Oct 2005 04:33:20 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id j9I4XJfM010507; Mon, 17 Oct 2005 21:33:19 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j9I4XJHi010506; Mon, 17 Oct 2005 21:33:19 -0700 Date: Mon, 17 Oct 2005 21:33:19 -0700 From: Brooks Davis To: Reid Linnemann Message-ID: <20051018043319.GA9748@odin.ac.hmc.edu> References: <20051018023825.7806EA0633@csa.cs.okstate.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AhhlLboLdkugWU4S" Content-Disposition: inline In-Reply-To: <20051018023825.7806EA0633@csa.cs.okstate.edu> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu Cc: freebsd-current@freebsd.org Subject: Re: dhclient chokes on dhclient-exit-hooks X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 18 Oct 2005 04:33:21 -0000 --AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 17, 2005 at 09:38:25PM -0500, Reid Linnemann wrote: >=20 > Running current as of 10/14, the dhclient-exit-hooks at the end of this > message causes dhclient to hang for a few seconds and terminate without > configuring its interface. >=20 > One interface, rl0, is configured with dhclient. In recent > history(current as of <3 weeks ago), the script would initialize the > interface, and after dhclient acquired an address would reverse lookup > the lease address and set the hostname to the result. >=20 > Currently, on the console, only one line of output comes from the script: > `reason is PREINIT and ip is ` >=20 > The last output from dhclient is: > `DHCPACK from ` >=20 > At this point, whatever is executing (dhclient? dhclient-exit-hooks?) > hangs for a second, and then the boot continues - no 'bound to w.x.y.z` > message is displayed, and the interface is not assigned an address. >=20 > If I remove dhclient-exit-hooks, the lease is acquired and the interface > is brought up normally. >=20 > My first intuition is - maybe the script is trying to to a host resolve > before the interface address and routes are added - but that doesn't > seem possible since dhclient-exit-hoks is only invoked by > dhclient-script after the configuration is completed - and the code n > dhclient-exit-hooks only executes on a condition that is guaranteed to > have set up the interface, added a route, and updated resolv.conf. Since > I see no output from the script as it is run when the interface comes > up, I can't be sure if that block of code is ever executed. >=20 > Ideas? Suggestions? >=20 > For context, the hooks are necessary to set the machine's hostname to a > valid string for the ip - my isp (cox cable) does not do ddns with a > sent host-name, nor does its dhcp server provide a host-name or fqdn on > request. >=20 >=20 > -Reid >=20 > dhclient-exit-hooks > -------------------------------------------- > #!/bin/sh > PATH=3D/bin:/sbin:/usr/bin > AWK=3D/usr/bin/awk > HOST=3D/usr/bin/host > echo "reason is $reason and ip is $new_ip_address" > case $reason in > BOUND|RENEW|REBIND|REBOOT) > if [ x$new_host_name !=3D x ]; then > if [ x$new_domain_name !=3D x ]; then > hostname $new_host_name.$new_domain_name > echo New Hostname: $new_host_name.$new_domain_name > else > hostname $new_host_name > echo New Hostname: $new_host_name > fi > else > hostname=3D`$HOST $new_ip_address | $AWK '{print $5}'` > hostname $hostname > echo New Hostname: $hostname > fi > ;; > esac > exit $1 Why on earth are you exiting with $1 as the status? This is almost certainly the problem. You should not exit from dhclient-exit-hooks at all since it occurs in the context of dhclient-script and this exit values is entirely bogus. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --AhhlLboLdkugWU4S Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFDVHsOXY6L6fI4GtQRAibtAKC7hRC7YbejKs+LtRyOLba4Nw8gyACgj+PF mDi1UWaJhvJhychlRSrhYRk= =Xgqt -----END PGP SIGNATURE----- --AhhlLboLdkugWU4S--