Bug 506600 - After F10 -> F11 upgrade, DHCP server won't start
After F10 -> F11 upgrade, DHCP server won't start
Product: Fedora
Classification: Fedora
Component: dhcp (Show other bugs)
All Linux
low Severity high
: ---
: ---
Assigned To: David Cantrell
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-06-17 17:24 EDT by Răzvan Sandu
Modified: 2009-08-04 20:36 EDT (History)
6 users (show)

See Also:
Fixed In Version: 4.1.0-23.fc11
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-08-04 20:36:35 EDT
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 Răzvan Sandu 2009-06-17 17:24:45 EDT
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 ("

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

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

subnet netmask {
        option routers        ;
        option subnet-mask    ;

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

        option time-offset              -18000;     # Eastern Standard Time


/etc/sysconfig/dhcpd contains:

# Command line options here

and interface eth0 actually is:

eth0      Link encap:Ethernet  HWaddr 00:23:54:63:8D:CB  
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::223:54ff:fe63:8dcb/64 Scope:Link
          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)

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

[root@localhost ~]# rpm -qa | grep dhcp
libdhcp4client-4.0.0-35.fc10.i386   ????

How reproducible:

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 18:09:56 EDT
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...

Comment 2 David Cantrell 2009-06-18 10:26:13 EDT
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 10:59:29 EDT
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,
Comment 4 Gilboa Davara 2009-06-22 11:14:10 EDT
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 16:01:08 EDT
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,
Comment 6 Jeroen van Meeuwen 2009-06-23 09:03:35 EDT
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

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-24 23:11:36 EDT
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.

Comment 8 Tom Trebisky 2009-06-28 22:00:43 EDT
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 17:17:46 EDT
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 17:54:18 EDT
dhcp-4.1.0-23.fc11 has been submitted as an update for Fedora 11.
Comment 11 Fedora Update System 2009-07-11 13:35:17 EDT
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-04 20:36:29 EDT
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.

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