↑ arvau

ArchWiki / D-Bus

de:Qdbus hu:D-Bus ja:D-Bus ru:D-Bus zh-hans:D-Bus

D-Bus is a message bus system that provides an easy way for inter-process communication. It consists of a daemon, which can be run both system-wide and for each user session, and a set of libraries to allow applications to use D-Bus.

dbus is pulled and installed as a dependency of systemd and user session bus is started automatically for each user.

Implementations

Arch provides two D-Bus message broker implementations. Initially, the user will be asked to choose a desired dbus-units provider during installation of systemd package. Only one implementation can be installed at a time.

dbus-broker

dbus-broker is currently the default implementation for Arch https://archlinux.org/news/making-dbus-broker-our-default-d-bus-daemon/ https://rfc.archlinux.page/0025-dbus-broker-default/. It is a drop-in replacement for the reference implementation, which aims "to provide high performance and reliability, while keeping compatibility to the D-Bus reference implementation".

Select dbus-broker-units when asked for dbus-units provider, or install it explicitly.

dbus-broker currently does not have support for AppArmor. However, officially supported kernels do not support AppArmor mediation for D-Bus, either.

Reference implementation

The reference implementation is still officially supported by Arch.

Select dbus-daemon-units when asked for dbus-units provider, or install it explicitly.

Tips and tricks

Override dbus service

This is useful when specifying a particular service among other services providing the same well-known bus name. See KeePass#Autostart and KDE Wallet#Automatic D-Bus activation for example.

D-Bus services can be masked by setting Exec/bin/false in service files of $XDG_DATA_HOME/dbus-1/services. For example, to mask gvfsd,

$ cp /usr/share/dbus-1/services/org.gtk.vfs.Daemon.service ~/.local/share/dbus-1/services
$ sed -i 's^Exec.*Exec/bin/false' ~/.local/share/dbus-1/services/org.gtk.vfs.Daemon.service

If the service is already launched, the override will not work. The existing service's process must be killed, or launched earlier.

Debugging

You can also use busctl(1) from systemd.

See also

  • https://freedesktop.org/wiki/Software/dbus/

  • https://freedesktop.org/wiki/IntroductionToDBus/

  • https://uyha.github.io/technical/dbus-systemd.html systemd uses DBus as the mechanism to interact with it. This article introduces just enough DBus concepts and the usage of busctl to communicate with systemd.