Products › lamco-dbus-tools › Docs

dbusdo commands: Call, start, replay and probe on D-Bus buses

dbusdo commands: The reference for every command that drives a D-Bus bus, from call, set, own and start to replay, load, relay and the policy and sandbox probe.

Generated from the help registry, as the man page dbusdo(1) is. Don't edit: Change the registry and regenerate with LAMCO_DBUS_TOOLS_UPDATE_SNAPSHOTS=1 cargo test.

Drives a D-Bus bus, and records everything it does.

It may hold commands of these layers: wake, drive, interpose.

Usage: dbusdo [FLAGS] <command> [arguments] [<command> [arguments]]...

Flags every program takes are in exit codes and flags.

dbusdo policy

Give a bus policy file to each real daemon, probe it, and hold every answer to the evaluator

dbusdo policy probe [--base <open|system>] [--implementation <daemon|broker|both>] [--probe <probe>]... [--probes <file>] <policy file>
  • <policy file>: A <busconfig> file with <policy> blocks, such as one from /usr/share/dbus-1/system.d.
  • --probe <probe>: One probe: call DEST INTERFACE|- MEMBER [PATH], - for a call with no interface; or own NAME. Repeat it for more.
  • --probes <file>: Probes, one on each line; # starts a comment.
  • --base <open|system>: The rules the file is included after: open, every send and receive allowed, owning only as the file allows; or system, the stock system bus's rules. Default: open.
  • --implementation <daemon|broker|both>: Which daemons to give it. Default: both, each where it's installed.

Needs: dbus-daemon, or dbus-broker's launcher with systemd-socket-activate. Each runs privately; nothing on the machine's buses is touched.

Layer: drive. Maturity: beta.

Each daemon is started on a private bus with the base and the file included. A call probe goes to a stand-in that owns its destination, which a mandatory rule lets it take; requests to own run on a second bus without that rule. Each answer, allowed, denied or another error, is set beside the evaluator's verdict for that implementation and the rule it named. A daemon that refuses to start on the file is a result too, held to whether the evaluator said it would. Fails when any answer differs. The cases in tests/oracle of the source tree are the toolkit's own, run on every daemon version tested.

$ dbusdo policy probe --probe "call com.example.Svc - Echo" mine.conf
$ dbusdo --out oracle.json policy probe --base system --probes probes.txt /usr/share/dbus-1/system.d/org.freedesktop.hostname1.conf

dbusdo sandbox

Ask the host's own xdg-dbus-proxy what a grant allows, and test it for its known flaws

dbusdo sandbox probe [--app <id> | --instance <id>] [--no-names] [--stand-in <name,name...>]... [--proxy <path>] [--] [<proxy options>...]
  • <proxy options>...: The grant, as the proxy takes it: --filter, --see=, --talk=, --own=, --call=NAME=RULE, --broadcast=NAME=RULE, --sloppy-names. The rest of the chain.
  • --app <id>: Take the grant from an installed Flatpak application's files, as Flatpak would run it.
  • --instance <id>: Take the grant from a running Flatpak instance: The options its proxy enforces, read back.
  • --no-names: Don't mirror the bus's names; stand in only for the names the grant itself names.
  • --stand-in <name,name...>: A stand-in connection owning these names. Repeat it for more.
  • --proxy <path>: The proxy to ask. Default: xdg-dbus-proxy on PATH.
  • --on-bus: Run the stand-ins and the proxy on the chain's own bus, given by --address, whose names they take. For tests.

Needs: xdg-dbus-proxy and dbus-daemon on this machine. No service is called: The probes go to stand-ins.

Layer: interpose. Maturity: beta.

Reads each well-known name of the chain's bus and its owner, and starts a private dbus-daemon with a stand-in for each connection, owning the same names, so names share an owner as they do on the real bus: The proxy lets a client reach every name of a connection through any one it was granted. Every name the grant names gets a stand-in too. Then the host's proxy is started in front of that bus with the grant and --log, and probes are sent through it: A ping to every name and every owner, each rule's own call and calls just outside it, the bus's questions about each name, requests and starts, match rules, the bus's other methods, the names it shows, and the broadcasts each stand-in sends. The proxy's log gives its decision on each, which is held to the toolkit's own evaluator of the filter. Then three behavior probes on a second private bus, for the flaws fixed in 2026: CVE-2026-34080, an eavesdrop match with a space; CVE-2026-93676, broadcasts leaking past a call rule; CVE-2026-94422, a method call passed as a reply. A proxy's version doesn't say which it carries, since distributions backport the fixes. Fails when any probe disagrees or a flaw is found.

$ dbusdo sandbox probe --filter --talk=org.freedesktop.Notifications --own=org.example.App.*
$ dbusdo --out probe.json sandbox probe --proxy ./xdg-dbus-proxy --no-names --filter --talk=org.example.Name

dbusdo relay

Run one program behind a recording relay, for its own send and receive moments

dbusdo relay [--bodies <length|hash|decoded|raw>] [--] <program> [<arguments>...]
  • <program> [<arguments>...]: The program to run, with the rest of the chain as its arguments. relay is the last link of a chain.
  • --bodies <length|hash|decoded|raw>: How much of each message's body to keep, as for dbussee record. Default: length.

Needs: A bus this user can connect to. The program connects to its bus through the address variable the relay sets.

Layer: interpose. Maturity: beta. Changes the bus or the machine.

The relay listens on a socket in a directory only this user can enter, runs the program with DBUS_SESSION_BUS_ADDRESS, or DBUS_SYSTEM_BUS_ADDRESS with --bus system, set to it, and joins each connection the program makes to the real bus. Bytes pass unchanged, and file descriptors with the bytes they came with. Beside that it reads the stream back: The authentication lines, which a monitor never sees, with the contents of DATA lines left out, and each message, stamped when the relay read it and when it had passed it on. dbustell reads the capture with every lens; a call's figure there runs from the relay reading the call to the relay reading its answer, a different figure from a monitor's and named so. A relay adds about 20 to 30 microseconds to a call (measured, release build). The bus sees the relay's process, not the program's. The relay starts the program, so the two share the user, the login session and the cgroup: A service that asks the bus who called gets the relay's pid and executable, and polkit and the portals, which go by the session, the user and the cgroup, see the program's own. Behind the relay a program is on the bus as the relay's user, whatever user it runs as: One that changes user with sudo gets in when its library lets the bus read the socket's credentials, as sd-bus and GLib do, and is refused when it names its own uid, as libdbus does. The relay act states this, with both pids, and says when the bus refused the program and which uid it had named. It suits a program started for the purpose. The program's exit status is the act's: Fails when the program does.

$ dbusdo --out relayed.json relay busctl --user call org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus GetId
$ dbusdo --bus system --out relayed.json relay --bodies decoded -- ./my-client --verbose

dbusdo replay

Send a recording's calls again, and say which ended differently

dbusdo replay [--speed <factor>] [--service <name>] <capture>
  • <capture>: A recording made with --bodies raw, so each call's arguments were kept.
  • --speed <factor>: Keep the recording's gaps between calls, divided by this. Default: One after another.
  • --service <name>: Only the calls to this name.

Needs: A bus, and the services the calls went to.

Layer: drive. Maturity: beta. Changes the bus or the machine. May raise a permission dialog.

Each method call to a well-known name is built again from its recorded header and body and sent with a new serial on this connection, and its answer is found by that serial. Calls to the bus itself are left out, and so are calls to a unique name, which belonged to a connection that has gone. Each sending is an act: The recorded call it repeats, how that call ended then, and how it ends now. Fails when any call ends differently or gets no answer. The calls are sent as this user, whoever sent them in the recording, so a call that changes something changes it again.

$ dbusdo --out again.json replay --service org.freedesktop.Notifications rec.json

dbusdo load

Broadcast signals at a stated rate and size, to load a bus

dbusdo load [--size <bytes>] <per-second> <seconds>
  • <per-second>: How many signals a second, up to 1000000.
  • <seconds>: For how long.
  • --size <bytes>: Bytes in each signal's body besides its count, up to 1048576. Default: 0.

Needs: A bus. Every connection with a match on the signal gets each one, so on a shared bus this loads them too.

Layer: drive. Maturity: beta. Changes the bus or the machine.

Broadcasts io.lamco.DbusTools.Load.Tick from /io/lamco/DbusTools/Load, each with its count and a body of the stated size, each due at its own moment. Recorded as one act: The rate asked, the rate achieved, how many were sent and how many went out more than a gap late, which is the sender falling behind. dbussee record beside it shows what the bus did with them.

$ dbusdo load 1000 5
$ dbusdo load --size 4096 200 10

dbusdo call

Call a method, once or repeated, timed at the caller

dbusdo call [--repeat <n>] [--interval <seconds>] [--timeout <seconds>] [--no-auto-start] [--max-p99 <ms>] <destination> <path> <interface.member> [<signature> <values>...]
  • <destination> <path> <interface.member>: Where the call goes, and what it calls.
  • <signature> <values>...: The arguments, as busctl call takes them: s hello, u 7, as 2 a b, a{sv} 1 key s value, v i 3, (si) x 1. None when the method takes none.
  • --repeat <n>: Send it this many times, one after another, and give the distribution. Default: 1.
  • --interval <seconds>: Wait between repeats. Default: none.
  • --timeout <seconds>: How long to wait for each answer. Default: 25.
  • --no-auto-start: Send with the flag that forbids starting a service: Then a name nobody owns is an error, not a start.
  • --max-p99 <ms>: Fail when the 99th percentile at the caller is over this many milliseconds, which is how a CI job catches a regression. With few repeats the 99th percentile is the slowest call.

Needs: A bus, and the service. A call may start a service that wasn't running, unless given --no-auto-start.

Layer: wake. Maturity: beta. Changes the bus or the machine. May raise a permission dialog.

The call is built and sent on the connection the chain keeps, and its answer is found by its serial. Each sending is an act in --out's capture, with the caller's name and the serial, which join it to a recording of the same call, and two stamps: Just before it was sent, and just after its answer was read. That figure at the caller holds both trips across the socket as well as the bus's and the service's work, and is never pooled with a monitor's; dbustell timing --caller joins the two. A reply is printed; a repeated call prints its distribution at the caller. A call to a service that asks a person for permission can raise a dialog. Fails when the answer is an error or doesn't come, which soft allows.

$ dbusdo call org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner s org.freedesktop.Notifications
$ dbusdo --out acts.json call --repeat 500 org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.GetServerInformation
$ dbusdo call --repeat 500 --max-p99 5 com.example.Service /com/example/Service com.example.Service.Get

dbusdo emit

Send a signal

dbusdo emit <destination|-> <path> <interface.member> [<signature> <values>...]
  • <destination|->: One connection to send it to, or - to broadcast it.
  • <path> <interface.member>: The signal's path and name.
  • <signature> <values>...: Its arguments, as for call.

Needs: A bus. Whoever listens for the signal acts on it.

Layer: drive. Maturity: beta. Changes the bus or the machine.

Recorded as an act with its serial and the moment it was sent. A signal has no answer.

$ dbusdo emit - /org/example com.example.Iface.Changed s hello

dbusdo set

Set a property

dbusdo set <destination> <path> <interface.property> <signature> <value>
  • <destination> <path> <interface.property>: The property.
  • <signature> <value>: Its new value, as for call: u 7, s text, as 2 a b.

Needs: A bus, and a service whose property may be set.

Layer: drive. Maturity: beta. Changes the bus or the machine. May raise a permission dialog.

Calls org.freedesktop.DBus.Properties.Set, recorded as an act like call. Fails when the service answers with an error.

$ dbusdo set com.example.App /com/example/App com.example.App.Level u 7

dbusdo own

Hold a name for a time, then give it up

dbusdo own [--replace] <name> <seconds>
  • <name>: The well-known name to take.
  • <seconds>: How long to hold it.
  • --replace: Ask to take it from an owner that allows it.

Needs: A bus whose policy lets this user own the name. The system bus mostly doesn't.

Layer: drive. Maturity: beta. Changes the bus or the machine.

Calls RequestName without queueing, holds the name, then ReleaseName. Callers of the name reach this connection meanwhile and get no answer, which is a way to test how a program behaves when its service doesn't answer. Recorded with the bus's reply: primary_owner, exists, and so on. Fails when the name wasn't taken.

$ dbusdo own com.example.Test 5
$ dbusdo own --replace org.freedesktop.Notifications 10

dbusdo start

Start a service by its name, and time it until its name has an owner

dbusdo start <name>
  • <name>: The name of a service the bus can start.

Needs: A bus that can start the service.

Layer: wake. Maturity: beta. Changes the bus or the machine.

Calls StartServiceByName, then waits for the name's owner to change, within the run's time limit. Records the time to the bus's answer and to the name having an owner. A service already running answers at once. dbussee record beside it, with its journal, gives dbustell activation the rest.

$ dbusdo start org.freedesktop.Notifications

dbusdo pause

Wait before the next command of the chain

dbusdo pause <seconds>
  • <seconds>: How long to wait. A fraction is allowed: 0.25.

Needs: Nothing.

Maturity: stable.

The wait counts against the run's time limit (--timeout).

$ dbusdo pause 2
$ dbusdo pause 0.5 help pause

dbusdo retry

Run the next command up to N times until it succeeds

dbusdo retry <count> <command...>
  • <count>: The most attempts, the first included. At least 1.

Needs: Nothing of its own.

Maturity: stable.

It applies to the next command of the chain and to no other. Half a second passes between attempts. With soft, the chain goes on even when every attempt failed.

$ dbusdo retry 3 pause 1
$ dbusdo soft retry 3 pause 1

dbusdo soft

Let the next command fail without ending the chain

dbusdo soft <command...>

Needs: Nothing of its own.

Maturity: stable.

It applies to the next command of the chain and to no other. The failure is still reported, and still written to the JUnit file, marked as allowed.

$ dbusdo soft pause 1 pause 2
$ dbusdo soft retry 2 help no-such-command

dbusdo session

Read commands from standard input, a chain on each line

dbusdo session

Also: repl, interactive.

Needs: Standard input.

Maturity: beta.

Each line is a chain, run when the line is entered. A chain that fails ends that line and not the session. exit, quit or the end of input ends the session. The run's time limit doesn't apply while the session waits for a line.

$ dbusdo session
$ dbusdo pause 1 session

dbusdo run

Run a script: A file of chains, one on each line

dbusdo run <script>
  • <script>: A text file. By convention its name ends in .dbusdo-script.

Needs: The file.

Maturity: beta.

Each line is a chain. Empty lines and lines that start with # are passed over. A part in double quotes is one word. {env:NAME} in a word is replaced with that environment variable, and a variable that isn't set is an error. The first line that fails ends the script. A script can't open a session, another script or a recording.

$ dbusdo run setup.dbusdo-script
$ dbusdo retry 2 run setup.dbusdo-script

dbusdo play

Play a recording back with its timing

dbusdo play <recording> [speed]
  • <recording>: A file --record wrote. By convention its name ends in .dbusdo.
  • [speed]: How many times faster than recorded. 2 is twice as fast, 0.5 half. Default: 1.

Needs: The file.

Maturity: beta.

Each command starts at the moment it started when recorded, divided by the speed, or as soon as the command before it has ended if that's later. The rules of run apply.

$ dbusdo play morning.dbusdo
$ dbusdo play morning.dbusdo 2

dbusdo convert

Write a recording as a script, or a script as a recording

dbusdo convert <input> <output>
  • <input>: A recording (.dbusdo) or a script (.dbusdo-script).
  • <output>: A file of the other kind. The direction is read from the two names.

Needs: The input file. It reads no bus.

Maturity: beta.

A script made from a recording loses the timing. A recording made from a script has every line at the start, so it plays back with no waits.

$ dbusdo convert morning.dbusdo morning.dbusdo-script
$ dbusdo convert setup.dbusdo-script setup.dbusdo

dbusdo help

Every command in detail, or one command or group in full

dbusdo help [<command> | <group>]
  • [<command> | <group>]: A command or a group of commands. Without one, every command is listed.

Needs: Nothing. It reads no bus and no file.

Maturity: stable.

Three forms of help come from one registry: --help gives the flags and a table of commands, help gives every command with its syntax, and help <command> gives one command in full. On a name it doesn't know, it says so and lists the names it does.

$ dbusdo help
$ dbusdo help retry
$ dbusdo help scripting