Debian GNU/Linux

Comment 1 for bug 12071

> In the event that no DHCP server is reachable, dhclient can check for leases
> stored in the dhclient.leases file, and if they are still valid, they can be
> reused. However, since ifupdown directs dhclient to use a leases file
> stored in /var/run, the file is deleted at boot, which more or less prevents
> this feature from working.
>
> I have been noticing this repeatedly, having been plagued with electrical
> problems recently, and having a DHCP server which takes just slightly longer
> to start up than my desktop. :-)
>
> The simple solution is to save the leases file in
> (for example) /var/lib/dhcp3/dhclient.<interface>.leases rather than a file
> in /var/run.

This is a duplicate of, or is related to, #246621.

There is currently not much point in keeping the leases file in /var/lib/.
The reason is that ifdown stops dhclient3 in such a way that dhclient3
relinquishes the lease, thus removing the lease from the .leases file
(I believe ... I should confirm this but I am not at my Debian machine
right now). In earlier versions of ifupdown, dhclient3 was simply killed
by ifdown. This had the advantage of preventing dhclient3 from
relinquishing the lease; however, it had the disadvantage that it also
prevented dhclient3 from doing anything else, such as running its hook
scripts. We chose to change ifupdown so that it stopped dhclient3
"cleanly" even though this meant deleting the lease info and making
another set of users unhappy. :/

In order to solve this problem, dhclient3 needs to be enhanced such
that there is some way of stopping it without it relinquishing
leases. (See #247812: "Please provide a way of stopping without
releasing".) One dhclient3 has been enhanced it will be possible to
change ifupdown to make use of the new feature.

--
Thomas Hood