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