Editing dhcpd.conf without corrupting leases

Mr. Jan Walter hopping_hol at yahoo.com
Mon Apr 13 16:28:18 UTC 2009


I think the easy answer to this one is to add some more logic, like lockfiles, to your dhcp updating scheme - as in, don't SIGHUP it when you know the file isn't complete. If you're having this problem, how do you know you're not processing two update requests simultaneously and then hopelessly corrupting the file?



----- Original Message ----
From: Sean Kelly <smkelly at rooster.creighton.edu>
To: dhcp-users at lists.isc.org
Sent: Monday, April 13, 2009 12:18:17 PM
Subject: Editing dhcpd.conf without corrupting leases

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.

Thanks.
-- 
Sean M. Kelly
Associate Director
Division of Information Technology
Creighton University
(402) 280-2264
AIM: smkellyg5
_______________________________________________
dhcp-users mailing list
dhcp-users at lists.isc.org
https://lists.isc.org/mailman/listinfo/dhcp-users



      



More information about the dhcp-users mailing list