Bug 5405 - No /var/lib/dhcp/dhcpd.leases file when dhcpd first run
Summary: No /var/lib/dhcp/dhcpd.leases file when dhcpd first run
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: dhcp
Version: 7.0
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Elliot Lee
QA Contact:
: 21265 38768 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 1999-09-27 20:11 UTC by Randy Russell
Modified: 2008-05-01 15:37 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2001-07-16 13:33:05 UTC

Attachments (Terms of Use)

Description Randy Russell 1999-09-27 20:11:08 UTC
When dhcpd first runs on a system, it exits with an error
because there is no /etc/dhcpd.leases file present.
Obviously, all it takes to fix the problem is 'touch
/etc/dhcpd.leases', but it's always nicer to have services
start without errors.

We could put a %post section in the dhcp RPM that would do a
'touch /etc/dhcpd.leases'.  For first-time runs, it would
allow dhcpd to start without the current error.  If there is
already a dhcpd.leases file, it will just have its time
stamp changed.

Comment 1 David Lawrence 1999-09-29 17:24:59 UTC
Thank you for the suggestion. It  has been forwarded to a developer
for further review.

Comment 2 Erik Troan 2000-02-23 20:59:59 UTC
We do this intentionally, as dhcpd can't run without significant configuration
being done first.

Comment 3 Milan Kerslager 2001-01-22 21:00:23 UTC
Putting configuration file in place is sufficient I think. This file shoul be 
very clean (ie. perfect subnet allocation for each interface/network). This is 
simply abusing (to push our users to do touch /var/lib/dhcp/dhcpd.leases or 
anything more than creating proper configuration file).

Comment 4 giulioo 2001-01-23 15:01:48 UTC
*** Bug 21265 has been marked as a duplicate of this bug. ***

Comment 5 Randy Russell 2001-01-24 14:54:37 UTC
It is true that one must actually configure dhcpd before it can be used, but I
would argue that the need to configure it is a sufficient safety valve:  dhcpd
won't even run if there isn't a dhcpd.conf file.  Consequently, if we were to
touch the leases file as per my earlier suggestion we would see one of two
results.  dhcpd would NOT start for people who had not done the "significant
configuration" or had done it incorrectly, which is the result we desire.  For
those who have done the configuration and done it correctly, things would work
cleanly, which is also a result we desire.  It's an admittedly trivial point,
but our current approach does open the door for someone who has configured dhcpd
correctly for the first time wondering if perhaps they have configured it

We might find it beneficial to place the sample dhcpd.conf that is in the docs
in /etc as dhcpd.conf.sample.  I don't think having an actual /etc/dhcpd.conf
would be a good thing, but having the sample in /etc might help a few people
out.  (I personally think they should be looking the docs directory as a matter
of habit, but a lot of people don't and I've had multiple people tell me they
would like to see a sample configuration in /etc.)

Comment 6 Milan Kerslager 2001-01-24 15:11:48 UTC
So please do at least one of the discussed cases. The second (with sample of 
configuration file) could be nice but don't forget to write inside something 
about need to touch the leases file.

Comment 7 Need Real Name 2001-04-25 15:40:37 UTC
This is really braindead behaviour as there is _NO_ user notification that 
configuration must take place and no sample dhcpd.conf installed.  After scping 
across my pre-prepared dhcpd.conf, the rc script still failed.  No messages 
were sent to syslog.  Only upon running it manually did I discover the leases 
file was missing.

How about a little feedback on "this won't work out of the box -- do this then 
this to make it work".  Better yet, how about the rc script actually _does_ 
something when it detects a missing lease or config file?

Comment 8 Ryan Weiss 2001-05-06 04:42:25 UTC
*** Bug 38768 has been marked as a duplicate of this bug. ***

Comment 9 Brian Rozmierski 2001-05-06 13:24:54 UTC
Another example to point out is when a fresh configuration is done with 
linuxconf. (Having usually done it manually, and only done it with linuxconf 
once...) Linuxconf seems to catch most of the obvious errors, but it doesn't go 
and touch the leases file either. It just blindly tries to start the daemon and 
exits with an error. Having the rpm touch the file seems like a trivial fix, so 
much so that I fail to see why it couldn't have been done a long time ago.

Comment 10 Elliot Lee 2001-07-16 21:38:18 UTC
Will have it as %config(noreplace) in rawhide.

Note You need to log in before you can comment on or make changes to this bug.