]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/udevadm.xml
journal: default ImportKernel=no until we make use of structured logging
[thirdparty/systemd.git] / man / udevadm.xml
CommitLineData
225cb03b 1<?xml version='1.0'?>
63749b1a
KS
2<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
3<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
225cb03b
KS
4 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5
63749b1a
KS
6<refentry id="udevadm">
7 <refentryinfo>
225cb03b 8 <title>udevadm</title>
d3a2386d
KS
9 <productname>systemd</productname>
10 <authorgroup>
11 <author>
12 <contrib>Developer</contrib>
13 <firstname>Kay</firstname>
14 <surname>Sievers</surname>
15 <email>kay@vrfy.org</email>
16 </author>
17 </authorgroup>
63749b1a 18 </refentryinfo>
225cb03b 19
63749b1a
KS
20 <refmeta>
21 <refentrytitle>udevadm</refentrytitle>
22 <manvolnum>8</manvolnum>
23 <refmiscinfo class="version"></refmiscinfo>
24 </refmeta>
225cb03b 25
63749b1a
KS
26 <refnamediv>
27 <refname>udevadm</refname><refpurpose>udev management tool</refpurpose>
28 </refnamediv>
225cb03b 29
63749b1a
KS
30 <refsynopsisdiv>
31 <cmdsynopsis>
32 <command>udevadm</command>
33 <arg><option>--debug</option></arg>
34 <arg><option>--version</option></arg>
35 <arg><option>--help</option></arg>
36 </cmdsynopsis>
37 <cmdsynopsis>
38 <command>udevadm info <replaceable>options</replaceable></command>
39 </cmdsynopsis>
40 <cmdsynopsis>
41 <command>udevadm trigger <optional>options</optional></command>
42 </cmdsynopsis>
43 <cmdsynopsis>
44 <command>udevadm settle <optional>options</optional></command>
45 </cmdsynopsis>
46 <cmdsynopsis>
47 <command>udevadm control <replaceable>command</replaceable></command>
48 </cmdsynopsis>
49 <cmdsynopsis>
50 <command>udevadm monitor <optional>options</optional></command>
51 </cmdsynopsis>
52 <cmdsynopsis>
53 <command>udevadm test <optional>options</optional> <replaceable>devpath</replaceable></command>
54 </cmdsynopsis>
d7867b31
KS
55 <cmdsynopsis>
56 <command>udevadm test-builtin <optional>options</optional> <replaceable>command</replaceable> <replaceable>devpath</replaceable></command>
57 </cmdsynopsis>
63749b1a 58 </refsynopsisdiv>
225cb03b 59
63749b1a
KS
60 <refsect1><title>Description</title>
61 <para>udevadm expects a command and command specific options. It
62 controls the runtime behavior of udev, requests kernel events,
63 manages the event queue, and provides simple debugging mechanisms.</para>
64 </refsect1>
225cb03b 65
63749b1a
KS
66 <refsect1><title>OPTIONS</title>
67 <variablelist>
68 <varlistentry>
69 <term><option>--debug</option></term>
70 <listitem>
71 <para>Print debug messages to stderr.</para>
72 </listitem>
73 </varlistentry>
74 <varlistentry>
75 <term><option>--version</option></term>
76 <listitem>
77 <para>Print version number.</para>
78 </listitem>
79 </varlistentry>
80 <varlistentry>
81 <term><option>--help</option></term>
82 <listitem>
83 <para>Print help text.</para>
84 </listitem>
85 </varlistentry>
86 </variablelist>
225cb03b 87
63749b1a
KS
88 <refsect2><title>udevadm info <replaceable>options</replaceable></title>
89 <para>Queries the udev database for device information
90 stored in the udev database. It can also query the properties
91 of a device from its sysfs representation to help creating udev
92 rules that match this device.</para>
93 <variablelist>
94 <varlistentry>
95 <term><option>--query=<replaceable>type</replaceable></option></term>
96 <listitem>
97 <para>Query the database for specified type of device data. It needs the
98 <option>--path</option> or <option>--name</option> to identify the specified
99 device. Valid queries are:
100 <command>name</command>, <command>symlink</command>, <command>path</command>,
101 <command>property</command>, <command>all</command>.</para>
102 </listitem>
103 </varlistentry>
104 <varlistentry>
105 <term><option>--path=<replaceable>devpath</replaceable></option></term>
106 <listitem>
107 <para>The devpath of the device to query.</para>
108 </listitem>
109 </varlistentry>
110 <varlistentry>
111 <term><option>--name=<replaceable>file</replaceable></option></term>
112 <listitem>
113 <para>The name of the device node or a symlink to query</para>
114 </listitem>
115 </varlistentry>
116 <varlistentry>
117 <term><option>--root</option></term>
118 <listitem>
4f5d327a
KS
119 <para>Print absolute paths in <command>name</command> or <command>symlink</command>
120 query.</para>
4ec9c3e7
KS
121 </listitem>
122 </varlistentry>
63749b1a
KS
123 <varlistentry>
124 <term><option>--attribute-walk</option></term>
125 <listitem>
126 <para>Print all sysfs properties of the specified device that can be used
127 in udev rules to match the specified device. It prints all devices
128 along the chain, up to the root of sysfs that can be used in udev rules.</para>
129 </listitem>
130 </varlistentry>
dc1791a9
KS
131 <varlistentry>
132 <term><option>--export</option></term>
133 <listitem>
134 <para>Print output as key/value pairs. Values are enclosed in single quotes.</para>
135 </listitem>
136 </varlistentry>
137 <varlistentry>
138 <term><option>--export-prefix=<replaceable>name</replaceable></option></term>
139 <listitem>
140 <para>Add a prefix to the key name of exported values.</para>
141 </listitem>
142 </varlistentry>
63749b1a
KS
143 <varlistentry>
144 <term><option>--device-id-of-file=<replaceable>file</replaceable></option></term>
145 <listitem>
146 <para>Print major/minor numbers of the underlying device, where the file
147 lives on.</para>
148 </listitem>
149 </varlistentry>
150 <varlistentry>
151 <term><option>--export-db</option></term>
152 <listitem>
153 <para>Export the content of the udev database.</para>
154 </listitem>
155 </varlistentry>
9ead6627
KS
156 <varlistentry>
157 <term><option>--cleanup-db</option></term>
158 <listitem>
159 <para>Cleanup the udev database.</para>
160 </listitem>
161 </varlistentry>
63749b1a
KS
162 <varlistentry>
163 <term><option>--version</option></term>
164 <listitem>
165 <para>Print version.</para>
166 </listitem>
167 </varlistentry>
168 <varlistentry>
169 <term><option>--help</option></term>
170 <listitem>
171 <para>Print help text.</para>
172 </listitem>
173 </varlistentry>
174 </variablelist>
175 </refsect2>
225cb03b 176
63749b1a
KS
177 <refsect2><title>udevadm trigger <optional>options</optional></title>
178 <para>Request device events from the kernel. Primarily used to replay events at system coldplug time.</para>
179 <variablelist>
180 <varlistentry>
181 <term><option>--verbose</option></term>
182 <listitem>
183 <para>Print the list of devices which will be triggered.</para>
184 </listitem>
185 </varlistentry>
186 <varlistentry>
187 <term><option>--dry-run</option></term>
188 <listitem>
189 <para>Do not actually trigger the event.</para>
190 </listitem>
191 </varlistentry>
192 <varlistentry>
193 <term><option>--type=<replaceable>type</replaceable></option></term>
194 <listitem>
195 <para>Trigger a specific type of devices. Valid types are:
864fde8a 196 <command>devices</command>, <command>subsystems</command>.
63749b1a
KS
197 The default value is <command>devices</command>.</para>
198 </listitem>
199 </varlistentry>
200 <varlistentry>
201 <term><option>--action=<replaceable>action</replaceable></option></term>
202 <listitem>
203 <para>Type of event to be triggered. The default value is <command>change</command>.</para>
204 </listitem>
205 </varlistentry>
206 <varlistentry>
207 <term><option>--subsystem-match=<replaceable>subsystem</replaceable></option></term>
208 <listitem>
209 <para>Trigger events for devices which belong to a matching subsystem. This option
210 can be specified multiple times and supports shell style pattern matching.</para>
211 </listitem>
212 </varlistentry>
213 <varlistentry>
214 <term><option>--subsystem-nomatch=<replaceable>subsystem</replaceable></option></term>
215 <listitem>
216 <para>Do not trigger events for devices which belong to a matching subsystem. This option
217 can be specified multiple times and supports shell style pattern matching.</para>
218 </listitem>
219 </varlistentry>
220 <varlistentry>
221 <term><option>--attr-match=<replaceable>attribute</replaceable>=<replaceable>value</replaceable></option></term>
222 <listitem>
223 <para>Trigger events for devices with a matching sysfs attribute. If a value is specified
224 along with the attribute name, the content of the attribute is matched against the given
225 value using shell style pattern matching. If no value is specified, the existence of the
226 sysfs attribute is checked. This option can be specified multiple times.</para>
227 </listitem>
228 </varlistentry>
229 <varlistentry>
230 <term><option>--attr-nomatch=<replaceable>attribute</replaceable>=<replaceable>value</replaceable></option></term>
231 <listitem>
232 <para>Do not trigger events for devices with a matching sysfs attribute. If a value is
233 specified along with the attribute name, the content of the attribute is matched against
234 the given value using shell style pattern matching. If no value is specified, the existence
235 of the sysfs attribute is checked. This option can be specified multiple times.</para>
236 </listitem>
237 </varlistentry>
238 <varlistentry>
239 <term><option>--property-match=<replaceable>property</replaceable>=<replaceable>value</replaceable></option></term>
240 <listitem>
241 <para>Trigger events for devices with a matching property value. This option can be
242 specified multiple times and supports shell style pattern matching.</para>
243 </listitem>
244 </varlistentry>
245 <varlistentry>
246 <term><option>--tag-match=<replaceable>property</replaceable></option></term>
247 <listitem>
248 <para>Trigger events for devices with a matching tag. This option can be
249 specified multiple times.</para>
250 </listitem>
251 </varlistentry>
252 <varlistentry>
253 <term><option>--sysname-match=<replaceable>name</replaceable></option></term>
254 <listitem>
255 <para>Trigger events for devices with a matching sys device name. This option can be
256 specified multiple times and supports shell style pattern matching.</para>
257 </listitem>
258 </varlistentry>
b05211fa
KS
259 <varlistentry>
260 <term><option>--parent-match=<replaceable>syspath</replaceable></option></term>
261 <listitem>
262 <para>Trigger events for all children of a given device.</para>
263 </listitem>
264 </varlistentry>
63749b1a
KS
265 </variablelist>
266 </refsect2>
225cb03b 267
63749b1a
KS
268 <refsect2><title>udevadm settle <optional>options</optional></title>
269 <para>Watches the udev event queue, and exits if all current events are handled.</para>
270 <variablelist>
271 <varlistentry>
272 <term><option>--timeout=<replaceable>seconds</replaceable></option></term>
273 <listitem>
274 <para>Maximum number of seconds to wait for the event queue to become empty.
d2f4a346 275 The default value is 120 seconds. A value of 0 will check if the queue is empty
63749b1a
KS
276 and always return immediately.</para>
277 </listitem>
278 </varlistentry>
279 <varlistentry>
280 <term><option>--seq-start=<replaceable>seqnum</replaceable></option></term>
281 <listitem>
282 <para>Wait only for events after the given sequence number.</para>
283 </listitem>
284 </varlistentry>
285 <varlistentry>
286 <term><option>--seq-end=<replaceable>seqnum</replaceable></option></term>
287 <listitem>
288 <para>Wait only for events before the given sequence number.</para>
289 </listitem>
290 </varlistentry>
291 <varlistentry>
292 <term><option>--exit-if-exists=<replaceable>file</replaceable></option></term>
293 <listitem>
294 <para>Stop waiting if file exists.</para>
295 </listitem>
296 </varlistentry>
297 <varlistentry>
298 <term><option>--quiet</option></term>
299 <listitem>
300 <para>Do not print any output, like the remaining queue entries when reaching the timeout.</para>
301 </listitem>
302 </varlistentry>
303 <varlistentry>
304 <term><option>--help</option></term>
305 <listitem>
306 <para>Print help text.</para>
307 </listitem>
308 </varlistentry>
309 </variablelist>
310 </refsect2>
225cb03b 311
63749b1a
KS
312 <refsect2><title>udevadm control <replaceable>command</replaceable></title>
313 <para>Modify the internal state of the running udev daemon.</para>
314 <variablelist>
ff2c503d
KS
315 <varlistentry>
316 <term><option>--exit</option></term>
317 <listitem>
f13b388f 318 <para>Signal and wait for systemd-udevd to exit.</para>
ff2c503d
KS
319 </listitem>
320 </varlistentry>
63749b1a
KS
321 <varlistentry>
322 <term><option>--log-priority=<replaceable>value</replaceable></option></term>
323 <listitem>
f13b388f 324 <para>Set the internal log level of systemd-udevd. Valid values are the numerical
63749b1a
KS
325 syslog priorities or their textual representations: <option>err</option>,
326 <option>info</option> and <option>debug</option>.</para>
327 </listitem>
328 </varlistentry>
329 <varlistentry>
330 <term><option>--stop-exec-queue</option></term>
331 <listitem>
f13b388f 332 <para>Signal systemd-udevd to stop executing new events. Incoming events
63749b1a
KS
333 will be queued.</para>
334 </listitem>
335 </varlistentry>
336 <varlistentry>
337 <term><option>--start-exec-queue</option></term>
338 <listitem>
f13b388f 339 <para>Signal systemd-udevd to enable the execution of events.</para>
63749b1a
KS
340 </listitem>
341 </varlistentry>
342 <varlistentry>
7c85d636 343 <term><option>--reload</option></term>
63749b1a 344 <listitem>
f13b388f 345 <para>Signal systemd-udevd to reload the rules files and other databases like the kernel
7c85d636
KS
346 module index. Reloading rules and databases does not apply any changes to already
347 existing devices; the new configuration will only be applied to new events.</para>
63749b1a
KS
348 </listitem>
349 </varlistentry>
350 <varlistentry>
351 <term><option>--property=<replaceable>KEY</replaceable>=<replaceable>value</replaceable></option></term>
352 <listitem>
353 <para>Set a global property for all events.</para>
354 </listitem>
355 </varlistentry>
356 <varlistentry>
87d55ff6 357 <term><option>--children-max=</option><replaceable>value</replaceable></term>
63749b1a 358 <listitem>
f13b388f 359 <para>Set the maximum number of events, systemd-udevd will handle at the
63749b1a
KS
360 same time.</para>
361 </listitem>
362 </varlistentry>
ff2c503d
KS
363 <varlistentry>
364 <term><option>--timeout=</option><replaceable>seconds</replaceable></term>
365 <listitem>
f13b388f 366 <para>The maximum number seconds to wait for a reply from systemd-udevd.</para>
ff2c503d
KS
367 </listitem>
368 </varlistentry>
63749b1a
KS
369 <varlistentry>
370 <term><option>--help</option></term>
371 <listitem>
372 <para>Print help text.</para>
373 </listitem>
374 </varlistentry>
375 </variablelist>
376 </refsect2>
225cb03b 377
63749b1a
KS
378 <refsect2><title>udevadm monitor <optional>options</optional></title>
379 <para>Listens to the kernel uevents and events sent out by a udev rule
380 and prints the devpath of the event to the console. It can be used to analyze the
381 event timing, by comparing the timestamps of the kernel uevent and the udev event.
382 </para>
383 <variablelist>
384 <varlistentry>
385 <term><option>--kernel</option></term>
386 <listitem>
387 <para>Print the kernel uevents.</para>
388 </listitem>
389 </varlistentry>
390 <varlistentry>
391 <term><option>--udev</option></term>
392 <listitem>
393 <para>Print the udev event after the rule processing.</para>
394 </listitem>
395 </varlistentry>
396 <varlistentry>
397 <term><option>--property</option></term>
398 <listitem>
399 <para>Also print the properties of the event.</para>
400 </listitem>
401 </varlistentry>
402 <varlistentry>
403 <term><option>--subsystem-match=<replaceable>string[/string]</replaceable></option></term>
404 <listitem>
405 <para>Filter events by subsystem[/devtype]. Only udev events with a matching subsystem value will pass.</para>
406 </listitem>
407 </varlistentry>
408 <varlistentry>
409 <term><option>--tag-match=<replaceable>string</replaceable></option></term>
410 <listitem>
411 <para>Filter events by property. Only udev events with a given tag attached will pass.</para>
412 </listitem>
413 </varlistentry>
414 <varlistentry>
415 <term><option>--help</option></term>
416 <listitem>
417 <para>Print help text.</para>
418 </listitem>
419 </varlistentry>
420 </variablelist>
421 </refsect2>
225cb03b 422
63749b1a
KS
423 <refsect2><title>udevadm test <optional>options</optional> <replaceable>devpath</replaceable></title>
424 <para>Simulate a udev event run for the given device, and print debug output.</para>
425 <variablelist>
426 <varlistentry>
427 <term><option>--action=<replaceable>string</replaceable></option></term>
428 <listitem>
429 <para>The action string.</para>
430 </listitem>
431 </varlistentry>
432 <varlistentry>
433 <term><option>--subsystem=<replaceable>string</replaceable></option></term>
434 <listitem>
435 <para>The subsystem string.</para>
436 </listitem>
437 </varlistentry>
438 <varlistentry>
439 <term><option>--help</option></term>
440 <listitem>
441 <para>Print help text.</para>
442 </listitem>
443 </varlistentry>
444 </variablelist>
445 </refsect2>
d7867b31
KS
446
447 <refsect2><title>udevadm test-builtin <optional>options</optional> <replaceable>command</replaceable> <replaceable>devpath</replaceable></title>
448 <para>Run a built-in command for the given device, and print debug output.</para>
449 <variablelist>
450 <varlistentry>
451 <term><option>--help</option></term>
452 <listitem>
453 <para>Print help text.</para>
454 </listitem>
455 </varlistentry>
456 </variablelist>
457 </refsect2>
63749b1a 458 </refsect1>
225cb03b 459
63749b1a
KS
460 <refsect1>
461 <title>See Also</title>
462 <para><citerefentry>
463 <refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum>
464 </citerefentry>
465 <citerefentry>
b79f817b 466 <refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum>
63749b1a
KS
467 </citerefentry></para>
468 </refsect1>
469</refentry>