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