chiark / gitweb /
man: udevadm trigger - the default is "change" not "add"
[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. Primarily 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>change</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>--tag-match=<replaceable>property</replaceable></option></term>
221               <listitem>
222                 <para>Trigger events for devices with a matching tag. This option can be
223                 specified multiple times.</para>
224               </listitem>
225             </varlistentry>
226             <varlistentry>
227               <term><option>--sysname-match=<replaceable>name</replaceable></option></term>
228               <listitem>
229                 <para>Trigger events for devices with a matching sys device name. This option can be
230                 specified multiple times and supports shell style pattern matching.</para>
231               </listitem>
232             </varlistentry>
233           </variablelist>
234         </refsect2>
235
236         <refsect2><title>udevadm settle <optional>options</optional></title>
237           <para>Watches the udev event queue, and exits if all current events are handled.</para>
238           <variablelist>
239             <varlistentry>
240               <term><option>--timeout=<replaceable>seconds</replaceable></option></term>
241               <listitem>
242                 <para>Maximum number of seconds to wait for the event queue to become empty.
243                 The default value is 180 seconds. A value of 0 will check if the queue is empty
244                 and always return immediately.</para>
245               </listitem>
246             </varlistentry>
247             <varlistentry>
248               <term><option>--seq-start=<replaceable>seqnum</replaceable></option></term>
249               <listitem>
250                 <para>Wait only for events after the given sequence number.</para>
251               </listitem>
252             </varlistentry>
253             <varlistentry>
254               <term><option>--seq-end=<replaceable>seqnum</replaceable></option></term>
255               <listitem>
256                 <para>Wait only for events before the given sequence number.</para>
257               </listitem>
258             </varlistentry>
259             <varlistentry>
260               <term><option>--exit-if-exists=<replaceable>file</replaceable></option></term>
261               <listitem>
262                 <para>Stop waiting if file exists.</para>
263               </listitem>
264             </varlistentry>
265             <varlistentry>
266               <term><option>--quiet</option></term>
267               <listitem>
268                 <para>Do not print any output, like the remaining queue entries when reaching the timeout.</para>
269               </listitem>
270             </varlistentry>
271             <varlistentry>
272               <term><option>--help</option></term>
273               <listitem>
274                 <para>Print help text.</para>
275               </listitem>
276             </varlistentry>
277           </variablelist>
278         </refsect2>
279
280         <refsect2><title>udevadm control <replaceable>command</replaceable></title>
281           <para>Modify the internal state of the running udev daemon.</para>
282           <variablelist>
283             <varlistentry>
284               <term><option>--log-priority=<replaceable>value</replaceable></option></term>
285               <listitem>
286                 <para>Set the internal log level of udevd. Valid values are the numerical
287                 syslog priorities or their textual representations: <option>err</option>,
288                 <option>info</option> and <option>debug</option>.</para>
289               </listitem>
290             </varlistentry>
291             <varlistentry>
292               <term><option>--stop-exec-queue</option></term>
293               <listitem>
294                 <para>Signal udevd to stop executing new events. Incoming events
295                 will be queued.</para>
296               </listitem>
297             </varlistentry>
298             <varlistentry>
299               <term><option>--start-exec-queue</option></term>
300               <listitem>
301                 <para>Signal udevd to enable the execution of events.</para>
302               </listitem>
303             </varlistentry>
304             <varlistentry>
305               <term><option>--reload-rules</option></term>
306               <listitem>
307                 <para>Signal udevd to reload the rules files.
308                 The udev daemon detects changes automatically, this option is
309                 usually not needed. Reloading rules does not apply any changes
310                 to already existing devices.</para>
311               </listitem>
312             </varlistentry>
313             <varlistentry>
314               <term><option>--property=<replaceable>KEY</replaceable>=<replaceable>value</replaceable></option></term>
315               <listitem>
316                 <para>Set a global property for all events.</para>
317               </listitem>
318             </varlistentry>
319             <varlistentry>
320               <term><option>--max-childs=</option><replaceable>value</replaceable></term>
321               <listitem>
322                 <para>Set the maximum number of events, udevd will handle at the
323                 same time.</para>
324               </listitem>
325             </varlistentry>
326             <varlistentry>
327               <term><option>--help</option></term>
328               <listitem>
329                 <para>Print help text.</para>
330               </listitem>
331             </varlistentry>
332           </variablelist>
333         </refsect2>
334
335         <refsect2><title>udevadm monitor <optional>options</optional></title>
336           <para>Listens to the kernel uevents and events sent out by a udev rule
337           and prints the devpath of the event to the console. It can be used to analyze the
338           event timing, by comparing the timestamps of the kernel uevent and the udev event.
339           </para>
340           <variablelist>
341             <varlistentry>
342               <term><option>--kernel</option></term>
343               <listitem>
344                 <para>Print the kernel uevents.</para>
345               </listitem>
346             </varlistentry>
347             <varlistentry>
348               <term><option>--udev</option></term>
349               <listitem>
350                 <para>Print the udev event after the rule processing.</para>
351               </listitem>
352             </varlistentry>
353             <varlistentry>
354               <term><option>--property</option></term>
355               <listitem>
356                 <para>Also print the properties of the event.</para>
357               </listitem>
358             </varlistentry>
359             <varlistentry>
360               <term><option>--subsystem-match=<replaceable>string[/string]</replaceable></option></term>
361               <listitem>
362                 <para>Filter events by subsystem[/devtype]. Only udev events with a matching subsystem value will pass.</para>
363               </listitem>
364             </varlistentry>
365             <varlistentry>
366               <term><option>--tag-match=<replaceable>string</replaceable></option></term>
367               <listitem>
368                 <para>Filter events by property. Only udev events with a given tag attached will pass.</para>
369               </listitem>
370             </varlistentry>
371             <varlistentry>
372               <term><option>--help</option></term>
373               <listitem>
374                 <para>Print help text.</para>
375               </listitem>
376             </varlistentry>
377           </variablelist>
378         </refsect2>
379
380         <refsect2><title>udevadm test <optional>options</optional> <replaceable>devpath</replaceable></title>
381           <para>Simulate a udev event run for the given device, and print debug output.</para>
382           <variablelist>
383             <varlistentry>
384               <term><option>--action=<replaceable>string</replaceable></option></term>
385               <listitem>
386                 <para>The action string.</para>
387               </listitem>
388             </varlistentry>
389             <varlistentry>
390               <term><option>--subsystem=<replaceable>string</replaceable></option></term>
391               <listitem>
392                 <para>The subsystem string.</para>
393               </listitem>
394             </varlistentry>
395             <varlistentry>
396               <term><option>--help</option></term>
397               <listitem>
398                 <para>Print help text.</para>
399               </listitem>
400             </varlistentry>
401           </variablelist>
402         </refsect2>
403       </refsect1>
404
405       <refsect1><title>AUTHOR</title>
406         <para>Written by Kay Sievers <email>kay.sievers@vrfy.org</email>.</para>
407       </refsect1>
408
409       <refsect1>
410         <title>SEE ALSO</title>
411         <para><citerefentry>
412             <refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum>
413         </citerefentry>
414         <citerefentry>
415             <refentrytitle>udevd</refentrytitle><manvolnum>8</manvolnum>
416         </citerefentry></para>
417       </refsect1>
418     </refentry>
419   </section>
420 </article>