Editing dhcpd.conf without corrupting leases
john at iastate.edu
Tue Apr 14 14:19:26 UTC 2009
Darren <perl-list at network1.net> writes:
> A second possibility
> could be that they have enormous amounts of activity from a large
> customer base or very short lease times, so that dhcpd is almost
> constantly writing to the lease file.
Well, I'm guessing not as we kick our leases file pretty hard
(average 10, upto maybe 30, leases per second as we give leases
as short as 5 minutes).
But after looking at the lease writing code, it occurs to me that
perhaps the OP has a complicated enough config that his leases
exceed whatever the default buffer size of stdio(fprintf) is on
his platform, so he is getting a buffer flush in the middle of
the lease (before the one in commit_leases)?
> On Apr 14, 2009, at 8:03 AM, John Hascall wrote:
> >> 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.
> > John
More information about the dhcp-users