Package: dbus Version: 1.8.20-0+deb8u1
When trying to boot a Debian Jessie container using systemd-nspawn
-
dbus.service
fails as the directive OOMScoreAdjust=-900
can't be
applied due to missing privileges in container environments.
dbus.service
will report on startup:
Starting D-Bus System Message Bus...
Started D-Bus System Message Bus.
Failed at step OOM_ADJUST spawning /usr/bin/dbus-daemon: Permission denied
dbus.service: main process exited, code=exited, status=206/OOM_ADJUST
Unit dbus.service entered failed state.
This renders the container completely useless, as without dbus neither
machinectl is able to do any kind of introspection, nor does the login
to the container work (service systemd-logind
will fail as a result of
this problem).
Upgrading the container image to testing "solves" this issue.
I can reproduce the problem using the following steps (the host where this is executed is running Gentoo, Kernel 4.5.0, systemd-230 git@d656822):
mkdir -p /var/tmp/machines debootstrap jessie /var/tmp/machines/debian-jessie http://httpredir.debian.org/debian cd /var/tmp/machines/debian-jessie
tar cf - . | machinectl import-tar - debian-jessie systemd-nspawn -D /var/lib/machines/debian-jessie passwd -d root systemd-nspawn -D /var/lib/machines/debian-jessie apt-get update systemd-nspawn -D /var/lib/machines/debian-jessie apt-get install -y wget ca-certificates dbus
systemd-nspawn -D /var/lib/machines/debian-jessie /bin/rm /etc/securetty machinectl read-only debian-jessie machinectl clone debian-jessie debian-jessie-test machinectl start debian-jessie-test
machinectl login debian-jessie-test
systemctl -M debian-jessie-test status dbus
journalctl --directory=/var/lib/machines/debian-jessie-test/var/log/journal/ -e
Jun 29 14:16:33 moria systemd[1]: Started getty on tty2-tty6 if dbus and logind are not available. Jun 29 14:16:33 moria systemd[1]: Starting D-Bus System Message Bus... Jun 29 14:16:33 moria systemd[1]: Started D-Bus System Message Bus. Jun 29 14:16:33 moria systemd[59]: Failed at step OOM_ADJUST spawning /usr/bin/dbus-daemon: Permission denied Jun 29 14:16:33 moria systemd-journal[20]: Forwarding to syslog missed 12 messages. Jun 29 14:16:33 moria cron[56]: (CRON) INFO (pidfile fd = 3) Jun 29 14:16:33 moria cron[56]: (CRON) INFO (Running @reboot jobs) Jun 29 14:16:33 moria networking[23]: Configuring network interfaces...done. Jun 29 14:16:58 moria systemd[1]: Failed to register match for Disconnected message: Connection timed out Jun 29 14:16:58 moria systemd-logind[58]: Failed to add match for NameOwnerChanged: Connection timed out Jun 29 14:16:58 moria systemd-logind[58]: Failed to fully start up daemon: Connection timed out Jun 29 14:17:01 moria CRON[62]: pam_env(cron:session): Unable to open env file: /etc/default/locale: No such file or directory Jun 29 14:17:01 moria CRON[62]: pam_unix(cron:session): session opened for user root by (uid=0) Jun 29 14:17:01 moria CRON[63]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly) Jun 29 14:17:01 moria CRON[62]: pam_unix(cron:session): session closed for user root Jun 29 14:17:23 moria systemd[1]: Failed to register match for Disconnected message: Connection timed out Jun 29 14:17:23 moria systemd[1]: Starting System Logging Service... Jun 29 14:17:23 moria systemd[1]: Starting Permit User Sessions... Jun 29 14:17:23 moria systemd-journal[20]: Forwarding to syslog missed 13 messages. Jun 29 14:17:23 moria systemd[1]: Started /etc/rc.local Compatibility. Jun 29 14:17:23 moria systemd[1]: systemd-logind.service: main process exited, code=exited, status=1/FAILURE Jun 29 14:17:23 moria systemd[1]: Failed to start Login Service. Jun 29 14:17:23 moria systemd[1]: Unit systemd-logind.service entered failed state. Jun 29 14:17:23 moria systemd[1]: dbus.service: main process exited, code=exited, status=206/OOM_ADJUST Jun 29 14:17:23 moria systemd[1]: Unit dbus.service entered failed state. Jun 29 14:17:23 moria systemd[1]: systemd-logind.service has no holdoff time, scheduling restart. Jun 29 14:17:23 moria systemd[1]: Started Permit User Sessions. Jun 29 14:17:23 moria systemd[1]: Started System Logging Service. Jun 29 14:17:23 moria systemd[1]: Looping too fast. Throttling execution a little. Jun 29 14:17:24 moria systemd[1]: Looping too fast. Throttling execution a little.