Back to main site | Back to man page index

BUSCTL(1)                                               busctl                                              BUSCTL(1)



NAME
       busctl - Introspect the bus

SYNOPSIS
       busctl [OPTIONS...] [COMMAND] [NAME...]

DESCRIPTION
       busctl may be used to introspect and monitor the D-Bus bus.

OPTIONS
       The following options are understood:

       --address=ADDRESS
           Connect to the bus specified by ADDRESS instead of using suitable defaults for the system bus (see
           --system option).

       --show-machine
           When showing the list of endpoints, show a column containing the names of containers they belong to. See
           systemd-machined.service(8).

       --unique
           When showing the list of endpoints, show only "unique" names (of the form ":number.number").

       --acquired
           The opposite of --unique — only "well-known" names will be shown.

       --activatable
           When showing the list of endpoints, show only endpoints which have actually not been activated yet, but
           may be started automatically if accessed.

       --match=MATCH
           When showing messages being exchanged, show only the subset matching MATCH.

       --size=
           When used with the capture command specifies the maximum bus message size to capture ("snaplen"). Defaults
           to 4096 bytes.

       --list
           When used with the tree command shows a flat list of object paths instead of a tree.

       --quiet
           When used with the call command suppresses display of the response message payload. Note that even if this
           option is specified errors returned will still be printed and the tool will indicate success or failure
           with the process exit code.

       --verbose
           When used with the call or get-property command shows output in a more verbose format.

       --expect-reply=BOOL
           When used with the call command specifies whether busctl shall wait for completion of the method call,
           output the returned method response data, and return success or failure via the process exit code. If this
           is set to "no" the method call will be issued but no response is expected, the tool terminates
           immediately, and thus no response can be shown, and no success or failure is returned via the exit code.
           To only suppress output of the reply message payload use --quiet above. Defaults to "yes".

       --auto-start=BOOL

       --augment-creds=BOOL
           Controls whether credential data reported by list or status shall be augmented with data from /proc. When
           this is turned on the data shown is possibly inconsistent, as the data read from /proc might be more
           recent than rest of the credential information. Defaults to "yes".

       --system
           Talk to the service manager of the system. This is the implied default.

       -H, --host=
           Execute the operation remotely. Specify a hostname, or a username and hostname separated by "@", to
           connect to. The hostname may optionally be suffixed by a container name, separated by ":", which connects
           directly to a specific container on the specified host. This will use SSH to talk to the remote machine
           manager instance. Container names may be enumerated with machinectl -H HOST.

       -M, --machine=
           Execute operation on a local container. Specify a container name to connect to.

       --no-pager
           Do not pipe output into a pager.

       --no-legend
           Do not print the legend, i.e. column headers and the footer with hints.

       -h, --help
           Print a short help text and exit.

       --version
           Print a short version string and exit.

COMMANDS
       The following commands are understood:

       list
           Show service names on the bus. This is the default if no command is specified.

       status [SERVICE]
           Show process information and credentials of a bus service (if one is specified by its unique or well-known
           name), a process (if one is specified by its numeric PID), or the owner of the bus (if no parameter is
           specified).

       monitor [SERVICE...]
           Dump messages being exchanged. If SERVICE is specified, show messages to or from this endpoint. Otherwise,
           show all messages on the bus. Use Ctrl-C to terminate dump.

       capture [SERVICE...]
           Similar to monitor but writes the output in pcap format (for details see the Libpcap File Format[1]
           description. Make sure to redirect the output to STDOUT to a file. Tools like wireshark(1) may be used to
           dissect and view the generated files.

       tree [SERVICE...]
           Shows an object tree of one or more services. If SERVICE is specified, show object tree of the specified
           services only. Otherwise, show all object trees of all services on the bus that acquired at least one
           well-known name.

       get-property SERVICE OBJECT INTERFACE PROPERTY...
           Retrieve the current value of one or more object properties. Takes a service name, object path, interface
           name and property name. Multiple properties may be specified at once in which case their values will be
           shown one after the other, separated by newlines. The output is by default in terse format. Use --verbose
           for a more elaborate output format.

       set-property SERVICE OBJECT INTERFACE PROPERTY SIGNATURE ARGUMENT...
           Set the current value an object property. Takes a service name, object path, interface name, property
           name, property signature, followed by a list of parameters formatted as strings.

       help
           Show command syntax help.

PARAMETER FORMATTING
       The call and set-property commands take a signature string followed by a list of parameters formatted as
       string (for details on D-Bus signature strings see the Type system chapter of the D-Bus specification[2]). For
       simple types each parameter following the signature should simply be the parameter's value formatted as
       string. Positive boolean values may be formatted as "true", "yes", "on", "1"; negative boolean values may be
       specified as "false", "no", "off", "0". For arrays, a numeric argument for the number of entries followed by
       the entries shall be specified. For variants the signature of the contents shall be specified, followed by the
       contents. For dictionaries and structs the contents of them shall be directly specified.

       For example,

           s jawoll

       is the formatting of a single string "jawoll".

           as 3 hello world foobar

       is the formatting of a string array with three entries, "hello", "world" and "foobar".

           a{sv} 3 One s Eins Two u 2 Yes b true

       is the formatting of a dictionary array that maps strings to variants, consisting of three entries. The string
       "One" is assigned the string "Eins". The string "Two" is assigned the 32bit unsigned integer 2. The string
       "Yes" is assigned a positive boolean.

       Note that the call, get-property, introspect commands will also generate output in this format for the
       returned data. Since this format is sometimes too terse to be easily understood, the call and get-property
       commands may generate a more verbose, multi-line output when passed the --verbose option.

EXAMPLES
       Example 1. Write and Read a Property

       The following two commands first write a property and then read it back. The property is found on the
       "/org/freedesktop/systemd1" object of the "org.freedesktop.systemd1" service. The name of the property is
       "LogLevel" on the "org.freedesktop.systemd1.Manager" interface. The property contains a single string:

           # busctl set-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager LogLevel s debug
           # busctl get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager LogLevel
           s "debug"

       Example 2. Terse and Verbose Output
       Example 3. Invoking a Method

       The following command invokes a the "StartUnit" method on the "org.freedesktop.systemd1.Manager" interface of
       the "/org/freedesktop/systemd1" object of the "org.freedesktop.systemd1" service, and passes it two strings
       "cups.service" and "replace". As result of the method call a single object path parameter is received and
       shown:

           # busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager StartUnit ss "cups.service" "replace"
           o "/org/freedesktop/systemd1/job/42684"

SEE ALSO
       dbus-daemon(1), D-Bus[3], kdbus[4], sd-bus(3), systemd(1), systemd-bus-proxyd(8), machinectl(1), wireshark(1)

NOTES
        1. Libpcap File Format
           http://wiki.wireshark.org/Development/LibpcapFileFormat

        2. Type system chapter of the D-Bus specification
           http://dbus.freedesktop.org/doc/dbus-specification.html#type-system

        3. D-Bus
           http://freedesktop.org/wiki/Software/dbus

        4. kdbus
           https://code.google.com/p/d-bus/



systemd 219                                                                                                 BUSCTL(1)