Bug#910693: systemd: systemd-networkd.service / network.target does not wait for IPv6LL to make a network device ready

michael at mi-pietsch.de michael at mi-pietsch.de
Tue Oct 9 22:33:29 BST 2018


Package: systemd
Version: 232-25+deb9u4
Severity: normal

Hi,

I have a system with network configured with systemd-networkd (static IPv4, static IPv6, DHCP=no, IPv6AcceptRA=no) and a bind9 systemd service which tries to bind to an ipv6 address while the link seems to not be fully configured (here error "could not get query source dispatcher (<2a01:some:ipv6:address:here>#0)")

I noticed that when the service starts too fast on boot there is not enough time to get the link local ipv6 address ready. Due to this a program (here bind9) fails to use a specific address assigned to the interface. At the same time binding to a port for listening on all IPv6 addresses seems to work.

The journal for a failing start looks like:
```
22:05:07 systemd[1]: Starting Network Service...
22:05:07 systemd-networkd[636]: Enumeration completed
22:05:07 systemd[1]: Started Network Service.
22:05:07 systemd-networkd[636]: ens3: IPv6 enabled for interface: Success
22:05:07 systemd-networkd[636]: ens3: Gained carrier
22:05:07 systemd[1]: Started BIND Domain Name Server.
22:05:07 named[820]: ....logs of starting bind9 service ...
22:05:07 named[820]: could not get query source dispatcher (<2a01:some:ipv6:address:here>#0)
22:05:08 systemd-networkd[636]: ens3: Gained IPv6LL
22:05:08 systemd-networkd[636]: ens3: Configured
```

If I delay the start of the bind9 service by 1-2 seconds so that it starts just after "Gained IPv6LL" was logged, it can use the ipv6 address successfully. The service should only start after the network is fully ready as it is defined to start after "network.target systemd-networkd.service network-online.target". Using the network devices .device unit as dependency doesn't work ether.

```
22:08:15 systemd[1]: Starting Network Service...
22:08:15 systemd-networkd[636]: Enumeration completed
22:08:15 systemd[1]: Started Network Service.
22:08:15 systemd-networkd[636]: ens3: IPv6 enabled for interface: Success
22:08:15 systemd-networkd[636]: ens3: Gained carrier
22:08:15 systemd-networkd[636]: ens3: Gained IPv6LL
22:08:15 systemd-networkd[636]: ens3: Configured
22:08:16 systemd[1]: Started BIND Domain Name Server.
22:08:16 named[820]: ....logs of starting bind9 service ...
```

The service file is
```
[Unit]
Description=BIND Domain Name Server
Documentation=man:named(8)
After=network.target systemd-networkd.service network-online.target
Wants=systemd-networkd.service network-online.target network.target

[Service]
EnvironmentFile=/etc/default/bind9
ExecStart=/usr/sbin/named -f $OPTIONS
ExecReload=/usr/sbin/rndc reload
ExecStop=/usr/sbin/rndc stop
#ExecStartPre=/bin/sleep 2

[Install]
WantedBy=multi-user.target
```

To reproduce the problem the bind9 server also has to be configured to use `query-source-v6` to bind use a specific IPv6

-- Package-specific info:

-- System Information:
Debian Release: 9.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-8-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages systemd depends on:
ii  adduser         3.115
ii  libacl1         2.2.52-3+b1
ii  libapparmor1    2.11.0-3+deb9u2
ii  libaudit1       1:2.6.7-2
ii  libblkid1       2.29.2-1+deb9u1
ii  libc6           2.24-11+deb9u3
ii  libcap2         1:2.25-1
ii  libcryptsetup4  2:1.7.3-4
ii  libgcrypt20     1.7.6-2+deb9u3
ii  libgpg-error0   1.26-2
ii  libidn11        1.33-1
ii  libip4tc0       1.6.0+snapshot20161117-6
ii  libkmod2        23-2
ii  liblz4-1        0.0~r131-2+b1
ii  liblzma5        5.2.2-1.2+b1
ii  libmount1       2.29.2-1+deb9u1
ii  libpam0g        1.1.8-3.6
ii  libseccomp2     2.3.1-2.1
ii  libselinux1     2.6-3+b3
ii  libsystemd0     232-25+deb9u4
ii  mount           2.29.2-1+deb9u1
ii  procps          2:3.3.12-3+deb9u1
ii  util-linux      2.29.2-1+deb9u1

Versions of packages systemd recommends:
ii  dbus            1.10.26-0+deb9u1
ii  libpam-systemd  232-25+deb9u4

Versions of packages systemd suggests:
pn  policykit-1        <none>
pn  systemd-container  <none>
pn  systemd-ui         <none>

Versions of packages systemd is related to:
pn  dracut           <none>
ii  initramfs-tools  0.130
ii  udev             232-25+deb9u4

-- Configuration Files:
/etc/systemd/journald.conf changed:
[Journal]
Storage=persistent
Compress=yes
Seal=yes

-- no debconf information



More information about the Pkg-systemd-maintainers mailing list