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