chiark / gitweb /
journald: move /dev/log socket to /run
[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 standard error.</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>-E</option></term>
343           <term><option>--exit-if-exists=<replaceable>FILE</replaceable></option></term>
344           <listitem>
345             <para>Stop waiting if file exists.</para>
346           </listitem>
347         </varlistentry>
348         <varlistentry>
349           <term><option>-h</option></term>
350           <term><option>--help</option></term>
351           <listitem>
352             <para>Print help text.</para>
353           </listitem>
354         </varlistentry>
355       </variablelist>
356     </refsect2>
357
358     <refsect2><title>udevadm control <replaceable>command</replaceable></title>
359       <para>Modify the internal state of the running udev daemon.</para>
360       <variablelist>
361         <varlistentry>
362           <term><option>-x</option></term>
363           <term><option>--exit</option></term>
364           <listitem>
365             <para>Signal and wait for systemd-udevd to exit.</para>
366           </listitem>
367         </varlistentry>
368         <varlistentry>
369           <term><option>-l</option></term>
370           <term><option>--log-priority=<replaceable>value</replaceable></option></term>
371           <listitem>
372             <para>Set the internal log level of systemd-udevd. Valid values are the numerical
373             syslog priorities or their textual representations: <option>err</option>,
374             <option>info</option> and <option>debug</option>.</para>
375           </listitem>
376         </varlistentry>
377         <varlistentry>
378           <term><option>-s</option></term>
379           <term><option>--stop-exec-queue</option></term>
380           <listitem>
381             <para>Signal systemd-udevd to stop executing new events. Incoming events
382             will be queued.</para>
383           </listitem>
384         </varlistentry>
385         <varlistentry>
386           <term><option>-S</option></term>
387           <term><option>--start-exec-queue</option></term>
388           <listitem>
389             <para>Signal systemd-udevd to enable the execution of events.</para>
390           </listitem>
391         </varlistentry>
392         <varlistentry>
393           <term><option>-R</option></term>
394           <term><option>--reload</option></term>
395           <listitem>
396             <para>Signal systemd-udevd to reload the rules files and other databases like the kernel
397             module index. Reloading rules and databases does not apply any changes to already
398             existing devices; the new configuration will only be applied to new events.</para>
399           </listitem>
400         </varlistentry>
401         <varlistentry>
402           <term><option>-p</option></term>
403           <term><option>--property=<replaceable>KEY</replaceable>=<replaceable>value</replaceable></option></term>
404           <listitem>
405             <para>Set a global property for all events.</para>
406           </listitem>
407         </varlistentry>
408         <varlistentry>
409           <term><option>-m</option></term>
410           <term><option>--children-max=</option><replaceable>value</replaceable></term>
411           <listitem>
412             <para>Set the maximum number of events, systemd-udevd will handle at the
413             same time.</para>
414           </listitem>
415         </varlistentry>
416         <varlistentry>
417           <term><option>--timeout=</option><replaceable>seconds</replaceable></term>
418           <listitem>
419             <para>The maximum number of seconds to wait for a reply from systemd-udevd.</para>
420           </listitem>
421         </varlistentry>
422         <varlistentry>
423           <term><option>-h</option></term>
424           <term><option>--help</option></term>
425           <listitem>
426             <para>Print help text.</para>
427           </listitem>
428         </varlistentry>
429       </variablelist>
430     </refsect2>
431
432     <refsect2><title>udevadm monitor <optional>options</optional></title>
433       <para>Listens to the kernel uevents and events sent out by a udev rule
434       and prints the devpath of the event to the console. It can be used to analyze the
435       event timing, by comparing the timestamps of the kernel uevent and the udev event.
436       </para>
437       <variablelist>
438         <varlistentry>
439           <term><option>-k</option></term>
440           <term><option>--kernel</option></term>
441           <listitem>
442             <para>Print the kernel uevents.</para>
443           </listitem>
444         </varlistentry>
445         <varlistentry>
446           <term><option>-u</option></term>
447           <term><option>--udev</option></term>
448           <listitem>
449             <para>Print the udev event after the rule processing.</para>
450           </listitem>
451         </varlistentry>
452         <varlistentry>
453           <term><option>-p</option></term>
454           <term><option>--property</option></term>
455           <listitem>
456             <para>Also print the properties of the event.</para>
457           </listitem>
458         </varlistentry>
459         <varlistentry>
460           <term><option>-s</option></term>
461           <term><option>--subsystem-match=<replaceable>string[/string]</replaceable></option></term>
462           <listitem>
463             <para>Filter events by subsystem[/devtype]. Only udev events with a matching subsystem value will pass.</para>
464           </listitem>
465         </varlistentry>
466         <varlistentry>
467           <term><option>-t</option></term>
468           <term><option>--tag-match=<replaceable>string</replaceable></option></term>
469           <listitem>
470             <para>Filter events by property. Only udev events with a given tag attached will pass.</para>
471           </listitem>
472         </varlistentry>
473         <varlistentry>
474           <term><option>-h</option></term>
475           <term><option>--help</option></term>
476           <listitem>
477             <para>Print help text.</para>
478           </listitem>
479         </varlistentry>
480       </variablelist>
481     </refsect2>
482
483     <refsect2><title>udevadm hwdb <optional>options</optional></title>
484       <para>Maintain the hardware database index in <filename>/etc/udev/hwdb.bin</filename>.</para>
485       <variablelist>
486         <varlistentry>
487           <term><option>-u</option></term>
488           <term><option>--update</option></term>
489           <listitem>
490             <para>Compile the hardware database information located in /usr/lib/udev/hwdb.d/,
491             /etc/udev/hwdb.d/ and store it in <filename>/etc/udev/hwdb.bin</filename>. This should be done after
492             any update to the source files; it will not be called automatically. The running
493             udev daemon will detect a new database on its own and does not need to be
494             notified about it.</para>
495           </listitem>
496         </varlistentry>
497         <varlistentry>
498           <term><option>-t</option></term>
499           <term><option>--test=<replaceable>string</replaceable></option></term>
500           <listitem>
501             <para>Query the database with a modalias string, and print the
502             retrieved properties.</para>
503           </listitem>
504         </varlistentry>
505         <varlistentry>
506           <term><option>-r</option></term>
507           <term><option>--root=<replaceable>string</replaceable></option></term>
508           <listitem>
509             <para>Alternative root path in the file system for reading and writing files.</para>
510           </listitem>
511         </varlistentry>
512         <varlistentry>
513           <term><option>-h</option></term>
514           <term><option>--help</option></term>
515           <listitem>
516             <para>Print help text.</para>
517           </listitem>
518         </varlistentry>
519       </variablelist>
520     </refsect2>
521
522     <refsect2><title>udevadm test <optional>options</optional> <replaceable>devpath</replaceable></title>
523       <para>Simulate a udev event run for the given device, and print debug output.</para>
524       <variablelist>
525         <varlistentry>
526           <term><option>-a</option></term>
527           <term><option>--action=<replaceable>string</replaceable></option></term>
528           <listitem>
529             <para>The action string.</para>
530           </listitem>
531         </varlistentry>
532         <varlistentry>
533           <term><option>-N</option></term>
534           <term><option>--resolve-names=<constant>early</constant>|<constant>late</constant>|<constant>never</constant></option></term>
535           <listitem>
536             <para>Specify when udevadm should resolve names of users
537             and groups.  When set to <constant>early</constant> (the
538             default), names will be resolved when the rules are
539             parsed. When set to <constant>late</constant>, names will
540             be resolved for every event. When set to
541             <constant>never</constant>, names will never be resolved
542             and all devices will be owned by root.</para>
543           </listitem>
544         </varlistentry>
545         <varlistentry>
546           <term><option>-h</option></term>
547           <term><option>--help</option></term>
548           <listitem>
549             <para>Print help text.</para>
550           </listitem>
551         </varlistentry>
552       </variablelist>
553     </refsect2>
554
555     <refsect2><title>udevadm test-builtin <optional>options</optional> <replaceable>COMMAND</replaceable> <replaceable>DEVPATH</replaceable></title>
556       <para>Run a built-in command <replaceable>COMMAND</replaceable>
557       for device <replaceable>DEVPATH</replaceable>, and print debug
558       output.</para>
559       <variablelist>
560         <varlistentry>
561           <term><option>-h</option></term>
562           <term><option>--help</option></term>
563           <listitem>
564             <para>Print help text.</para>
565           </listitem>
566         </varlistentry>
567       </variablelist>
568     </refsect2>
569   </refsect1>
570
571   <refsect1>
572     <title>See Also</title>
573     <para><citerefentry>
574         <refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum>
575     </citerefentry>,
576     <citerefentry>
577         <refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum>
578     </citerefentry></para>
579   </refsect1>
580 </refentry>