Products › lamco-dbus-tools › Docs
dbuskeep commands: The D-Bus rolling record and kernel part
dbuskeep commands: The reference for run, status, kernel and kernel-status, the service that keeps the last minutes of D-Bus traffic, and its kernel part.
Generated from the help registry, as the man page dbuskeep(1) is. Don't edit: Change the registry and regenerate with LAMCO_DBUS_TOOLS_UPDATE_SNAPSHOTS=1 cargo test.
The optional service that keeps a rolling record. No other program requires it.
It may hold commands of these layers: ask the bus, listen, kernel.
Usage: dbuskeep [FLAGS] <command> [arguments]
Flags every program takes are in exit codes and flags.
dbuskeep run
Keep the last minutes of a bus with one monitor, and answer the other programs over a socket of its own
dbuskeep run [--bus <session|system> | --address <address>] [--window <seconds>] [--held-cap <MiB>] [--accept-known-flaw] [--socket <path>]
--bus <session|system>: Which bus. Default: session.--address <address>: A bus by its address.--window <seconds>: How much to keep. Default: 300.--held-cap <MiB>: The most of it to hold, the oldest let go first past it. Default: 64.--accept-known-flaw: Listen to a system bus whose dbus-daemon is older than 1.16.4, as for dbussee record.--socket <path>: Answer at this socket, in place of the one named by the bus's id.
Needs: A bus this user may monitor: The session bus as its user, the system bus as root.
Layer: listen. Maturity: beta.
One monitor of the whole bus, whatever number of programs read from it. The messages of the last --window seconds are kept, as the bus sent them, with who owned each name as of the oldest. The socket is named by the bus's id: $XDG_RUNTIME_DIR/lamco-dbus-tools/keep/<id>.sock for a user's service, /run/lamco-dbus-tools/keep/<id>.sock for the system's, and never on the bus it watches. A user's service answers that user and root; the system's, root and the group lamco-dbus-monitor, which the helper trusts already. dbussee record finds it by the bus's id and reads through it, with its --service and --match rules applied by the service as the bus would apply them to a monitor; a ring starts from what it kept. A reader that falls behind by more than its budget is cut off and told so, as a recorder's own guard lets go, so no reader can make the others or the bus wait. It stops on SIGINT or SIGTERM and removes its socket. Units for a user's and the system's service are in packaging/systemd.
$ dbuskeep run
$ dbuskeep run --window 900
dbuskeep status
Whether a service keeps this bus, and what it holds
dbuskeep status [--bus <session|system> | --address <address>]
--bus <session|system>: Which bus. Default: session.--address <address>: A bus by its address.
Needs: A bus, to read its id.
Layer: ask the bus. Maturity: beta.
Asks the bus for its id, then the service named by it: Its process and version, how many messages and bytes it holds and from how long ago, how many it has read, and how many readers it has now. Exits 1 when no service keeps the bus, or it refuses.
$ dbuskeep status
$ dbuskeep --json status --bus system
dbuskeep kernel
Load the kernel-level hooks, which stamp every message at each bus socket it crosses, and keep their events for the other programs
dbuskeep kernel [--window <seconds>] [--max-events <n>] [--refuse <cgroup>=<socket>]... [--socket <path>]
--window <seconds>: How much to keep. Default: 600.--max-events <n>: The most events to hold, the oldest let go first past it. Default: 2000000.--refuse <cgroup>=<socket>: Refuse connections to the bus at <socket> from the cgroup <cgroup>, its path under /sys/fs/cgroup, and every cgroup under it. May be given more than once. Needs bpf among the kernel's active security modules.--socket <path>: Answer at this socket, in place of /run/lamco-dbus-tools/keep/kernel.sock.
Needs: A build with the kernel feature, a kernel that describes its own types (/sys/kernel/btf/vmlinux), and CAP_BPF with CAP_PERFMON: Root, or a service given exactly those two, as the system unit does. On x86_64 from kernel 5.5, on 64-bit ARM from 6.0. The 64-bit ARM programs have run only under emulation.
Layer: kernel. Maturity: experimental. Needs privilege. Changes the bus or the machine.
Hooks on the kernel's unix_stream_sendmsg and unix_stream_recvmsg, at the start and end of each, so every write to and read from a local stream socket on the machine passes them while this runs: That's the cost, measured on 2026-12-01. A socket is a bus's when its address, or its peer's, is one this service was told of; for those it reports each D-Bus message that starts in the bytes moved, with its serial, its reply serial and the kernel's clock when the write or read began and ended. It keeps nothing of a message's content. dbussee record --kernel tells it of a bus and fetches that bus's events for the recording's span. A bus's events go only to whoever may read that bus: The system bus's to root and the group lamco-dbus-monitor, any other's to the user whose socket it is, and root. --refuse adds the one decision this layer makes: A connection refused with EPERM, before the bus sees it. It honors a refusal by any security module before it. It stops on SIGINT or SIGTERM, and the hooks are gone with it: Nothing is pinned. The unit is packaging/systemd/system/dbuskeep-kernel.service.
$ dbuskeep kernel
$ dbuskeep kernel --refuse /user.slice/user-1000.slice/user@1000.service/app.slice/untrusted.slice=/run/user/1000/bus
dbuskeep kernel-status
Whether the kernel-level part runs, and what it holds
dbuskeep kernel-status
Needs: Nothing: It asks dbuskeep kernel's socket, or the one LAMCO_DBUS_TOOLS_KERNEL_SOCKET names.
Layer: ask the bus. Maturity: experimental.
Its process and version, how many buses it watches and whether it refuses any connections, the events it holds and has read, and three counts from the hooks: Events the ring had no room for, places a message was due and its header wasn't there, and headers split across two buffers of a write, which are skipped. Exits 1 when it isn't running.
$ dbuskeep kernel-status
$ dbuskeep --json kernel-status
dbuskeep help
Every command in detail, or one command or group in full
dbuskeep 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.
$ dbuskeep help
$ dbuskeep help run