Bug#843497: systemd-networkd block the shutdown process of my nspawn container

Zhang Jingqiang zh_jq at outlook.com
Mon Nov 7 05:05:44 GMT 2016


Package: systemd
Version: 232-2
Severity: normal

Hello,
I have a nspawn container, which has one bridged interface and one veth local only interface,
which is called as "host0" and "ho" in the container.
The command to start the container by the service file is

 #/usr/bin/systemd-nspawn --quiet --keep-unit --boot --link-journal=try-guest --network-veth -U --settings=override --machine=pstat-ci

The config file pstat-ci.nspawn is
  [Exec]
  Boot=on
  User=root
  PrivateUsers=off

  [Network]
  Bridge=br0
  VirtualEthernetExtra=nspawn:ho

I add systemd-networkd config files in the container as follow:
 /etc/systemd/network/80-dhcp.network:
  [Match]
  Name=host*

  [Network]
  DHCP=ipv4

 /etc/systemd/network/80-static.network:
  [Match]
  Name=ho

  [Network]
  Address=192.168.2.2/24

  [Route]
  Gateway=192.168.2.1
  Scope=link

When I stop the coresponding nspawn service, timeout happened, with log in the container like this:
  Nov 07 12:26:32 pstat-ci systemd[1]: systemd-networkd.service: Service has no hold-off time, scheduling restart.
  Nov 07 12:26:32 pstat-ci systemd[1]: systemd-networkd.service: Failed with result 'exit-code'.
  Nov 07 12:26:32 pstat-ci systemd[1]: systemd-networkd.service: Unit entered failed state.
  Nov 07 12:26:32 pstat-ci systemd[1]: Failed to start Network Service.
  Nov 07 12:26:32 pstat-ci systemd[1]: systemd-networkd.service: Main process exited, code=exited, status=1/FAILURE
  Nov 07 12:26:32 pstat-ci systemd[1]: Stopped target Local File Systems (Pre).
  Nov 07 12:26:32 pstat-ci systemd[1]: Reached target Final Step.
  Nov 07 12:26:32 pstat-ci systemd[1]: Reached target Unmount All Filesystems.
  Nov 07 12:26:32 pstat-ci systemd-networkd[130]: Could not connect to bus: Connection refused

And the service stop action takes about 90s to finish.

After I disabled systemd-networkd, and use interfaces(5) to config network, the service stop action finish
in time, no more that 30s.

dbus is installed in the container.

Thanks

-- Package-specific info:

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'work'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.8.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=zh_CN.UTF-8, LC_CTYPE=zh_CN.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
ii  libapparmor1    2.10.95-5
ii  libaudit1       1:2.6.7-1
ii  libblkid1       2.28.2-1
ii  libc6           2.24-5
ii  libcap2         1:2.25-1
ii  libcryptsetup4  2:1.7.3-1
ii  libgcrypt20     1.7.3-2
ii  libgpg-error0   1.24-1
ii  libidn11        1.33-1
ii  libip4tc0       1.6.0-4
ii  libkmod2        23-1
ii  liblzma5        5.2.2-1.2
ii  libmount1       2.28.2-1
ii  libpam0g        1.1.8-3.3
ii  libseccomp2     2.3.1-2
ii  libselinux1     2.6-2
ii  libsystemd0     232-2
ii  mount           2.28.2-1
ii  util-linux      2.28.2-1

Versions of packages systemd recommends:
ii  dbus            1.10.12-1
ii  libpam-systemd  232-2

Versions of packages systemd suggests:
ii  policykit-1        0.105-17
ii  systemd-container  232-2
pn  systemd-ui         <none>

Versions of packages systemd is related to:
pn  dracut           <none>
ii  initramfs-tools  0.125
ii  udev             232-2

-- Configuration Files:
/etc/systemd/timesyncd.conf changed [not included]

-- no debconf information



More information about the Pkg-systemd-maintainers mailing list