[Bug 1590838] [NEW] shutdown -r +<number> does not work without dbus in xenial LXC container

Launchpad Bug Tracker 1590838 at bugs.launchpad.net
Thu Jun 9 15:55:35 UTC 2016


You have been subscribed to a public bug:

The command "shutdown -r +5" doesn't work in a xenial lxc container. I
found this out by trying to use Landscape to restart a xenial lxc
container and the operation failed. I was told by the Landscape team
that the restart button simply does a "shutdown -r +5".

The problem seems to be that the dbus package is missing in the xenial
lxc image.

This is what happens:

root at xenialtest:/# shutdown -r +5
Failed to connect to bus: No such file or directory
Failed to connect to bus: No such file or directory

And if I install dbus:

root at xenialtest:/# shutdown -r +5
Shutdown scheduled for Wed 2016-06-08 19:28:44 UTC, use 'shutdown -c' to cancel.

The issue happens whether I use the download template or the ubuntu
template when creating the LXC container:

root at davecorelaptop:/var/cache/lxc# lxc-create -t ubuntu -n test2
root at davecorelaptop:/var/cache/lxc# lxc-start -d -n test2
root at davecorelaptop:/var/cache/lxc# lxc-attach -n test2

root at test2:/# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04 LTS
Release:	16.04
Codename:	xenial

root at test2:/# shutdown -r +5
Failed to connect to bus: No such file or directory
Failed to connect to bus: No such file or directory


or


root at davecorelaptop:~# lxc-create -t download -n test
Setting up the GPG keyring
Downloading the image index

---
DIST	RELEASE	ARCH	VARIANT	BUILD
---
alpine	3.0	amd64	default	20160608_18:03
alpine	3.0	i386	default	20160608_17:50
alpine	3.1	amd64	default	20160608_17:50
alpine	3.1	i386	default	20160608_18:03
alpine	3.2	amd64	default	20160608_17:50
alpine	3.2	i386	default	20160608_17:50
alpine	3.3	amd64	default	20160608_17:50
alpine	3.3	i386	default	20160608_17:50
alpine	edge	amd64	default	20160608_17:50
alpine	edge	i386	default	20160608_17:50
centos	6	amd64	default	20160609_02:16
centos	6	i386	default	20160609_02:16
centos	7	amd64	default	20160609_02:16
debian	jessie	amd64	default	20160608_22:42
debian	jessie	arm64	default	20160609_02:38
debian	jessie	armel	default	20160608_22:42
debian	jessie	armhf	default	20160608_22:42
debian	jessie	i386	default	20160608_22:42
debian	jessie	powerpc	default	20160608_22:42
debian	jessie	ppc64el	default	20160608_22:42
debian	jessie	s390x	default	20160608_22:42
debian	sid	amd64	default	20160608_22:42
debian	sid	arm64	default	20160608_22:42
debian	sid	armel	default	20160608_22:42
debian	sid	armhf	default	20160608_22:42
debian	sid	i386	default	20160608_22:42
debian	sid	powerpc	default	20160608_22:42
debian	sid	ppc64el	default	20160608_22:42
debian	sid	s390x	default	20160608_22:42
debian	stretch	amd64	default	20160608_22:42
debian	stretch	arm64	default	20160608_22:42
debian	stretch	armel	default	20160608_22:42
debian	stretch	armhf	default	20160608_22:42
debian	stretch	i386	default	20160608_22:42
debian	stretch	powerpc	default	20160608_22:42
debian	stretch	ppc64el	default	20160608_22:42
debian	stretch	s390x	default	20160608_22:42
debian	wheezy	amd64	default	20160608_22:42
debian	wheezy	armel	default	20160608_22:42
debian	wheezy	armhf	default	20160608_22:42
debian	wheezy	i386	default	20160608_22:42
debian	wheezy	powerpc	default	20160609_02:38
debian	wheezy	s390x	default	20160608_22:42
fedora	22	amd64	default	20160609_01:27
fedora	22	armhf	default	20160112_01:27
fedora	22	i386	default	20160609_01:27
fedora	23	amd64	default	20160609_01:27
fedora	23	i386	default	20160609_01:27
gentoo	current	amd64	default	20160608_14:12
gentoo	current	i386	default	20160608_14:12
opensuse	13.2	amd64	default	20160609_00:53
oracle	6	amd64	default	20160609_11:40
oracle	6	i386	default	20160609_11:40
oracle	7	amd64	default	20160609_11:40
plamo	5.x	amd64	default	20160608_21:36
plamo	5.x	i386	default	20160608_21:36
plamo	6.x	amd64	default	20160608_21:36
plamo	6.x	i386	default	20160608_21:36
ubuntu	precise	amd64	default	20160609_03:49
ubuntu	precise	armel	default	20160609_03:49
ubuntu	precise	armhf	default	20160609_03:49
ubuntu	precise	i386	default	20160609_03:49
ubuntu	precise	powerpc	default	20160609_03:49
ubuntu	trusty	amd64	default	20160609_03:49
ubuntu	trusty	arm64	default	20160609_03:49
ubuntu	trusty	armhf	default	20160609_03:49
ubuntu	trusty	i386	default	20160609_03:49
ubuntu	trusty	powerpc	default	20160609_03:49
ubuntu	trusty	ppc64el	default	20160609_03:49
ubuntu	wily	amd64	default	20160609_03:49
ubuntu	wily	arm64	default	20160609_03:49
ubuntu	wily	armhf	default	20160609_03:49
ubuntu	wily	i386	default	20160609_03:49
ubuntu	wily	powerpc	default	20160609_03:49
ubuntu	wily	ppc64el	default	20160609_07:06
ubuntu	xenial	amd64	default	20160609_03:49
ubuntu	xenial	arm64	default	20160609_07:06
ubuntu	xenial	armhf	default	20160609_03:49
ubuntu	xenial	i386	default	20160609_03:49
ubuntu	xenial	powerpc	default	20160609_03:49
ubuntu	xenial	ppc64el	default	20160609_03:49
ubuntu	xenial	s390x	default	20160609_03:49
ubuntu	yakkety	amd64	default	20160609_03:49
ubuntu	yakkety	arm64	default	20160609_03:49
ubuntu	yakkety	armhf	default	20160609_03:49
ubuntu	yakkety	i386	default	20160609_03:49
ubuntu	yakkety	powerpc	default	20160609_03:49
ubuntu	yakkety	ppc64el	default	20160609_03:49
ubuntu	yakkety	s390x	default	20160609_03:49
---

Distribution: ubuntu
Release: xenial
Architecture: amd64

Downloading the image index
Downloading the rootfs
Downloading the metadata
The image cache is now ready
Unpacking the rootfs

---
You just created an Ubuntu container (release=xenial, arch=amd64, variant=default)

To enable sshd, run: apt-get install openssh-server

For security reason, container images ship without user accounts
and without a root password.

Use lxc-attach or chroot directly into the rootfs to set a root password
or create user accounts.

root at davecorelaptop:~# lxc-start -d -n test
root at davecorelaptop:~# lxc-attach -n test

root at test:/# shutdown -r +5
Failed to connect to bus: No such file or directory
Failed to connect to bus: No such file or directory


I cleared my /var/cache/lxc before doing these 2 tests. The tests were
done around 11:00 AM Eastern time on June 9 2016.

Note that a "shutdown -r now" works properly. The problem happens only
when I specify minutes.

And also note that installing the dbus package also fixes the issue.

** Affects: systemd (Ubuntu)
     Importance: Undecided
         Status: Triaged

-- 
shutdown -r +<number> does not work without dbus in xenial LXC container
https://bugs.launchpad.net/bugs/1590838
You received this bug notification because you are a member of Ubuntu Foundations Bugs, which is subscribed to systemd in Ubuntu.



More information about the foundations-bugs mailing list