Re: dhclient-exit-hooks weirdness

From: Brooks Davis <brooks_at_one-eyed-alien.net>
Date: Fri, 15 Jul 2005 10:29:14 -0700
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

Received on Fri Jul 15 2005 - 15:29:16 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:38 UTC