dhclient chokes on dhclient-exit-hooks

From: Reid Linnemann <lreid_at_cs.okstate.edu>
Date: Mon, 17 Oct 2005 21:38:25 -0500 (CDT)
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.

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.

Currently, on the console, only one line of output comes from the script:
`reason is PREINIT and ip is `

The last output from dhclient is:
`DHCPACK from <ip>`

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.

If I remove dhclient-exit-hooks, the lease is acquired and the interface
is brought up normally.

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.

Ideas? Suggestions?

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.


-Reid

dhclient-exit-hooks
--------------------------------------------
#!/bin/sh
PATH=/bin:/sbin:/usr/bin
AWK=/usr/bin/awk
HOST=/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 != 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=`$HOST $new_ip_address | $AWK '{print $5}'`
  hostname $hostname
  echo New Hostname: $hostname
 fi
;;
esac
exit $1
Received on Tue Oct 18 2005 - 00:38:26 UTC

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