Bug 28169

Summary: 6.2->7.0 upgrade loses /var/lib/dhcp/dhcpd.leases
Product: [Retired] Red Hat Linux Reporter: rgb
Component: dhcpcdAssignee: Erik Troan <ewt>
Status: CLOSED DEFERRED QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-02-21 15:13:27 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 rgb 2001-02-17 21:30:34 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.2.18 i686)


When upgrading from 6.2 to 7.0, the upgrade of dhcpcd left me with no
/var/lib/dhcp/dhcpd.leases.  This causes /etc/rc.d/init.d/dhcpd start (or
restart) to silently fail (silently in that I saw nothing reported
in e.g. /var/log/messages).  I diagnosed the problem by set -x at the top
of the script and noted failure at the line:

[ -f /var/lib/dhcp/dhcpd.leases ] || exit 0

When I touched the file and restarted again, everything went perfectly.

Note that this is awfully hard to reproduce for me personally without
re-upgrading my server, so I'll skip the next steps.  I will say that the
server was working perfectly immediately before and (once I touched
/var/lib/dhcp/dhcpd.leases) immediately after the upgrade, so it is almost
certain that removing the old dhcpd rpm removed the lease and installing
the new one failed to touch/preserve/recreate it.

Reproducible: Didn't try
Steps to Reproduce:
1. Can only reproduce by re-upgrading system, but circumstances make it
fairly certain that it is a bug in the upgrade process.
2.
3.
	

This is a simple one to fix.  Add a "touch /var/lib/dhcp/dhcpd.leases"
to the %post of the rpm.  This is harmless -- it preserves what is there
for a functional upgrade and creates the file for a new or distribution
revision upgrade.

A second suggestion might be to put SOMETHING a bit more constructive in
/etc/rc.d/init.d/dhcpd -- perhaps something like:

[ -f /usr/sbin/dhcpd ] || echo "dhcpd not installed";exit 0
[ -f /etc/dhcpd.conf ] || echo "/etc/dhcpd.conf not installed";exit 0
[ -f /var/lib/dhcp/dhcpd.leases ] || touch /var/lib/dhcp/dhcpd.leases

since there is really no reason to punt if the leases file doesn't exist --
just create it and go.  Or at least announce what's wrong if you're going
to punt.