LinuxCommandLibrary

dbus-daemon

Manage inter-process communication via D-Bus

TLDR

Run the daemon with a configuration file

$ dbus-daemon --config-file [path/to/file]
copy

Run the daemon with the standard per-login-session message bus configuration
$ dbus-daemon --session
copy

Run the daemon with the standard systemwide message bus configuration
$ dbus-daemon --system
copy

Set the address to listen on and override the configuration value for it
$ dbus-daemon --address [address]
copy

Output the process ID to stdout
$ dbus-daemon --print-pid
copy

Force the message bus to write to the system log for messages
$ dbus-daemon --syslog
copy

SYNOPSIS

dbus-daemon [--version] [--session | --system] [--config-file=FILE] [--print-address[=DESCRIPTOR]] [--print-pid[=DESCRIPTOR]] [--fork] [--address=ADDRESS] [--nofork] [--nopidfile] [--systemd-activation]

PARAMETERS

--version
    Print the daemon version and exit.

--session
    Run as a session bus instance.

--system
    Run as a system bus instance.

--config-file=FILE
    Use the specified configuration file.

--print-address[=DESCRIPTOR]
    Print the bus address to standard output or the specified file descriptor and exit.

--print-pid[=DESCRIPTOR]
    Print the daemon's PID to standard output or the specified file descriptor and exit.

--fork
    Fork to the background after initialization.

--address=ADDRESS
    Use the specified address instead of the default.

--nofork
    Do not fork to the background.

--nopidfile
    Do not create a PID file.

--systemd-activation
    Accept socket activation requests from systemd.

DESCRIPTION

The dbus-daemon is the message bus daemon, a system for providing inter-process communication. It acts as a central router for messages between applications. Processes connect to the daemon, and can send messages to specific destinations or broadcast messages to all interested listeners.

It manages connections, authenticates applications, and routes messages based on destination addresses. Configuration files, typically located in /etc/dbus-1/system.d/ or /usr/share/dbus-1/system.d/ (system bus) and ~/.config/dbus-1/session.d/ (session bus), control security policies, allowed connections, and other settings. The daemon supports various security features, including authentication mechanisms and access control based on rules defined in the configuration files.

It usually runs as a system service (system bus) and as a user service (session bus). The system bus allows system-wide communication, while the session bus is for applications within a user's desktop session. Error handling and connection management are core functions of the daemon, ensuring reliable communication between applications.

CAVEATS

Improper configuration can lead to security vulnerabilities or communication failures.

CONFIGURATION FILES

Configuration files in /etc/dbus-1/ and ~/.config/dbus-1/ control access and behavior. They define security policies, allowed connections, and other settings. These files are crucial for ensuring a secure and stable D-Bus environment.

BUS TYPES

The system bus facilitates communication between system services and applications. The session bus is specific to a user session and allows applications within that session to communicate with each other.

HISTORY

D-Bus was created as a freedesktop.org project to standardize communication between desktop applications, replacing earlier technologies like CORBA. Over time, it has become a fundamental component of Linux desktop environments, providing a reliable and secure way for applications to interact.

SEE ALSO

Copied to clipboard