Dependency loop via sockets.target

Bug #1936948 reported by Lukas Märdian
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dbus (Ubuntu)
Fix Released
Undecided
Unassigned
Impish
Fix Released
Undecided
Unassigned

Bug Description

basic.target waits for dbus.socket (via sockets.target) AND dbus.socket waits for basic.target, too, delaying dbus-daemon startup. At some point a timeout happens, dbus is started and all queued services try to start registering to the bus at the same time.

All services registering at the same time, seems to be triggering bugs like this more often: https://bugs.launchpad.net/ubuntu/+source/dbus/+bug/1871538/

This happens since Hirsute (dbus 1.12.20-1ubuntu3), where the following delta was added:

Index: dbus-1.12.20/bus/dbus.socket.in
===================================================================
--- dbus-1.12.20.orig/bus/dbus.socket.in
+++ dbus-1.12.20/bus/dbus.socket.in
@@ -1,5 +1,9 @@
 [Unit]
 Description=D-Bus System Message Bus Socket
+# Do not stop on shutdown
+DefaultDependencies=no
+Wants=sysinit.target
+After=sysinit.target basic.target

 [Socket]
 ListenStream=@DBUS_SYSTEM_SOCKET@

It leads to deadlock situations like this:
09:23:59.276245 systemd[1]: basic.target: starting held back, waiting for: sockets.target
09:23:59.276438 systemd[1]: dbus.socket: starting held back, waiting for: basic.target
09:23:59.304393 systemd[1]: dbus.service: starting held back, waiting for: dbus.socket

Tags: fr-1522

Related branches

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

What the patch was supposed to do is to list

Default Dependencies from https://www.freedesktop.org/software/systemd/man/systemd.socket.html#

But drop/negate shutdown related ones.

Thus it should have been

1) Before= dependency on sockets.target
2) After= and Wants= dependency on sysinit.target

Requires=sysinit.target is downgraded to Wants to prevent attempting to stop dbus.service on shutdown.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

i.e. basic.target is too much there.

Lukas Märdian (slyon)
tags: added: rls-ii-incoming
tags: added: fr-1522
Changed in dbus (Ubuntu Impish):
milestone: none → ubuntu-21.10
tags: removed: rls-ii-incoming
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in dbus (Ubuntu):
status: New → Confirmed
Lukas Märdian (slyon)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dbus - 1.12.20-2ubuntu2

---------------
dbus (1.12.20-2ubuntu2) impish; urgency=medium

  * Rework d/p/ubuntu/dont-stop-dbus.patch to avoid a deadlock during boot
    (LP: #1936948)

 -- Lukas Märdian <email address hidden> Thu, 09 Sep 2021 15:45:30 +0200

Changed in dbus (Ubuntu Impish):
status: Confirmed → 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.