logo

What is dbus?

dbus (short for Desktop Bus) is an inter-process communication (IPC) mechanism: a message bus that allows different processes and applications to communicate with each other. All processes connected to the bus can communicate with each other through it. dbus is a spec, libdbus is a reference implementation of the specification.

  • dbus-x11 is an older implementation of dbus that creates a new dbus-daemon for each graphical display that is opened (i.e. when a user logs in). This dbus-daemon (and any of its services) dies whenever that graphical session ends.
  • dbus-user-session instead has a systemd user service, where the dbus-daemon is shared among all of a user's sessions (graphical, ssh, tty, etc). This dbus-daemon dies when the last of a user’s login sessions has ended. dbus-user-session has a hard dependency on systemd which only supports running one graphical session per user at a time.

Usage:

  • systemd: uses the D-Bus wire protocol for communication between systemctl and systemd.
  • NetworkManager / udev:
    • udev daemon creates an entry for each network interface card (NIC) installed in the system in the network rules file.
    • D-Bus signals the presence of a new network device—wired or wireless—to NetworkManager.
    • NetworkManager then listens to the traffic on the D-Bus and responds by creating a configuration for this new device.