[Bug 1904695] Re: systemctl doesn't work when running from `docker run $image chroot` command (Bionic)
Andrei Alymau
1904695 at bugs.launchpad.net
Fri Nov 20 11:04:32 UTC 2020
I found a solution that works for me: it is needed to add option `--pid
host` option to `docker run` command.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1904695
Title:
systemctl doesn't work when running from `docker run $image chroot`
command (Bionic)
Status in systemd package in Ubuntu:
New
Bug description:
1) Tested on fresh installed system using http://old-releases.ubuntu.com/releases/bionic/ubuntu-18.04-server-amd64.iso image. The release of Ubuntu via 'lsb_release -rd'
Description: Ubuntu 18.04.4 LTS
Release: 18.04
2) The version of the systemd package via 'apt-cache policy systemd'
systemd:
Installed: 237-3ubuntu10.33
Candidate: 237-3ubuntu10.42
Version table:
237-3ubuntu10.42 500
500 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
237-3ubuntu10.38 500
500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
*** 237-3ubuntu10.33 100
100 /var/lib/dpkg/status
237-3ubuntu10 500
500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
3) Steps to reproduce the problem
$ sudo su
$ apt update
$ apt install docker.io
$ docker pull ubuntu:latest
$ docker run -it -v /:/host_root:ro ubuntu:latest chroot /host_root/ systemctl -a
4) What you expected to happen: a list of all systemd units is expected to be displayed, e.g.
UNIT LOAD ACTIVE SUB DESCRIPTION
proc-sys-fs-binfmt_misc.automount loaded active waiting Arbitrary Executable File Formats File System Auto
dev-cdrom.device loaded active plugged VBOX_CD-ROM
dev-disk-by\x2did-ata\x2dVBOX_CD\x2dROM_VB2\x2d01700376.device loaded active plugged VBOX_CD-ROM
....[cut out]....
5) What happened instead: get the following error message
Failed to connect to bus: No data available
6) The same steps tested on fresh installed Ubuntu Xenial OS using http://old-releases.ubuntu.com/releases/xenial/ubuntu-16.04.6-server-amd64.iso image.
And in this environment the `systemctl -a` command works well.
$ lsb_release -rd
Description: Ubuntu 16.04.6 LTS
Release: 16.04
$ apt-cache policy systemd
systemd:
Installed: 229-4ubuntu21.16
Candidate: 229-4ubuntu21.29
Version table:
229-4ubuntu21.29 500
500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
229-4ubuntu21.27 500
500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
*** 229-4ubuntu21.16 100
100 /var/lib/dpkg/status
229-4ubuntu4 500
500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
7) Additional notes: I tried to add `--privileged` options to `docker run` command but it didn't help.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1904695/+subscriptions
More information about the foundations-bugs
mailing list