Bug 506600

Summary: After F10 -> F11 upgrade, DHCP server won't start
Product: [Fedora] Fedora Reporter: Răzvan Sandu <rsandu2004>
Component: dhcpAssignee: David Cantrell <dcantrell>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: 11CC: dcantrell, gilboad, marius.stracna, tom, vanmeeuwen+fedora, wwoods
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 4.1.0-23.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-08-05 00:36:35 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 Răzvan Sandu 2009-06-17 21:24:45 UTC
Description of problem:

After upgrading from F10 to F11, a perfectly functional DHCP server (on F10) will refuse to start, complaining about 

"No subnet declaration for eth0 (192.168.1.226)"

eth0 is a set with a static IP address 192.168.1.226 (netmask 255.255.255.0), up and running.

The subnet declaration *does* exist in /etc/dhcpd.conf; the file actually contains:

-----------------------------------------------------------------
subnet 192.168.1.0 netmask 255.255.255.0 {
        option routers                  192.168.1.254;
        option subnet-mask              255.255.255.0;

        option domain-name              "example.com";
        option domain-name-servers       192.168.1.1;

        option time-offset              -18000;     # Eastern Standard Time

        range 192.168.1.10 192.168.1.100;
}
 
-------------------------------------------------------------------

/etc/sysconfig/dhcpd contains:

-------------------------------------------------------------------
# Command line options here
DHCPDARGS="eth0";
--------------------------------------------------------------------

and interface eth0 actually is:

--------------------------------------------------------------------
eth0      Link encap:Ethernet  HWaddr 00:23:54:63:8D:CB  
          inet addr:192.168.1.226  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::223:54ff:fe63:8dcb/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:53811 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5429 errors:0 dropped:0 overruns:0 carrier:1
          collisions:0 txqueuelen:1000 
          RX bytes:10807108 (10.3 MiB)  TX bytes:809096 (790.1 KiB)
          Interrupt:27 
--------------------------------------------------------------------

Version-Release number of selected component (if applicable):

[root@localhost ~]# rpm -qa | grep dhcp
dhcp-4.1.0-20.fc11.i586
dhcpv6-client-1.2.0-2.fc11.i586
libdhcp4client-4.0.0-35.fc10.i386   ????



How reproducible:
Always

Steps to Reproduce:
1. Install Fedora 10
2. Configure DHCP server as above
3. Test if it works - it does
4. Upgrade to Fedora 11 using standard procedure and official DVD
5. Restart DHCP server with the same configuration files

  
Actual results:
DHCP server won't start, complaining about missing subnet

Expected results:
DHCP server must start normally.

Comment 1 Răzvan Sandu 2009-06-17 22:09:56 UTC
After much investigation, I've found that the default configuration file, which was /etc/dhcpd.conf, now went into /etc/dhcp/dhcpd.conf.

That's OK, but it is bad practice to do such a change without a safe-belt mechanism - to move the old file at upgrade (via rpm) - and/or document this change in big bold letters, in the Release Notes ?

The change *is* documented in dhcpd man page, in  the FILES section, after a 3 km long text ;-) ; besides, the error message that shows up in /var/log/messages when the config file is in the old place is misleading...

Regards,
Răzvan

Comment 2 David Cantrell 2009-06-18 14:26:13 UTC
That is correct, the configuration files for both dhcpd and dhclient have moved to the /etc/dhcp subdirectory.  There are a lot of possible configuration files for dhcp and rather than pollute /etc directly, it felt time to move them in to a subdirectory.

However, on upgrade the dhcp package will create a link named /etc/dhcp/dhcpd.conf that points to /etc/dhcpd.conf if that's where you've had the configuration file.  This report is the first I've heard of such problem, but it's entirely possible there is an issue with the %post install scriptlet.  Can you describe how you upgraded?

Comment 3 Răzvan Sandu 2009-06-18 14:59:29 UTC
Thanks, David !

There is noting unusual about my upgrade.

I had a manually-created /etc/dhcpd.conf on a stock Fedora system. That's true it was freshly installed with Fedora 7 and upgraded version by version. Automatic nightly upgrades are also active.

The F10 -> F11 upgrade was done via DVD, by the book.  ;-)

After the upgrade, I noticed that the DHCP server doesn't start (this is the main function of the machine) and I started to "dig", suspecting an inter-version syntax change in dhcpd.conf.

The misleading part was the message that appeared in /var/log/messages (which I had open in another terminal while repeatedly trying to restart the dhcpd service).

The message says that there is no subnet declaration in the config file - which was actually true, apparently because I was working on /etc/dhcpd.conf and the service was reading /etc/dhcp/dhcpd.conf, which was empty (contained some comments only...)

After some time, I discovered the truth - when I've tried to move the configuration file on another physical machine, using FileZilla.


Thanks again,
Răzvan

Comment 4 Gilboa Davara 2009-06-22 15:14:10 UTC
I can confirm it.
My original F10's /etc/dhcpd.conf got deleted somehow and replaced with an empty /etc/dhcpd.conf.
On the other hand, the service was reading a second file (/etc/dhcp/dhcpd.conf) that was also empty...

Only once I created a new /etc/dhcp/dhcpd.conf file, dhcpd started working again.

- Gilboa

Comment 5 Răzvan Sandu 2009-06-22 20:01:08 UTC
IMHO, the rpm package should follow this "algorithm" - in case of upgrade:

1. check if there is a pre-existent /etc/dhcpd.conf on disk
2. if there is one, move it to /etc/dhcp/dhcpd.conf (as it is); else create an empty /etc/dhcp/dhcpd.conf (containing only comments)
3. in both cases, create /etc/dhcpd.conf as a symlink to /etc/dhcp/dhcpd.conf

Best regards,
Răzvan

Comment 6 Jeroen van Meeuwen 2009-06-23 13:03:35 UTC
This I believe is the scriptlet used for dhcp-4.1.0-20.fc11.x86_64

==
if [ -f /etc/dhcpd.conf ] && [ ! -r /etc/dhcp/dhcpd.conf ]; then
    /bin/ln -s /etc/dhcpd.conf /etc/dhcp/dhcpd.conf >/dev/null 2>&1
fi
==

This says;

If /etc/dhcpd.conf exists and I can't read /etc/dhcp/dhcpd.conf, then create that symbolic link.

So, maybe, if dhcpd does not read this symlink really well or something like that, this should say;

If /etc/dhcpd.conf exists and I can't read /etc/dhcp/dhcpd.conf, then move /etc/dhcpd.conf to /etc/dhcp/dhcpd.conf and create /etc/dhcpd.conf -> /etc/dhcp/dhcpd.conf

David, what do you think?

Comment 7 David Cantrell 2009-06-25 03:11:36 UTC
I don't really like the idea of the RPM scriptlet moving the configuration file to /etc/dhcp.  I prefer to leave it as /etc/dhcpd.conf and create a symlink as /etc/dhcp/dhcpd.conf.  Mostly because that gives users a path to downgrade to a previous package if they need to.

In cases of new installations where users create /etc/dhcpd.conf rather than /etc/dhcp/dhcpd.conf, how about the dhcpd init script failing and logging a message and/or displaying a message on the console explaining the config file should go in /etc/dhcp?

The idea with the symlink is simply to preserve the existing location of a configuration file.  I don't want to honor both /etc/dhcpd.conf and /etc/dhcp/dhcpd.conf.  In fact, when /etc/dhcp/dhcpd.conf is a symlink pointing /etc/dhcpd.conf, perhaps the init script should also log a deprecation warning telling users that /etc/dhcp/dhcpd.conf is the location of the configuration file.

The dhcpd executable looks for /etc/dhcp/dhcpd.conf now, it does not look at /etc/dhcpd.conf.

Thoughts?

Comment 8 Tom Trebisky 2009-06-29 02:00:43 UTC
Same problem here. My old dhcpd.conf got renamed to /etc/dhcpd.conf.rpmsave and a fresh new (and useless) dhcpd.conf placed into /etc/dhcp - so I was going around in circles after I put the rpmsave file back in the usual place, not realizing that the short and useless file in the new location was what was in charge.

I'm not quite sure what should be done, but moving my existing dhcpd.conf file to the new location would certainly have kept things working.  I wonder if this is documented in the FC11 release notes?

Comment 9 David Cantrell 2009-07-02 21:17:46 UTC
The %post script in the dhcp package needed some work.  I made some assumptions and also shell scripting is programmer hostile.

I've got it working now for initial installs where you already have /etc/dhcpd.conf but no dhcp package installed as well as upgrades from previous versions.  The %post script will now copy /etc/dhcpd.conf in to /etc/dhcp/dhcpd.conf.  The old one remains and if you are upgrading, rpm will rename it to dhcpd.conf.rpmsave.  But with it copied over to /etc/dhcp, the server will continue working.

I am currently building the update in to rawhide and F-11.

Sorry for all the problems with this issue and thanks, everyone, for the reports.

Comment 10 Fedora Update System 2009-07-02 21:54:18 UTC
dhcp-4.1.0-23.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/dhcp-4.1.0-23.fc11

Comment 11 Fedora Update System 2009-07-11 17:35:17 UTC
dhcp-4.1.0-23.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update dhcp'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-7546

Comment 12 Fedora Update System 2009-08-05 00:36:29 UTC
dhcp-4.1.0-23.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.