Bug 16642 - dhcpd fails to start at boot due to trying to start too early
Summary: dhcpd fails to start at boot due to trying to start too early
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 5
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
Whiteboard: advisory MGA5-32-OK MGA5-64-OK
Keywords: validated_update
Depends on:
Reported: 2015-08-24 19:11 CEST by Giuseppe Ghibò
Modified: 2015-09-17 20:03 CEST (History)
4 users (show)

See Also:
Source RPM: dhcp-4.3.2-1.mga5.src.rpm
Status comment:


Description Giuseppe Ghibò 2015-08-24 19:11:43 CEST
Description of problem:

dhcpd fails to start at boot. It gives error:

systemd[1]: Failed to start DHCPv4 Server Daemon.

Sound because the network startup has not yet been completed or is started later.


Steps to Reproduce:
Comment 1 David Walser 2015-08-24 19:15:14 CEST
We discussed this on IRC and determined that network.target was not active on his machine for some reason.  I checked in Fedora, and they changed the After to be on network-online.target instead of network.target (and added a Wants for it):

This fixed it for Giuseppe, but I don't understand why network.target wasn't active on his system.  I guess we should change it to network-online.target, but it'd be nice to know why and what this all means.

Whatever fix we make for this can be included in the next dhcp security update.

Assigning to Colin to get some advice on this.

CC: (none) => luigiwalser
Assignee: bugsquad => mageia

Comment 2 Giuseppe Ghibò 2015-08-24 23:12:09 CEST
Here is the fix
(note that Fedora had a similar problem, see:

--- dhcpd-4.3.2-old/dhcpd6.service      2012-03-12 23:23:08.000000000 +0100
+++ dhcpd-4.3.2-new/dhcpd6.service      2015-08-24 18:40:44.000000000 +0200
@@ -1,6 +1,7 @@
 Description=DHCPv6 Server Daemon
-After=syslog.target network.target
+After=syslog.target network-online.target
 Environment=CONFIGFILE=/etc/dhcpd6.conf LEASEFILE=/var/lib/dhcp/dhcpd6.leases
diff -w -uN dhcpd-4.3.2-old/dhcpd.service dhcpd-4.3.2-new/dhcpd.service
--- dhcpd-4.3.2-old/dhcpd.service       2013-03-28 09:39:54.000000000 +0100
+++ dhcpd-4.3.2-new/dhcpd.service       2015-08-24 18:40:59.000000000 +0200
@@ -1,6 +1,7 @@
 Description=DHCPv4 Server Daemon
-After=syslog.target network.target ldap.service
+After=syslog.target network-online.target ldap.service
 Environment=CONFIGFILE=/etc/dhcpd.conf LEASEFILE=/var/lib/dhcpd/dhcpd.leases
diff -w -uN dhcpd-4.3.2-old/dhcrelay.service dhcpd-4.3.2-new/dhcrelay.service
--- dhcpd-4.3.2-old/dhcrelay.service    2011-09-05 11:03:33.000000000 +0200
+++ dhcpd-4.3.2-new/dhcrelay.service    2015-08-24 18:41:10.000000000 +0200
@@ -1,6 +1,7 @@
 Description=DHCP Relay Agent Daemon
-After=syslog.target network.target
+After=syslog.target network-online.target
Comment 3 David Walser 2015-08-25 00:09:18 CEST
OK, your patch is submitted in Cauldron and committed in Mageia 5 SVN.
Comment 4 David Walser 2015-09-12 00:17:31 CEST
For users upgrading from Mageia 4 to Mageia 5, this is a non-obvious and unpleasant surprise, so let's fix this now.


The dhcpd service in dhcp-server was not correctly waiting for the network to
be up before attempting to start, causing it to fail to start at boot time.


Updated packages in core/updates_testing:

from dhcp-4.3.2-1.1.mga5.src.rpm

CC: (none) => mageia
Assignee: mageia => qa-bugs
Summary: dhcpd fails to start at boot => dhcpd fails to start at boot due to trying to start too early

Comment 5 David Walser 2015-09-12 00:17:48 CEST
I can verify that the updated service file fixes the issue on Mageia 5 i586.

Whiteboard: (none) => MGA5-32-OK

Comment 6 William Kenney 2015-09-16 19:08:14 CEST
In VirtualBox, M5, KDE, 64-bit

Package(s) under test:
dhcp-common dhcp-client

default install of dhcp-common & dhcp-client

[root@localhost wilcal]# urpmi dhcp-common
Package dhcp-common-4.3.2-1.mga5.x86_64 is already installed
[root@localhost wilcal]# urpmi dhcp-client
Package dhcp-client-4.3.2-1.mga5.x86_64 is already installed

Connects to my network at startup

install dhcp-common & dhcp-client from updates_testing

reboot system

[root@localhost wilcal]# urpmi dhcp-common
Package dhcp-common-4.3.2-1.1.mga5.x86_64 is already installed
[root@localhost wilcal]# urpmi dhcp-client
Package dhcp-client-4.3.2-1.1.mga5.x86_64 is already installed

Connects to my network at startup

CC: (none) => wilcal.int
Whiteboard: MGA5-32-OK => MGA5-32-OK MGA5-64-OK

Comment 7 William Kenney 2015-09-16 19:09:06 CEST
This update works fine.
Testing complete for MGA5, 32-bit & 64-bit
Validating the update.
Could someone from the sysadmin team push to updates.

Keywords: (none) => validated_update
CC: (none) => sysadmin-bugs

Comment 8 claire robinson 2015-09-17 17:06:27 CEST
Advisory uploaded.

Whiteboard: MGA5-32-OK MGA5-64-OK => advisory MGA5-32-OK MGA5-64-OK

Comment 9 Mageia Robot 2015-09-17 20:03:29 CEST
An update for this issue has been pushed to Mageia Updates repository.


Resolution: (none) => FIXED

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