dhclient for eth0 does never exit and retries dhcp foerever

Bug #1503680 reported by Simon Eisenmann
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
snapd
Incomplete
Medium
Unassigned
isc-dhcp (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When booting snappy without eth0 connected, dhclient runs forever trying to retrieve DHCP every 5 minutes.

dhclient is run with the -1 parameter which is supposed to try only once and exit after trying.

       -1 Try to get a lease once. On failure exit with code 2. In
              DHCPv6 this sets the maximum duration of the initial exchange to
              timeout (from dhclient.conf(5) with a default of sixty seconds).

Though dhclient keeps running / does not exit.

If dhclient is changed to exit after failure, it must be insured that it will be restarted when the network interface gets a physical link.

Revision history for this message
Oliver Grawert (ogra) wrote :

dhclient.conf has "timeout 300" set by default in ubuntu so theoretically according to the manpge it should exit after 5min. this looks like a bug in dhclient itself

Revision history for this message
Oliver Grawert (ogra) wrote :

simon: starting dhclient on connect should be done by ifup once the link exists and if allow-hotplug is set in /etc/network/interfaces.d/eth0 ... does this not happen if you manually kill dhclient and then connect a cable ?

Revision history for this message
Simon Eisenmann (longsleep) wrote :

Oct 08 10:00:19 odroid dhclient[587]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 15 (xid=0xe7223b64)
Oct 08 10:00:19 odroid sh[578]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 15 (xid=0xe7223b64)
Oct 08 10:00:34 odroid dhclient[587]: No DHCPOFFERS received.
Oct 08 10:00:34 odroid dhclient[587]: No working leases in persistent database - sleeping.
Oct 08 10:00:34 odroid sh[578]: No DHCPOFFERS received.
Oct 08 10:00:34 odroid sh[578]: No working leases in persistent database - sleeping.
Oct 08 10:00:35 odroid sshd[836]: Received SIGHUP; restarting.
Oct 08 10:00:35 odroid systemd[1]: Reloaded OpenBSD Secure Shell server.
Oct 08 10:00:35 odroid sh[578]: ifup: interface eth0 already configured
Oct 08 10:00:35 odroid sshd[836]: Server listening on 0.0.0.0 port 22.
Oct 08 10:00:35 odroid sshd[836]: Server listening on :: port 22.

Now i killed dhclient for eth0
No dhclient is running now
Now i plug the network cable

Oct 08 10:03:17 odroid kernel: [adjust link] -> eth: full-duplex
Oct 08 10:03:17 odroid kernel: [adjust link] -> eth: phy_speed <> priv_speed)
Oct 08 10:03:17 odroid kernel: [adjust link -> eth: am_adjust_link state change (new_state=true)
Oct 08 10:03:17 odroid kernel: libphy: 0:01 - Link is Up - 1000/Full
Oct 08 10:03:17 odroid kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

Thats it, still no dhclient is running for eth0. @Oliver : no dhclient is started if the link becomes ready

cat /etc/network/interfaces.d/eth0
allow-hotplug eth0
iface eth0 inet dhcp

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in isc-dhcp (Ubuntu):
status: New → Confirmed
Revision history for this message
Cameron Nicholson (cameron-nicholson) wrote :

I can confirm this behavior on my systems.

from syslog (identifying information removed):
Mar 23 19:10:41 HOSTNAME dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0x3e38a8c2)
Mar 23 19:10:44 HOSTNAME dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8 (xid=0x3e38a8c2)
Mar 23 19:10:52 HOSTNAME dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 20 (xid=0x3e38a8c2)
Mar 23 19:11:12 HOSTNAME dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8 (xid=0x3e38a8c2)
Mar 23 19:11:20 HOSTNAME dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 13 (xid=0x3e38a8c2)
Mar 23 19:11:33 HOSTNAME dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 9 (xid=0x3e38a8c2)
Mar 23 19:11:42 HOSTNAME dhclient: No DHCPOFFERS received.
Mar 23 19:11:42 HOSTNAME dhclient: No working leases in persistent database - sleeping.
Mar 23 19:13:12 HOSTNAME dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0x49984e3f)
Mar 23 19:13:15 HOSTNAME dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5 (xid=0x49984e3f)
Mar 23 19:13:20 HOSTNAME dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 10 (xid=0x49984e3f)
Mar 23 19:13:30 HOSTNAME dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11 (xid=0x49984e3f)
Mar 23 19:13:41 HOSTNAME dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 17 (xid=0x49984e3f)
Mar 23 19:13:58 HOSTNAME dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 10 (xid=0x49984e3f)
Mar 23 19:14:08 HOSTNAME dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5 (xid=0x49984e3f)
Mar 23 19:14:13 HOSTNAME dhclient: No DHCPOFFERS received.
Mar 23 19:14:13 HOSTNAME dhclient: No working leases in persistent database - sleeping.

This repeats forever.

dhclient was launched by a script thusly: /sbin/dhclient -1 -nw eth0_20

/etc/dhcp/dhclient.conf:
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
 domain-name, domain-name-servers, domain-search, host-name,
 dhcp6.name-servers, dhcp6.domain-search,
 netbios-name-servers, netbios-scope, interface-mtu,
 rfc3442-classless-static-routes, ntp-servers,
 dhcp6.fqdn, dhcp6.sntp-servers;
timeout 60;
retry 60;
initial-interval 3;

package isc-dhcp-client version 4.2.4-7ubuntu8

Is this fixed in the newer versions?

Michael Vogt (mvo)
Changed in snappy:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Michael Vogt (mvo) wrote :

Is this still an issue with core 16 and networkd?

Changed in snappy:
status: Triaged → Incomplete
Michael Vogt (mvo)
affects: snappy → snapd
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.