dhclient running exit-scripts when told to deregister only

tpo2 at sourcepole.ch tpo2 at sourcepole.ch
Thu Nov 23 12:10:05 UTC 2006


Debian's bugreports [1] and [2] are due to the fact that the ifup/down tool
tries to "cleanly" shut down the machines interfaces. This means according to
ifdown's idea of the world that it expects the dhclient-script to be run so that
its customized "HOOK" scripts can be run.

The DESCRIPTION paragraph in dhclient-scripts' manpage is rather unspecific
about when the dhclient-script will be run by dhclient:

> The DHCP client network configuration script is invoked from time to time by
> dhclient(8).  This script is used by the dhcp client to set each interface's
> initial configuration prior to requesting an address, to test the address once
> it has  been  offered,  and  to  set the interface's final configuration once
> a lease has been acquired.

Later on in the manpage the circumstances under which the dhclient-script will
be called are extended - notably various shutdown scenarios are now also
included:

> In all cases, $reason is set to the name of the reason why the script has
> been  invoked. The following reasons are currently defined: MEDIUM, PREINIT,
> BOUND, RENEW, REBIND, REBOOT, EXPIRE, FAIL, STOP, RELEASE, NBI and TIMEOUT.

Of interest to ifup/down are the STOP and RELEASE $reasons. RELEASE can be
triggered by calling dhclilent with the '-r' command line switch. Explicitly
releasing a leased IP address at reboot is sometimes not wanted though, f.ex. in
DDNS situations, where the DHCP client doesn't want to loose it's current
IP-DNS Name association.

Thus the only other option to run dhclient-script's HOOK scripts seems to be to
somehow trigger the STOP $reason.

Unfortunately the only known way (at least in the discussions under [1] and [2])
to do this seems to be a rather hackish approach through omshell.

Notably sending SIGTERM to dhclient will not trigger it to run dhclient-script
nor is there some analogon to the '-r' comand line switch to do a shutdown
withouth a ip lease release.

Is this situation as is intended or is it a to-be-done/unfortunate outcome of
history?

Since the $reasons stated above does not seem to include situations, where
dhclient is killed by SIGTERM in a system shutdown or similar I'd like to
suggest that dhclient add's a command line switch to actually do a "graceful
shutdown", without releasing the lease. [3] contains a patch against dhcp 3.0.1
to add such a switch.

Would it be possible to include it in the current development release?

*t

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=246621
[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=247812
[3] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=295064

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


More information about the dhcp-users mailing list