Bug 471874 - dhcp initscript creates leases file in wrong location
dhcp initscript creates leases file in wrong location
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: dhcp (Show other bugs)
4.7
All Linux
medium Severity medium
: rc
: ---
Assigned To: David Cantrell
Alexander Todorov
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-17 07:32 EST by John Robinson
Modified: 2009-05-18 16:06 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-05-18 16:06:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Robinson 2008-11-17 07:32:16 EST
Description of problem:
/etc/init.d/dhcpd creates an empty leases file in /var/lib/dhcpd. dhcpd looks for it in /var/lib/dhcp and won't start.

Version-Release number of selected component (if applicable): 3.0.1-62.EL4


How reproducible:
Every time.

Steps to Reproduce:
1. Install/update to dhcp-3.0.1-62.EL4
2. Shut down dhcpd
3. Delete leases file from /var/lib/dhcp/dhcpd.leases
4. Attempt to restart dhcpd
  
Actual results:
dhcpd fails to start

Expected results:
dhcpd starts

Additional info:

It looks like the initscript has changed since an earlier version, as this used to work. In fact, the current version looks for and creates the leases file in the wrong location, then sets the selinux context for the file in the right location.
Comment 1 David Cantrell 2008-11-17 14:49:00 EST
This is a regression and easy enough to fix in the init script.

Index: dhcpd.init
===================================================================
RCS file: /cvs/dist/rpms/dhcp/RHEL-4/dhcpd.init,v
retrieving revision 1.15
diff -u -p -r1.15 dhcpd.init
--- dhcpd.init	15 Feb 2008 00:39:18 -0000	1.15
+++ dhcpd.init	17 Nov 2008 19:47:59 -0000
@@ -33,9 +33,9 @@ fi
 
 [ -f "$CF" ] || exit 0
 
-if [ ! -f /var/lib/dhcpd/dhcpd.leases ] ; then
-    mkdir -p /var/lib/dhcpd
-    touch /var/lib/dhcpd/dhcpd.leases
+if [ ! -f /var/lib/dhcp/dhcpd.leases ] ; then
+    mkdir -p /var/lib/dhcp
+    touch /var/lib/dhcp/dhcpd.leases
     [ -x /sbin/restorecon ] && [ -d /selinux ] && /sbin/restorecon /var/lib/dhcp/dhcpd.leases >/dev/null 2>&1
 fi
Comment 2 RHEL Product and Program Management 2008-11-17 15:00:38 EST
This bugzilla has Keywords: Regression.  

Since no regressions are allowed between releases, 
it is also being proposed as a blocker for this release.  

Please resolve ASAP.
Comment 3 David Cantrell 2008-11-18 19:57:04 EST
Can I get a qa-ack on this bug?  I'm not sure how the change to /var/lib/dhcpd slipped in to the RHEL-4 branch, but it shouldn't have.  All I want to do is revert the init script back to using /var/lib/dhcp.  dhcp is currently built that way on RHEL-4 and I don't want to rebuild it to start using /var/lib/dhcpd at this point either.

Thanks.
Comment 5 David Cantrell 2008-11-19 17:55:54 EST
Fix will be in dhcp-3.0.1-63.EL4
Comment 7 Alexander Todorov 2009-01-30 11:15:18 EST
VERIFIED that dhcp-3.0.1-64.EL4 will create empty leases file under /var/lib/dhcp/dhcpd.leases
Comment 9 errata-xmlrpc 2009-05-18 16:06:33 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0956.html

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