2018-07-03 00:15:39 +03:00
<?xml version='1.0'?>
2019-03-14 16:40:58 +03:00
< !DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
2023-12-25 17:48:33 +03:00
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
2020-11-09 07:23:58 +03:00
<!-- SPDX - License - Identifier: LGPL - 2.1 - or - later -->
2014-01-12 08:44:34 +04:00
2014-02-13 23:33:51 +04:00
<refentry id= "busctl"
xmlns:xi="http://www.w3.org/2001/XInclude">
2014-01-12 08:44:34 +04:00
<refentryinfo >
<title > busctl</title>
<productname > systemd</productname>
</refentryinfo>
<refmeta >
<refentrytitle > busctl</refentrytitle>
<manvolnum > 1</manvolnum>
</refmeta>
<refnamediv >
<refname > busctl</refname>
<refpurpose > Introspect the bus</refpurpose>
</refnamediv>
<refsynopsisdiv >
<cmdsynopsis >
<command > busctl</command>
<arg choice= "opt" rep= "repeat" > OPTIONS</arg>
<arg choice= "opt" > COMMAND</arg>
<arg choice= "opt" rep= "repeat" > <replaceable > NAME</replaceable> </arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1 >
<title > Description</title>
<para > <command > busctl</command> may be used to
introspect and monitor the D-Bus bus.</para>
</refsect1>
2019-10-08 18:58:44 +03:00
<refsect1 >
<title > Commands</title>
<para > The following commands are understood:</para>
<variablelist >
<varlistentry >
2024-01-18 16:45:24 +03:00
<term > <command > list</command> </term>
2019-10-08 18:58:44 +03:00
<listitem > <para > Show all peers on the bus, by their service
names. By default, shows both unique and well-known names, but
this may be changed with the <option > --unique</option> and
<option > --acquired</option> switches. This is the default
2023-08-22 19:52:36 +03:00
operation if no command is specified.</para>
<xi:include href= "version-info.xml" xpointer= "v209" /> </listitem>
2019-10-08 18:58:44 +03:00
</varlistentry>
<varlistentry >
2024-01-18 16:45:24 +03:00
<term > <command > status</command> <arg choice= "opt" > <replaceable > SERVICE</replaceable> </arg> </term>
2019-10-08 18:58:44 +03:00
<listitem > <para > 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
2023-08-22 19:52:36 +03:00
specified).</para>
2023-09-18 18:03:38 +03:00
<xi:include href= "version-info.xml" xpointer= "v209" /> </listitem>
2019-10-08 18:58:44 +03:00
</varlistentry>
<varlistentry >
2024-01-18 16:45:24 +03:00
<term > <command > monitor</command> <arg choice= "opt" rep= "repeat" > <replaceable > SERVICE</replaceable> </arg> </term>
2019-10-08 18:58:44 +03:00
<listitem > <para > Dump messages being exchanged. If
<replaceable > SERVICE</replaceable> is specified, show messages
to or from this peer, identified by its well-known or unique
name. Otherwise, show all messages on the bus. Use
<keycombo > <keycap > Ctrl</keycap> <keycap > C</keycap> </keycombo>
2023-08-22 19:52:36 +03:00
to terminate the dump.</para>
2023-09-18 18:03:38 +03:00
<xi:include href= "version-info.xml" xpointer= "v209" /> </listitem>
2019-10-08 18:58:44 +03:00
</varlistentry>
<varlistentry >
2024-01-18 16:45:24 +03:00
<term > <command > capture</command> <arg choice= "opt" rep= "repeat" > <replaceable > SERVICE</replaceable> </arg> </term>
2019-10-08 18:58:44 +03:00
<listitem > <para > Similar to <command > monitor</command> but
2021-12-25 09:07:40 +03:00
writes the output in pcapng format (for details, see
<ulink url= "https://github.com/pcapng/pcapng/" >
PCAP Next Generation (pcapng) Capture File Format</ulink> ).
Make sure to redirect standard output to a file or pipe. Tools like
2019-10-08 18:58:44 +03:00
<citerefentry project= 'die-net' > <refentrytitle > wireshark</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry>
may be used to dissect and view the resulting
2023-08-22 19:52:36 +03:00
files.</para>
<xi:include href= "version-info.xml" xpointer= "v218" /> </listitem>
2019-10-08 18:58:44 +03:00
</varlistentry>
<varlistentry >
2024-01-18 16:45:24 +03:00
<term > <command > tree</command> <arg choice= "opt" rep= "repeat" > <replaceable > SERVICE</replaceable> </arg> </term>
2019-10-08 18:58:44 +03:00
<listitem > <para > Shows an object tree of one or more
services. If <replaceable > SERVICE</replaceable> is specified,
show object tree of the specified services only. Otherwise,
show all object trees of all services on the bus that acquired
2023-08-22 19:52:36 +03:00
at least one well-known name.</para>
<xi:include href= "version-info.xml" xpointer= "v218" /> </listitem>
2019-10-08 18:58:44 +03:00
</varlistentry>
<varlistentry >
2024-01-18 16:45:24 +03:00
<term > <command > introspect</command> <arg choice= "plain" > <replaceable > SERVICE</replaceable> </arg> <arg choice= "plain" > <replaceable > OBJECT</replaceable> </arg> <arg choice= "opt" > <replaceable > INTERFACE</replaceable> </arg> </term>
2019-10-08 18:58:44 +03:00
<listitem > <para > Show interfaces, methods, properties and
signals of the specified object (identified by its path) on
the specified service. If the interface argument is passed, the
output is limited to members of the specified
2023-08-22 19:52:36 +03:00
interface.</para>
2023-09-18 18:03:38 +03:00
<xi:include href= "version-info.xml" xpointer= "v218" /> </listitem>
2019-10-08 18:58:44 +03:00
</varlistentry>
<varlistentry >
2024-01-18 16:45:24 +03:00
<term > <command > call</command> <arg choice= "plain" > <replaceable > SERVICE</replaceable> </arg> <arg choice= "plain" > <replaceable > OBJECT</replaceable> </arg> <arg choice= "plain" > <replaceable > INTERFACE</replaceable> </arg> <arg choice= "plain" > <replaceable > METHOD</replaceable> </arg> <arg choice= "opt" > <replaceable > SIGNATURE</replaceable> <arg choice= "opt" rep= "repeat" > <replaceable > ARGUMENT</replaceable> </arg> </arg> </term>
2019-10-08 18:58:44 +03:00
<listitem > <para > Invoke a method and show the response. Takes a
service name, object path, interface name and method name. If
parameters shall be passed to the method call, a signature
string is required, followed by the arguments, individually
formatted as strings. For details on the formatting used, see
below. To suppress output of the returned data, use the
2023-08-22 19:52:36 +03:00
<option > --quiet</option> option.</para>
<xi:include href= "version-info.xml" xpointer= "v218" /> </listitem>
2019-10-08 18:58:44 +03:00
</varlistentry>
<varlistentry >
2024-01-18 16:45:24 +03:00
<term > <command > emit</command> <arg choice= "plain" > <replaceable > OBJECT</replaceable> </arg> <arg choice= "plain" > <replaceable > INTERFACE</replaceable> </arg> <arg choice= "plain" > <replaceable > SIGNAL</replaceable> </arg> <arg choice= "opt" > <replaceable > SIGNATURE</replaceable> <arg choice= "opt" rep= "repeat" > <replaceable > ARGUMENT</replaceable> </arg> </arg> </term>
2019-10-08 18:58:44 +03:00
2021-06-30 15:26:47 +03:00
<listitem > <para > Emit a signal. Takes an object path, interface name and method name. If parameters
2019-10-08 18:58:44 +03:00
shall be passed, a signature string is required, followed by the arguments, individually formatted as
strings. For details on the formatting used, see below. To specify the destination of the signal,
2023-08-22 19:52:36 +03:00
use the <option > --destination=</option> option.</para>
<xi:include href= "version-info.xml" xpointer= "v242" /> </listitem>
2019-10-08 18:58:44 +03:00
</varlistentry>
<varlistentry >
2024-01-18 16:45:24 +03:00
<term > <command > get-property</command> <arg choice= "plain" > <replaceable > SERVICE</replaceable> </arg> <arg choice= "plain" > <replaceable > OBJECT</replaceable> </arg> <arg choice= "plain" > <replaceable > INTERFACE</replaceable> </arg> <arg choice= "plain" rep= "repeat" > <replaceable > PROPERTY</replaceable> </arg> </term>
2019-10-08 18:58:44 +03:00
<listitem > <para > 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 <option > --verbose</option> for a
2023-08-22 19:52:36 +03:00
more elaborate output format.</para>
<xi:include href= "version-info.xml" xpointer= "v218" /> </listitem>
2019-10-08 18:58:44 +03:00
</varlistentry>
<varlistentry >
2024-01-18 16:45:24 +03:00
<term > <command > set-property</command> <arg choice= "plain" > <replaceable > SERVICE</replaceable> </arg> <arg choice= "plain" > <replaceable > OBJECT</replaceable> </arg> <arg choice= "plain" > <replaceable > INTERFACE</replaceable> </arg> <arg choice= "plain" > <replaceable > PROPERTY</replaceable> </arg> <arg choice= "plain" > <replaceable > SIGNATURE</replaceable> </arg> <arg choice= "plain" rep= "repeat" > <replaceable > ARGUMENT</replaceable> </arg> </term>
2019-10-08 18:58:44 +03:00
<listitem > <para > Set the current value of an object
property. Takes a service name, object path, interface name,
property name, property signature, followed by a list of
2023-08-22 19:52:36 +03:00
parameters formatted as strings.</para>
<xi:include href= "version-info.xml" xpointer= "v218" /> </listitem>
2019-10-08 18:58:44 +03:00
</varlistentry>
<varlistentry >
2024-01-18 16:45:24 +03:00
<term > <command > help</command> </term>
2019-10-08 18:58:44 +03:00
2023-08-22 19:52:36 +03:00
<listitem > <para > Show command syntax help.</para>
<xi:include href= "version-info.xml" xpointer= "v209" /> </listitem>
2019-10-08 18:58:44 +03:00
</varlistentry>
</variablelist>
</refsect1>
2014-01-12 08:44:34 +04:00
<refsect1 >
<title > Options</title>
<para > The following options are understood:</para>
<variablelist >
<varlistentry >
<term > <option > --address=<replaceable > ADDRESS</replaceable> </option> </term>
<listitem > <para > Connect to the bus specified by
<replaceable > ADDRESS</replaceable> instead of using suitable
defaults for either the system or user bus (see
<option > --system</option> and <option > --user</option>
2023-08-22 19:52:36 +03:00
options).</para>
<xi:include href= "version-info.xml" xpointer= "v209" /> </listitem>
2014-01-12 08:44:34 +04:00
</varlistentry>
<varlistentry >
<term > <option > --show-machine</option> </term>
2015-06-19 23:29:29 +03:00
<listitem > <para > When showing the list of peers, show a
2014-01-12 08:44:34 +04:00
column containing the names of containers they belong to.
See
<citerefentry > <refentrytitle > systemd-machined.service</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> .
2023-08-22 19:52:36 +03:00
</para>
<xi:include href= "version-info.xml" xpointer= "v209" /> </listitem>
2014-01-12 08:44:34 +04:00
</varlistentry>
<varlistentry >
<term > <option > --unique</option> </term>
2015-06-19 23:29:29 +03:00
<listitem > <para > When showing the list of peers, show only
"unique" names (of the form
2014-01-12 08:44:34 +04:00
<literal > :<replaceable > number</replaceable> .<replaceable > number</replaceable> </literal> ).
2023-08-22 19:52:36 +03:00
</para>
<xi:include href= "version-info.xml" xpointer= "v209" /> </listitem>
2014-01-12 08:44:34 +04:00
</varlistentry>
<varlistentry >
<term > <option > --acquired</option> </term>
<listitem > <para > The opposite of <option > --unique</option> —
2023-08-22 19:52:36 +03:00
only "well-known" names will be shown.</para>
<xi:include href= "version-info.xml" xpointer= "v209" /> </listitem>
2014-01-12 08:44:34 +04:00
</varlistentry>
<varlistentry >
<term > <option > --activatable</option> </term>
2015-06-19 23:29:29 +03:00
<listitem > <para > When showing the list of peers, show only
peers which have actually not been activated yet, but may be
started automatically if accessed.</para>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v209" />
2014-01-12 08:44:34 +04:00
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --match=<replaceable > MATCH</replaceable> </option> </term>
<listitem > <para > When showing messages being exchanged, show only the
2016-06-24 16:32:57 +03:00
subset matching <replaceable > MATCH</replaceable> .
See
<citerefentry > <refentrytitle > sd_bus_add_match</refentrytitle> <manvolnum > 3</manvolnum> </citerefentry> .
2023-08-22 19:52:36 +03:00
</para>
<xi:include href= "version-info.xml" xpointer= "v209" /> </listitem>
2014-01-12 08:44:34 +04:00
</varlistentry>
2014-02-13 23:33:51 +04:00
2014-10-30 03:13:11 +03:00
<varlistentry >
<term > <option > --size=</option> </term>
<listitem >
2014-08-03 09:11:12 +04:00
<para > When used with the <command > capture</command> command,
2014-10-30 03:13:11 +03:00
specifies the maximum bus message size to capture
("snaplen"). Defaults to 4096 bytes.</para>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v218" />
2014-10-30 03:13:11 +03:00
</listitem>
</varlistentry>
2014-11-10 21:24:48 +03:00
<varlistentry >
<term > <option > --list</option> </term>
<listitem >
2014-08-03 09:11:12 +04:00
<para > When used with the <command > tree</command> command, shows a
2014-11-10 21:24:48 +03:00
flat list of object paths instead of a tree.</para>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v218" />
2014-11-10 21:24:48 +03:00
</listitem>
</varlistentry>
2014-11-14 15:11:10 +03:00
<varlistentry >
2017-12-04 15:02:09 +03:00
<term > <option > -q</option> </term>
2014-11-14 15:11:10 +03:00
<term > <option > --quiet</option> </term>
<listitem >
2014-08-03 09:11:12 +04:00
<para > When used with the <command > call</command> command,
2014-11-21 22:13:26 +03:00
suppresses display of the response message payload. Note that even
2014-08-03 09:11:12 +04:00
if this option is specified, errors returned will still be
2014-11-21 22:13:26 +03:00
printed and the tool will indicate success or failure with
the process exit code.</para>
2023-09-18 18:03:38 +03:00
<xi:include href= "version-info.xml" xpointer= "v218" />
2014-11-14 15:11:10 +03:00
</listitem>
</varlistentry>
2014-11-21 01:12:29 +03:00
<varlistentry >
<term > <option > --verbose</option> </term>
<listitem >
<para > When used with the <command > call</command> or
2014-08-03 09:11:12 +04:00
<command > get-property</command> command, shows output in a
2014-11-21 01:12:29 +03:00
more verbose format.</para>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v218" />
2014-11-21 01:12:29 +03:00
</listitem>
</varlistentry>
2019-04-21 23:23:45 +03:00
<varlistentry >
<term > <option > --xml-interface</option> </term>
<listitem >
<para > When used with the <command > introspect</command> call, dump the XML description received from
the D-Bus <constant > org.freedesktop.DBus.Introspectable.Introspect</constant> call instead of the
normal output.</para>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v243" />
2019-04-21 23:23:45 +03:00
</listitem>
</varlistentry>
2018-07-04 16:28:09 +03:00
<varlistentry >
2024-04-12 12:12:15 +03:00
<term > <option > --json=<replaceable > MODE</replaceable> </option> </term>
2018-07-04 16:28:09 +03:00
<listitem >
<para > When used with the <command > call</command> or <command > get-property</command> command, shows output
formatted as JSON. Expects one of <literal > short</literal> (for the shortest possible output without any
redundant whitespace or line breaks) or <literal > pretty</literal> (for a pretty version of the same, with
indentation and line breaks). Note that transformation from D-Bus marshalling to JSON is done in a loss-less
way, which means type information is embedded into the JSON object tree.</para>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v240" />
2018-07-04 16:28:09 +03:00
</listitem>
</varlistentry>
<varlistentry >
<term > <option > -j</option> </term>
<listitem >
<para > Equivalent to <option > --json=pretty</option> when invoked interactively from a terminal. Otherwise
equivalent to <option > --json=short</option> , in particular when the output is piped to some other
program.</para>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v240" />
2018-07-04 16:28:09 +03:00
</listitem>
</varlistentry>
2014-11-21 22:13:26 +03:00
<varlistentry >
2024-04-12 12:12:15 +03:00
<term > <option > --expect-reply=<replaceable > BOOL</replaceable> </option> </term>
2014-11-21 22:13:26 +03:00
<listitem >
2014-08-03 09:11:12 +04:00
<para > When used with the <command > call</command> command,
2014-11-21 22:13:26 +03:00
specifies whether <command > busctl</command> shall wait for
completion of the method call, output the returned method
response data, and return success or failure via the process
2014-08-03 09:11:12 +04:00
exit code. If this is set to <literal > no</literal> , the
2014-11-21 22:13:26 +03:00
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
2014-08-03 09:11:12 +04:00
code. To only suppress output of the reply message payload,
2014-11-21 22:13:26 +03:00
use <option > --quiet</option> above. Defaults to
<literal > yes</literal> .</para>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v218" />
2014-11-21 22:13:26 +03:00
</listitem>
</varlistentry>
<varlistentry >
2024-04-12 12:12:15 +03:00
<term > <option > --auto-start=<replaceable > BOOL</replaceable> </option> </term>
2014-11-21 22:13:26 +03:00
<listitem >
2019-02-02 20:01:05 +03:00
<para > When used with the <command > call</command> or <command > emit</command> command, specifies
2014-11-21 22:13:26 +03:00
whether the method call should implicitly activate the
2014-08-03 09:11:12 +04:00
called service, should it not be running yet but is
2014-11-21 22:13:26 +03:00
configured to be auto-started. Defaults to
<literal > yes</literal> .</para>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v218" />
2014-11-21 22:13:26 +03:00
</listitem>
</varlistentry>
<varlistentry >
2024-04-12 12:12:15 +03:00
<term > <option > --allow-interactive-authorization=<replaceable > BOOL</replaceable> </option> </term>
2014-11-21 22:13:26 +03:00
<listitem >
2014-08-03 09:11:12 +04:00
<para > When used with the <command > call</command> command,
2014-11-21 22:13:26 +03:00
specifies whether the services may enforce interactive
authorization while executing the operation, if the security
policy is configured for this. Defaults to
<literal > yes</literal> .</para>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v218" />
2014-11-21 22:13:26 +03:00
</listitem>
</varlistentry>
2014-11-21 22:31:50 +03:00
<varlistentry >
2024-04-12 12:12:15 +03:00
<term > <option > --timeout=<replaceable > SECS</replaceable> </option> </term>
2014-11-21 22:31:50 +03:00
<listitem >
2024-08-07 22:41:20 +03:00
<para > When used with the <command > call</command> command, specifies the maximum time to wait for
method call completion. When used with the <command > monitor</command> command, since version v257,
specifies the maximum time to wait for messages before automatically exiting. If no time unit is
specified, assumes seconds. The usual other units are understood, too (ms, us, s, min, h, d, w,
month, y). Note that this timeout does not apply if <option > --expect-reply=no</option> is used,
when combined with the <command > call</command> command, as the tool does not wait for any reply
message then. When not specified or when set to 0, the default of <literal > 25s</literal> is
assumed for the <command > call</command> command, and it is disabled for the
<command > monitor</command> command.</para>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v218" />
2014-11-21 22:31:50 +03:00
</listitem>
</varlistentry>
2024-08-07 23:59:26 +03:00
<varlistentry >
<term > <option > --num-matches=<replaceable > NUMBER</replaceable> </option> </term>
<listitem >
<para > When used with the <command > monitor</command> command, if enabled will make
<command > busctl</command> exit when the specified number of messages have been received and
printed. This is useful in combination with <option > --match=</option> , to wait for the specified
number of occurrences of specific D-Bus messages.</para>
<xi:include href= "version-info.xml" xpointer= "v257" />
</listitem>
</varlistentry>
2014-11-24 23:53:29 +03:00
<varlistentry >
2024-04-12 12:12:15 +03:00
<term > <option > --augment-creds=<replaceable > BOOL</replaceable> </option> </term>
2014-11-24 23:53:29 +03:00
<listitem >
<para > Controls whether credential data reported by
<command > list</command> or <command > status</command> shall
be augmented with data from
2020-10-05 19:08:21 +03:00
<filename > /proc/</filename> . When this is turned on, the data
2014-11-24 23:53:29 +03:00
shown is possibly inconsistent, as the data read from
2020-10-05 19:08:21 +03:00
<filename > /proc/</filename> might be more recent than the rest of
2014-11-24 23:53:29 +03:00
the credential information. Defaults to <literal > yes</literal> .</para>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v218" />
2014-11-24 23:53:29 +03:00
</listitem>
</varlistentry>
2017-12-16 00:19:34 +03:00
<varlistentry >
2024-04-12 12:12:15 +03:00
<term > <option > --watch-bind=<replaceable > BOOL</replaceable> </option> </term>
2017-12-16 00:19:34 +03:00
<listitem >
<para > Controls whether to wait for the specified <constant > AF_UNIX</constant> bus socket to appear in the
file system before connecting to it. Defaults to off. When enabled, the tool will watch the file system until
the socket is created and then connect to it.</para>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v237" />
2017-12-16 00:19:34 +03:00
</listitem>
</varlistentry>
2019-02-02 20:01:05 +03:00
<varlistentry >
2024-04-12 12:12:15 +03:00
<term > <option > --destination=<replaceable > SERVICE</replaceable> </option> </term>
2019-02-02 20:01:05 +03:00
<listitem >
<para > Takes a service name. When used with the <command > emit</command> command, a signal is
emitted to the specified service.</para>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v242" />
2019-02-02 20:01:05 +03:00
</listitem>
</varlistentry>
2014-02-13 23:40:40 +04:00
<xi:include href= "user-system-options.xml" xpointer= "user" />
<xi:include href= "user-system-options.xml" xpointer= "system" />
2014-02-21 04:47:03 +04:00
<xi:include href= "user-system-options.xml" xpointer= "host" />
<xi:include href= "user-system-options.xml" xpointer= "machine" />
2024-01-03 21:29:23 +03:00
<xi:include href= "user-system-options.xml" xpointer= "capsule" />
2014-02-13 23:40:40 +04:00
2020-01-10 06:19:47 +03:00
<varlistentry >
<term > <option > -l</option> </term>
<term > <option > --full</option> </term>
<listitem >
<para > Do not ellipsize the output in <command > list</command> command.</para>
2023-08-22 19:52:36 +03:00
<xi:include href= "version-info.xml" xpointer= "v245" />
2020-01-10 06:19:47 +03:00
</listitem>
</varlistentry>
2015-01-20 05:43:35 +03:00
<xi:include href= "standard-options.xml" xpointer= "no-pager" />
<xi:include href= "standard-options.xml" xpointer= "no-legend" />
2014-02-13 23:33:51 +04:00
<xi:include href= "standard-options.xml" xpointer= "help" />
<xi:include href= "standard-options.xml" xpointer= "version" />
2014-01-12 08:44:34 +04:00
</variablelist>
</refsect1>
2014-11-21 01:12:29 +03:00
<refsect1 >
2014-11-21 22:46:01 +03:00
<title > Parameter Formatting</title>
<para > The <command > call</command> and
<command > set-property</command> commands take a signature string
followed by a list of parameters formatted as string (for details
2014-08-03 09:11:12 +04:00
on D-Bus signature strings, see the <ulink
2022-06-28 13:00:47 +03:00
url="https://dbus.freedesktop.org/doc/dbus-specification.html#type-system">Type
2014-11-21 22:46:01 +03:00
system chapter of the D-Bus specification</ulink> ). For simple
2014-08-03 09:11:12 +04:00
types, each parameter following the signature should simply be the
2014-11-21 22:46:01 +03:00
parameter's value formatted as string. Positive boolean values may
be formatted as <literal > true</literal> , <literal > yes</literal> ,
2014-08-03 09:11:37 +04:00
<literal > on</literal> , or <literal > 1</literal> ; negative boolean
2014-11-21 22:46:01 +03:00
values may be specified as <literal > false</literal> ,
2014-08-03 09:11:37 +04:00
<literal > no</literal> , <literal > off</literal> , or
2014-11-21 22:46:01 +03:00
<literal > 0</literal> . For arrays, a numeric argument for the
number of entries followed by the entries shall be specified. For
2014-08-03 09:11:12 +04:00
variants, the signature of the contents shall be specified,
followed by the contents. For dictionaries and structs, the
2014-11-21 22:46:01 +03:00
contents of them shall be directly specified.</para>
<para > For example,
<programlisting > s jawoll</programlisting> is the formatting
of a single string <literal > jawoll</literal> .</para>
<para >
<programlisting > as 3 hello world foobar</programlisting>
is the formatting of a string array with three entries,
<literal > hello</literal> , <literal > world</literal> and
<literal > foobar</literal> .</para>
<para >
<programlisting > a{sv} 3 One s Eins Two u 2 Yes b true</programlisting>
is the formatting of a dictionary
array that maps strings to variants, consisting of three
entries. The string <literal > One</literal> is assigned the
string <literal > Eins</literal> . The string
2014-08-03 09:11:12 +04:00
<literal > Two</literal> is assigned the 32-bit unsigned
2014-11-21 22:46:01 +03:00
integer 2. The string <literal > Yes</literal> is assigned a
positive boolean.</para>
<para > Note that the <command > call</command> ,
<command > get-property</command> , <command > introspect</command>
commands will also generate output in this format for the returned
data. Since this format is sometimes too terse to be easily
understood, the <command > call</command> and
<command > get-property</command> commands may generate a more
verbose, multi-line output when passed the
<option > --verbose</option> option.</para>
2014-11-21 01:12:29 +03:00
</refsect1>
<refsect1 >
2014-11-21 22:46:01 +03:00
<title > Examples</title>
<example >
<title > Write and Read a Property</title>
<para > The following two commands first write a property and then
read it back. The property is found on the
<literal > /org/freedesktop/systemd1</literal> object of the
<literal > org.freedesktop.systemd1</literal> service. The name of
the property is <literal > LogLevel</literal> on the
<literal > org.freedesktop.systemd1.Manager</literal>
interface. The property contains a single string:</para>
<programlisting > # busctl set-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager LogLevel s debug
2014-11-21 01:12:29 +03:00
# busctl get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager LogLevel
s "debug"</programlisting>
2014-11-21 22:46:01 +03:00
</example>
2014-11-21 01:12:29 +03:00
2014-11-21 22:46:01 +03:00
<example >
<title > Terse and Verbose Output</title>
2014-11-21 01:12:29 +03:00
2014-11-21 22:46:01 +03:00
<para > The following two commands read a property that contains
an array of strings, and first show it in terse format, followed
by verbose format:</para>
2014-11-21 01:12:29 +03:00
2014-11-21 22:46:01 +03:00
<programlisting > $ busctl get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager Environment
2014-11-21 01:12:29 +03:00
as 2 "LANG=en_US.UTF-8" "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
$ busctl get-property --verbose org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager Environment
ARRAY "s" {
STRING "LANG=en_US.UTF-8";
STRING "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin";
};</programlisting>
2014-11-21 22:46:01 +03:00
</example>
<example >
<title > Invoking a Method</title>
2015-12-26 20:25:49 +03:00
<para > The following command invokes the
2014-11-21 22:46:01 +03:00
<literal > StartUnit</literal> method on the
<literal > org.freedesktop.systemd1.Manager</literal>
interface of the
<literal > /org/freedesktop/systemd1</literal> object
of the <literal > org.freedesktop.systemd1</literal>
service, and passes it two strings
<literal > cups.service</literal> and
2014-08-03 09:11:37 +04:00
<literal > replace</literal> . As a result of the method
2014-08-03 09:11:12 +04:00
call, a single object path parameter is received and
2014-11-21 22:46:01 +03:00
shown:</para>
<programlisting > # busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager StartUnit ss "cups.service" "replace"
2014-11-21 01:12:29 +03:00
o "/org/freedesktop/systemd1/job/42684"</programlisting>
2014-11-21 22:46:01 +03:00
</example>
2014-11-21 01:12:29 +03:00
</refsect1>
2014-01-12 08:44:34 +04:00
<refsect1 >
<title > See Also</title>
2023-12-22 21:09:32 +03:00
<para > <simplelist type= "inline" >
<member > <citerefentry project= 'dbus' > <refentrytitle > dbus-daemon</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry> </member>
<member > <ulink url= "https://www.freedesktop.org/wiki/Software/dbus" > D-Bus</ulink> </member>
<member > <citerefentry > <refentrytitle > sd-bus</refentrytitle> <manvolnum > 3</manvolnum> </citerefentry> </member>
<member > <citerefentry > <refentrytitle > varlinkctl</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry> </member>
<member > <citerefentry > <refentrytitle > systemd</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry> </member>
<member > <citerefentry > <refentrytitle > machinectl</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry> </member>
<member > <citerefentry project= 'die-net' > <refentrytitle > wireshark</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry> </member>
</simplelist> </para>
2014-01-12 08:44:34 +04:00
</refsect1>
</refentry>