Editing dhcpd.conf without corrupting leases

John Wobus jw354 at cornell.edu
Fri Apr 17 16:09:48 UTC 2009

>> when you get to this sort of large numbers of static hosts
>> and modification numbers then the best way is to move all
>> of it to a DB back end. generate a dhcpd.conf.new from
>> the DB entries, then do a sanity check (hopefully the
>> code producing the config file from the DB will stop
>> weird and broken entries anyway!)
> While I agree with this, I'm not sure it solves the OP's
> problem which is a corrupt leases file, not a corrupt
> config file.
> I'm still wondering how the OP is (multiple times) seeing a
> corrupt leases file on restart, because I just checked my logs
> and we've done over a million dhcp restarts since we started
> with 'NetReg' and have yet to see this.  Either there must be
> some fundamental difference in our installations or they are
> doing jillions of restarts and/or are the unluckiest bastards
> on the planet.

I am equally mystified.  We do virtually the same thing: use
SIGTERM to stop the dhcp daemon when we need to start it
with a modified config.  We perform this with a cron task that
skips the restart if the config has not changed.  In years of
operation (many thousands of restarts), we've never had a
problem with a daemon not starting.  I had always assumed
that the daemon knew how to work around the issue of
a partial entry at the end of the lease file.

In our case, we have a short maximum lease
time period and we avoid putting any permanent
data in the lease file.  This gives us the insurance
that if we were ever forced to start the lease file fresh
on both servers, that any resulting chaos would
disappear soon.

John W.

More information about the dhcp-users mailing list