D-Bus: Difference between revisions

From Alpine Linux
m (Added to category, minor formatting)
m (Formatting "=" in Cmd template)
Line 13: Line 13:
Running D-Bus like so should work for many applications:
Running D-Bus like so should work for many applications:


{{Cmd|dbus-daemon --nofork --address unix:path=$XDG_RUNTIME_DIR/bus --session}}
{{Cmd|dbus-daemon --nofork --address unix:path{{=}}$XDG_RUNTIME_DIR/bus --session}}


[[Category:System Administration]]
[[Category:System Administration]]

Revision as of 07:31, 19 April 2023

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.

You can start a dbus session like this: dbus-run-session -- sh(replacing sh with your shell or a window manager), or, export $(dbus-launch). This is distinct from running dbus system-wide: rc-service dbus start, which is a prerequisite to run a user dbus session.

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