]>
Commit | Line | Data |
---|---|---|
60f067b4 | 1 | '\" t |
e735f4d4 | 2 | .TH "BUSCTL" "1" "" "systemd 219" "busctl" |
60f067b4 JS |
3 | .\" ----------------------------------------------------------------- |
4 | .\" * Define some portability stuff | |
5 | .\" ----------------------------------------------------------------- | |
6 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
7 | .\" http://bugs.debian.org/507673 | |
8 | .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html | |
9 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
10 | .ie \n(.g .ds Aq \(aq | |
11 | .el .ds Aq ' | |
12 | .\" ----------------------------------------------------------------- | |
13 | .\" * set default formatting | |
14 | .\" ----------------------------------------------------------------- | |
15 | .\" disable hyphenation | |
16 | .nh | |
17 | .\" disable justification (adjust text to left margin only) | |
18 | .ad l | |
19 | .\" ----------------------------------------------------------------- | |
20 | .\" * MAIN CONTENT STARTS HERE * | |
21 | .\" ----------------------------------------------------------------- | |
22 | .SH "NAME" | |
23 | busctl \- Introspect the bus | |
24 | .SH "SYNOPSIS" | |
25 | .HP \w'\fBbusctl\fR\ 'u | |
26 | \fBbusctl\fR [OPTIONS...] [COMMAND] [\fINAME\fR...] | |
27 | .SH "DESCRIPTION" | |
28 | .PP | |
29 | \fBbusctl\fR | |
30 | may be used to introspect and monitor the D\-Bus bus\&. | |
31 | .SH "OPTIONS" | |
32 | .PP | |
33 | The following options are understood: | |
34 | .PP | |
35 | \fB\-\-address=\fR\fB\fIADDRESS\fR\fR | |
36 | .RS 4 | |
37 | Connect to the bus specified by | |
38 | \fIADDRESS\fR | |
39 | instead of using suitable defaults for either the system or user bus (see | |
40 | \fB\-\-system\fR | |
41 | and | |
42 | \fB\-\-user\fR | |
43 | options)\&. | |
44 | .RE | |
45 | .PP | |
46 | \fB\-\-show\-machine\fR | |
47 | .RS 4 | |
48 | When showing the list of endpoints, show a column containing the names of containers they belong to\&. See | |
49 | \fBsystemd-machined.service\fR(8)\&. | |
50 | .RE | |
51 | .PP | |
52 | \fB\-\-unique\fR | |
53 | .RS 4 | |
54 | When showing the list of endpoints, show only "unique" names (of the form | |
55 | ":\fInumber\fR\&.\fInumber\fR")\&. | |
56 | .RE | |
57 | .PP | |
58 | \fB\-\-acquired\fR | |
59 | .RS 4 | |
60 | The opposite of | |
61 | \fB\-\-unique\fR | |
62 | \(em only "well\-known" names will be shown\&. | |
63 | .RE | |
64 | .PP | |
65 | \fB\-\-activatable\fR | |
66 | .RS 4 | |
67 | When showing the list of endpoints, show only endpoints which have actually not been activated yet, but may be started automatically if accessed\&. | |
68 | .RE | |
69 | .PP | |
70 | \fB\-\-match=\fR\fB\fIMATCH\fR\fR | |
71 | .RS 4 | |
72 | When showing messages being exchanged, show only the subset matching | |
73 | \fIMATCH\fR\&. | |
74 | .RE | |
75 | .PP | |
f47781d8 MP |
76 | \fB\-\-size=\fR |
77 | .RS 4 | |
78 | When used with the | |
79 | \fBcapture\fR | |
80 | command specifies the maximum bus message size to capture ("snaplen")\&. Defaults to 4096 bytes\&. | |
81 | .RE | |
82 | .PP | |
83 | \fB\-\-list\fR | |
84 | .RS 4 | |
85 | When used with the | |
86 | \fBtree\fR | |
87 | command shows a flat list of object paths instead of a tree\&. | |
88 | .RE | |
89 | .PP | |
90 | \fB\-\-quiet\fR | |
91 | .RS 4 | |
92 | When used with the | |
93 | \fBcall\fR | |
94 | 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\&. | |
95 | .RE | |
96 | .PP | |
97 | \fB\-\-verbose\fR | |
98 | .RS 4 | |
99 | When used with the | |
100 | \fBcall\fR | |
101 | or | |
102 | \fBget\-property\fR | |
103 | command shows output in a more verbose format\&. | |
104 | .RE | |
105 | .PP | |
106 | \fB\-\-expect\-reply=\fR\fIBOOL\fR | |
107 | .RS 4 | |
108 | When used with the | |
109 | \fBcall\fR | |
110 | command specifies whether | |
111 | \fBbusctl\fR | |
112 | 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 | |
113 | "no" | |
114 | 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 | |
115 | \fB\-\-quiet\fR | |
116 | above\&. Defaults to | |
117 | "yes"\&. | |
118 | .RE | |
119 | .PP | |
120 | \fB\-\-auto\-start=\fR\fIBOOL\fR | |
121 | .RS 4 | |
122 | When used with the | |
123 | \fBcall\fR | |
124 | command specifies whether the method call should implicitly activate the called service should it not be running yet but is configured to be auto\-started\&. Defaults to | |
125 | "yes"\&. | |
126 | .RE | |
127 | .PP | |
128 | \fB\-\-allow\-interactive\-authorization=\fR\fIBOOL\fR | |
129 | .RS 4 | |
130 | When used with the | |
131 | \fBcall\fR | |
132 | command specifies whether the services may enforce interactive authorization while executing the operation, if the security policy is configured for this\&. Defaults to | |
133 | "yes"\&. | |
134 | .RE | |
135 | .PP | |
136 | \fB\-\-timeout=\fR\fISECS\fR | |
137 | .RS 4 | |
138 | When used with the | |
139 | \fBcall\fR | |
140 | command specifies the maximum time to wait for method call completion\&. 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 | |
141 | \fB\-\-expect\-reply=no\fR | |
142 | is used as the tool does not wait for any reply message then\&. When not specified or when set to 0 the default of | |
143 | "25s" | |
144 | is assumed\&. | |
145 | .RE | |
146 | .PP | |
147 | \fB\-\-augment\-creds=\fR\fIBOOL\fR | |
148 | .RS 4 | |
149 | Controls whether credential data reported by | |
150 | \fBlist\fR | |
151 | or | |
152 | \fBstatus\fR | |
153 | shall be augmented with data from | |
154 | /proc\&. When this is turned on the data shown is possibly inconsistent, as the data read from | |
155 | /proc | |
156 | might be more recent than rest of the credential information\&. Defaults to | |
157 | "yes"\&. | |
158 | .RE | |
159 | .PP | |
60f067b4 JS |
160 | \fB\-\-user\fR |
161 | .RS 4 | |
162 | Talk to the service manager of the calling user, rather than the service manager of the system\&. | |
163 | .RE | |
164 | .PP | |
165 | \fB\-\-system\fR | |
166 | .RS 4 | |
167 | Talk to the service manager of the system\&. This is the implied default\&. | |
168 | .RE | |
169 | .PP | |
170 | \fB\-H\fR, \fB\-\-host=\fR | |
171 | .RS 4 | |
e842803a MB |
172 | Execute the operation remotely\&. Specify a hostname, or a username and hostname separated by |
173 | "@", to connect to\&. The hostname may optionally be suffixed by a container name, separated by | |
174 | ":", 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 | |
175 | \fBmachinectl \-H \fR\fB\fIHOST\fR\fR\&. | |
60f067b4 JS |
176 | .RE |
177 | .PP | |
178 | \fB\-M\fR, \fB\-\-machine=\fR | |
179 | .RS 4 | |
180 | Execute operation on a local container\&. Specify a container name to connect to\&. | |
181 | .RE | |
182 | .PP | |
e735f4d4 MP |
183 | \fB\-\-no\-pager\fR |
184 | .RS 4 | |
185 | Do not pipe output into a pager\&. | |
186 | .RE | |
187 | .PP | |
188 | \fB\-\-no\-legend\fR | |
189 | .RS 4 | |
190 | Do not print the legend, i\&.e\&. column headers and the footer with hints\&. | |
191 | .RE | |
192 | .PP | |
60f067b4 JS |
193 | \fB\-h\fR, \fB\-\-help\fR |
194 | .RS 4 | |
195 | Print a short help text and exit\&. | |
196 | .RE | |
197 | .PP | |
198 | \fB\-\-version\fR | |
199 | .RS 4 | |
200 | Print a short version string and exit\&. | |
201 | .RE | |
60f067b4 JS |
202 | .SH "COMMANDS" |
203 | .PP | |
204 | The following commands are understood: | |
205 | .PP | |
206 | \fBlist\fR | |
207 | .RS 4 | |
f47781d8 MP |
208 | Show service names on the bus\&. This is the default if no command is specified\&. |
209 | .RE | |
210 | .PP | |
211 | \fBstatus\fR [\fISERVICE\fR] | |
212 | .RS 4 | |
213 | 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)\&. | |
60f067b4 JS |
214 | .RE |
215 | .PP | |
f47781d8 | 216 | \fBmonitor\fR [\fISERVICE\fR...] |
60f067b4 JS |
217 | .RS 4 |
218 | Dump messages being exchanged\&. If | |
f47781d8 MP |
219 | \fISERVICE\fR |
220 | is specified, show messages to or from this endpoint\&. Otherwise, show all messages on the bus\&. Use Ctrl\-C to terminate dump\&. | |
221 | .RE | |
222 | .PP | |
223 | \fBcapture\fR [\fISERVICE\fR...] | |
224 | .RS 4 | |
225 | Similar to | |
226 | \fBmonitor\fR | |
227 | but writes the output in pcap format (for details see the | |
228 | \m[blue]\fBLibpcap File Format\fR\m[]\&\s-2\u[1]\d\s+2 | |
229 | description\&. Make sure to redirect the output to STDOUT to a file\&. Tools like | |
230 | \fBwireshark\fR(1) | |
231 | may be used to dissect and view the generated files\&. | |
232 | .RE | |
233 | .PP | |
234 | \fBtree\fR [\fISERVICE\fR...] | |
235 | .RS 4 | |
236 | Shows an object tree of one or more services\&. If | |
237 | \fISERVICE\fR | |
238 | 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\&. | |
239 | .RE | |
240 | .PP | |
e735f4d4 | 241 | \fBintrospect\fR \fISERVICE\fR \fIOBJECT\fR [\fIINTERFACE\fR] |
f47781d8 | 242 | .RS 4 |
e735f4d4 | 243 | 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 interface\&. |
f47781d8 MP |
244 | .RE |
245 | .PP | |
246 | \fBcall\fR \fISERVICE\fR \fIOBJECT\fR \fIINTERFACE\fR \fIMETHOD\fR [\fISIGNATURE\fR\ [\fIARGUMENT\fR...]] | |
247 | .RS 4 | |
248 | 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 | |
249 | \fB\-\-quiet\fR | |
250 | option\&. | |
251 | .RE | |
252 | .PP | |
253 | \fBget\-property\fR \fISERVICE\fR \fIOBJECT\fR \fIINTERFACE\fR \fIPROPERTY\fR... | |
254 | .RS 4 | |
255 | 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 | |
256 | \fB\-\-verbose\fR | |
257 | for a more elaborate output format\&. | |
60f067b4 JS |
258 | .RE |
259 | .PP | |
f47781d8 | 260 | \fBset\-property\fR \fISERVICE\fR \fIOBJECT\fR \fIINTERFACE\fR \fIPROPERTY\fR \fISIGNATURE\fR \fIARGUMENT\fR... |
60f067b4 | 261 | .RS 4 |
f47781d8 | 262 | 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\&. |
60f067b4 JS |
263 | .RE |
264 | .PP | |
265 | \fBhelp\fR | |
266 | .RS 4 | |
267 | Show command syntax help\&. | |
268 | .RE | |
f47781d8 MP |
269 | .SH "PARAMETER FORMATTING" |
270 | .PP | |
271 | The | |
272 | \fBcall\fR | |
273 | and | |
274 | \fBset\-property\fR | |
275 | commands take a signature string followed by a list of parameters formatted as string (for details on D\-Bus signature strings see the | |
276 | \m[blue]\fBType system chapter of the D\-Bus specification\fR\m[]\&\s-2\u[2]\d\s+2)\&. For simple types each parameter following the signature should simply be the parameter\*(Aqs value formatted as string\&. Positive boolean values may be formatted as | |
277 | "true", | |
278 | "yes", | |
279 | "on", | |
280 | "1"; negative boolean values may be specified as | |
281 | "false", | |
282 | "no", | |
283 | "off", | |
284 | "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\&. | |
285 | .PP | |
286 | For example, | |
287 | .sp | |
288 | .if n \{\ | |
289 | .RS 4 | |
290 | .\} | |
291 | .nf | |
292 | s jawoll | |
293 | .fi | |
294 | .if n \{\ | |
295 | .RE | |
296 | .\} | |
297 | .sp | |
298 | is the formatting of a single string | |
299 | "jawoll"\&. | |
300 | .PP | |
301 | .if n \{\ | |
302 | .RS 4 | |
303 | .\} | |
304 | .nf | |
305 | as 3 hello world foobar | |
306 | .fi | |
307 | .if n \{\ | |
308 | .RE | |
309 | .\} | |
310 | .sp | |
311 | is the formatting of a string array with three entries, | |
312 | "hello", | |
313 | "world" | |
314 | and | |
315 | "foobar"\&. | |
316 | .PP | |
317 | .if n \{\ | |
318 | .RS 4 | |
319 | .\} | |
320 | .nf | |
321 | a{sv} 3 One s Eins Two u 2 Yes b true | |
322 | .fi | |
323 | .if n \{\ | |
324 | .RE | |
325 | .\} | |
326 | .sp | |
327 | is the formatting of a dictionary array that maps strings to variants, consisting of three entries\&. The string | |
328 | "One" | |
329 | is assigned the string | |
330 | "Eins"\&. The string | |
331 | "Two" | |
332 | is assigned the 32bit unsigned integer 2\&. The string | |
333 | "Yes" | |
334 | is assigned a positive boolean\&. | |
335 | .PP | |
336 | Note that the | |
337 | \fBcall\fR, | |
338 | \fBget\-property\fR, | |
339 | \fBintrospect\fR | |
340 | commands will also generate output in this format for the returned data\&. Since this format is sometimes too terse to be easily understood, the | |
341 | \fBcall\fR | |
342 | and | |
343 | \fBget\-property\fR | |
344 | commands may generate a more verbose, multi\-line output when passed the | |
345 | \fB\-\-verbose\fR | |
346 | option\&. | |
347 | .SH "EXAMPLES" | |
348 | .PP | |
349 | \fBExample\ \&1.\ \&Write and Read a Property\fR | |
350 | .PP | |
351 | The following two commands first write a property and then read it back\&. The property is found on the | |
352 | "/org/freedesktop/systemd1" | |
353 | object of the | |
354 | "org\&.freedesktop\&.systemd1" | |
355 | service\&. The name of the property is | |
356 | "LogLevel" | |
357 | on the | |
358 | "org\&.freedesktop\&.systemd1\&.Manager" | |
359 | interface\&. The property contains a single string: | |
360 | .sp | |
361 | .if n \{\ | |
362 | .RS 4 | |
363 | .\} | |
364 | .nf | |
365 | # busctl set\-property org\&.freedesktop\&.systemd1 /org/freedesktop/systemd1 org\&.freedesktop\&.systemd1\&.Manager LogLevel s debug | |
366 | # busctl get\-property org\&.freedesktop\&.systemd1 /org/freedesktop/systemd1 org\&.freedesktop\&.systemd1\&.Manager LogLevel | |
367 | s "debug" | |
368 | .fi | |
369 | .if n \{\ | |
370 | .RE | |
371 | .\} | |
372 | .PP | |
373 | \fBExample\ \&2.\ \&Terse and Verbose Output\fR | |
374 | .PP | |
375 | The following two commands read a property that contains an array of strings, and first show it in terse format, followed by verbose format: | |
376 | .sp | |
377 | .if n \{\ | |
378 | .RS 4 | |
379 | .\} | |
380 | .nf | |
381 | $ busctl get\-property org\&.freedesktop\&.systemd1 /org/freedesktop/systemd1 org\&.freedesktop\&.systemd1\&.Manager Environment | |
382 | as 2 "LANG=en_US\&.UTF\-8" "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" | |
383 | $ busctl get\-property \-\-verbose org\&.freedesktop\&.systemd1 /org/freedesktop/systemd1 org\&.freedesktop\&.systemd1\&.Manager Environment | |
384 | ARRAY "s" { | |
385 | STRING "LANG=en_US\&.UTF\-8"; | |
386 | STRING "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"; | |
387 | }; | |
388 | .fi | |
389 | .if n \{\ | |
390 | .RE | |
391 | .\} | |
392 | .PP | |
393 | \fBExample\ \&3.\ \&Invoking a Method\fR | |
394 | .PP | |
395 | The following command invokes a the | |
396 | "StartUnit" | |
397 | method on the | |
398 | "org\&.freedesktop\&.systemd1\&.Manager" | |
399 | interface of the | |
400 | "/org/freedesktop/systemd1" | |
401 | object of the | |
402 | "org\&.freedesktop\&.systemd1" | |
403 | service, and passes it two strings | |
404 | "cups\&.service" | |
405 | and | |
406 | "replace"\&. As result of the method call a single object path parameter is received and shown: | |
407 | .sp | |
408 | .if n \{\ | |
409 | .RS 4 | |
410 | .\} | |
411 | .nf | |
412 | # busctl call org\&.freedesktop\&.systemd1 /org/freedesktop/systemd1 org\&.freedesktop\&.systemd1\&.Manager StartUnit ss "cups\&.service" "replace" | |
413 | o "/org/freedesktop/systemd1/job/42684" | |
414 | .fi | |
415 | .if n \{\ | |
416 | .RE | |
417 | .\} | |
60f067b4 JS |
418 | .SH "SEE ALSO" |
419 | .PP | |
420 | \fBdbus-daemon\fR(1), | |
f47781d8 MP |
421 | \m[blue]\fBD\-Bus\fR\m[]\&\s-2\u[3]\d\s+2, |
422 | \m[blue]\fBkdbus\fR\m[]\&\s-2\u[4]\d\s+2, | |
60f067b4 JS |
423 | \fBsd-bus\fR(3), |
424 | \fBsystemd\fR(1), | |
425 | \fBsystemd-bus-proxyd\fR(8), | |
f47781d8 MP |
426 | \fBmachinectl\fR(1), |
427 | \fBwireshark\fR(1) | |
60f067b4 JS |
428 | .SH "NOTES" |
429 | .IP " 1." 4 | |
f47781d8 MP |
430 | Libpcap File Format |
431 | .RS 4 | |
432 | \%http://wiki.wireshark.org/Development/LibpcapFileFormat | |
433 | .RE | |
434 | .IP " 2." 4 | |
435 | Type system chapter of the D-Bus specification | |
436 | .RS 4 | |
437 | \%http://dbus.freedesktop.org/doc/dbus-specification.html#type-system | |
438 | .RE | |
439 | .IP " 3." 4 | |
60f067b4 JS |
440 | D-Bus |
441 | .RS 4 | |
442 | \%http://freedesktop.org/wiki/Software/dbus | |
443 | .RE | |
f47781d8 | 444 | .IP " 4." 4 |
60f067b4 JS |
445 | kdbus |
446 | .RS 4 | |
447 | \%https://code.google.com/p/d-bus/ | |
448 | .RE |