Bug 28169 - 6.2->7.0 upgrade loses /var/lib/dhcp/dhcpd.leases
6.2->7.0 upgrade loses /var/lib/dhcp/dhcpd.leases
Product: Red Hat Linux
Classification: Retired
Component: dhcpcd (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Erik Troan
Depends On:
  Show dependency treegraph
Reported: 2001-02-17 16:30 EST by rgb
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-02-21 10:13:27 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description rgb 2001-02-17 16:30:34 EST
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.

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.

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