]> git.proxmox.com Git - systemd.git/blame - man/udevadm.xml
Imported Upstream version 231
[systemd.git] / man / udevadm.xml
CommitLineData
f47781d8 1<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
663996b3
MS
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5<refentry id="udevadm">
6 <refentryinfo>
7 <title>udevadm</title>
8 <productname>systemd</productname>
9 <authorgroup>
10 <author>
11 <contrib>Developer</contrib>
12 <firstname>Kay</firstname>
13 <surname>Sievers</surname>
14 <email>kay@vrfy.org</email>
15 </author>
16 </authorgroup>
17 </refentryinfo>
18
19 <refmeta>
20 <refentrytitle>udevadm</refentrytitle>
21 <manvolnum>8</manvolnum>
663996b3
MS
22 </refmeta>
23
24 <refnamediv>
25 <refname>udevadm</refname><refpurpose>udev management tool</refpurpose>
26 </refnamediv>
27
28 <refsynopsisdiv>
29 <cmdsynopsis>
30 <command>udevadm</command>
31 <arg><option>--debug</option></arg>
32 <arg><option>--version</option></arg>
33 <arg><option>--help</option></arg>
34 </cmdsynopsis>
35 <cmdsynopsis>
36 <command>udevadm info <replaceable>options</replaceable></command>
37 </cmdsynopsis>
38 <cmdsynopsis>
39 <command>udevadm trigger <optional>options</optional></command>
40 </cmdsynopsis>
41 <cmdsynopsis>
42 <command>udevadm settle <optional>options</optional></command>
43 </cmdsynopsis>
44 <cmdsynopsis>
45 <command>udevadm control <replaceable>command</replaceable></command>
46 </cmdsynopsis>
47 <cmdsynopsis>
48 <command>udevadm monitor <optional>options</optional></command>
49 </cmdsynopsis>
663996b3
MS
50 <cmdsynopsis>
51 <command>udevadm test <optional>options</optional> <replaceable>devpath</replaceable></command>
52 </cmdsynopsis>
53 <cmdsynopsis>
54 <command>udevadm test-builtin <optional>options</optional> <replaceable>command</replaceable> <replaceable>devpath</replaceable></command>
55 </cmdsynopsis>
56 </refsynopsisdiv>
57
58 <refsect1><title>Description</title>
60f067b4
JS
59 <para><command>udevadm</command> expects a command and command
60 specific options. It controls the runtime behavior of
61 <command>systemd-udevd</command>, requests kernel events, manages
62 the event queue, and provides simple debugging mechanisms.</para>
663996b3
MS
63 </refsect1>
64
f47781d8 65 <refsect1><title>Options</title>
663996b3
MS
66 <variablelist>
67 <varlistentry>
68 <term><option>--debug</option></term>
69 <listitem>
60f067b4 70 <para>Print debug messages to standard error.</para>
663996b3
MS
71 </listitem>
72 </varlistentry>
73 <varlistentry>
74 <term><option>--version</option></term>
75 <listitem>
76 <para>Print version number.</para>
77 </listitem>
78 </varlistentry>
79 <varlistentry>
60f067b4 80 <term><option>-h</option></term>
663996b3
MS
81 <term><option>--help</option></term>
82 <listitem>
83 <para>Print help text.</para>
84 </listitem>
85 </varlistentry>
86 </variablelist>
87
f47781d8
MP
88 <refsect2><title>udevadm info
89 <arg choice="opt"><replaceable>options</replaceable></arg>
90 <arg choice="opt"><replaceable>devpath</replaceable>|<replaceable>file</replaceable></arg>
91 </title>
92
663996b3
MS
93 <para>Queries the udev database for device information
94 stored in the udev database. It can also query the properties
95 of a device from its sysfs representation to help creating udev
96 rules that match this device.</para>
97 <variablelist>
98 <varlistentry>
60f067b4
JS
99 <term><option>-q</option></term>
100 <term><option>--query=<replaceable>TYPE</replaceable></option></term>
663996b3 101 <listitem>
60f067b4
JS
102 <para>Query the database for the specified type of device
103 data. It needs the <option>--path</option> or
104 <option>--name</option> to identify the specified device.
105 Valid <replaceable>TYPE</replaceable>s are:
106 <constant>name</constant>, <constant>symlink</constant>,
107 <constant>path</constant>, <constant>property</constant>,
108 <constant>all</constant>.</para>
663996b3
MS
109 </listitem>
110 </varlistentry>
111 <varlistentry>
60f067b4
JS
112 <term><option>-p</option></term>
113 <term><option>--path=<replaceable>DEVPATH</replaceable></option></term>
663996b3 114 <listitem>
60f067b4
JS
115 <para>The <filename>/sys</filename> path of the device to
116 query, e.g.
117 <filename><optional>/sys</optional>/class/block/sda</filename>.
118 Note that this option usually is not very useful, since
119 <command>udev</command> can guess the type of the
120 argument, so <command>udevadm
121 --devpath=/class/block/sda</command> is equivalent to
122 <command>udevadm /sys/class/block/sda</command>.</para>
663996b3
MS
123 </listitem>
124 </varlistentry>
125 <varlistentry>
60f067b4
JS
126 <term><option>-n</option></term>
127 <term><option>--name=<replaceable>FILE</replaceable></option></term>
663996b3 128 <listitem>
60f067b4
JS
129 <para>The name of the device node or a symlink to query,
130 e.g. <filename><optional>/dev</optional>/sda</filename>.
131 Note that this option usually is not very useful, since
132 <command>udev</command> can guess the type of the
133 argument, so <command>udevadm --name=sda</command> is
134 equivalent to <command>udevadm /dev/sda</command>.</para>
663996b3
MS
135 </listitem>
136 </varlistentry>
137 <varlistentry>
60f067b4 138 <term><option>-r</option></term>
663996b3
MS
139 <term><option>--root</option></term>
140 <listitem>
141 <para>Print absolute paths in <command>name</command> or <command>symlink</command>
142 query.</para>
143 </listitem>
144 </varlistentry>
145 <varlistentry>
60f067b4 146 <term><option>-a</option></term>
663996b3
MS
147 <term><option>--attribute-walk</option></term>
148 <listitem>
149 <para>Print all sysfs properties of the specified device that can be used
150 in udev rules to match the specified device. It prints all devices
151 along the chain, up to the root of sysfs that can be used in udev rules.</para>
152 </listitem>
153 </varlistentry>
154 <varlistentry>
60f067b4 155 <term><option>-x</option></term>
663996b3
MS
156 <term><option>--export</option></term>
157 <listitem>
158 <para>Print output as key/value pairs. Values are enclosed in single quotes.</para>
159 </listitem>
160 </varlistentry>
161 <varlistentry>
60f067b4
JS
162 <term><option>-P</option></term>
163 <term><option>--export-prefix=<replaceable>NAME</replaceable></option></term>
663996b3
MS
164 <listitem>
165 <para>Add a prefix to the key name of exported values.</para>
166 </listitem>
167 </varlistentry>
168 <varlistentry>
60f067b4
JS
169 <term><option>-d</option></term>
170 <term><option>--device-id-of-file=<replaceable>FILE</replaceable></option></term>
663996b3
MS
171 <listitem>
172 <para>Print major/minor numbers of the underlying device, where the file
173 lives on.</para>
174 </listitem>
175 </varlistentry>
176 <varlistentry>
60f067b4 177 <term><option>-e</option></term>
663996b3
MS
178 <term><option>--export-db</option></term>
179 <listitem>
180 <para>Export the content of the udev database.</para>
181 </listitem>
182 </varlistentry>
183 <varlistentry>
60f067b4 184 <term><option>-c</option></term>
663996b3
MS
185 <term><option>--cleanup-db</option></term>
186 <listitem>
187 <para>Cleanup the udev database.</para>
188 </listitem>
189 </varlistentry>
190 <varlistentry>
191 <term><option>--version</option></term>
192 <listitem>
193 <para>Print version.</para>
194 </listitem>
195 </varlistentry>
196 <varlistentry>
60f067b4 197 <term><option>-h</option></term>
663996b3
MS
198 <term><option>--help</option></term>
199 <listitem>
200 <para>Print help text.</para>
201 </listitem>
202 </varlistentry>
203 </variablelist>
f47781d8 204
db2df898 205 <para>In addition, an optional positional argument can be used
f47781d8
MP
206 to specify a device name or a sys path. It must start with
207 <filename>/dev</filename> or <filename>/sys</filename>
208 respectively.</para>
663996b3
MS
209 </refsect2>
210
f47781d8
MP
211 <refsect2><title>udevadm trigger
212 <arg choice="opt"><replaceable>options</replaceable></arg>
213 <arg choice="opt" rep="repeat"><replaceable>devpath</replaceable>|<replaceable>file</replaceable></arg></title>
663996b3
MS
214 <para>Request device events from the kernel. Primarily used to replay events at system coldplug time.</para>
215 <variablelist>
216 <varlistentry>
60f067b4 217 <term><option>-v</option></term>
663996b3
MS
218 <term><option>--verbose</option></term>
219 <listitem>
220 <para>Print the list of devices which will be triggered.</para>
221 </listitem>
222 </varlistentry>
223 <varlistentry>
60f067b4 224 <term><option>-n</option></term>
663996b3
MS
225 <term><option>--dry-run</option></term>
226 <listitem>
227 <para>Do not actually trigger the event.</para>
228 </listitem>
229 </varlistentry>
230 <varlistentry>
60f067b4
JS
231 <term><option>-t</option></term>
232 <term><option>--type=<replaceable>TYPE</replaceable></option></term>
663996b3
MS
233 <listitem>
234 <para>Trigger a specific type of devices. Valid types are:
235 <command>devices</command>, <command>subsystems</command>.
236 The default value is <command>devices</command>.</para>
237 </listitem>
238 </varlistentry>
239 <varlistentry>
60f067b4
JS
240 <term><option>-c</option></term>
241 <term><option>--action=<replaceable>ACTION</replaceable></option></term>
663996b3 242 <listitem>
60f067b4
JS
243 <para>Type of event to be triggered. The default value is
244 <command>change</command>.</para>
663996b3
MS
245 </listitem>
246 </varlistentry>
247 <varlistentry>
60f067b4
JS
248 <term><option>-s</option></term>
249 <term><option>--subsystem-match=<replaceable>SUBSYSTEM</replaceable></option></term>
663996b3 250 <listitem>
60f067b4
JS
251 <para>Trigger events for devices which belong to a
252 matching subsystem. This option can be specified multiple
253 times and supports shell style pattern matching.</para>
663996b3
MS
254 </listitem>
255 </varlistentry>
256 <varlistentry>
60f067b4
JS
257 <term><option>-S</option></term>
258 <term><option>--subsystem-nomatch=<replaceable>SUBSYSTEM</replaceable></option></term>
663996b3
MS
259 <listitem>
260 <para>Do not trigger events for devices which belong to a matching subsystem. This option
261 can be specified multiple times and supports shell style pattern matching.</para>
262 </listitem>
263 </varlistentry>
264 <varlistentry>
60f067b4
JS
265 <term><option>-a</option></term>
266 <term><option>--attr-match=<replaceable>ATTRIBUTE</replaceable>=<replaceable>VALUE</replaceable></option></term>
663996b3 267 <listitem>
60f067b4
JS
268 <para>Trigger events for devices with a matching sysfs
269 attribute. If a value is specified along with the
270 attribute name, the content of the attribute is matched
271 against the given value using shell style pattern
272 matching. If no value is specified, the existence of the
273 sysfs attribute is checked. This option can be specified
274 multiple times.</para>
663996b3
MS
275 </listitem>
276 </varlistentry>
277 <varlistentry>
60f067b4
JS
278 <term><option>-A</option></term>
279 <term><option>--attr-nomatch=<replaceable>ATTRIBUTE</replaceable>=<replaceable>VALUE</replaceable></option></term>
663996b3 280 <listitem>
60f067b4
JS
281 <para>Do not trigger events for devices with a matching
282 sysfs attribute. If a value is specified along with the
283 attribute name, the content of the attribute is matched
284 against the given value using shell style pattern
285 matching. If no value is specified, the existence of the
286 sysfs attribute is checked. This option can be specified
287 multiple times.</para>
663996b3
MS
288 </listitem>
289 </varlistentry>
290 <varlistentry>
60f067b4
JS
291 <term><option>-p</option></term>
292 <term><option>--property-match=<replaceable>PROPERTY</replaceable>=<replaceable>VALUE</replaceable></option></term>
663996b3 293 <listitem>
60f067b4
JS
294 <para>Trigger events for devices with a matching property
295 value. This option can be specified multiple times and
296 supports shell style pattern matching.</para>
663996b3
MS
297 </listitem>
298 </varlistentry>
299 <varlistentry>
60f067b4
JS
300 <term><option>-g</option></term>
301 <term><option>--tag-match=<replaceable>PROPERTY</replaceable></option></term>
663996b3 302 <listitem>
60f067b4
JS
303 <para>Trigger events for devices with a matching tag. This
304 option can be specified multiple times.</para>
663996b3
MS
305 </listitem>
306 </varlistentry>
307 <varlistentry>
60f067b4 308 <term><option>-y</option></term>
f47781d8 309 <term><option>--sysname-match=<replaceable>PATH</replaceable></option></term>
663996b3 310 <listitem>
60f067b4 311 <para>Trigger events for devices with a matching sys
f47781d8 312 device path. This option can be specified multiple times
60f067b4 313 and supports shell style pattern matching.</para>
663996b3
MS
314 </listitem>
315 </varlistentry>
f47781d8
MP
316 <varlistentry>
317 <term><option>--name-match=<replaceable>NAME</replaceable></option></term>
318 <listitem>
319 <para>Trigger events for devices with a matching
db2df898 320 device path. This option can be specified multiple
f47781d8
MP
321 times.</para>
322 </listitem>
323 </varlistentry>
663996b3 324 <varlistentry>
60f067b4
JS
325 <term><option>-b</option></term>
326 <term><option>--parent-match=<replaceable>SYSPATH</replaceable></option></term>
663996b3 327 <listitem>
60f067b4
JS
328 <para>Trigger events for all children of a given
329 device.</para>
330 </listitem>
331 </varlistentry>
332 <varlistentry>
333 <term><option>-h</option></term>
334 <term><option>--help</option></term>
335 <listitem>
336 <para>Print help text.</para>
663996b3
MS
337 </listitem>
338 </varlistentry>
339 </variablelist>
f47781d8 340
db2df898 341 <para>In addition, optional positional arguments can be used
f47781d8
MP
342 to specify device names or sys paths. They must start with
343 <filename>/dev</filename> or <filename>/sys</filename>
344 respectively.</para>
663996b3
MS
345 </refsect2>
346
f47781d8
MP
347 <refsect2><title>udevadm settle
348 <arg choice="opt"><replaceable>options</replaceable></arg>
349 </title>
663996b3
MS
350 <para>Watches the udev event queue, and exits if all current events are handled.</para>
351 <variablelist>
352 <varlistentry>
60f067b4
JS
353 <term><option>-t</option></term>
354 <term><option>--timeout=<replaceable>SECONDS</replaceable></option></term>
663996b3 355 <listitem>
60f067b4
JS
356 <para>Maximum number of seconds to wait for the event
357 queue to become empty. The default value is 120 seconds. A
358 value of 0 will check if the queue is empty and always
359 return immediately.</para>
663996b3
MS
360 </listitem>
361 </varlistentry>
362 <varlistentry>
60f067b4
JS
363 <term><option>-E</option></term>
364 <term><option>--exit-if-exists=<replaceable>FILE</replaceable></option></term>
663996b3
MS
365 <listitem>
366 <para>Stop waiting if file exists.</para>
367 </listitem>
368 </varlistentry>
369 <varlistentry>
60f067b4 370 <term><option>-h</option></term>
663996b3
MS
371 <term><option>--help</option></term>
372 <listitem>
373 <para>Print help text.</para>
374 </listitem>
375 </varlistentry>
376 </variablelist>
377 </refsect2>
378
379 <refsect2><title>udevadm control <replaceable>command</replaceable></title>
380 <para>Modify the internal state of the running udev daemon.</para>
381 <variablelist>
382 <varlistentry>
5a920b42 383 <term><option>-e</option></term>
663996b3
MS
384 <term><option>--exit</option></term>
385 <listitem>
386 <para>Signal and wait for systemd-udevd to exit.</para>
387 </listitem>
388 </varlistentry>
389 <varlistentry>
60f067b4 390 <term><option>-l</option></term>
663996b3
MS
391 <term><option>--log-priority=<replaceable>value</replaceable></option></term>
392 <listitem>
f47781d8
MP
393 <para>Set the internal log level of
394 <filename>systemd-udevd</filename>. Valid values are the
395 numerical syslog priorities or their textual
396 representations: <option>emerg</option>,
397 <option>alert</option>, <option>crit</option>,
398 <option>err</option>, <option>warning</option>,
399 <option>notice</option>, <option>info</option>, and
400 <option>debug</option>.</para>
663996b3
MS
401 </listitem>
402 </varlistentry>
403 <varlistentry>
60f067b4 404 <term><option>-s</option></term>
663996b3
MS
405 <term><option>--stop-exec-queue</option></term>
406 <listitem>
407 <para>Signal systemd-udevd to stop executing new events. Incoming events
408 will be queued.</para>
409 </listitem>
410 </varlistentry>
411 <varlistentry>
60f067b4 412 <term><option>-S</option></term>
663996b3
MS
413 <term><option>--start-exec-queue</option></term>
414 <listitem>
415 <para>Signal systemd-udevd to enable the execution of events.</para>
416 </listitem>
417 </varlistentry>
418 <varlistentry>
60f067b4 419 <term><option>-R</option></term>
663996b3
MS
420 <term><option>--reload</option></term>
421 <listitem>
422 <para>Signal systemd-udevd to reload the rules files and other databases like the kernel
423 module index. Reloading rules and databases does not apply any changes to already
424 existing devices; the new configuration will only be applied to new events.</para>
425 </listitem>
426 </varlistentry>
427 <varlistentry>
60f067b4 428 <term><option>-p</option></term>
663996b3
MS
429 <term><option>--property=<replaceable>KEY</replaceable>=<replaceable>value</replaceable></option></term>
430 <listitem>
431 <para>Set a global property for all events.</para>
432 </listitem>
433 </varlistentry>
434 <varlistentry>
60f067b4 435 <term><option>-m</option></term>
663996b3
MS
436 <term><option>--children-max=</option><replaceable>value</replaceable></term>
437 <listitem>
438 <para>Set the maximum number of events, systemd-udevd will handle at the
439 same time.</para>
440 </listitem>
441 </varlistentry>
442 <varlistentry>
443 <term><option>--timeout=</option><replaceable>seconds</replaceable></term>
444 <listitem>
445 <para>The maximum number of seconds to wait for a reply from systemd-udevd.</para>
446 </listitem>
447 </varlistentry>
448 <varlistentry>
60f067b4 449 <term><option>-h</option></term>
663996b3
MS
450 <term><option>--help</option></term>
451 <listitem>
452 <para>Print help text.</para>
453 </listitem>
454 </varlistentry>
455 </variablelist>
456 </refsect2>
457
f47781d8
MP
458 <refsect2><title>udevadm monitor
459 <arg choice="opt"><replaceable>options</replaceable></arg>
460 </title>
663996b3
MS
461 <para>Listens to the kernel uevents and events sent out by a udev rule
462 and prints the devpath of the event to the console. It can be used to analyze the
463 event timing, by comparing the timestamps of the kernel uevent and the udev event.
464 </para>
465 <variablelist>
466 <varlistentry>
60f067b4 467 <term><option>-k</option></term>
663996b3
MS
468 <term><option>--kernel</option></term>
469 <listitem>
470 <para>Print the kernel uevents.</para>
471 </listitem>
472 </varlistentry>
473 <varlistentry>
60f067b4 474 <term><option>-u</option></term>
663996b3
MS
475 <term><option>--udev</option></term>
476 <listitem>
477 <para>Print the udev event after the rule processing.</para>
478 </listitem>
479 </varlistentry>
480 <varlistentry>
60f067b4 481 <term><option>-p</option></term>
663996b3
MS
482 <term><option>--property</option></term>
483 <listitem>
484 <para>Also print the properties of the event.</para>
485 </listitem>
486 </varlistentry>
487 <varlistentry>
60f067b4 488 <term><option>-s</option></term>
663996b3
MS
489 <term><option>--subsystem-match=<replaceable>string[/string]</replaceable></option></term>
490 <listitem>
491 <para>Filter events by subsystem[/devtype]. Only udev events with a matching subsystem value will pass.</para>
492 </listitem>
493 </varlistentry>
494 <varlistentry>
60f067b4 495 <term><option>-t</option></term>
663996b3
MS
496 <term><option>--tag-match=<replaceable>string</replaceable></option></term>
497 <listitem>
498 <para>Filter events by property. Only udev events with a given tag attached will pass.</para>
499 </listitem>
500 </varlistentry>
501 <varlistentry>
60f067b4 502 <term><option>-h</option></term>
663996b3
MS
503 <term><option>--help</option></term>
504 <listitem>
505 <para>Print help text.</para>
506 </listitem>
507 </varlistentry>
508 </variablelist>
509 </refsect2>
510
f47781d8
MP
511 <refsect2><title>udevadm test
512 <arg choice="opt"><replaceable>options</replaceable></arg>
513 <arg><replaceable>devpath</replaceable></arg>
514 </title>
663996b3
MS
515 <para>Simulate a udev event run for the given device, and print debug output.</para>
516 <variablelist>
517 <varlistentry>
60f067b4 518 <term><option>-a</option></term>
663996b3
MS
519 <term><option>--action=<replaceable>string</replaceable></option></term>
520 <listitem>
521 <para>The action string.</para>
522 </listitem>
523 </varlistentry>
524 <varlistentry>
60f067b4
JS
525 <term><option>-N</option></term>
526 <term><option>--resolve-names=<constant>early</constant>|<constant>late</constant>|<constant>never</constant></option></term>
663996b3 527 <listitem>
60f067b4
JS
528 <para>Specify when udevadm should resolve names of users
529 and groups. When set to <constant>early</constant> (the
530 default), names will be resolved when the rules are
531 parsed. When set to <constant>late</constant>, names will
532 be resolved for every event. When set to
533 <constant>never</constant>, names will never be resolved
534 and all devices will be owned by root.</para>
663996b3
MS
535 </listitem>
536 </varlistentry>
537 <varlistentry>
60f067b4 538 <term><option>-h</option></term>
663996b3
MS
539 <term><option>--help</option></term>
540 <listitem>
541 <para>Print help text.</para>
542 </listitem>
543 </varlistentry>
544 </variablelist>
545 </refsect2>
546
f47781d8
MP
547 <refsect2><title>udevadm test-builtin
548 <arg choice="opt"><replaceable>options</replaceable></arg>
549 <arg><replaceable>command</replaceable></arg>
550 <arg><replaceable>devpath</replaceable></arg>
551 </title>
60f067b4
JS
552 <para>Run a built-in command <replaceable>COMMAND</replaceable>
553 for device <replaceable>DEVPATH</replaceable>, and print debug
554 output.</para>
663996b3
MS
555 <variablelist>
556 <varlistentry>
60f067b4 557 <term><option>-h</option></term>
663996b3
MS
558 <term><option>--help</option></term>
559 <listitem>
560 <para>Print help text.</para>
561 </listitem>
562 </varlistentry>
563 </variablelist>
564 </refsect2>
565 </refsect1>
566
567 <refsect1>
568 <title>See Also</title>
569 <para><citerefentry>
570 <refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum>
60f067b4 571 </citerefentry>,
663996b3
MS
572 <citerefentry>
573 <refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum>
574 </citerefentry></para>
575 </refsect1>
576</refentry>