[Bug 1588915] Re: ifup does not block for interface to be up with static addresses
vishal yadav
vyadav at advaoptical.com
Thu Oct 26 09:44:06 UTC 2017
Facing the same issue but with dhcp and on ubuntu 16.04 VM.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
Just after initial launch of VM, it's not accessible.
/run/network/ifstate files for interfaces are locked by ifup which only
gets released and dhcp probe begins when networking service is
restarted. After this VM becomes accessible.
$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto ens3
iface ens3 inet dhcp
auto ens4
iface ens4 inet dhcp
auto ens5
iface ens5 inet dhcp
After initial launch (VM not accessible)
-----------------------------------------
$ grep -nri "ifup" /var/log/syslog
20691:Oct 26 03:10:43 IansUbunturequest systemd[1]: Started ifup for ens5.
20692:Oct 26 03:10:43 IansUbunturequest systemd[1]: Started ifup for ens3.
20693:Oct 26 03:10:43 IansUbunturequest systemd[1]: Started ifup for ens4.
20990:Oct 26 03:10:43 IansUbunturequest ifup[1076]: /sbin/ifup: waiting for lock on /run/network/ifstate.ens
3
21001:Oct 26 03:10:43 IansUbunturequest ifup[1076]: /sbin/ifup: waiting for lock on /run/network/ifstate.ens
4
21002:Oct 26 03:10:43 IansUbunturequest ifup[1076]: /sbin/ifup: waiting for lock on /run/network/ifstate.ens
5
21004:Oct 26 03:10:43 IansUbunturequest systemd[1]: Started Raise network interfaces.
21005:Oct 26 03:10:43 IansUbunturequest systemd[1]: Reached target Network.
21015:Oct 26 03:10:43 IansUbunturequest systemd[1]: Reached target Network is Online.
After network restart (VM becomes accessible)
---------------------------------------------
$ less /var/log/syslog
Oct 26 03:34:34 IansUbunturequest systemd[1]: Stopping Raise network interfaces...
Oct 26 03:34:34 IansUbunturequest dhclient[2125]: Killed old client process
Oct 26 03:34:34 IansUbunturequest ifdown[2104]: Killed old client process
Oct 26 03:34:36 IansUbunturequest dhclient[2166]: DHCPRELEASE on ens3 to 10.64.247.13 port 67 (xid=0x6a1fe99f)
Oct 26 03:34:36 IansUbunturequest ifdown[2104]: DHCPRELEASE on ens3 to 10.64.247.13 port 67 (xid=0x6a1fe99f)
Oct 26 03:34:37 IansUbunturequest systemd[1]: Stopped Raise network interfaces.
Oct 26 03:34:37 IansUbunturequest systemd[1]: Starting Raise network interfaces...
Oct 26 03:34:37 IansUbunturequest ifup[2249]: DHCPDISCOVER on ens3 to 255.255.255.255 port 67 interval 3 (xid=0x9fd17b39)
Oct 26 03:34:37 IansUbunturequest dhclient[2263]: Sending on LPF/ens3/fa:16:3e:5e:13:fb
Oct 26 03:34:37 IansUbunturequest dhclient[2263]: Sending on Socket/fallback
Oct 26 03:34:37 IansUbunturequest ifup[2249]: DHCPREQUEST of 10.64.247.24 on ens3 to 255.255.255.255 port 67 (xid=0x397bd19f)
Oct 26 03:34:37 IansUbunturequest ifup[2249]: DHCPOFFER of 10.64.247.24 from 10.64.247.13
Oct 26 03:34:37 IansUbunturequest dhclient[2263]: DHCPDISCOVER on ens3 to 255.255.255.255 port 67 interval 3 (xid=0x9fd17b39)
Oct 26 03:34:37 IansUbunturequest dhclient[2263]: DHCPREQUEST of 10.64.247.24 on ens3 to 255.255.255.255 port 67 (xid=0x397bd19f)
Oct 26 03:34:37 IansUbunturequest dhclient[2263]: DHCPOFFER of 10.64.247.24 from 10.64.247.13
Oct 26 03:34:37 IansUbunturequest ifup[2249]: DHCPACK of 10.64.247.24 from 10.64.247.13
Oct 26 03:34:37 IansUbunturequest dhclient[2263]: DHCPACK of 10.64.247.24 from 10.64.247.13
Oct 26 03:34:38 IansUbunturequest dhclient[2263]: bound to 10.64.247.24 -- renewal in 4287 seconds.
Oct 26 03:34:38 IansUbunturequest ifup[2249]: bound to 10.64.247.24 -- renewal in 4287 seconds.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ifupdown in Ubuntu.
https://bugs.launchpad.net/bugs/1588915
Title:
ifup does not block for interface to be up with static addresses
Status in ifupdown package in Ubuntu:
Confirmed
Bug description:
Description: Ubuntu 16.04 LTS (server)
Release: 16.04
systemd:
Installed: 229-4ubuntu6
Candidate: 229-4ubuntu6
Version table:
*** 229-4ubuntu6 500
500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
100 /var/lib/dpkg/status
229-4ubuntu4 500
500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
This issue is more about systemd integration then an issue with
systemd package itself. The general problem is the distinction
between the network being configured and the network being up and what
that means for services that depend on the network.
upstream systemd has network.target (network is configured) and
network-online.target (network is up), however xenial server (dunno
about desktop) doesn't seem to use network-online.target. The result
of which is, as soon as the network is configured both network.target
and network-online.target are considered complete. At which point
services dependent on either of those will get started. However this
can lead to problems if the services in question are actually
dependent on the network (ie dns lookups) when they are starting up.
Here's an example of what I mean. If you install openntpd and add the
-s option there is a race on boot if it will or wont be able to do the
initial sync.
Jun 02 16:58:02 xenial64 systemd[1]: Reached target Network.
Jun 02 16:58:02 xenial64 systemd[1]: Starting OpenNTPd Network Time Protocol...
Jun 02 16:58:02 xenial64 systemd[1]: Reached target Network is Online.
Jun 02 16:58:02 xenial64 ntpd[920]: constraint certificate verification turned off
Jun 02 16:58:02 xenial64 ntpd[928]: ntp engine ready
Jun 02 16:58:02 xenial64 kernel: tg3 0000:02:00.0 enp2s0: Link is down
Jun 02 16:58:05 xenial64 kernel: tg3 0000:02:00.0 enp2s0: Link is up at 1000 Mbps, full duplex
Jun 02 16:58:05 xenial64 kernel: tg3 0000:02:00.0 enp2s0: Flow control is on for TX and on for RX
Jun 02 16:58:05 xenial64 kernel: IPv6: ADDRCONF(NETDEV_CHANGE): enp2s0: link becomes ready
Jun 02 16:58:17 xenial64 ntpd[920]: no reply received in time, skipping initial time setting
openntpd was started 3 seconds before the interface even got link.
I believe this issue is only going to effect physical servers with
static ips. vm's interfaces will instantly have link when they are
brought up and dhcp, the interface will already be up or else they
wouldn't have been able to get an ip.
thanks
jim
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1588915/+subscriptions
More information about the foundations-bugs
mailing list