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