From owner-freebsd-current@FreeBSD.ORG Fri Jul 15 17:29:16 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 5956A16A41C for ; Fri, 15 Jul 2005 17:29:16 +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 0A93643D49 for ; Fri, 15 Jul 2005 17:29:15 +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 j6FHTErN006118; Fri, 15 Jul 2005 10:29:14 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j6FHTEQQ006117; Fri, 15 Jul 2005 10:29:14 -0700 Date: Fri, 15 Jul 2005 10:29:14 -0700 From: Brooks Davis To: Reid Linnemann Message-ID: <20050715172914.GA337@odin.ac.hmc.edu> References: <20050715130345.80C0EA068C@csa.cs.okstate.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IS0zKkzwUGydFO0o" Content-Disposition: inline In-Reply-To: <20050715130345.80C0EA068C@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-exit-hooks weirdness 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: Fri, 15 Jul 2005 17:29:16 -0000 --IS0zKkzwUGydFO0o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 15, 2005 at 08:03:45AM -0500, Reid Linnemann wrote: >=20 > I'm using dhclient-script 1.4, and the following dhclient-exit-hooks > that worked prior to the OpenBSD dhclient import: >=20 > #!/bin/sh > PATH=3D/bin:/sbin:/usr/bin > 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`/usr/local/bin/resolveip -s $new_ip_address` > hostname $hostname > echo New Hostname: $hostname > fi >=20 > When dhclient starts on the interface (rl0) during system boot, > dhclient-exit-hooks is invoked before dhclient reports it has even > recieved a DHCPACK, and the console is cluttered with resolveip's usage > message. $new_ip_address is empty when dhclient-exit-hooks is invoked, > and the hostname of the system remains bogus. Is anyone else having > similar trouble? Is my dhclient-exit-hooks actually sane? I suspect the issue is that you need to check the $reason variable and only run this code in cases where it actually makes sense. See /sbin/dhclient-script for the list. -- 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 --IS0zKkzwUGydFO0o Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFC1/JpXY6L6fI4GtQRAhdmAJ0UPZD71M+UgT12tWgDAx050IcipACfYbIl RA/e806lls/1/iqkFMP8cnA= =8TSQ -----END PGP SIGNATURE----- --IS0zKkzwUGydFO0o--