Editing dhcpd.conf without corrupting leases

Sean Kelly smkelly at rooster.creighton.edu
Mon Apr 13 16:18:17 UTC 2009

Good morning.

We have a web application here that allows users to register their IPs and
a process comes along and updates /etc/dhcpd.conf every minute or so and
restarts dhcpd as needed. However, ew're starting to see issues where our
dhcpd.leases file is truncated and dhcpd refuses to start back up.

My working theory is that the SIGTERM from `/etc/init.d/dhcpd restart` is
happening in the middle of a lease file append, thus causing it to become a
corrupt leasefile and then making dhcpd fail on restart. That is the
easiest explanation I've been able to come up with.

What are people doing to prevent this sort of thing when automatically
restarting dhcpd? There doesn't appear to be any locking of dhcpd.leases,
so I can't have my restart process wait for an exclusive write lock to know
the file is in a consistent state. I'm also not sure whether OMAPI is the
right solution, or even supportd/maintained anymore. There is no SIGHUP to
do a config file reload.

How can I reload dhcpd.conf without accidentally corrupting dhcpd.leases
due to a restart? This is starting to be a bigger problem here.

Sean M. Kelly
Associate Director
Division of Information Technology
Creighton University
(402) 280-2264
AIM: smkellyg5

More information about the dhcp-users mailing list