D-Bus

From Alpine Linux
Revision as of 21:34, 26 February 2023 by WhyNotHugo (talk | contribs) (This is a short stub, but I've found these details to be a frequently source of confusion)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

D-Bus is a message bus system that provides a mechanism for inter-process communication.

Some services (including Pipewire) rely on a D-Bus session instance. Other processes will only be able to communicate with these services if d-bus is running.

The easiest way to run d-bus effectively is to use dbus-run-session. E.g.: when using sway, run it using:

dbus-run-session sway

D-Bus passes the environment variable $DBUS_SESSION_BUS_ADDRESS to its children. Running dbus-launch in a terminal means that other running process won't find this D-Bus's socket.

If $DBUS_SESSION_BUS_ADDRESS is undefined, many applications will attempt to use the standard path:

$XDG_RUNTIME_DIR/bus

Running D-Bus like so should work for many applications:

dbus-daemon --nofork --address unix:path=$XDG_RUNTIME_DIR/bus --session