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