Products › lamco-dbus-tools › Interfaces
D-Bus service files and systemd units: What starts a service
D-Bus service files and their systemd units decide what starts a service on demand and as whom, and lamco-dbus-tools times each start and audits each unit.
A D-Bus service file is the small text file that tells a bus how to start a service when someone calls a name nobody owns yet. On systems with systemd, it usually hands the start to a unit, through org.freedesktop.systemd1. These two files together decide whether a call starts anything, which program runs, as which user, and with how much hardening. A command that's slow only the first time, or a call that fails because a service never came up, is decided here. lamco-dbus-tools follows each start from request to name taken, and audits each service file with the unit behind it.
What it is
The specification describes the file: A [D-BUS Service] group with at least Name=, the well-known name, and Exec=, the command. On the system bus a User= key is required, the account the service runs as. An optional SystemdService= names a systemd unit. The bus finds the files in:
- For the session bus,
dbus-1/servicesunder each of$XDG_DATA_DIRS. - For the system bus,
/etc/dbus-1/system-services,/run/dbus-1/system-services,/usr/local/share/dbus-1/system-services,/usr/share/dbus-1/system-servicesand/lib/dbus-1/system-services, in that order of precedence.
On the system bus two files in one directory can't offer the same name, because each file's name has to match its service's. dbus-daemon's activation helper finds a system service by its file's name.
A start is asked for with StartServiceByName, or happens on a call to an unowned name that a service file provides. With SystemdService=, the bus asks systemd to start that unit, and a common practice is to name it dbus- plus the bus name plus .service, an alias for the real unit. The unit can then carry BusName= and the hardening options systemd-analyze security scores. Without the key, dbus-daemon forks Exec= itself, and dbus-broker's launcher has systemd start it in a transient unit of its own making. Either way, a unit the service manager has for the name isn't used, and its settings don't apply.
The repository's reading of both programs' source found that dbus-daemon puts a time limit on a start and logs when it's hit, and that dbus-broker enforces none. That reading hasn't been run.
Errors you'll meet
org.freedesktop.DBus.Error.ServiceUnknown: No connection owns the name and no service file provides it.org.freedesktop.DBus.Error.NoReply: A started service exited, or crashed, without answering the call that started it.
How lamco-dbus-tools reads it
dbussee audit collect reads the service files of the directories each implementation reads, the units behind them through their aliases, scored with systemd-analyze security --offline=yes, and who owns each name and the unit its process is in. dbussee record records each start with the unit a bus activation started, and reads the journal for its span unless given --no-host. dbusdo start calls StartServiceByName and times it to the name having an owner. dbustell activation gives each start, or the reason it failed in the words of whoever logged it, and dbustell audit gives the AUD- findings, with --sarif for SARIF 2.1.0.
dbussee audit collect --out audit.json # service files, their units and each unit's score
dbussee record --all --duration 15 --out rec.json # record a start, with the journal for its span
dbusdo start org.freedesktop.Notifications # start one by name, timed to the name having an owner
dbustell activation rec.json # requested, started, name taken, or why it failed
dbustell audit audit.json --sarif audit.sarif # AUD- findings, for security tooling
Where it has been run
The README's run record lists service starts and the activation lens on private buses with dbus-daemon 1.16.2 and dbus-broker 37 on 2026-11-29 and 2026-11-30: A service that exits 3 reported with dbus-daemon's reason and the service manager's, and each of ACT-001 to ACT-006 from a recording that holds it. The policy audit on Debian 13 and Fedora 45 scored every unit (2026-11-30). On KDE neon, the user's journal held an activation of org.kde.KSplash that plasmashell asked for and that failed (2026-11-28).
Findings
ACT-001: A service failed to start.ACT-002: A service took a second or more to start.ACT-003: A call asked for a name nothing provides.ACT-004: A service was started for a caller that didn't wait for it.ACT-006: A service was started outside the unit meant for it.AUD-001: A root service every user may call, with little hardening.AUD-004: A system service file whose name isn't its bus name.AUD-007: A name owned by another unit than the files give.
Related
- The bus in the journal, where a failed start is explained.
- A command slow the first time.
- Time a service's start, and see why one failed.
- The D-Bus specification, on service files and systemd activation.