Fresh install of an artful-server image in a VM, and I can't reproduce this problem. For some reason, on your system networkd never logs that the network interface has been 'configured'. So in fact, systemd-networkd-wait-online is behaving correctly; you're somehow just never getting the OK from systemd-networkd.
ubuntu@artful-server:~$ time sudo /lib/systemd/systemd-networkd-wait-online
ignoring: lo
real 0m0.018s
user 0m0.012s
sys 0m0.000s
ubuntu@artful-server:~$ echo $?
0
ubuntu@artful-server:~$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:68:21:e2 brd ff:ff:ff:ff:ff:ff
ubuntu@artful-server:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 52:54:00:68:21:e2 brd ff:ff:ff:ff:ff:ff
inet 192.168.15.68/24 brd 192.168.15.255 scope global dynamic ens3
valid_lft 3269sec preferred_lft 3269sec
inet6 2001:470:e980:0:5054:ff:fe68:21e2/64 scope global mngtmpaddr noprefixroute dynamic
valid_lft 86295sec preferred_lft 14295sec
inet6 fe80::5054:ff:fe68:21e2/64 scope link
valid_lft forever preferred_lft forever
ubuntu@artful-server:~$ cat /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: yes
dhcp6: yes
ubuntu@artful-server:~$ cat /run/systemd/network/10-netplan-ens3.network
[Match]
Name=ens3
[Network]
DHCP=yes
[DHCP]
RouteMetric=100
ubuntu@artful-server:~$ dpkg -l systemd|grep ^ii
ii systemd 233-6ubuntu3 amd64 system and service manager
ubuntu@artful-server:~$
And, perhaps most crucially:
ubuntu@artful-server:~$ sudo journalctl -u systemd-networkd --no-pager
-- Logs begin at Wed 2017-06-14 09:20:15 PDT, end at Wed 2017-06-14 09:27:38 PDT. --
Jun 14 09:20:17 artful-server systemd[1]: Starting Network Service...
Jun 14 09:20:17 artful-server systemd-networkd[451]: Enumeration completed
Jun 14 09:20:17 artful-server systemd[1]: Started Network Service.
Jun 14 09:20:17 artful-server systemd-networkd[451]: ens3: IPv6 successfully enabled
Jun 14 09:20:17 artful-server systemd-networkd[451]: ens3: Gained carrier
Jun 14 09:20:18 artful-server systemd-networkd[451]: ens3: DHCPv4 address 192.168.15.68/24 via 192.168.15.1
Jun 14 09:20:18 artful-server systemd-networkd[451]: ens3: Gained IPv6LL
Jun 14 09:20:20 artful-server systemd-networkd[451]: ens3: Configured
ubuntu@artful-server:~$
Fresh install of an artful-server image in a VM, and I can't reproduce this problem. For some reason, on your system networkd never logs that the network interface has been 'configured'. So in fact, systemd- networkd- wait-online is behaving correctly; you're somehow just never getting the OK from systemd-networkd.
ubuntu@ artful- server: ~$ time sudo /lib/systemd/ systemd- networkd- wait-online
ignoring: lo
real 0m0.018s artful- server: ~$ echo $? artful- server: ~$ ip link UP,LOWER_ UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 MULTICAST, UP,LOWER_ UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 artful- server: ~$ ip addr UP,LOWER_ UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 MULTICAST, UP,LOWER_ UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 e980:0: 5054:ff: fe68:21e2/ 64 scope global mngtmpaddr noprefixroute dynamic ff:fe68: 21e2/64 scope link artful- server: ~$ cat /etc/netplan/ 01-netcfg. yaml artful- server: ~$ cat /run/systemd/ network/ 10-netplan- ens3.network
user 0m0.012s
sys 0m0.000s
ubuntu@
0
ubuntu@
1: lo: <LOOPBACK,
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens3: <BROADCAST,
link/ether 52:54:00:68:21:e2 brd ff:ff:ff:ff:ff:ff
ubuntu@
1: lo: <LOOPBACK,
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,
link/ether 52:54:00:68:21:e2 brd ff:ff:ff:ff:ff:ff
inet 192.168.15.68/24 brd 192.168.15.255 scope global dynamic ens3
valid_lft 3269sec preferred_lft 3269sec
inet6 2001:470:
valid_lft 86295sec preferred_lft 14295sec
inet6 fe80::5054:
valid_lft forever preferred_lft forever
ubuntu@
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: yes
dhcp6: yes
ubuntu@
[Match]
Name=ens3
[Network]
DHCP=yes
[DHCP] artful- server: ~$ dpkg -l systemd|grep ^ii artful- server: ~$
RouteMetric=100
ubuntu@
ii systemd 233-6ubuntu3 amd64 system and service manager
ubuntu@
And, perhaps most crucially:
ubuntu@ artful- server: ~$ sudo journalctl -u systemd-networkd --no-pager networkd[ 451]: Enumeration completed networkd[ 451]: ens3: IPv6 successfully enabled networkd[ 451]: ens3: Gained carrier networkd[ 451]: ens3: DHCPv4 address 192.168.15.68/24 via 192.168.15.1 networkd[ 451]: ens3: Gained IPv6LL networkd[ 451]: ens3: Configured artful- server: ~$
-- Logs begin at Wed 2017-06-14 09:20:15 PDT, end at Wed 2017-06-14 09:27:38 PDT. --
Jun 14 09:20:17 artful-server systemd[1]: Starting Network Service...
Jun 14 09:20:17 artful-server systemd-
Jun 14 09:20:17 artful-server systemd[1]: Started Network Service.
Jun 14 09:20:17 artful-server systemd-
Jun 14 09:20:17 artful-server systemd-
Jun 14 09:20:18 artful-server systemd-
Jun 14 09:20:18 artful-server systemd-
Jun 14 09:20:20 artful-server systemd-
ubuntu@