| 1 |
<?xml version='1.0'?> |
| 2 |
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
| 3 |
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> |
| 4 |
<!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
| 5 |
|
| 6 |
<refentry id="busctl" |
| 7 |
xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 8 |
|
| 9 |
<refentryinfo> |
| 10 |
<title>busctl</title> |
| 11 |
<productname>systemd</productname> |
| 12 |
</refentryinfo> |
| 13 |
|
| 14 |
<refmeta> |
| 15 |
<refentrytitle>busctl</refentrytitle> |
| 16 |
<manvolnum>1</manvolnum> |
| 17 |
</refmeta> |
| 18 |
|
| 19 |
<refnamediv> |
| 20 |
<refname>busctl</refname> |
| 21 |
<refpurpose>Introspect the bus</refpurpose> |
| 22 |
</refnamediv> |
| 23 |
|
| 24 |
<refsynopsisdiv> |
| 25 |
<cmdsynopsis> |
| 26 |
<command>busctl</command> |
| 27 |
<arg choice="opt" rep="repeat">OPTIONS</arg> |
| 28 |
<arg choice="opt">COMMAND</arg> |
| 29 |
<arg choice="opt" rep="repeat"><replaceable>NAME</replaceable></arg> |
| 30 |
</cmdsynopsis> |
| 31 |
</refsynopsisdiv> |
| 32 |
|
| 33 |
<refsect1> |
| 34 |
<title>Description</title> |
| 35 |
|
| 36 |
<para><command>busctl</command> may be used to |
| 37 |
introspect and monitor the D-Bus bus.</para> |
| 38 |
</refsect1> |
| 39 |
|
| 40 |
<refsect1> |
| 41 |
<title>Commands</title> |
| 42 |
|
| 43 |
<para>The following commands are understood:</para> |
| 44 |
|
| 45 |
<variablelist> |
| 46 |
<varlistentry> |
| 47 |
<term><command>list</command></term> |
| 48 |
|
| 49 |
<listitem><para>Show all peers on the bus, by their service |
| 50 |
names. By default, shows both unique and well-known names, but |
| 51 |
this may be changed with the <option>--unique</option> and |
| 52 |
<option>--acquired</option> switches. This is the default |
| 53 |
operation if no command is specified.</para> |
| 54 |
|
| 55 |
<xi:include href="version-info.xml" xpointer="v209"/></listitem> |
| 56 |
</varlistentry> |
| 57 |
|
| 58 |
<varlistentry> |
| 59 |
<term><command>status</command> <arg choice="opt"><replaceable>SERVICE</replaceable></arg></term> |
| 60 |
|
| 61 |
<listitem><para>Show process information and credentials of a |
| 62 |
bus service (if one is specified by its unique or well-known |
| 63 |
name), a process (if one is specified by its numeric PID), or |
| 64 |
the owner of the bus (if no parameter is |
| 65 |
specified).</para> |
| 66 |
|
| 67 |
<xi:include href="version-info.xml" xpointer="v209"/></listitem> |
| 68 |
</varlistentry> |
| 69 |
|
| 70 |
<varlistentry> |
| 71 |
<term><command>monitor</command> <arg choice="opt" rep="repeat"><replaceable>SERVICE</replaceable></arg></term> |
| 72 |
|
| 73 |
<listitem><para>Dump messages being exchanged. If |
| 74 |
<replaceable>SERVICE</replaceable> is specified, show messages |
| 75 |
to or from this peer, identified by its well-known or unique |
| 76 |
name. Otherwise, show all messages on the bus. Use |
| 77 |
<keycombo><keycap>Ctrl</keycap><keycap>C</keycap></keycombo> |
| 78 |
to terminate the dump or limit it with the <option>--limit-messages=</option> option.</para> |
| 79 |
|
| 80 |
<xi:include href="version-info.xml" xpointer="v209"/></listitem> |
| 81 |
</varlistentry> |
| 82 |
|
| 83 |
<varlistentry> |
| 84 |
<term><command>capture</command> <arg choice="opt" rep="repeat"><replaceable>SERVICE</replaceable></arg></term> |
| 85 |
|
| 86 |
<listitem><para>Similar to <command>monitor</command> but |
| 87 |
writes the output in pcapng format (for details, see |
| 88 |
<ulink url="https://github.com/pcapng/pcapng/"> |
| 89 |
PCAP Next Generation (pcapng) Capture File Format</ulink>). |
| 90 |
Make sure to redirect standard output to a file or pipe. Tools like |
| 91 |
<citerefentry project='die-net'><refentrytitle>wireshark</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
| 92 |
may be used to dissect and view the resulting |
| 93 |
files.</para> |
| 94 |
|
| 95 |
<xi:include href="version-info.xml" xpointer="v218"/></listitem> |
| 96 |
</varlistentry> |
| 97 |
|
| 98 |
<varlistentry> |
| 99 |
<term><command>tree</command> <arg choice="opt" rep="repeat"><replaceable>SERVICE</replaceable></arg></term> |
| 100 |
|
| 101 |
<listitem><para>Shows an object tree of one or more |
| 102 |
services. If <replaceable>SERVICE</replaceable> is specified, |
| 103 |
show object tree of the specified services only. Otherwise, |
| 104 |
show all object trees of all services on the bus that acquired |
| 105 |
at least one well-known name.</para> |
| 106 |
|
| 107 |
<xi:include href="version-info.xml" xpointer="v218"/></listitem> |
| 108 |
</varlistentry> |
| 109 |
|
| 110 |
<varlistentry> |
| 111 |
<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> |
| 112 |
|
| 113 |
<listitem><para>Show interfaces, methods, properties and |
| 114 |
signals of the specified object (identified by its path) on |
| 115 |
the specified service. If the interface argument is passed, the |
| 116 |
output is limited to members of the specified |
| 117 |
interface.</para> |
| 118 |
|
| 119 |
<xi:include href="version-info.xml" xpointer="v218"/></listitem> |
| 120 |
</varlistentry> |
| 121 |
|
| 122 |
<varlistentry> |
| 123 |
<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> |
| 124 |
|
| 125 |
<listitem><para>Invoke a method and show the response. Takes a |
| 126 |
service name, object path, interface name and method name. If |
| 127 |
parameters shall be passed to the method call, a signature |
| 128 |
string is required, followed by the arguments, individually |
| 129 |
formatted as strings. For details on the formatting used, see |
| 130 |
below. To suppress output of the returned data, use the |
| 131 |
<option>--quiet</option> option.</para> |
| 132 |
|
| 133 |
<xi:include href="version-info.xml" xpointer="v218"/></listitem> |
| 134 |
</varlistentry> |
| 135 |
|
| 136 |
<varlistentry> |
| 137 |
<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> |
| 138 |
|
| 139 |
<listitem><para>Emit a signal. Takes an object path, interface name and method name. If parameters |
| 140 |
shall be passed, a signature string is required, followed by the arguments, individually formatted as |
| 141 |
strings. For details on the formatting used, see below. To specify the destination of the signal, |
| 142 |
use the <option>--destination=</option> option.</para> |
| 143 |
|
| 144 |
<xi:include href="version-info.xml" xpointer="v242"/></listitem> |
| 145 |
</varlistentry> |
| 146 |
|
| 147 |
<varlistentry> |
| 148 |
<term><command>wait</command> <arg choice="opt"><replaceable>SERVICE</replaceable></arg> <arg choice="plain"><replaceable>OBJECT</replaceable></arg> <arg choice="plain"><replaceable>INTERFACE</replaceable></arg> <arg choice="plain"><replaceable>SIGNAL</replaceable></arg></term> |
| 149 |
|
| 150 |
<listitem><para>Wait for a signal. Takes an object path, interface name, and signal name. Use the |
| 151 |
<option>--limit-messages=</option> option to wait for more than just one signal before exiting. To |
| 152 |
suppress output of the returned data, use the <option>--quiet</option> option. The service name may |
| 153 |
be omitted, in which case <command>busctl</command> will match signals from any sender.</para> |
| 154 |
|
| 155 |
<xi:include href="version-info.xml" xpointer="v257"/></listitem> |
| 156 |
</varlistentry> |
| 157 |
|
| 158 |
<varlistentry> |
| 159 |
<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> |
| 160 |
|
| 161 |
<listitem><para>Retrieve the current value of one or more |
| 162 |
object properties. Takes a service name, object path, |
| 163 |
interface name and property name. Multiple properties may be |
| 164 |
specified at once, in which case their values will be shown one |
| 165 |
after the other, separated by newlines. The output is, by |
| 166 |
default, in terse format. Use <option>--verbose</option> for a |
| 167 |
more elaborate output format.</para> |
| 168 |
|
| 169 |
<xi:include href="version-info.xml" xpointer="v218"/></listitem> |
| 170 |
</varlistentry> |
| 171 |
|
| 172 |
<varlistentry> |
| 173 |
<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> |
| 174 |
|
| 175 |
<listitem><para>Set the current value of an object |
| 176 |
property. Takes a service name, object path, interface name, |
| 177 |
property name, property signature, followed by a list of |
| 178 |
parameters formatted as strings.</para> |
| 179 |
|
| 180 |
<xi:include href="version-info.xml" xpointer="v218"/></listitem> |
| 181 |
</varlistentry> |
| 182 |
|
| 183 |
<varlistentry> |
| 184 |
<term><command>help</command></term> |
| 185 |
|
| 186 |
<listitem><para>Show command syntax help.</para> |
| 187 |
|
| 188 |
<xi:include href="version-info.xml" xpointer="v209"/></listitem> |
| 189 |
</varlistentry> |
| 190 |
</variablelist> |
| 191 |
</refsect1> |
| 192 |
|
| 193 |
<refsect1> |
| 194 |
<title>Options</title> |
| 195 |
|
| 196 |
<para>The following options are understood:</para> |
| 197 |
|
| 198 |
<variablelist> |
| 199 |
<varlistentry> |
| 200 |
<term><option>--address=<replaceable>ADDRESS</replaceable></option></term> |
| 201 |
|
| 202 |
<listitem><para>Connect to the bus specified by |
| 203 |
<replaceable>ADDRESS</replaceable> instead of using suitable |
| 204 |
defaults for either the system or user bus (see |
| 205 |
<option>--system</option> and <option>--user</option> |
| 206 |
options).</para> |
| 207 |
|
| 208 |
<xi:include href="version-info.xml" xpointer="v209"/></listitem> |
| 209 |
</varlistentry> |
| 210 |
|
| 211 |
<varlistentry> |
| 212 |
<term><option>--show-machine</option></term> |
| 213 |
|
| 214 |
<listitem><para>When showing the list of peers, show a |
| 215 |
column containing the names of containers they belong to. |
| 216 |
See |
| 217 |
<citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. |
| 218 |
</para> |
| 219 |
|
| 220 |
<xi:include href="version-info.xml" xpointer="v209"/></listitem> |
| 221 |
</varlistentry> |
| 222 |
|
| 223 |
<varlistentry> |
| 224 |
<term><option>--unique</option></term> |
| 225 |
|
| 226 |
<listitem><para>When showing the list of peers, show only |
| 227 |
"unique" names (of the form |
| 228 |
<literal>:<replaceable>number</replaceable>.<replaceable>number</replaceable></literal>). |
| 229 |
</para> |
| 230 |
|
| 231 |
<xi:include href="version-info.xml" xpointer="v209"/></listitem> |
| 232 |
</varlistentry> |
| 233 |
|
| 234 |
<varlistentry> |
| 235 |
<term><option>--acquired</option></term> |
| 236 |
|
| 237 |
<listitem><para>The opposite of <option>--unique</option> — |
| 238 |
only "well-known" names will be shown.</para> |
| 239 |
|
| 240 |
<xi:include href="version-info.xml" xpointer="v209"/></listitem> |
| 241 |
</varlistentry> |
| 242 |
|
| 243 |
<varlistentry> |
| 244 |
<term><option>--activatable</option></term> |
| 245 |
|
| 246 |
<listitem><para>When showing the list of peers, show only |
| 247 |
peers which have actually not been activated yet, but may be |
| 248 |
started automatically if accessed.</para> |
| 249 |
|
| 250 |
<xi:include href="version-info.xml" xpointer="v209"/> |
| 251 |
</listitem> |
| 252 |
</varlistentry> |
| 253 |
|
| 254 |
<varlistentry> |
| 255 |
<term><option>--match=<replaceable>MATCH</replaceable></option></term> |
| 256 |
|
| 257 |
<listitem><para>When showing messages being exchanged, show only the |
| 258 |
subset matching <replaceable>MATCH</replaceable>. |
| 259 |
See |
| 260 |
<citerefentry><refentrytitle>sd_bus_add_match</refentrytitle><manvolnum>3</manvolnum></citerefentry>. |
| 261 |
</para> |
| 262 |
|
| 263 |
<xi:include href="version-info.xml" xpointer="v209"/></listitem> |
| 264 |
</varlistentry> |
| 265 |
|
| 266 |
<varlistentry> |
| 267 |
<term><option>--size=</option></term> |
| 268 |
|
| 269 |
<listitem> |
| 270 |
<para>When used with the <command>capture</command> command, |
| 271 |
specifies the maximum bus message size to capture |
| 272 |
("snaplen"). Defaults to 4096 bytes.</para> |
| 273 |
|
| 274 |
<xi:include href="version-info.xml" xpointer="v218"/> |
| 275 |
</listitem> |
| 276 |
</varlistentry> |
| 277 |
|
| 278 |
<varlistentry> |
| 279 |
<term><option>--list</option></term> |
| 280 |
|
| 281 |
<listitem> |
| 282 |
<para>When used with the <command>tree</command> command, shows a |
| 283 |
flat list of object paths instead of a tree.</para> |
| 284 |
|
| 285 |
<xi:include href="version-info.xml" xpointer="v218"/> |
| 286 |
</listitem> |
| 287 |
</varlistentry> |
| 288 |
|
| 289 |
<varlistentry> |
| 290 |
<term><option>-q</option></term> |
| 291 |
<term><option>--quiet</option></term> |
| 292 |
|
| 293 |
<listitem> |
| 294 |
<para>When used with the <command>call</command> command, |
| 295 |
suppresses display of the response message payload. Note that even |
| 296 |
if this option is specified, errors returned will still be |
| 297 |
printed and the tool will indicate success or failure with |
| 298 |
the process exit code.</para> |
| 299 |
|
| 300 |
<xi:include href="version-info.xml" xpointer="v218"/> |
| 301 |
</listitem> |
| 302 |
</varlistentry> |
| 303 |
|
| 304 |
<varlistentry> |
| 305 |
<term><option>--verbose</option></term> |
| 306 |
|
| 307 |
<listitem> |
| 308 |
<para>When used with the <command>call</command> or |
| 309 |
<command>get-property</command> command, shows output in a |
| 310 |
more verbose format.</para> |
| 311 |
|
| 312 |
<xi:include href="version-info.xml" xpointer="v218"/> |
| 313 |
</listitem> |
| 314 |
</varlistentry> |
| 315 |
|
| 316 |
<varlistentry> |
| 317 |
<term><option>--xml-interface</option></term> |
| 318 |
|
| 319 |
<listitem> |
| 320 |
<para>When used with the <command>introspect</command> call, dump the XML description received from |
| 321 |
the D-Bus <constant>org.freedesktop.DBus.Introspectable.Introspect</constant> call instead of the |
| 322 |
normal output.</para> |
| 323 |
|
| 324 |
<xi:include href="version-info.xml" xpointer="v243"/> |
| 325 |
</listitem> |
| 326 |
</varlistentry> |
| 327 |
|
| 328 |
<varlistentry> |
| 329 |
<term><option>--expect-reply=<replaceable>BOOL</replaceable></option></term> |
| 330 |
|
| 331 |
<listitem> |
| 332 |
<para>When used with the <command>call</command> command, |
| 333 |
specifies whether <command>busctl</command> shall wait for |
| 334 |
completion of the method call, output the returned method |
| 335 |
response data, and return success or failure via the process |
| 336 |
exit code. If this is set to <literal>no</literal>, the |
| 337 |
method call will be issued but no response is expected, the |
| 338 |
tool terminates immediately, and thus no response can be |
| 339 |
shown, and no success or failure is returned via the exit |
| 340 |
code. To only suppress output of the reply message payload, |
| 341 |
use <option>--quiet</option> above. Defaults to |
| 342 |
<literal>yes</literal>.</para> |
| 343 |
|
| 344 |
<xi:include href="version-info.xml" xpointer="v218"/> |
| 345 |
</listitem> |
| 346 |
</varlistentry> |
| 347 |
|
| 348 |
<varlistentry> |
| 349 |
<term><option>--auto-start=<replaceable>BOOL</replaceable></option></term> |
| 350 |
|
| 351 |
<listitem> |
| 352 |
<para>When used with the <command>call</command> or <command>emit</command> command, specifies |
| 353 |
whether the method call should implicitly activate the |
| 354 |
called service, should it not be running yet but is |
| 355 |
configured to be auto-started. Defaults to |
| 356 |
<literal>yes</literal>.</para> |
| 357 |
|
| 358 |
<xi:include href="version-info.xml" xpointer="v218"/> |
| 359 |
</listitem> |
| 360 |
</varlistentry> |
| 361 |
|
| 362 |
<varlistentry> |
| 363 |
<term><option>--allow-interactive-authorization=<replaceable>BOOL</replaceable></option></term> |
| 364 |
|
| 365 |
<listitem> |
| 366 |
<para>When used with the <command>call</command> command, |
| 367 |
specifies whether the services may enforce interactive |
| 368 |
authorization while executing the operation, if the security |
| 369 |
policy is configured for this. Defaults to |
| 370 |
<literal>yes</literal>.</para> |
| 371 |
|
| 372 |
<xi:include href="version-info.xml" xpointer="v218"/> |
| 373 |
</listitem> |
| 374 |
</varlistentry> |
| 375 |
|
| 376 |
<varlistentry> |
| 377 |
<term><option>--timeout=<replaceable>SECS</replaceable></option></term> |
| 378 |
|
| 379 |
<listitem> |
| 380 |
<para>When used with the <command>call</command> command, specifies the maximum time to wait for |
| 381 |
method call completion. When used with the <command>monitor</command> command, since version v257, |
| 382 |
specifies the maximum time to wait for messages before automatically exiting. If no time unit is |
| 383 |
specified, assumes seconds. The usual other units are understood, too (ms, us, s, min, h, d, w, |
| 384 |
month, y). Note that this timeout does not apply if <option>--expect-reply=no</option> is used, |
| 385 |
when combined with the <command>call</command> command, as the tool does not wait for any reply |
| 386 |
message then. When not specified or when set to 0, the default of <literal>25s</literal> is |
| 387 |
assumed for the <command>call</command> command, and it is disabled for the |
| 388 |
<command>monitor</command> command.</para> |
| 389 |
|
| 390 |
<xi:include href="version-info.xml" xpointer="v218"/> |
| 391 |
</listitem> |
| 392 |
</varlistentry> |
| 393 |
|
| 394 |
<varlistentry> |
| 395 |
<term><option>--limit-messages=<replaceable>NUMBER</replaceable></option></term> |
| 396 |
<term><option>-N <replaceable>NUMBER</replaceable></option></term> |
| 397 |
|
| 398 |
<listitem> |
| 399 |
<para>When used with the <command>monitor</command> command, if enabled will make |
| 400 |
<command>busctl</command> exit when the specified number of messages have been received and |
| 401 |
printed. This is useful in combination with <option>--match=</option>, to wait for the specified |
| 402 |
number of occurrences of specific D-Bus messages. While if not specified or is set to special value |
| 403 |
<literal>infinity</literal>, the default is to keep monitoring without limitations.</para> |
| 404 |
|
| 405 |
<para>When used with the <command>wait</command> command, it will make <command>busctl</command> |
| 406 |
exit when the specified number of DBus signals have been received and printed. Setting it to |
| 407 |
special value <literal>infinity</literal> will sustain <command>busctl</command> to receive and |
| 408 |
print signals continuously without limitations. When nothing is specified, the default is to exit |
| 409 |
immediately after receiving and printing the first signal.</para> |
| 410 |
|
| 411 |
<xi:include href="version-info.xml" xpointer="v257"/> |
| 412 |
</listitem> |
| 413 |
</varlistentry> |
| 414 |
|
| 415 |
<varlistentry> |
| 416 |
<term><option>--augment-creds=<replaceable>BOOL</replaceable></option></term> |
| 417 |
|
| 418 |
<listitem> |
| 419 |
<para>Controls whether credential data reported by |
| 420 |
<command>list</command> or <command>status</command> shall |
| 421 |
be augmented with data from |
| 422 |
<filename>/proc/</filename>. When this is turned on, the data |
| 423 |
shown is possibly inconsistent, as the data read from |
| 424 |
<filename>/proc/</filename> might be more recent than the rest of |
| 425 |
the credential information. Defaults to <literal>yes</literal>.</para> |
| 426 |
|
| 427 |
<xi:include href="version-info.xml" xpointer="v218"/> |
| 428 |
</listitem> |
| 429 |
</varlistentry> |
| 430 |
|
| 431 |
<varlistentry> |
| 432 |
<term><option>--watch-bind=<replaceable>BOOL</replaceable></option></term> |
| 433 |
|
| 434 |
<listitem> |
| 435 |
<para>Controls whether to wait for the specified <constant>AF_UNIX</constant> bus socket to appear in the |
| 436 |
file system before connecting to it. Defaults to off. When enabled, the tool will watch the file system until |
| 437 |
the socket is created and then connect to it.</para> |
| 438 |
|
| 439 |
<xi:include href="version-info.xml" xpointer="v237"/> |
| 440 |
</listitem> |
| 441 |
</varlistentry> |
| 442 |
|
| 443 |
<varlistentry> |
| 444 |
<term><option>--destination=<replaceable>SERVICE</replaceable></option></term> |
| 445 |
|
| 446 |
<listitem> |
| 447 |
<para>Takes a service name. When used with the <command>emit</command> command, a signal is |
| 448 |
emitted to the specified service.</para> |
| 449 |
|
| 450 |
<xi:include href="version-info.xml" xpointer="v242"/> |
| 451 |
</listitem> |
| 452 |
</varlistentry> |
| 453 |
|
| 454 |
<xi:include href="user-system-options.xml" xpointer="user" /> |
| 455 |
<xi:include href="user-system-options.xml" xpointer="system" /> |
| 456 |
<xi:include href="user-system-options.xml" xpointer="host" /> |
| 457 |
<xi:include href="user-system-options.xml" xpointer="machine" /> |
| 458 |
<xi:include href="user-system-options.xml" xpointer="capsule" /> |
| 459 |
|
| 460 |
<varlistentry> |
| 461 |
<term><option>-l</option></term> |
| 462 |
<term><option>--full</option></term> |
| 463 |
|
| 464 |
<listitem> |
| 465 |
<para>Do not ellipsize the output in <command>list</command> command.</para> |
| 466 |
|
| 467 |
<xi:include href="version-info.xml" xpointer="v245"/> |
| 468 |
</listitem> |
| 469 |
</varlistentry> |
| 470 |
|
| 471 |
<xi:include href="standard-options.xml" xpointer="json" /> |
| 472 |
<xi:include href="standard-options.xml" xpointer="j" /> |
| 473 |
<xi:include href="standard-options.xml" xpointer="no-pager" /> |
| 474 |
<xi:include href="standard-options.xml" xpointer="no-legend" /> |
| 475 |
<xi:include href="standard-options.xml" xpointer="help" /> |
| 476 |
<xi:include href="standard-options.xml" xpointer="version" /> |
| 477 |
</variablelist> |
| 478 |
</refsect1> |
| 479 |
|
| 480 |
<refsect1> |
| 481 |
<title>Parameter Formatting</title> |
| 482 |
|
| 483 |
<para>The <command>call</command> and |
| 484 |
<command>set-property</command> commands take a signature string |
| 485 |
followed by a list of parameters formatted as string (for details |
| 486 |
on D-Bus signature strings, see the <ulink |
| 487 |
url="https://dbus.freedesktop.org/doc/dbus-specification.html#type-system">Type |
| 488 |
system chapter of the D-Bus specification</ulink>). For simple |
| 489 |
types, each parameter following the signature should simply be the |
| 490 |
parameter's value formatted as string. Positive boolean values may |
| 491 |
be formatted as <literal>true</literal>, <literal>yes</literal>, |
| 492 |
<literal>on</literal>, or <literal>1</literal>; negative boolean |
| 493 |
values may be specified as <literal>false</literal>, |
| 494 |
<literal>no</literal>, <literal>off</literal>, or |
| 495 |
<literal>0</literal>. For arrays, a numeric argument for the |
| 496 |
number of entries followed by the entries shall be specified. For |
| 497 |
variants, the signature of the contents shall be specified, |
| 498 |
followed by the contents. For dictionaries and structs, the |
| 499 |
contents of them shall be directly specified.</para> |
| 500 |
|
| 501 |
<para>For example, |
| 502 |
<programlisting>s jawoll</programlisting> is the formatting |
| 503 |
of a single string <literal>jawoll</literal>.</para> |
| 504 |
|
| 505 |
<para> |
| 506 |
<programlisting>as 3 hello world foobar</programlisting> |
| 507 |
is the formatting of a string array with three entries, |
| 508 |
<literal>hello</literal>, <literal>world</literal> and |
| 509 |
<literal>foobar</literal>.</para> |
| 510 |
|
| 511 |
<para> |
| 512 |
<programlisting>a{sv} 3 One s Eins Two u 2 Yes b true</programlisting> |
| 513 |
is the formatting of a dictionary |
| 514 |
array that maps strings to variants, consisting of three |
| 515 |
entries. The string <literal>One</literal> is assigned the |
| 516 |
string <literal>Eins</literal>. The string |
| 517 |
<literal>Two</literal> is assigned the 32-bit unsigned |
| 518 |
integer 2. The string <literal>Yes</literal> is assigned a |
| 519 |
positive boolean.</para> |
| 520 |
|
| 521 |
<para>Note that the <command>call</command>, |
| 522 |
<command>get-property</command>, <command>introspect</command> |
| 523 |
commands will also generate output in this format for the returned |
| 524 |
data. Since this format is sometimes too terse to be easily |
| 525 |
understood, the <command>call</command> and |
| 526 |
<command>get-property</command> commands may generate a more |
| 527 |
verbose, multi-line output when passed the |
| 528 |
<option>--verbose</option> option.</para> |
| 529 |
</refsect1> |
| 530 |
|
| 531 |
<refsect1> |
| 532 |
<title>Examples</title> |
| 533 |
|
| 534 |
<example> |
| 535 |
<title>Write and Read a Property</title> |
| 536 |
|
| 537 |
<para>The following two commands first write a property and then |
| 538 |
read it back. The property is found on the |
| 539 |
<literal>/org/freedesktop/systemd1</literal> object of the |
| 540 |
<literal>org.freedesktop.systemd1</literal> service. The name of |
| 541 |
the property is <literal>LogLevel</literal> on the |
| 542 |
<literal>org.freedesktop.systemd1.Manager</literal> |
| 543 |
interface. The property contains a single string:</para> |
| 544 |
|
| 545 |
<programlisting># busctl set-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager LogLevel s debug |
| 546 |
# busctl get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager LogLevel |
| 547 |
s "debug"</programlisting> |
| 548 |
|
| 549 |
</example> |
| 550 |
|
| 551 |
<example> |
| 552 |
<title>Terse and Verbose Output</title> |
| 553 |
|
| 554 |
<para>The following two commands read a property that contains |
| 555 |
an array of strings, and first show it in terse format, followed |
| 556 |
by verbose format:</para> |
| 557 |
|
| 558 |
<programlisting>$ busctl get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager Environment |
| 559 |
as 2 "LANG=en_US.UTF-8" "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" |
| 560 |
$ busctl get-property --verbose org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager Environment |
| 561 |
ARRAY "s" { |
| 562 |
STRING "LANG=en_US.UTF-8"; |
| 563 |
STRING "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"; |
| 564 |
};</programlisting> |
| 565 |
</example> |
| 566 |
|
| 567 |
<example> |
| 568 |
<title>Invoking a Method</title> |
| 569 |
|
| 570 |
<para>The following command invokes the |
| 571 |
<literal>StartUnit</literal> method on the |
| 572 |
<literal>org.freedesktop.systemd1.Manager</literal> |
| 573 |
interface of the |
| 574 |
<literal>/org/freedesktop/systemd1</literal> object |
| 575 |
of the <literal>org.freedesktop.systemd1</literal> |
| 576 |
service, and passes it two strings |
| 577 |
<literal>cups.service</literal> and |
| 578 |
<literal>replace</literal>. As a result of the method |
| 579 |
call, a single object path parameter is received and |
| 580 |
shown:</para> |
| 581 |
|
| 582 |
<programlisting># busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager StartUnit ss "cups.service" "replace" |
| 583 |
o "/org/freedesktop/systemd1/job/42684"</programlisting> |
| 584 |
</example> |
| 585 |
</refsect1> |
| 586 |
|
| 587 |
<refsect1> |
| 588 |
<title>See Also</title> |
| 589 |
|
| 590 |
<para><simplelist type="inline"> |
| 591 |
<member><citerefentry project='dbus'><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 592 |
<member><ulink url="https://www.freedesktop.org/wiki/Software/dbus">D-Bus</ulink></member> |
| 593 |
<member><citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> |
| 594 |
<member><citerefentry><refentrytitle>varlinkctl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 595 |
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 596 |
<member><citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 597 |
<member><citerefentry project='die-net'><refentrytitle>wireshark</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 598 |
</simplelist></para> |
| 599 |
</refsect1> |
| 600 |
</refentry> |