[Bug 1649931] Re: systemd-networkd needs to ensure DNS is up before network-online.target
Ryan Harper
1649931 at bugs.launchpad.net
Thu Dec 15 21:43:48 UTC 2016
On Thu, Dec 15, 2016 at 10:27 PM, Brian Murray <brian at ubuntu.com> wrote:
> How is this fixed in the development release?
>
There is an upstream resolvconf bug that addresses that package portion:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=847440
> Also the having a "Regression Potential" of low just because not a lot
> of people use the service is wrong. A bad change could still horribly
> impact the users of the software, regardless of how many users there
> are.
>
I don't disagree (that saying few folks impacted means low).
This portion was split out from the previous systemd SRU
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1636912
in which the changes were classified in the same way, so I was coping over
the assessment done by pitti and Foundations with which I agree.
I'd be happy if someone else could comment on whether they disagree with
the assessment.
IMO the risk is low:
The changes involve running resolvconf.service earlier (which sets an
inotify watch) and
does not regress anyone AFAICT.
Asking that DNS services (systemd-networkd-resolvconf-update.service) to
run before
network-online.target vs. (how it is today) running after
network-online.target is reach
also has low regression potential since _nothing_ requiring networking
should
run before systemd reaches network-online.target anyhow.
These potential users would already be broken since the units don't
currently
ensure that resolvconf (when using networkd instead of
networking.service/ifupdown)
runs to completion before reaching network-online.target.
>
> ** Changed in: resolvconf (Ubuntu)
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1649931
>
> Title:
> systemd-networkd needs to ensure DNS is up before network-
> online.target
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/resolvconf/+
> bug/1649931/+subscriptions
>
--
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1649931
Title:
systemd-networkd needs to ensure DNS is up before network-
online.target
Status in resolvconf package in Ubuntu:
Incomplete
Status in systemd package in Ubuntu:
New
Bug description:
Currently resolvconf and systemd-networkd don't ensure DNS has been
configured before allowing network-online.target to be reached.
This was discussed in https://launchpad.net/bugs/1636912 however it
was not a regression since there aren't any users of networkd + DNS
early in boot at this time, it was requested that we move this DNS
issue to a separate bug.
[SRU]
Fix: switch resolvconf.service to run Before=network-pre.target and add Wants=network-pre.target. Add a Before=network-online.target to systemd-networkd-resolvconf-update.service to ensure we update /etc/resolv.conf with DNS config prior to reaching network-online.target.
Regression potential: Low. networkd is not widely being used outside
of netplan/snappy in xenial.
Test Case:
lxc launch ubuntu-daily:xenial x1
lxc exec x1 /bin/bash
# make sure you're on systemd-229-4ubuntu13
apt update && apt install -y systemd
# enable networkd and netplan
apt install -y nplan
cat <<EOF > /etc/netplan/nplan.yaml
network:
version: 2
ethernets:
eth0:
dhcp4: true
EOF
sed -i.orig -e 's/^source/# source/' /etc/network/interfaces
netplan generate
# make sure cloud-init.service uses networkd
sed -i.orig -e '/After=networking.service/a After=systemd-network-wait-online.service' /lib/systemd/system/cloud-init.service
reboot
# check that the order of execution with:
journalctl -o short-precise --unit resolvconf.service --unit network-online.target --unit systemd-networkd-wait-online.service --unit systemd-networkd-resolvconf-update.service
# the order should be:
1. resolvconf: systemd[1]: Started Nameserver information manager.
2. systemd-networkd-wait-online.service: systemd[1]: Starting Wait for Network to be Configured...
3. systemd-networkd-resolvconf-update.service: systemd[1]: Started Update resolvconf for networkd DNS.
4. network-online.target: systemd[1]: Reached target Network is Online.
=== BAD OUTPUT ===
On a failing system, Reached target Network is Online occurs before (1, 2, or 3) above, like this output:
Dec 15 19:18:15.233443 x4 systemd[1]: Started Nameserver information manager.
Dec 15 19:18:15.797857 x4 systemd[1]: Starting Wait for Network to be Configured...
Dec 15 19:18:15.799573 x4 systemd-networkd-wait-online[145]: ignoring: lo
Dec 15 19:18:15.804949 x4 systemd-networkd-wait-online[145]: ignoring: lo
Dec 15 19:18:15.805079 x4 systemd-networkd-wait-online[145]: ignoring: lo
Dec 15 19:18:29.100305 x4 systemd[1]: Starting Update resolvconf for networkd DNS...
Dec 15 19:18:29.101870 x4 systemd[1]: Started Wait for Network to be Configured.
Dec 15 19:18:29.102144 x4 systemd[1]: Reached target Network is Online.
Dec 15 19:18:29.212842 x4 systemd[1]: Started Update resolvconf for networkd DNS.
=== GOOD OUTPUT ===
On a passing system, Reached target Network is Online occurs after 1, 2, and 3.
Dec 15 19:28:42.548545 x4 systemd[1]: Started Nameserver information manager.
Dec 15 19:28:43.144389 x4 systemd[1]: Starting Wait for Network to be Configured...
Dec 15 19:28:43.146155 x4 systemd-networkd-wait-online[145]: ignoring: lo
Dec 15 19:28:56.081487 x4 systemd[1]: Started Wait for Network to be Configured.
Dec 15 19:28:56.100353 x4 systemd[1]: Starting Update resolvconf for networkd DNS...
Dec 15 19:28:56.124005 x4 systemd[1]: Started Update resolvconf for networkd DNS.
Dec 15 19:28:56.124555 x4 systemd[1]: Reached target Network is Online.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1649931/+subscriptions
More information about the Ubuntu-sponsors
mailing list