chiark / gitweb /
2e02c305d920ac766d3b18082eb849eaae3573b2
[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 info <optional>options</optional></command>
28         </cmdsynopsis>
29         <cmdsynopsis>
30           <command>udevadm trigger <optional>options</optional></command>
31         </cmdsynopsis>
32         <cmdsynopsis>
33           <command>udevadm settle <optional>options</optional></command>
34         </cmdsynopsis>
35         <cmdsynopsis>
36           <command>udevadm control <replaceable>command</replaceable></command>
37         </cmdsynopsis>
38         <cmdsynopsis>
39           <command>udevadm monitor <optional>options</optional></command>
40         </cmdsynopsis>
41         <cmdsynopsis>
42           <command>udevadm test <optional>options</optional> <replaceable>devpath</replaceable></command>
43         </cmdsynopsis>
44         <cmdsynopsis>
45           <command>udevadm version</command>
46         </cmdsynopsis>
47         <cmdsynopsis>
48           <command>udevadm help</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
60         <refsect2><title>udevadm info <replaceable>options</replaceable></title>
61           <para>Queries the udev database for device information
62           stored in the udev database. It can also query the properties
63           of a device from its sysfs representation to help creating udev
64           rules that match this device.</para>
65           <variablelist>
66             <varlistentry>
67               <term><option>--query=<replaceable>type</replaceable></option></term>
68               <listitem>
69                 <para>Query the database for specified type of device data. It needs the
70                 <option>--path</option> or <option>--name</option> to identify the specified
71                 device. Valid queries are:
72                 <command>name</command>, <command>symlink</command>, <command>path</command>,
73                 <command>env</command>, <command>all</command>.</para>
74               </listitem>
75             </varlistentry>
76             <varlistentry>
77               <term><option>--path=<replaceable>devpath</replaceable></option></term>
78               <listitem>
79                 <para>The devpath of the device to query.</para>
80               </listitem>
81             </varlistentry>
82             <varlistentry>
83               <term><option>--name=<replaceable>file</replaceable></option></term>
84               <listitem>
85                 <para>The name of the device node or a symlink to query</para>
86               </listitem>
87             </varlistentry>
88             <varlistentry>
89               <term><option>--root</option></term>
90               <listitem>
91                 <para>The udev root directory: <filename>/dev</filename>. If used in conjunction
92                 with a <command>name</command> or <command>symlink</command> query, the
93                 query returns the absolute path including the root directory.</para>
94               </listitem>
95             </varlistentry>
96             <varlistentry>
97               <term><option>--attribute-walk</option></term>
98               <listitem>
99                 <para>Print all sysfs properties of the specified device that can be used
100                 in udev rules to match the specified device. It prints all devices
101                 along the chain, up to the root of sysfs that can be used in udev rules.</para>
102               </listitem>
103             </varlistentry>
104             <varlistentry>
105               <term><option>--device-id-of-file=<replaceable>file</replaceable></option></term>
106               <listitem>
107                 <para>Print major/minor numbers of the underlying device, where the file
108                 lives on.</para>
109               </listitem>
110             </varlistentry>
111             <varlistentry>
112               <term><option>--export-db</option></term>
113               <listitem>
114                 <para>Export the content of the udev database.</para>
115               </listitem>
116             </varlistentry>
117             <varlistentry>
118               <term><option>--version</option></term>
119               <listitem>
120                 <para>Print version.</para>
121               </listitem>
122             </varlistentry>
123             <varlistentry>
124               <term><option>--help</option></term>
125               <listitem>
126                 <para>Print help text.</para>
127               </listitem>
128             </varlistentry>
129           </variablelist>
130         </refsect2>
131
132         <refsect2><title>udevadm trigger <optional>options</optional></title>
133           <para>Request device uevents, usually used to replay events at system coldplug.</para>
134           <variablelist>
135             <varlistentry>
136               <term><option>--verbose</option></term>
137               <listitem>
138                 <para>Print the list of devices which will be triggered.</para>
139               </listitem>
140             </varlistentry>
141             <varlistentry>
142               <term><option>--dry-run</option></term>
143               <listitem>
144                 <para>Do not actually trigger the event.</para>
145               </listitem>
146             </varlistentry>
147             <varlistentry>
148               <term><option>--retry-failed</option></term>
149               <listitem>
150                 <para>Trigger only the events which are failed during a previous run.</para>
151               </listitem>
152             </varlistentry>
153             <varlistentry>
154               <term><option>--action=<replaceable>action</replaceable></option></term>
155               <listitem>
156                 <para>Type of event to be triggered. The default value is "add".</para>
157               </listitem>
158             </varlistentry>
159             <varlistentry>
160               <term><option>--subsystem-match=<replaceable>subsystem</replaceable></option></term>
161               <listitem>
162                 <para>Trigger events for devices which belong to a matching subsystem. This option
163                 can be specified multiple times and supports shell style pattern matching.</para>
164               </listitem>
165             </varlistentry>
166             <varlistentry>
167               <term><option>--subsystem-nomatch=<replaceable>subsystem</replaceable></option></term>
168               <listitem>
169                 <para>Do not trigger events for devices which belong to a matching subsystem. This option
170                 can be specified multiple times and supports shell style pattern matching.</para>
171               </listitem>
172             </varlistentry>
173             <varlistentry>
174               <term><option>--attr-match=<replaceable>attribute</replaceable>=<replaceable>value</replaceable></option></term>
175               <listitem>
176                 <para>Trigger events for devices with a matching sysfs attribute. If a value is specified
177                 along with the attribute name, the content of the attribute is matched against the given
178                 value using shell style pattern matching. If no value is specified, the existence of the
179                 sysfs attribute is checked. This option can be specified multiple times.</para>
180               </listitem>
181             </varlistentry>
182             <varlistentry>
183               <term><option>--attr-nomatch=<replaceable>attribute</replaceable>=<replaceable>value</replaceable></option></term>
184               <listitem>
185                 <para>Do not trigger events for devices with a matching sysfs attribute. If a value is
186                 specified along with the attribute name, the content of the attribute is matched against
187                 the given value using shell style pattern matching. If no value is specified, the existence
188                 of the sysfs attribute is checked. This option can be specified multiple times.</para>
189               </listitem>
190             </varlistentry>
191             <varlistentry>
192               <term><option>--socket=<replaceable>path</replaceable></option></term>
193               <listitem>
194                 <para>Pass the synthesized events to the specified socket, instead of triggering
195                 a global kernel event. All available event values will be send in the same format
196                 the kernel sends an uevent, or <option>RUN+="socket:<replaceable>path</replaceable>"</option>
197                 sends a message. If the first character of the specified path is an @ character,
198                 an abstract namespace socket is used, instead of an existing socket file.</para>
199               </listitem>
200             </varlistentry>
201             <varlistentry>
202               <term><option>--env=<replaceable>KEY</replaceable>=<replaceable>value</replaceable></option></term>
203               <listitem>
204                 <para>Pass an additional environemt key to the event. This works only with the
205                 --socket option.</para>
206               </listitem>
207             </varlistentry>
208           </variablelist>
209         </refsect2>
210
211         <refsect2><title>udevadm settle <optional>options</optional></title>
212           <para>Watches the udev event queue, and exits if all current events are handled.</para>
213           <variablelist>
214             <varlistentry>
215               <term><option>--timeout=<replaceable>seconds</replaceable></option></term>
216               <listitem>
217                 <para>Maximum number of seconds to wait for the event queue to become empty.
218                 The default value is 180 seconds.</para>
219               </listitem>
220             </varlistentry>
221             <varlistentry>
222               <term><option>--help</option></term>
223               <listitem>
224                 <para>Print help text.</para>
225               </listitem>
226             </varlistentry>
227           </variablelist>
228         </refsect2>
229
230         <refsect2><title>udevadm control <replaceable>command</replaceable></title>
231           <para>Modify the internal state of the running udev daemon.</para>
232           <variablelist>
233             <varlistentry>
234               <term><option>--log-priority=<replaceable>value</replaceable></option></term>
235               <listitem>
236                 <para>Set the internal log level of udevd. Valid values are the numerical
237                 syslog priorities or their textual representations: <option>err</option>,
238                 <option>info</option> and <option>debug</option>.</para>
239               </listitem>
240             </varlistentry>
241             <varlistentry>
242               <term><option>--stop-exec-queue</option></term>
243               <listitem>
244                 <para>Signal udevd to stop executing new events. Incoming events
245                 will be queued.</para>
246               </listitem>
247             </varlistentry>
248             <varlistentry>
249               <term><option>--start-exec-queue</option></term>
250               <listitem>
251                 <para>Signal udevd to enable the execution of events.</para>
252               </listitem>
253             </varlistentry>
254             <varlistentry>
255               <term><option>--reload-rules</option></term>
256               <listitem>
257                 <para>Signal udevd to reload the rules from the config.</para>
258               </listitem>
259             </varlistentry>
260             <varlistentry>
261               <term><option>--env=<replaceable>KEY</replaceable>=<replaceable>value</replaceable></option></term>
262               <listitem>
263                 <para>Set global variable.</para>
264               </listitem>
265             </varlistentry>
266             <varlistentry>
267               <term><option>--max-childs=</option><replaceable>value</replaceable></term>
268               <listitem>
269                 <para>Set the maximum number of events, udevd will handle at the
270                 same time.</para>
271               </listitem>
272             </varlistentry>
273             <varlistentry>
274               <term><option>--max-childs-running=<replaceable>value</replaceable></option></term>
275               <listitem>
276                 <para>Set the maximum number of events, which are allowed to run at the
277                 same time.</para>
278               </listitem>
279             </varlistentry>
280             <varlistentry>
281               <term><option>--help</option></term>
282               <listitem>
283                 <para>Print help text.</para>
284               </listitem>
285             </varlistentry>
286           </variablelist>
287         </refsect2>
288
289         <refsect2><title>udevadm monitor <optional>options</optional></title>
290           <para>Listens to the kernel uevents and events sent out by a udev rule
291           and prints the devpath of the event to the console. It can be used to analyze the
292           event timing, by comparing the timestamps of the kernel uevent and the udev event.
293           </para>
294           <variablelist>
295             <varlistentry>
296               <term><option>--environment</option></term>
297               <listitem>
298                 <para>Print the complete environment for all events. Can be used to compare the
299                 kernel supplied and the udev added environment values.</para>
300               </listitem>
301             </varlistentry>
302             <varlistentry>
303               <term><option>--kernel</option></term>
304               <listitem>
305                 <para>Print the kernel uevents.</para>
306               </listitem>
307             </varlistentry>
308             <varlistentry>
309               <term><option>--udev</option></term>
310               <listitem>
311                 <para>Print the udev event after the rule processing.</para>
312               </listitem>
313             </varlistentry>
314             <varlistentry>
315               <term><option>--help</option></term>
316               <listitem>
317                 <para>Print help text.</para>
318               </listitem>
319             </varlistentry>
320           </variablelist>
321         </refsect2>
322
323         <refsect2><title>udevadm test <optional>options</optional> <replaceable>devpath</replaceable></title>
324           <para>Simulate a udev event run for the given device, and print out debug
325           output. Unless forced to, no device node or symlink will be created.</para>
326           <variablelist>
327             <varlistentry>
328               <term><option>--action=<replaceable>string</replaceable></option></term>
329               <listitem>
330                 <para>The action string.</para>
331               </listitem>
332             </varlistentry>
333             <varlistentry>
334               <term><option>--subsystem=<replaceable>string</replaceable></option></term>
335               <listitem>
336                 <para>The subsystem string.</para>
337               </listitem>
338             </varlistentry>
339             <varlistentry>
340               <term><option>--force</option></term>
341               <listitem>
342                 <para>Force the creation of a device node or symlink. Usually the test run
343                 prints only debug output.</para>
344               </listitem>
345             </varlistentry>
346             <varlistentry>
347               <term><option>--help</option></term>
348               <listitem>
349                 <para>Print help text.</para>
350               </listitem>
351             </varlistentry>
352           </variablelist>
353         </refsect2>
354
355         <refsect2><title>udevadm version</title>
356           <para>Print version number.</para>
357         </refsect2>
358
359         <refsect2><title>udevadm help</title>
360           <para>Print help text.</para>
361         </refsect2>
362       </refsect1>
363
364       <refsect1><title>AUTHOR</title>
365         <para>Written by Kay Sievers <email>kay.sievers@vrfy.org</email>.</para>
366       </refsect1>
367
368       <refsect1>
369         <title>SEE ALSO</title>
370         <para><citerefentry>
371             <refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum>
372         </citerefentry>
373         <citerefentry>
374             <refentrytitle>udevd</refentrytitle><manvolnum>8</manvolnum>
375         </citerefentry></para>
376       </refsect1>
377     </refentry>
378   </section>
379 </article>