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