chiark / gitweb /
net-util: add support for Type=ethernet
[elogind.git] / man / 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>systemd</productname>
10     <authorgroup>
11       <author>
12         <contrib>Developer</contrib>
13         <firstname>Kay</firstname>
14         <surname>Sievers</surname>
15         <email>kay@vrfy.org</email>
16       </author>
17     </authorgroup>
18   </refentryinfo>
19
20   <refmeta>
21     <refentrytitle>udevadm</refentrytitle>
22     <manvolnum>8</manvolnum>
23     <refmiscinfo class="version"></refmiscinfo>
24   </refmeta>
25
26   <refnamediv>
27     <refname>udevadm</refname><refpurpose>udev management tool</refpurpose>
28   </refnamediv>
29
30   <refsynopsisdiv>
31     <cmdsynopsis>
32       <command>udevadm</command>
33         <arg><option>--debug</option></arg>
34         <arg><option>--version</option></arg>
35         <arg><option>--help</option></arg>
36     </cmdsynopsis>
37     <cmdsynopsis>
38       <command>udevadm info <replaceable>options</replaceable></command>
39     </cmdsynopsis>
40     <cmdsynopsis>
41       <command>udevadm trigger <optional>options</optional></command>
42     </cmdsynopsis>
43     <cmdsynopsis>
44       <command>udevadm settle <optional>options</optional></command>
45     </cmdsynopsis>
46     <cmdsynopsis>
47       <command>udevadm control <replaceable>command</replaceable></command>
48     </cmdsynopsis>
49     <cmdsynopsis>
50       <command>udevadm monitor <optional>options</optional></command>
51     </cmdsynopsis>
52     <cmdsynopsis>
53       <command>udevadm hwdb <optional>options</optional></command>
54     </cmdsynopsis>
55     <cmdsynopsis>
56       <command>udevadm test <optional>options</optional> <replaceable>devpath</replaceable></command>
57     </cmdsynopsis>
58     <cmdsynopsis>
59       <command>udevadm test-builtin <optional>options</optional> <replaceable>command</replaceable> <replaceable>devpath</replaceable></command>
60     </cmdsynopsis>
61   </refsynopsisdiv>
62
63   <refsect1><title>Description</title>
64     <para><command>udevadm</command> expects a command and command
65     specific options.  It controls the runtime behavior of
66     <command>systemd-udevd</command>, requests kernel events, manages
67     the event queue, and provides simple debugging mechanisms.</para>
68   </refsect1>
69
70   <refsect1><title>OPTIONS</title>
71     <variablelist>
72       <varlistentry>
73         <term><option>--debug</option></term>
74         <listitem>
75           <para>Print debug messages to stderr.</para>
76         </listitem>
77       </varlistentry>
78       <varlistentry>
79         <term><option>--version</option></term>
80         <listitem>
81           <para>Print version number.</para>
82         </listitem>
83       </varlistentry>
84       <varlistentry>
85         <term><option>-h</option></term>
86         <term><option>--help</option></term>
87         <listitem>
88           <para>Print help text.</para>
89         </listitem>
90       </varlistentry>
91     </variablelist>
92
93     <refsect2><title>udevadm info <optional><replaceable>OPTIONS</replaceable></optional> <optional><replaceable>DEVPATH</replaceable>|<replaceable>FILE</replaceable></optional></title>
94       <para>Queries the udev database for device information
95       stored in the udev database. It can also query the properties
96       of a device from its sysfs representation to help creating udev
97       rules that match this device.</para>
98       <variablelist>
99         <varlistentry>
100           <term><option>-q</option></term>
101           <term><option>--query=<replaceable>TYPE</replaceable></option></term>
102           <listitem>
103             <para>Query the database for the specified type of device
104             data. It needs the <option>--path</option> or
105             <option>--name</option> to identify the specified device.
106             Valid <replaceable>TYPE</replaceable>s are:
107             <constant>name</constant>, <constant>symlink</constant>,
108             <constant>path</constant>, <constant>property</constant>,
109             <constant>all</constant>.</para>
110           </listitem>
111         </varlistentry>
112         <varlistentry>
113           <term><option>-p</option></term>
114           <term><option>--path=<replaceable>DEVPATH</replaceable></option></term>
115           <listitem>
116             <para>The <filename>/sys</filename> path of the device to
117             query, e.g.
118             <filename><optional>/sys</optional>/class/block/sda</filename>.
119             Note that this option usually is not very useful, since
120             <command>udev</command> can guess the type of the
121             argument, so <command>udevadm
122             --devpath=/class/block/sda</command> is equivalent to
123             <command>udevadm /sys/class/block/sda</command>.</para>
124           </listitem>
125         </varlistentry>
126         <varlistentry>
127           <term><option>-n</option></term>
128           <term><option>--name=<replaceable>FILE</replaceable></option></term>
129           <listitem>
130             <para>The name of the device node or a symlink to query,
131             e.g. <filename><optional>/dev</optional>/sda</filename>.
132             Note that this option usually is not very useful, since
133             <command>udev</command> can guess the type of the
134             argument, so <command>udevadm --name=sda</command> is
135             equivalent to <command>udevadm /dev/sda</command>.</para>
136           </listitem>
137         </varlistentry>
138         <varlistentry>
139           <term><option>-r</option></term>
140           <term><option>--root</option></term>
141           <listitem>
142             <para>Print absolute paths in <command>name</command> or <command>symlink</command>
143             query.</para>
144           </listitem>
145         </varlistentry>
146         <varlistentry>
147           <term><option>-a</option></term>
148           <term><option>--attribute-walk</option></term>
149           <listitem>
150             <para>Print all sysfs properties of the specified device that can be used
151             in udev rules to match the specified device. It prints all devices
152             along the chain, up to the root of sysfs that can be used in udev rules.</para>
153           </listitem>
154         </varlistentry>
155         <varlistentry>
156           <term><option>-x</option></term>
157           <term><option>--export</option></term>
158           <listitem>
159             <para>Print output as key/value pairs. Values are enclosed in single quotes.</para>
160           </listitem>
161         </varlistentry>
162         <varlistentry>
163           <term><option>-P</option></term>
164           <term><option>--export-prefix=<replaceable>NAME</replaceable></option></term>
165           <listitem>
166             <para>Add a prefix to the key name of exported values.</para>
167           </listitem>
168         </varlistentry>
169         <varlistentry>
170           <term><option>-d</option></term>
171           <term><option>--device-id-of-file=<replaceable>FILE</replaceable></option></term>
172           <listitem>
173             <para>Print major/minor numbers of the underlying device, where the file
174             lives on.</para>
175           </listitem>
176         </varlistentry>
177         <varlistentry>
178           <term><option>-e</option></term>
179           <term><option>--export-db</option></term>
180           <listitem>
181             <para>Export the content of the udev database.</para>
182           </listitem>
183         </varlistentry>
184         <varlistentry>
185           <term><option>-c</option></term>
186           <term><option>--cleanup-db</option></term>
187           <listitem>
188             <para>Cleanup the udev database.</para>
189           </listitem>
190         </varlistentry>
191         <varlistentry>
192           <term><option>--version</option></term>
193           <listitem>
194             <para>Print version.</para>
195           </listitem>
196         </varlistentry>
197         <varlistentry>
198           <term><option>-h</option></term>
199           <term><option>--help</option></term>
200           <listitem>
201             <para>Print help text.</para>
202           </listitem>
203         </varlistentry>
204       </variablelist>
205     </refsect2>
206
207     <refsect2><title>udevadm trigger <optional>options</optional></title>
208       <para>Request device events from the kernel. Primarily used to replay events at system coldplug time.</para>
209       <variablelist>
210         <varlistentry>
211           <term><option>-v</option></term>
212           <term><option>--verbose</option></term>
213           <listitem>
214             <para>Print the list of devices which will be triggered.</para>
215           </listitem>
216         </varlistentry>
217         <varlistentry>
218           <term><option>-n</option></term>
219           <term><option>--dry-run</option></term>
220           <listitem>
221             <para>Do not actually trigger the event.</para>
222           </listitem>
223         </varlistentry>
224         <varlistentry>
225           <term><option>-t</option></term>
226           <term><option>--type=<replaceable>TYPE</replaceable></option></term>
227           <listitem>
228             <para>Trigger a specific type of devices. Valid types are:
229             <command>devices</command>, <command>subsystems</command>.
230             The default value is <command>devices</command>.</para>
231           </listitem>
232         </varlistentry>
233         <varlistentry>
234           <term><option>-c</option></term>
235           <term><option>--action=<replaceable>ACTION</replaceable></option></term>
236           <listitem>
237             <para>Type of event to be triggered. The default value is
238             <command>change</command>.</para>
239           </listitem>
240         </varlistentry>
241         <varlistentry>
242           <term><option>-s</option></term>
243           <term><option>--subsystem-match=<replaceable>SUBSYSTEM</replaceable></option></term>
244           <listitem>
245             <para>Trigger events for devices which belong to a
246             matching subsystem. This option can be specified multiple
247             times and supports shell style pattern matching.</para>
248           </listitem>
249         </varlistentry>
250         <varlistentry>
251           <term><option>-S</option></term>
252           <term><option>--subsystem-nomatch=<replaceable>SUBSYSTEM</replaceable></option></term>
253           <listitem>
254             <para>Do not trigger events for devices which belong to a matching subsystem. This option
255             can be specified multiple times and supports shell style pattern matching.</para>
256           </listitem>
257         </varlistentry>
258         <varlistentry>
259           <term><option>-a</option></term>
260           <term><option>--attr-match=<replaceable>ATTRIBUTE</replaceable>=<replaceable>VALUE</replaceable></option></term>
261           <listitem>
262             <para>Trigger events for devices with a matching sysfs
263             attribute. If a value is specified along with the
264             attribute name, the content of the attribute is matched
265             against the given value using shell style pattern
266             matching. If no value is specified, the existence of the
267             sysfs attribute is checked. This option can be specified
268             multiple times.</para>
269           </listitem>
270         </varlistentry>
271         <varlistentry>
272           <term><option>-A</option></term>
273           <term><option>--attr-nomatch=<replaceable>ATTRIBUTE</replaceable>=<replaceable>VALUE</replaceable></option></term>
274           <listitem>
275             <para>Do not trigger events for devices with a matching
276             sysfs attribute. If a value is specified along with the
277             attribute name, the content of the attribute is matched
278             against the given value using shell style pattern
279             matching. If no value is specified, the existence of the
280             sysfs attribute is checked. This option can be specified
281             multiple times.</para>
282           </listitem>
283         </varlistentry>
284         <varlistentry>
285           <term><option>-p</option></term>
286           <term><option>--property-match=<replaceable>PROPERTY</replaceable>=<replaceable>VALUE</replaceable></option></term>
287           <listitem>
288             <para>Trigger events for devices with a matching property
289             value. This option can be specified multiple times and
290             supports shell style pattern matching.</para>
291           </listitem>
292         </varlistentry>
293         <varlistentry>
294           <term><option>-g</option></term>
295           <term><option>--tag-match=<replaceable>PROPERTY</replaceable></option></term>
296           <listitem>
297             <para>Trigger events for devices with a matching tag. This
298             option can be specified multiple times.</para>
299           </listitem>
300         </varlistentry>
301         <varlistentry>
302           <term><option>-y</option></term>
303           <term><option>--sysname-match=<replaceable>NAME</replaceable></option></term>
304           <listitem>
305             <para>Trigger events for devices with a matching sys
306             device name. This option can be specified multiple times
307             and supports shell style pattern matching.</para>
308           </listitem>
309         </varlistentry>
310         <varlistentry>
311           <term><option>-b</option></term>
312           <term><option>--parent-match=<replaceable>SYSPATH</replaceable></option></term>
313           <listitem>
314             <para>Trigger events for all children of a given
315             device.</para>
316           </listitem>
317         </varlistentry>
318         <varlistentry>
319           <term><option>-h</option></term>
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 settle <optional>options</optional></title>
329       <para>Watches the udev event queue, and exits if all current events are handled.</para>
330       <variablelist>
331         <varlistentry>
332           <term><option>-t</option></term>
333           <term><option>--timeout=<replaceable>SECONDS</replaceable></option></term>
334           <listitem>
335             <para>Maximum number of seconds to wait for the event
336             queue to become empty. The default value is 120 seconds. A
337             value of 0 will check if the queue is empty and always
338             return immediately.</para>
339           </listitem>
340         </varlistentry>
341         <varlistentry>
342           <term><option>-s</option></term>
343           <term><option>--seq-start=<replaceable>SEQNUM</replaceable></option></term>
344           <listitem>
345             <para>Wait only for events after the given sequence
346             number.</para>
347           </listitem>
348         </varlistentry>
349         <varlistentry>
350           <term><option>-e</option></term>
351           <term><option>--seq-end=<replaceable>SEQNUM</replaceable></option></term>
352           <listitem>
353             <para>Wait only for events before the given sequence number.</para>
354           </listitem>
355         </varlistentry>
356         <varlistentry>
357           <term><option>-E</option></term>
358           <term><option>--exit-if-exists=<replaceable>FILE</replaceable></option></term>
359           <listitem>
360             <para>Stop waiting if file exists.</para>
361           </listitem>
362         </varlistentry>
363         <varlistentry>
364           <term><option>-q</option></term>
365           <term><option>--quiet</option></term>
366           <listitem>
367             <para>Do not print any output, like the remaining queue entries when reaching the timeout.</para>
368           </listitem>
369         </varlistentry>
370         <varlistentry>
371           <term><option>-h</option></term>
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 control <replaceable>command</replaceable></title>
381       <para>Modify the internal state of the running udev daemon.</para>
382       <variablelist>
383         <varlistentry>
384           <term><option>-x</option></term>
385           <term><option>--exit</option></term>
386           <listitem>
387             <para>Signal and wait for systemd-udevd to exit.</para>
388           </listitem>
389         </varlistentry>
390         <varlistentry>
391           <term><option>-l</option></term>
392           <term><option>--log-priority=<replaceable>value</replaceable></option></term>
393           <listitem>
394             <para>Set the internal log level of systemd-udevd. Valid values are the numerical
395             syslog priorities or their textual representations: <option>err</option>,
396             <option>info</option> and <option>debug</option>.</para>
397           </listitem>
398         </varlistentry>
399         <varlistentry>
400           <term><option>-s</option></term>
401           <term><option>--stop-exec-queue</option></term>
402           <listitem>
403             <para>Signal systemd-udevd to stop executing new events. Incoming events
404             will be queued.</para>
405           </listitem>
406         </varlistentry>
407         <varlistentry>
408           <term><option>-S</option></term>
409           <term><option>--start-exec-queue</option></term>
410           <listitem>
411             <para>Signal systemd-udevd to enable the execution of events.</para>
412           </listitem>
413         </varlistentry>
414         <varlistentry>
415           <term><option>-R</option></term>
416           <term><option>--reload</option></term>
417           <listitem>
418             <para>Signal systemd-udevd to reload the rules files and other databases like the kernel
419             module index. Reloading rules and databases does not apply any changes to already
420             existing devices; the new configuration will only be applied to new events.</para>
421           </listitem>
422         </varlistentry>
423         <varlistentry>
424           <term><option>-p</option></term>
425           <term><option>--property=<replaceable>KEY</replaceable>=<replaceable>value</replaceable></option></term>
426           <listitem>
427             <para>Set a global property for all events.</para>
428           </listitem>
429         </varlistentry>
430         <varlistentry>
431           <term><option>-m</option></term>
432           <term><option>--children-max=</option><replaceable>value</replaceable></term>
433           <listitem>
434             <para>Set the maximum number of events, systemd-udevd will handle at the
435             same time.</para>
436           </listitem>
437         </varlistentry>
438         <varlistentry>
439           <term><option>--timeout=</option><replaceable>seconds</replaceable></term>
440           <listitem>
441             <para>The maximum number of seconds to wait for a reply from systemd-udevd.</para>
442           </listitem>
443         </varlistentry>
444         <varlistentry>
445           <term><option>-h</option></term>
446           <term><option>--help</option></term>
447           <listitem>
448             <para>Print help text.</para>
449           </listitem>
450         </varlistentry>
451       </variablelist>
452     </refsect2>
453
454     <refsect2><title>udevadm monitor <optional>options</optional></title>
455       <para>Listens to the kernel uevents and events sent out by a udev rule
456       and prints the devpath of the event to the console. It can be used to analyze the
457       event timing, by comparing the timestamps of the kernel uevent and the udev event.
458       </para>
459       <variablelist>
460         <varlistentry>
461           <term><option>-k</option></term>
462           <term><option>--kernel</option></term>
463           <listitem>
464             <para>Print the kernel uevents.</para>
465           </listitem>
466         </varlistentry>
467         <varlistentry>
468           <term><option>-u</option></term>
469           <term><option>--udev</option></term>
470           <listitem>
471             <para>Print the udev event after the rule processing.</para>
472           </listitem>
473         </varlistentry>
474         <varlistentry>
475           <term><option>-p</option></term>
476           <term><option>--property</option></term>
477           <listitem>
478             <para>Also print the properties of the event.</para>
479           </listitem>
480         </varlistentry>
481         <varlistentry>
482           <term><option>-s</option></term>
483           <term><option>--subsystem-match=<replaceable>string[/string]</replaceable></option></term>
484           <listitem>
485             <para>Filter events by subsystem[/devtype]. Only udev events with a matching subsystem value will pass.</para>
486           </listitem>
487         </varlistentry>
488         <varlistentry>
489           <term><option>-t</option></term>
490           <term><option>--tag-match=<replaceable>string</replaceable></option></term>
491           <listitem>
492             <para>Filter events by property. Only udev events with a given tag attached will pass.</para>
493           </listitem>
494         </varlistentry>
495         <varlistentry>
496           <term><option>-h</option></term>
497           <term><option>--help</option></term>
498           <listitem>
499             <para>Print help text.</para>
500           </listitem>
501         </varlistentry>
502       </variablelist>
503     </refsect2>
504
505     <refsect2><title>udevadm hwdb <optional>options</optional></title>
506       <para>Maintain the hardware database index in <filename>/etc/udev/hwdb.bin</filename>.</para>
507       <variablelist>
508         <varlistentry>
509           <term><option>-u</option></term>
510           <term><option>--update</option></term>
511           <listitem>
512             <para>Compile the hardware database information located in /usr/lib/udev/hwdb.d/,
513             /etc/udev/hwdb.d/ and store it in <filename>/etc/udev/hwdb.bin</filename>. This should be done after
514             any update to the source files; it will not be called automatically. The running
515             udev daemon will detect a new database on its own and does not need to be
516             notified about it.</para>
517           </listitem>
518         </varlistentry>
519         <varlistentry>
520           <term><option>-t</option></term>
521           <term><option>--test=<replaceable>string</replaceable></option></term>
522           <listitem>
523             <para>Query the database with a modalias string, and print the
524             retrieved properties.</para>
525           </listitem>
526         </varlistentry>
527         <varlistentry>
528           <term><option>-r</option></term>
529           <term><option>--root=<replaceable>string</replaceable></option></term>
530           <listitem>
531             <para>Alternative root path in the file system for reading and writing files.</para>
532           </listitem>
533         </varlistentry>
534         <varlistentry>
535           <term><option>-h</option></term>
536           <term><option>--help</option></term>
537           <listitem>
538             <para>Print help text.</para>
539           </listitem>
540         </varlistentry>
541       </variablelist>
542     </refsect2>
543
544     <refsect2><title>udevadm test <optional>options</optional> <replaceable>devpath</replaceable></title>
545       <para>Simulate a udev event run for the given device, and print debug output.</para>
546       <variablelist>
547         <varlistentry>
548           <term><option>-a</option></term>
549           <term><option>--action=<replaceable>string</replaceable></option></term>
550           <listitem>
551             <para>The action string.</para>
552           </listitem>
553         </varlistentry>
554         <varlistentry>
555           <term><option>-N</option></term>
556           <term><option>--resolve-names=<constant>early</constant>|<constant>late</constant>|<constant>never</constant></option></term>
557           <listitem>
558             <para>Specify when udevadm should resolve names of users
559             and groups.  When set to <constant>early</constant> (the
560             default), names will be resolved when the rules are
561             parsed. When set to <constant>late</constant>, names will
562             be resolved for every event. When set to
563             <constant>never</constant>, names will never be resolved
564             and all devices will be owned by root.</para>
565           </listitem>
566         </varlistentry>
567         <varlistentry>
568           <term><option>-h</option></term>
569           <term><option>--help</option></term>
570           <listitem>
571             <para>Print help text.</para>
572           </listitem>
573         </varlistentry>
574       </variablelist>
575     </refsect2>
576
577     <refsect2><title>udevadm test-builtin <optional>options</optional> <replaceable>COMMAND</replaceable> <replaceable>DEVPATH</replaceable></title>
578       <para>Run a built-in command <replaceable>COMMAND</replaceable>
579       for device <replaceable>DEVPATH</replaceable>, and print debug
580       output.</para>
581       <variablelist>
582         <varlistentry>
583           <term><option>-h</option></term>
584           <term><option>--help</option></term>
585           <listitem>
586             <para>Print help text.</para>
587           </listitem>
588         </varlistentry>
589       </variablelist>
590     </refsect2>
591   </refsect1>
592
593   <refsect1>
594     <title>See Also</title>
595     <para><citerefentry>
596         <refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum>
597     </citerefentry>
598     <citerefentry>
599         <refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum>
600     </citerefentry></para>
601   </refsect1>
602 </refentry>