dhclient-exit-hooks weirdness
Brooks Davis
brooks at one-eyed-alien.net
Fri Jul 15 17:29:16 GMT 2005
On Fri, Jul 15, 2005 at 08:03:45AM -0500, Reid Linnemann wrote:
>
> I'm using dhclient-script 1.4, and the following dhclient-exit-hooks
> that worked prior to the OpenBSD dhclient import:
>
> #!/bin/sh
> PATH=/bin:/sbin:/usr/bin
> if [ x$new_host_name != x ]; then
> if [ x$new_domain_name != 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=`/usr/local/bin/resolveip -s $new_ip_address`
> hostname $hostname
> echo New Hostname: $hostname
> fi
>
> 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
--
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20050715/cf2dcdcf/attachment.bin
More information about the freebsd-current
mailing list