chiark / gitweb /
special-case "?*" match to skip fnmatch()
[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>udevd</title>
11         <date>November 2007</date>
12         <productname>udev</productname>
13       </refentryinfo>
14
15       <refmeta>
16         <refentrytitle>udevadm</refentrytitle>
17         <manvolnum>8</manvolnum>
18         <refmiscinfo class="version"></refmiscinfo>
19       </refmeta>
20
21       <refnamediv>
22         <refname>udevadm</refname><refpurpose>udev management tool</refpurpose>
23       </refnamediv>
24
25       <refsynopsisdiv>
26         <cmdsynopsis>
27           <command>udevadm</command>
28             <arg><option>--debug</option></arg>
29             <arg><option>--version</option></arg>
30             <arg><option>--help</option></arg>
31         </cmdsynopsis>
32         <cmdsynopsis>
33           <command>udevadm info <replaceable>options</replaceable></command>
34         </cmdsynopsis>
35         <cmdsynopsis>
36           <command>udevadm trigger <optional>options</optional></command>
37         </cmdsynopsis>
38         <cmdsynopsis>
39           <command>udevadm settle <optional>options</optional></command>
40         </cmdsynopsis>
41         <cmdsynopsis>
42           <command>udevadm control <replaceable>command</replaceable></command>
43         </cmdsynopsis>
44         <cmdsynopsis>
45           <command>udevadm monitor <optional>options</optional></command>
46         </cmdsynopsis>
47         <cmdsynopsis>
48           <command>udevadm test <optional>options</optional> <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>env</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>--attribute-walk</option></term>
118               <listitem>
119                 <para>Print all sysfs properties of the specified device that can be used
120                 in udev rules to match the specified device. It prints all devices
121                 along the chain, up to the root of sysfs that can be used in udev rules.</para>
122               </listitem>
123             </varlistentry>
124             <varlistentry>
125               <term><option>--device-id-of-file=<replaceable>file</replaceable></option></term>
126               <listitem>
127                 <para>Print major/minor numbers of the underlying device, where the file
128                 lives on.</para>
129               </listitem>
130             </varlistentry>
131             <varlistentry>
132               <term><option>--export-db</option></term>
133               <listitem>
134                 <para>Export the content of the udev database.</para>
135               </listitem>
136             </varlistentry>
137             <varlistentry>
138               <term><option>--version</option></term>
139               <listitem>
140                 <para>Print version.</para>
141               </listitem>
142             </varlistentry>
143             <varlistentry>
144               <term><option>--help</option></term>
145               <listitem>
146                 <para>Print help text.</para>
147               </listitem>
148             </varlistentry>
149           </variablelist>
150         </refsect2>
151
152         <refsect2><title>udevadm trigger <optional>options</optional></title>
153           <para>Request device events from the kernel. Usually used to replay events at system coldplug time.</para>
154           <variablelist>
155             <varlistentry>
156               <term><option>--verbose</option></term>
157               <listitem>
158                 <para>Print the list of devices which will be triggered.</para>
159               </listitem>
160             </varlistentry>
161             <varlistentry>
162               <term><option>--dry-run</option></term>
163               <listitem>
164                 <para>Do not actually trigger the event.</para>
165               </listitem>
166             </varlistentry>
167             <varlistentry>
168               <term><option>--type=<replaceable>type</replaceable></option></term>
169               <listitem>
170                 <para>Trigger a specific type of devices. Valid types are:
171                 <command>devices</command>, <command>subsystems</command>, <command>failed</command>.
172                 The default value is <command>devices</command>.</para>
173               </listitem>
174             </varlistentry>
175             <varlistentry>
176               <term><option>--action=<replaceable>action</replaceable></option></term>
177               <listitem>
178                 <para>Type of event to be triggered. The default value is <command>add</command>.</para>
179               </listitem>
180             </varlistentry>
181             <varlistentry>
182               <term><option>--subsystem-match=<replaceable>subsystem</replaceable></option></term>
183               <listitem>
184                 <para>Trigger events for devices which belong to a matching subsystem. This option
185                 can be specified multiple times and supports shell style pattern matching.</para>
186               </listitem>
187             </varlistentry>
188             <varlistentry>
189               <term><option>--subsystem-nomatch=<replaceable>subsystem</replaceable></option></term>
190               <listitem>
191                 <para>Do not trigger events for devices which belong to a matching subsystem. This option
192                 can be specified multiple times and supports shell style pattern matching.</para>
193               </listitem>
194             </varlistentry>
195             <varlistentry>
196               <term><option>--attr-match=<replaceable>attribute</replaceable>=<replaceable>value</replaceable></option></term>
197               <listitem>
198                 <para>Trigger events for devices with a matching sysfs attribute. If a value is specified
199                 along with the attribute name, the content of the attribute is matched against the given
200                 value using shell style pattern matching. If no value is specified, the existence of the
201                 sysfs attribute is checked. This option can be specified multiple times.</para>
202               </listitem>
203             </varlistentry>
204             <varlistentry>
205               <term><option>--attr-nomatch=<replaceable>attribute</replaceable>=<replaceable>value</replaceable></option></term>
206               <listitem>
207                 <para>Do not trigger events for devices with a matching sysfs attribute. If a value is
208                 specified along with the attribute name, the content of the attribute is matched against
209                 the given value using shell style pattern matching. If no value is specified, the existence
210                 of the sysfs attribute is checked. This option can be specified multiple times.</para>
211               </listitem>
212             </varlistentry>
213           </variablelist>
214         </refsect2>
215
216         <refsect2><title>udevadm settle <optional>options</optional></title>
217           <para>Watches the udev event queue, and exits if all current events are handled.</para>
218           <variablelist>
219             <varlistentry>
220               <term><option>--timeout=<replaceable>seconds</replaceable></option></term>
221               <listitem>
222                 <para>Maximum number of seconds to wait for the event queue to become empty.
223                 The default value is 180 seconds.</para>
224               </listitem>
225             </varlistentry>
226             <varlistentry>
227               <term><option>--help</option></term>
228               <listitem>
229                 <para>Print help text.</para>
230               </listitem>
231             </varlistentry>
232           </variablelist>
233         </refsect2>
234
235         <refsect2><title>udevadm control <replaceable>command</replaceable></title>
236           <para>Modify the internal state of the running udev daemon.</para>
237           <variablelist>
238             <varlistentry>
239               <term><option>--log-priority=<replaceable>value</replaceable></option></term>
240               <listitem>
241                 <para>Set the internal log level of udevd. Valid values are the numerical
242                 syslog priorities or their textual representations: <option>err</option>,
243                 <option>info</option> and <option>debug</option>.</para>
244               </listitem>
245             </varlistentry>
246             <varlistentry>
247               <term><option>--stop-exec-queue</option></term>
248               <listitem>
249                 <para>Signal udevd to stop executing new events. Incoming events
250                 will be queued.</para>
251               </listitem>
252             </varlistentry>
253             <varlistentry>
254               <term><option>--start-exec-queue</option></term>
255               <listitem>
256                 <para>Signal udevd to enable the execution of events.</para>
257               </listitem>
258             </varlistentry>
259             <varlistentry>
260               <term><option>--reload-rules</option></term>
261               <listitem>
262                 <para>Signal udevd to reload the rules from the config.</para>
263               </listitem>
264             </varlistentry>
265             <varlistentry>
266               <term><option>--env=<replaceable>KEY</replaceable>=<replaceable>value</replaceable></option></term>
267               <listitem>
268                 <para>Set global variable.</para>
269               </listitem>
270             </varlistentry>
271             <varlistentry>
272               <term><option>--max-childs=</option><replaceable>value</replaceable></term>
273               <listitem>
274                 <para>Set the maximum number of events, udevd will handle at the
275                 same time.</para>
276               </listitem>
277             </varlistentry>
278             <varlistentry>
279               <term><option>--help</option></term>
280               <listitem>
281                 <para>Print help text.</para>
282               </listitem>
283             </varlistentry>
284           </variablelist>
285         </refsect2>
286
287         <refsect2><title>udevadm monitor <optional>options</optional></title>
288           <para>Listens to the kernel uevents and events sent out by a udev rule
289           and prints the devpath of the event to the console. It can be used to analyze the
290           event timing, by comparing the timestamps of the kernel uevent and the udev event.
291           </para>
292           <variablelist>
293             <varlistentry>
294               <term><option>--environment</option></term>
295               <listitem>
296                 <para>Print the complete environment for all events. Can be used to compare the
297                 kernel supplied and the udev added environment values.</para>
298               </listitem>
299             </varlistentry>
300             <varlistentry>
301               <term><option>--kernel</option></term>
302               <listitem>
303                 <para>Print the kernel uevents.</para>
304               </listitem>
305             </varlistentry>
306             <varlistentry>
307               <term><option>--udev</option></term>
308               <listitem>
309                 <para>Print the udev event after the rule processing.</para>
310               </listitem>
311             </varlistentry>
312             <varlistentry>
313               <term><option>--help</option></term>
314               <listitem>
315                 <para>Print help text.</para>
316               </listitem>
317             </varlistentry>
318           </variablelist>
319         </refsect2>
320
321         <refsect2><title>udevadm test <optional>options</optional> <replaceable>devpath</replaceable></title>
322           <para>Simulate a udev event run for the given device, and print out debug
323           output. Unless forced to, no device node or symlink will be created.</para>
324           <variablelist>
325             <varlistentry>
326               <term><option>--action=<replaceable>string</replaceable></option></term>
327               <listitem>
328                 <para>The action string.</para>
329               </listitem>
330             </varlistentry>
331             <varlistentry>
332               <term><option>--subsystem=<replaceable>string</replaceable></option></term>
333               <listitem>
334                 <para>The subsystem string.</para>
335               </listitem>
336             </varlistentry>
337             <varlistentry>
338               <term><option>--force</option></term>
339               <listitem>
340                 <para>Force the creation of a device node or symlink. Usually the test run
341                 prints only debug output.</para>
342               </listitem>
343             </varlistentry>
344             <varlistentry>
345               <term><option>--help</option></term>
346               <listitem>
347                 <para>Print help text.</para>
348               </listitem>
349             </varlistentry>
350           </variablelist>
351         </refsect2>
352       </refsect1>
353
354       <refsect1><title>AUTHOR</title>
355         <para>Written by Kay Sievers <email>kay.sievers@vrfy.org</email>.</para>
356       </refsect1>
357
358       <refsect1>
359         <title>SEE ALSO</title>
360         <para><citerefentry>
361             <refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum>
362         </citerefentry>
363         <citerefentry>
364             <refentrytitle>udevd</refentrytitle><manvolnum>8</manvolnum>
365         </citerefentry></para>
366       </refsect1>
367     </refentry>
368   </section>
369 </article>