Bug 471874

Summary: dhcp initscript creates leases file in wrong location
Product: Red Hat Enterprise Linux 4 Reporter: John Robinson <john.robinson>
Component: dhcpAssignee: David Cantrell <dcantrell>
Status: CLOSED ERRATA QA Contact: Alexander Todorov <atodorov>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.7CC: atodorov
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-18 20:06:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Robinson 2008-11-17 12:32:16 UTC
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 19:49:00 UTC
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 Program Management 2008-11-17 20:00:38 UTC
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-19 00:57:04 UTC
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 22:55:54 UTC
Fix will be in dhcp-3.0.1-63.EL4

Comment 7 Alexander Todorov 2009-01-30 16:15:18 UTC
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 20:06:33 UTC
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