scheduled shutdown -r does not work without dbus in xenial LXC container

Bug #1590838 reported by David Coronel
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Landscape Client
Fix Committed
Undecided
Andreas Hasenack
landscape-client (Ubuntu)
Fix Released
Undecided
Andreas Hasenack
Xenial
New
Undecided
Unassigned
Yakkety
Won't Fix
Undecided
Unassigned
systemd (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Won't Fix
Undecided
Unassigned
Yakkety
Fix Released
Undecided
Unassigned

Bug Description

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@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@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@davecorelaptop:/var/cache/lxc# lxc-create -t ubuntu -n test2
root@davecorelaptop:/var/cache/lxc# lxc-start -d -n test2
root@davecorelaptop:/var/cache/lxc# lxc-attach -n test2

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

root@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@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@davecorelaptop:~# lxc-start -d -n test
root@davecorelaptop:~# lxc-attach -n test

root@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.

Related branches

Revision history for this message
Martin Pitt (pitti) wrote :

Reassigning to systemd. The sysvinit compat tools should fallback to systemd's internal D-Bus socket if D-Bus is not installed.

affects: lxc (Ubuntu) → systemd (Ubuntu)
Changed in systemd (Ubuntu):
status: New → Triaged
Martin Pitt (pitti)
summary: - shutdown -r +<number> does not work without dbus in xenial LXC container
+ shutdown -r does not work without dbus in xenial LXC container
Martin Pitt (pitti)
summary: - shutdown -r does not work without dbus in xenial LXC container
+ scheduled shutdown -r does not work without dbus in xenial LXC
+ container
Revision history for this message
Martin Pitt (pitti) wrote :

Ah, I just noticed that immediate shutdowns work fine. Scheduled shutdowns however are handled by logind, and that requires dbus. I'm afraid this won't change.

This has been "fixed" in yakkety by pulling libpam-systemd and consequently dbus into the container images, as we were able to make init/systemd-sysv/systemd non-essential. This is quite an intrusive change though, and not suitable for backporting.

So for now I'm afraid you need to install libpam-systemd if you need scheduled shutdowns.

Changed in systemd (Ubuntu):
status: Triaged → Won't Fix
Revision history for this message
Martin Pitt (pitti) wrote :

Adding a landscape-client task. I suggest to add a libpam-systemd dependency to landscape-client to ensure that scheduled shutdown works.

Changed in landscape-client:
status: New → In Progress
assignee: nobody → Andreas Hasenack (ahasenack)
Martin Pitt (pitti)
Changed in systemd (Ubuntu Yakkety):
status: Won't Fix → Fix Released
Changed in systemd (Ubuntu Xenial):
status: New → Won't Fix
Changed in systemd (Ubuntu):
status: Won't Fix → Fix Released
Changed in landscape-client:
status: In Progress → Fix Committed
Changed in landscape-client (Ubuntu):
assignee: nobody → Andreas Hasenack (ahasenack)
status: New → In Progress
Changed in landscape-client (Ubuntu Yakkety):
status: New → Won't Fix
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.9 KiB)

This bug was fixed in the package landscape-client - 18.01-0ubuntu1

---------------
landscape-client (18.01-0ubuntu1) bionic; urgency=medium

  * New upstream release 18.01:
    - Ported to python3 (LP: #1577850)
    - move Replaces/Breaks landscape-client-ui rules to landscape-common
      (LP: #1560424)
    - Add a libpam-systemd Depends if built for xenial (LP: #1590838)
    - Some units not reporting swift usage (LP: #1588404)
    - Fix missing install directories for landscape-common and drop
      usr/share/landscape as its only used and created by landscape-client.
      (LP: #1680842)
    - Fix VM detection for Xen, by returning "xen" only for paravirtualized and
      HVM hosts, not for dom0. (LP: #1601818)
    - Add an indication of truncation to process output that has been truncated
      prior to delivery to the server. (LP: #1629000)
    - add /snap/bin to the PATH when executing scripts. (LP: #1635634)
    - Save the original sources.list file when a repository profile is
      associated with a computer and restore it when the profile is removed.
      (LP: #1607529)
    - Drop the legacy HAService plugin, which is no longer used.
    - Avoid double-decoding package descriptions in build_skeleton_apt, which
      causes an error with Xenial python-apt. (LP: #1655395)
    - Remove dead dbus code and textmessage (confirmed not supported in server
      for ~2 years). (LP: #1657372)
    - Move bzr-builddeb conf file from deprecated location to debian/
      (LP: #1658796)
    - Support for new server error message about there being too many pending
      computers already (LP: #1662530)
    - Add a timestamp to the package reporter result (LP: #1674252)
    - Check if ubuntu-release-upgrader is running before apt-update (LP: #1699179)
    - Implicitly trust file-local sources managed by landscape. On upgrades,
      add the trusted flag to the landscape file-local apt source file if it's
      not there. (LP: #1736576)
    - Use local system tools to change the user's password (LP: #1743558)
  * clean up packaging and getting in sync with the new landscape version:
    - d/rules: drop extra:suggests which is unused since 13.07.1-0ubuntu2
    - Remove antique postinst code. No supported landscape-client version
      installs cronjobs anymore (since a long time).
    - d/landscape-client.docs: the README file is now a markdown file, so
      install that instead.
    - d/landscape-common.postinst: no need to single out
      /var/lib/landscape/.gnupg when fixing ownerships, just do it over
      the entire parent directory.
    - guard user and group removal via an empty .cleanup.* file in post, so we
      only remove the user/group if we were the ones who created them at
      install time.
    - lintian: remove absolute path from update-motd calls in maintainer
      scripts
    - d/rules: drop special handling for dapper, hardy and lucid, which are no
      longer supported.
    - d/rules: make sure we have an "extra:Depends=" in substvars even if it's
      empty
    - d/rules: drop dh_pycentral handling, it's obsolete
  * Dropped (already included in this version):
    - d/p/set-vm-info-to-kvm-for-aws-C5-instances.patch:
  ...

Read more...

Changed in landscape-client (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.