Comment 9 for bug 105251

Revision history for this message
Marius Gedminas (mgedmin) wrote :

Adding

  exec >> /tmp/dhcp.debug 2>&1
  set -x

to the end of /etc/dhcp3/dhclient-exit-hooks.d/debug showed that the culprit on one system was a whereami script that did 'exit 1' prematurely, stopping /etc/dhcp3/dhclient-exit-hooks.d/zzzz_dhcdbd from being run. Here's the relevant line of code:

  test ! -e /usr/sbin/whereami && exit 1

'exit 1' is a bad idea when your script is being sourced rather than executed.

dpkg --purge whereami fixed the problem on this system. A proper fix would be to make the whereami hook not call 'exit'.

Obviously this happens only when you've had whereami installed and then removed without purging its configuration files.

It might be a good idea to check other packages supplying dhclient hooks for similar problems.