Bug#903288: systemd-container: container does not reboot when it is started by machinectl or systemctl

Ryutaroh Matsumoto ryutaroh.matsumoto at nagoya-u.jp
Sun Jul 8 13:44:41 BST 2018


Package: systemd-container
Version: 239-5
Severity: normal


A systemd-nspawn container does not reboot if it is started by
machinectl or systemctl on the host Linux. The key error messages are

Jul 08 21:17:17 unstable systemd[1]: Starting Container container-unstable...
Jul 08 21:17:17 unstable systemd-nspawn[943]: Failed to register
machine: Machine 'container-unstable' already exists
Jul 08 21:17:17 unstable systemd[1]:
systemd-nspawn at container-unstable.service: Main process exited,
code=exited, status=1/FAILURE
Jul 08 21:17:17 unstable systemd[1]:
systemd-nspawn at container-unstable.service: Failed with result
'exit-code'.
Jul 08 21:17:17 unstable systemd[1]: Failed to start Container
container-unstable.
Jul 08 21:17:17 unstable systemd[1]:
systemd-nspawn at container-unstable.service: Consumed 31ms CPU time,
received 0B IP traffic, sent 0B IP traffic

If I start it as
systemd-nspawn -b -M container-unstable --network-ipvlan=wls3
then "systemctl reboot" inside the container works as expected.

So, I believe that this issue is different from the archived one
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=900956


The below is transcript to reproduce the above:


root at unstable:/var/tmp# machinectl start container-unstable
root at unstable:/var/tmp# machinectl list
MACHINE            CLASS     SERVICE        OS VERSION ADDRESSES
container-desktop  container systemd-nspawn -  -       192.168.1.131
container-unstable container systemd-nspawn -  -       192.168.1.130

2 machines listed.
root at unstable:/var/tmp# ssh -l root 192.168.1.130
root at 192.168.1.130's password:
Linux container-unstable 4.17.0-1-amd64 #1 SMP Debian 4.17.3-1
(2018-07-02) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Jul  8 21:13:16 2018 from 192.168.1.129
root at container-unstable:~# systemctl reboot
Connection to 192.168.1.130 closed by remote host.
Connection to 192.168.1.130 closed.
root at unstable:/var/tmp# machinectl list
MACHINE           CLASS     SERVICE        OS VERSION ADDRESSES
container-desktop container systemd-nspawn -  -       192.168.1.131

1 machines listed.
root at unstable:/var/tmp# journalctl -n 20 -u
systemd-nspawn at container-unstable --no-pager
-- Logs begin at Sun 2018-07-08 21:06:44 JST, end at Sun 2018-07-08
21:17:17 JST. --
Jul 08 21:17:15 unstable systemd-nspawn[867]: [FAILED] Failed unmounting /tmp.
Jul 08 21:17:15 unstable systemd-nspawn[867]: [  OK  ] Unmounted
/run/systemd/nspawn/incoming.
Jul 08 21:17:15 unstable systemd-nspawn[867]: [  OK  ] Reached target
Unmount All Filesystems.
Jul 08 21:17:15 unstable systemd-nspawn[867]: [  OK  ] Stopped target
Local File Systems (Pre).
Jul 08 21:17:15 unstable systemd-nspawn[867]: [  OK  ] Stopped Remount
Root and Kernel File Systems.
Jul 08 21:17:15 unstable systemd-nspawn[867]: [  OK  ] Stopped target Swap.
Jul 08 21:17:15 unstable systemd-nspawn[867]: [  OK  ] Reached target Shutdown.
Jul 08 21:17:15 unstable systemd-nspawn[867]: [  OK  ] Reached target
Final Step.
Jul 08 21:17:15 unstable systemd-nspawn[867]:          Starting Reboot...
Jul 08 21:17:17 unstable systemd[1]:
systemd-nspawn at container-unstable.service: Consumed 1.083s CPU time,
received 13.1K IP traffic, sent 8.5K IP traffic
Jul 08 21:17:17 unstable systemd[1]:
systemd-nspawn at container-unstable.service: Service RestartSec=100ms
expired, scheduling restart.
Jul 08 21:17:17 unstable systemd[1]:
systemd-nspawn at container-unstable.service: Scheduled restart job,
restart counter is at 1.
Jul 08 21:17:17 unstable systemd[1]: Stopped Container container-unstable.
Jul 08 21:17:17 unstable systemd[1]:
systemd-nspawn at container-unstable.service: Consumed 1.083s CPU time,
received 13.1K IP traffic, sent 8.5K IP traffic
Jul 08 21:17:17 unstable systemd[1]: Starting Container container-unstable...
Jul 08 21:17:17 unstable systemd-nspawn[943]: Failed to register
machine: Machine 'container-unstable' already exists
Jul 08 21:17:17 unstable systemd[1]:
systemd-nspawn at container-unstable.service: Main process exited,
code=exited, status=1/FAILURE
Jul 08 21:17:17 unstable systemd[1]:
systemd-nspawn at container-unstable.service: Failed with result
'exit-code'.
Jul 08 21:17:17 unstable systemd[1]: Failed to start Container
container-unstable.
Jul 08 21:17:17 unstable systemd[1]:
systemd-nspawn at container-unstable.service: Consumed 31ms CPU time,
received 0B IP traffic, sent 0B IP traffic
root at unstable:/var/tmp# exit
exit

Script done on 2018-07-08 21:18:58+09:00



-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.17.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8),
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages systemd-container depends on:
ii  dbus             1.12.8-3
ii  libacl1          2.2.52-3+b1
ii  libbz2-1.0       1.0.6-8.1
ii  libc6            2.27-3
ii  libcurl3-gnutls  7.60.0-2
ii  libgcrypt20      1.8.3-1
ii  liblzma5         5.2.2-1.3
ii  libseccomp2      2.3.3-3
ii  libselinux1      2.8-1+b1
ii  systemd          239-5
ii  zlib1g           1:1.2.11.dfsg-1

Versions of packages systemd-container recommends:
ii  btrfs-progs        4.16.1-2
ii  libnss-mymachines  239-5

systemd-container suggests no packages.

-- no debconf information



More information about the Pkg-systemd-maintainers mailing list