busctl - Linux
Overview
busctl is a versatile tool for interacting with systemd’s D-Bus interface. It enables users to manage and inspect services, units, and other D-Bus objects.
Syntax
busctl [--quiet|--no-pager|--match-prefix|--match-end|--match-regex|--match-init-stats] COMMAND [OBJECT-PATH...] [METHOD-NAME...] [METHOD-ARGUMENTS...]
Options/Flags
- –quiet: Suppress general status output
- –no-pager: Disable pagination of output
- –match-prefix: Only show objects with matching prefixes
- –match-end: Only show objects with matching ends
- –match-regex: Filter objects based on a regular expression
- –match-init-stats: Filter objects based on initialization statistics
Examples
Inspect Service Status
busctl status org.freedesktop.systemd1
Start a Service
busctl start example.service
Introspection
busctl introspect org.freedesktop.systemd1 /org/freedesktop/systemd1
Common Issues
Permission Denied
Ensure you have sufficient privileges to access the D-Bus object or method.
Object Not Found
Verify that the object path or method name is correct.
Integration
busctl can be combined with other commands for advanced tasks:
# Monitor service changes
watch -d -n 5 'busctl status org.freedesktop.systemd1'
Related Commands
- systemctl: Control systemd services
- dbus-monitor: Monitor D-Bus traffic
- systemd D-Bus Interface Documentation