1BUSCTL(1) busctl BUSCTL(1)
2
3
4
6 busctl - Introspect the bus
7
9 busctl [OPTIONS...] [COMMAND] [NAME...]
10
12 busctl may be used to introspect and monitor the D-Bus bus.
13
15 The following options are understood:
16
17 --address=ADDRESS
18 Connect to the bus specified by ADDRESS instead of using suitable
19 defaults for the system bus (see --system option).
20
21 --show-machine
22 When showing the list of endpoints, show a column containing the
23 names of containers they belong to. See systemd-
24 machined.service(8).
25
26 --unique
27 When showing the list of endpoints, show only "unique" names (of
28 the form ":number.number").
29
30 --acquired
31 The opposite of --unique — only "well-known" names will be shown.
32
33 --activatable
34 When showing the list of endpoints, show only endpoints which have
35 actually not been activated yet, but may be started automatically
36 if accessed.
37
38 --match=MATCH
39 When showing messages being exchanged, show only the subset
40 matching MATCH.
41
42 --size=
43 When used with the capture command specifies the maximum bus
44 message size to capture ("snaplen"). Defaults to 4096 bytes.
45
46 --list
47 When used with the tree command shows a flat list of object paths
48 instead of a tree.
49
50 --quiet
51 When used with the call command suppresses display of the response
52 message payload. Note that even if this option is specified errors
53 returned will still be printed and the tool will indicate success
54 or failure with the process exit code.
55
56 --verbose
57 When used with the call or get-property command shows output in a
58 more verbose format.
59
60 --expect-reply=BOOL
61 When used with the call command specifies whether busctl shall wait
62 for completion of the method call, output the returned method
63 response data, and return success or failure via the process exit
64 code. If this is set to "no" the method call will be issued but no
65 response is expected, the tool terminates immediately, and thus no
66 response can be shown, and no success or failure is returned via
67 the exit code. To only suppress output of the reply message payload
68 use --quiet above. Defaults to "yes".
69
70 --auto-start=BOOL
71 When used with the call command specifies whether the method call
72 should implicitly activate the called service should it not be
73 running yet but is configured to be auto-started. Defaults to
74 "yes".
75
76 --allow-interactive-authorization=BOOL
77 When used with the call command specifies whether the services may
78 enforce interactive authorization while executing the operation, if
79 the security policy is configured for this. Defaults to "yes".
80
81 --timeout=SECS
82 When used with the call command specifies the maximum time to wait
83 for method call completion. If no time unit is specified assumes
84 seconds. The usual other units are understood, too (ms, us, s, min,
85 h, d, w, month, y). Note that this timeout does not apply if
86 --expect-reply=no is used as the tool does not wait for any reply
87 message then. When not specified or when set to 0 the default of
88 "25s" is assumed.
89
90 --augment-creds=BOOL
91 Controls whether credential data reported by list or status shall
92 be augmented with data from /proc. When this is turned on the data
93 shown is possibly inconsistent, as the data read from /proc might
94 be more recent than rest of the credential information. Defaults to
95 "yes".
96
97 --system
98 Talk to the service manager of the system. This is the implied
99 default.
100
101 -H, --host=
102 Execute the operation remotely. Specify a hostname, or a username
103 and hostname separated by "@", to connect to. The hostname may
104 optionally be suffixed by a container name, separated by ":", which
105 connects directly to a specific container on the specified host.
106 This will use SSH to talk to the remote machine manager instance.
107 Container names may be enumerated with machinectl -H HOST.
108
109 -M, --machine=
110 Execute operation on a local container. Specify a container name to
111 connect to.
112
113 --no-pager
114 Do not pipe output into a pager.
115
116 --no-legend
117 Do not print the legend, i.e. column headers and the footer with
118 hints.
119
120 -h, --help
121 Print a short help text and exit.
122
123 --version
124 Print a short version string and exit.
125
127 The following commands are understood:
128
129 list
130 Show service names on the bus. This is the default if no command is
131 specified.
132
133 status [SERVICE]
134 Show process information and credentials of a bus service (if one
135 is specified by its unique or well-known name), a process (if one
136 is specified by its numeric PID), or the owner of the bus (if no
137 parameter is specified).
138
139 monitor [SERVICE...]
140 Dump messages being exchanged. If SERVICE is specified, show
141 messages to or from this endpoint. Otherwise, show all messages on
142 the bus. Use Ctrl-C to terminate dump.
143
144 capture [SERVICE...]
145 Similar to monitor but writes the output in pcap format (for
146 details see the Libpcap File Format[1] description. Make sure to
147 redirect the output to STDOUT to a file. Tools like wireshark(1)
148 may be used to dissect and view the generated files.
149
150 tree [SERVICE...]
151 Shows an object tree of one or more services. If SERVICE is
152 specified, show object tree of the specified services only.
153 Otherwise, show all object trees of all services on the bus that
154 acquired at least one well-known name.
155
156 introspect SERVICE OBJECT [INTERFACE]
157 Show interfaces, methods, properties and signals of the specified
158 object (identified by its path) on the specified service. If the
159 interface argument is passed the output is limited to members of
160 the specified interface.
161
162 call SERVICE OBJECT INTERFACE METHOD [SIGNATURE [ARGUMENT...]]
163 Invoke a method and show the response. Takes a service name, object
164 path, interface name and method name. If parameters shall be passed
165 to the method call a signature string is required, followed by the
166 arguments, individually formatted as strings. For details on the
167 formatting used, see below. To suppress output of the returned data
168 use the --quiet option.
169
170 get-property SERVICE OBJECT INTERFACE PROPERTY...
171 Retrieve the current value of one or more object properties. Takes
172 a service name, object path, interface name and property name.
173 Multiple properties may be specified at once in which case their
174 values will be shown one after the other, separated by newlines.
175 The output is by default in terse format. Use --verbose for a more
176 elaborate output format.
177
178 set-property SERVICE OBJECT INTERFACE PROPERTY SIGNATURE ARGUMENT...
179 Set the current value an object property. Takes a service name,
180 object path, interface name, property name, property signature,
181 followed by a list of parameters formatted as strings.
182
183 help
184 Show command syntax help.
185
187 The call and set-property commands take a signature string followed by
188 a list of parameters formatted as string (for details on D-Bus
189 signature strings see the Type system chapter of the D-Bus
190 specification[2]). For simple types each parameter following the
191 signature should simply be the parameter's value formatted as string.
192 Positive boolean values may be formatted as "true", "yes", "on", "1";
193 negative boolean values may be specified as "false", "no", "off", "0".
194 For arrays, a numeric argument for the number of entries followed by
195 the entries shall be specified. For variants the signature of the
196 contents shall be specified, followed by the contents. For dictionaries
197 and structs the contents of them shall be directly specified.
198
199 For example,
200
201 s jawoll
202
203 is the formatting of a single string "jawoll".
204
205 as 3 hello world foobar
206
207 is the formatting of a string array with three entries, "hello",
208 "world" and "foobar".
209
210 a{sv} 3 One s Eins Two u 2 Yes b true
211
212 is the formatting of a dictionary array that maps strings to variants,
213 consisting of three entries. The string "One" is assigned the string
214 "Eins". The string "Two" is assigned the 32bit unsigned integer 2. The
215 string "Yes" is assigned a positive boolean.
216
217 Note that the call, get-property, introspect commands will also
218 generate output in this format for the returned data. Since this format
219 is sometimes too terse to be easily understood, the call and
220 get-property commands may generate a more verbose, multi-line output
221 when passed the --verbose option.
222
224 Example 1. Write and Read a Property
225
226 The following two commands first write a property and then read it
227 back. The property is found on the "/org/freedesktop/systemd1" object
228 of the "org.freedesktop.systemd1" service. The name of the property is
229 "LogLevel" on the "org.freedesktop.systemd1.Manager" interface. The
230 property contains a single string:
231
232 # busctl set-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager LogLevel s debug
233 # busctl get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager LogLevel
234 s "debug"
235
236 Example 2. Terse and Verbose Output
237
238 The following two commands read a property that contains an array of
239 strings, and first show it in terse format, followed by verbose format:
240
241 $ busctl get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager Environment
242 as 2 "LANG=en_US.UTF-8" "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
243 $ busctl get-property --verbose org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager Environment
244 ARRAY "s" {
245 STRING "LANG=en_US.UTF-8";
246 STRING "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin";
247 };
248
249 Example 3. Invoking a Method
250
251 The following command invokes a the "StartUnit" method on the
252 "org.freedesktop.systemd1.Manager" interface of the
253 "/org/freedesktop/systemd1" object of the "org.freedesktop.systemd1"
254 service, and passes it two strings "cups.service" and "replace". As
255 result of the method call a single object path parameter is received
256 and shown:
257
258 # busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager StartUnit ss "cups.service" "replace"
259 o "/org/freedesktop/systemd1/job/42684"
260
262 dbus-daemon(1), D-Bus[3], kdbus[4], sd-bus(3), systemd(1),
263 machinectl(1), wireshark(1)
264
266 1. Libpcap File Format
267 http://wiki.wireshark.org/Development/LibpcapFileFormat
268
269 2. Type system chapter of the D-Bus specification
270 http://dbus.freedesktop.org/doc/dbus-specification.html#type-system
271
272 3. D-Bus
273 http://freedesktop.org/wiki/Software/dbus
274
275 4. kdbus
276 https://code.google.com/p/d-bus/
277
278
279
280systemd 219 BUSCTL(1)