It seems that the issue here is networking.service does:
/sbin/ifdown -a --read-environment
but it should do:
ifdown -a --exclude=lo
As is seen in the equivalent upstart job (/etc/init/networking.conf).
$ m="ifdown -a --read-environment";
$ sed -i "s,$m, --exclude=lo," /lib/systemd/system/networking.service
$ systemctl daemon-reload
$ sudo poweroff
Demonstration below.
## http://paste.ubuntu.com/23319833/
## ipv6 networking is broken by
## ip link set down dev lo
##
## This seems to be the root cause of bug 1629972 (http://pad.lv/1629972)
## where system networking (networking.service) is brought down on
## shutdown and causes hang.
##
## Note, that it is the link that is the issue, there is actually
## no problem seen in 'ping6' by either:
## ip addr del 127.0.0.1/8 dev lo
## ip addr del ::1/128 dev lo
$ for n in y1 y2; do lxc delete --force $n; lxc launch ubuntu-daily:yakkety $n; done
error: not found
Creating y1
Starting y1
error: not found
Creating y2
Starting y2
$ for n in y1 y2; do lxc exec $n -- dhclient -6 -1 -v eth0; done
It seems that the issue here is networking.service does:
/sbin/ifdown -a --read-environment
but it should do:
ifdown -a --exclude=lo
As is seen in the equivalent upstart job (/etc/init/ networking. conf).
$ m="ifdown -a --read- environment" ; system/ networking. service
$ sed -i "s,$m, --exclude=lo," /lib/systemd/
$ systemctl daemon-reload
$ sudo poweroff
Demonstration below.
## http:// paste.ubuntu. com/23319833/ pad.lv/ 1629972) service) is brought down on
## ipv6 networking is broken by
## ip link set down dev lo
##
## This seems to be the root cause of bug 1629972 (http://
## where system networking (networking.
## shutdown and causes hang.
##
## Note, that it is the link that is the issue, there is actually
## no problem seen in 'ping6' by either:
## ip addr del 127.0.0.1/8 dev lo
## ip addr del ::1/128 dev lo
$ for n in y1 y2; do lxc delete --force $n; lxc launch ubuntu- daily:yakkety $n; done
error: not found
Creating y1
Starting y1
error: not found
Creating y2
Starting y2
$ for n in y1 y2; do lxc exec $n -- dhclient -6 -1 -v eth0; done
$ lxc list y[12] +------ ---+--- ------- ------- -----+- ------- ------- ------- ------- ------- ------- -----+- ------- ----+-- ------- --+ +------ ---+--- ------- ------- -----+- ------- ------- ------- ------- ------- ------- -----+- ------- ----+-- ------- --+ 7c43:3d62: c7fd:6ccc: 6181:8d48 (eth0) | PERSISTENT | 0 | +------ ---+--- ------- ------- -----+- ------- ------- ------- ------- ------- ------- -----+- ------- ----+-- ------- --+ 7c43:3d62: f285:69dd: 7210:c0a5 (eth0) | PERSISTENT | 0 | +------ ---+--- ------- ------- -----+- ------- ------- ------- ------- ------- ------- -----+- ------- ----+-- ------- --+
+------
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------
| y1 | RUNNING | 10.75.205.102 (eth0) | fd42:eee5:
+------
| y2 | RUNNING | 10.75.205.5 (eth0) | fd42:eee5:
+------
$ for n in y1 y2; do 7c43:3d62: :0/64 dev eth0
lxc exec $n -- ip route add fd42:eee5:
$ lxc exec y1 -- ping6 fd42:eee5: 7c43:3d62: f285:69dd: 7210:c0a5 7c43:3d62: f285:69dd: 7210:c0a5( fd42:eee5: 7c43:3d62: f285:69dd: 7210:c0a5) 56 data bytes 7c43:3d62: f285:69dd: 7210:c0a5: icmp_seq=1 ttl=64 time=0.133 ms 7c43:3d62: f285:69dd: 7210:c0a5: icmp_seq=2 ttl=64 time=0.061 ms 7c43:3d62: f285:69dd: 7210:c0a5: icmp_seq=3 ttl=64 time=0.069 ms
PING fd42:eee5:
64 bytes from fd42:eee5:
64 bytes from fd42:eee5:
64 bytes from fd42:eee5:
...
<window 2>
$ lxc exec y1 -- ip link set down dev lo
immediately ping6 starts dropping packets in window1.