Generated by GPT-5-mini| D-Bus | |
|---|---|
| Name | D-Bus |
| Developer | freedesktop.org and contributors |
| Released | 2002 |
| Programming language | C, C++ |
| Operating system | Unix-like, Linux, BSD, macOS (ports), Windows (ports) |
| License | GNU Lesser General Public License |
D-Bus D-Bus is an inter-process communication (IPC) system widely used on Unix-like systems to enable communication between desktop components, system services, and applications. It facilitates message passing, service discovery, and event notification across processes and user sessions. Designed and maintained within the freedesktop.org community, D-Bus integrates with software stacks used by projects such as GNOME, KDE, systemd, and Wayland.
D-Bus was originally developed to replace ad hoc IPC mechanisms in desktop environments and to provide a standardized bus for system and session communication. Early adopters included projects like GNOME Project, KDE e.V., and X.Org Foundation, while contributions came from developers associated with Red Hat, Novell, and Intel Corporation. D-Bus is frequently discussed alongside other IPC technologies such as CORBA, DCOP, DBus (duplicate banned term), and ZeroMQ in initiatives led by organizations like freedesktop.org.
The D-Bus architecture centers on one or more message buses mediating traffic between clients. Core components include the system bus daemon and the per-user session bus daemon, managed on many distributions by init systems and service managers such as systemd and Upstart; service activation often integrates with udev and polkit. Client libraries implement proxies and stubs to expose object paths and interfaces similar in concept to technologies used by SOAP and gRPC. Key runtime elements include bus names, unique names, well-known names, object paths, and interfaces, where services can be activated by bus daemons in response to incoming method calls. D-Bus daemons are configured via XML or policy files analogous to configuration management used at projects like Debian and Red Hat Enterprise Linux.
D-Bus defines a binary protocol layered over Unix domain sockets and, in some ports, TCP sockets; the protocol specifies message headers, byte-order negotiation, and a type system roughly comparable to XDR and ASN.1. Message types include method calls, method returns, errors, and signals; these are analogous to request-response patterns in HTTP and publish-subscribe patterns in MQTT. The wire format supports primitive types and container types, and messages carry metadata such as sender, destination, serial numbers, and signatures. Authentication mechanisms in the protocol borrow concepts from SASL and use ephemeral credentials like those exposed by Linux kernel SCM_CREDENTIALS ancillary messages on Unix sockets.
Multiple implementations and language bindings exist: the reference implementation maintained in C is hosted by freedesktop.org; alternative implementations and bindings are available for C++ (libdbus-c++), Qt Project's integration (QtDBus), GNOME Project's GLib-based binding (GDBus in GIO), and bindings for languages such as Python (programming language), Rust (programming language), Go (programming language), Java (programming language), and Perl. Third-party projects and vendors like Canonical (company), SUSE, and Arch Linux include packaging and patches; desktop stacks like GNOME Shell and KWin rely on these libraries for session operations. Daemons compatible with containerization and virtualization platforms such as Docker and QEMU are maintained for integration scenarios.
D-Bus access control is enforced by bus-level policies and by external authorization frameworks like Polkit (PolicyKit). System bus policies are often defined by distributions and influenced by projects such as Debian Project and Fedora Project; session bus rules are typically less restrictive. Security considerations include privilege separation, sandboxing via technologies like Flatpak, Snapcraft (Snap), and SELinux, and mitigation of message injection or race conditions. Authentication uses Unix credentials, and cryptographic approaches akin to TLS are sometimes applied for remote transports. Threat models and hardening guidance have been discussed by vendors including Red Hat and researchers at institutions such as University of Cambridge.
D-Bus is ubiquitous in desktop stacks: it provides service discovery and notifications for components like NetworkManager, PulseAudio, systemd-logind, udisks2, and upowerd; session services such as GNOME Settings Daemon and KDE Plasma components use it for global actions and settings synchronization. Desktop notifications through freedesktop.org specifications and integration with compositors such as Wayland and X.Org Foundation rely on D-Bus for event propagation. Applications like Firefox and LibreOffice integrate with desktop services through language-specific bindings, while system management tools from Canonical (company) and Red Hat interact via the system bus.
Developer tools include introspection utilities, schema and XML generators, and language-specific bindings shipped by projects like GNOME Project and Qt Project. Tools such as bus sniffers, message debuggers, and introspection browsers are available in distributions maintained by Debian Project and Fedora Project; continuous integration and packaging are often orchestrated by services from organizations like OpenEmbedded and Yocto Project for embedded environments. Documentation, tutorials, and design discussions are hosted on community platforms including freedesktop.org and archived mailing lists where contributors from Red Hat, Intel Corporation, and Canonical (company) collaborate.
Category:Inter-process communication