bionic LXD image reports systemd-hostnamed.service failure

Bug #1759578 reported by Robert C Jennings
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
cloud-images
New
Undecided
Unassigned

Bug Description

I am launching a bionic minimal** image in LXD and the systemd-hostnamed.service reports as 'failed' at boot. System booted in degraded state. This is not a privileged container so the operations it is performing may not be expected to succeed, but I would think the service would then check that it's running in a container and degrade gracefully without marking the unit as failed.

** This occurs with bionic cloud images (non-minimal variety) too

Tested with daily bionic minimal LXD images (serial 20180328.1) from https://cloud-images.ubuntu.com/minimal/daily/bionic/

$ lxc remote add minimal-ubuntu-daily https://cloud-images.ubuntu.com/minimal/daily --protocol simplestreams
$ lxc launch minimal-ubuntu-daily:bionic b
$ lxc exec b -- systemctl list-units --failed
  UNIT LOAD ACTIVE SUB DESCRIPTION
● cloud-init.service loaded failed failed Initial cloud-init job (metadata service crawler)
● systemd-hostnamed.service loaded failed failed Hostname Service

(The cloud-init.service failure is reported separately in bug #1759571)

$ lxc exec b journalctl | grep hostnamed
Mar 28 13:42:33 b systemd[1]: systemd-hostnamed.service: Failed to reset devices.list: Operation not permitted
Mar 28 13:42:33 b systemd[1]: Failed to set devices.allow on /system.slice/systemd-hostnamed.service: Operation not permitted
Mar 28 13:42:33 b systemd[1]: Failed to set devices.allow on /system.slice/systemd-hostnamed.service: Operation not permitted
Mar 28 13:42:33 b systemd[1]: Failed to set devices.allow on /system.slice/systemd-hostnamed.service: Operation not permitted
Mar 28 13:42:33 b systemd[1]: Failed to set devices.allow on /system.slice/systemd-hostnamed.service: Operation not permitted
Mar 28 13:42:33 b systemd[1]: Failed to set devices.allow on /system.slice/systemd-hostnamed.service: Operation not permitted
Mar 28 13:42:33 b systemd[1]: Failed to set devices.allow on /system.slice/systemd-hostnamed.service: Operation not permitted
Mar 28 13:42:33 b systemd[1]: Failed to set devices.allow on /system.slice/systemd-hostnamed.service: Operation not permitted
Mar 28 13:42:33 b systemd[1]: Failed to set devices.allow on /system.slice/systemd-hostnamed.service: Operation not permitted
Mar 28 13:42:33 b systemd[143]: systemd-hostnamed.service: Failed to set up network namespacing: Permission denied
Mar 28 13:42:33 b systemd[143]: systemd-hostnamed.service: Failed at step NETWORK spawning /lib/systemd/systemd-hostnamed: Permission denied
Mar 28 13:42:33 b systemd[1]: systemd-hostnamed.service: Main process exited, code=exited, status=225/NETWORK
Mar 28 13:42:33 b systemd[1]: systemd-hostnamed.service: Failed with result 'exit-code'.

Robert C Jennings (rcj)
summary: - bionic minimal images report systemd-hostnamed.service failure
+ bionic LXD image reports systemd-hostnamed.service failure
description: updated
Revision history for this message
Simon IJskes (sim-nyx) wrote :

i tried two variants:
1) lxc launch images:ubuntu/18.04 u1
2) lxc launch ubuntu:18.04 u2

1) takes ages before runlevel becomes "N 5" and contains mentioned bug.
2) is fast but contains cloud-init package.

lxd containers are create on a 10.* net.

1) syslog:
root@u1:~# grep hostname /var/log/syslog
May 4 17:16:57 u1 dbus-daemon[78]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.1' (uid=100 pid=58 comm="/lib/systemd/systemd-networkd " label="unconfined")
May 4 17:16:57 u1 systemd[1]: systemd-hostnamed.service: Failed to reset devices.list: Operation not permitted
May 4 17:16:57 u1 systemd[1]: Failed to set devices.allow on /system.slice/systemd-hostnamed.service: Operation not permitted
May 4 17:16:57 u1 systemd[1]: message repeated 7 times: [ Failed to set devices.allow on /system.slice/systemd-hostnamed.service: Operation not permitted]
May 4 17:16:57 u1 systemd[90]: systemd-hostnamed.service: Failed to set up network namespacing: Permission denied
May 4 17:16:57 u1 systemd[90]: systemd-hostnamed.service: Failed at step NETWORK spawning /lib/systemd/systemd-hostnamed: Permission denied
May 4 17:16:57 u1 systemd[1]: systemd-hostnamed.service: Main process exited, code=exited, status=225/NETWORK
May 4 17:16:57 u1 systemd[1]: systemd-hostnamed.service: Failed with result 'exit-code'.
May 4 17:17:22 u1 systemd-networkd[58]: Could not set hostname: Method call timed out

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.