Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jul 2005 10:29:14 -0700
From:      Brooks Davis <brooks@one-eyed-alien.net>
To:        Reid Linnemann <lreid@a.cs.okstate.edu>
Cc:        freebsd-current@freebsd.org
Subject:   Re: dhclient-exit-hooks weirdness
Message-ID:  <20050715172914.GA337@odin.ac.hmc.edu>
In-Reply-To: <20050715130345.80C0EA068C@csa.cs.okstate.edu>
References:  <20050715130345.80C0EA068C@csa.cs.okstate.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050715172914.GA337>