chiark / gitweb /
Add sabridge for socket activation of traditional daemons
[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>--help</option></term>
86         <listitem>
87           <para>Print help text.</para>
88         </listitem>
89       </varlistentry>
90     </variablelist>
91
92     <refsect2><title>udevadm info <replaceable>options</replaceable></title>
93       <para>Queries the udev database for device information
94       stored in the udev database. It can also query the properties
95       of a device from its sysfs representation to help creating udev
96       rules that match this device.</para>
97       <variablelist>
98         <varlistentry>
99           <term><option>--query=<replaceable>type</replaceable></option></term>
100           <listitem>
101             <para>Query the database for the specified type of device
102             data. It needs the <option>--path</option> or
103             <option>--name</option> to identify the specified
104             device. Valid queries are: <constant>name</constant>,
105             <constant>symlink</constant>, <constant>path</constant>,
106             <constant>property</constant>,
107             <constant>all</constant>.</para>
108           </listitem>
109         </varlistentry>
110         <varlistentry>
111           <term><option>--path=<replaceable>devpath</replaceable></option></term>
112           <listitem>
113             <para>The <filename>/sys</filename> path of the device to
114             query, e.g.
115             <filename><optional>/sys</optional>/class/block/sda</filename>.
116             Note that this option usually is not very useful, since
117             <command>udev</command> can guess the type of the
118             argument, so <command>udevadm
119             --devpath=/class/block/sda</command> is equivalent to
120             <command>udevadm /sys/class/block/sda</command>.</para>
121           </listitem>
122         </varlistentry>
123         <varlistentry>
124           <term><option>--name=<replaceable>file</replaceable></option></term>
125           <listitem>
126             <para>The name of the device node or a symlink to query,
127             e.g. <filename><optional>/dev</optional>/sda</filename>.
128             Note that this option usually is not very useful, since
129             <command>udev</command> can guess the type of the
130             argument, so <command>udevadm --name=sda</command> is
131             equivalent to <command>udevadm /dev/sda</command>.</para>
132           </listitem>
133         </varlistentry>
134         <varlistentry>
135           <term><option>--root</option></term>
136           <listitem>
137             <para>Print absolute paths in <command>name</command> or <command>symlink</command>
138             query.</para>
139           </listitem>
140         </varlistentry>
141         <varlistentry>
142           <term><option>--attribute-walk</option></term>
143           <listitem>
144             <para>Print all sysfs properties of the specified device that can be used
145             in udev rules to match the specified device. It prints all devices
146             along the chain, up to the root of sysfs that can be used in udev rules.</para>
147           </listitem>
148         </varlistentry>
149         <varlistentry>
150           <term><option>--export</option></term>
151           <listitem>
152             <para>Print output as key/value pairs. Values are enclosed in single quotes.</para>
153           </listitem>
154         </varlistentry>
155         <varlistentry>
156           <term><option>--export-prefix=<replaceable>name</replaceable></option></term>
157           <listitem>
158             <para>Add a prefix to the key name of exported values.</para>
159           </listitem>
160         </varlistentry>
161         <varlistentry>
162           <term><option>--device-id-of-file=<replaceable>file</replaceable></option></term>
163           <listitem>
164             <para>Print major/minor numbers of the underlying device, where the file
165             lives on.</para>
166           </listitem>
167         </varlistentry>
168         <varlistentry>
169           <term><option>--export-db</option></term>
170           <listitem>
171             <para>Export the content of the udev database.</para>
172           </listitem>
173         </varlistentry>
174         <varlistentry>
175           <term><option>--cleanup-db</option></term>
176           <listitem>
177             <para>Cleanup the udev database.</para>
178           </listitem>
179         </varlistentry>
180         <varlistentry>
181           <term><option>--version</option></term>
182           <listitem>
183             <para>Print version.</para>
184           </listitem>
185         </varlistentry>
186         <varlistentry>
187           <term><option>--help</option></term>
188           <listitem>
189             <para>Print help text.</para>
190           </listitem>
191         </varlistentry>
192       </variablelist>
193     </refsect2>
194
195     <refsect2><title>udevadm trigger <optional>options</optional></title>
196       <para>Request device events from the kernel. Primarily used to replay events at system coldplug time.</para>
197       <variablelist>
198         <varlistentry>
199           <term><option>--verbose</option></term>
200           <listitem>
201             <para>Print the list of devices which will be triggered.</para>
202           </listitem>
203         </varlistentry>
204         <varlistentry>
205           <term><option>--dry-run</option></term>
206           <listitem>
207             <para>Do not actually trigger the event.</para>
208           </listitem>
209         </varlistentry>
210         <varlistentry>
211           <term><option>--type=<replaceable>type</replaceable></option></term>
212           <listitem>
213             <para>Trigger a specific type of devices. Valid types are:
214             <command>devices</command>, <command>subsystems</command>.
215             The default value is <command>devices</command>.</para>
216           </listitem>
217         </varlistentry>
218         <varlistentry>
219           <term><option>--action=<replaceable>action</replaceable></option></term>
220           <listitem>
221             <para>Type of event to be triggered. The default value is <command>change</command>.</para>
222           </listitem>
223         </varlistentry>
224         <varlistentry>
225           <term><option>--subsystem-match=<replaceable>subsystem</replaceable></option></term>
226           <listitem>
227             <para>Trigger events for devices which belong to a matching subsystem. This option
228             can be specified multiple times and supports shell style pattern matching.</para>
229           </listitem>
230         </varlistentry>
231         <varlistentry>
232           <term><option>--subsystem-nomatch=<replaceable>subsystem</replaceable></option></term>
233           <listitem>
234             <para>Do not trigger events for devices which belong to a matching subsystem. This option
235             can be specified multiple times and supports shell style pattern matching.</para>
236           </listitem>
237         </varlistentry>
238         <varlistentry>
239           <term><option>--attr-match=<replaceable>attribute</replaceable>=<replaceable>value</replaceable></option></term>
240           <listitem>
241             <para>Trigger events for devices with a matching sysfs attribute. If a value is specified
242             along with the attribute name, the content of the attribute is matched against the given
243             value using shell style pattern matching. If no value is specified, the existence of the
244             sysfs attribute is checked. This option can be specified multiple times.</para>
245           </listitem>
246         </varlistentry>
247         <varlistentry>
248           <term><option>--attr-nomatch=<replaceable>attribute</replaceable>=<replaceable>value</replaceable></option></term>
249           <listitem>
250             <para>Do not trigger events for devices with a matching sysfs attribute. If a value is
251             specified along with the attribute name, the content of the attribute is matched against
252             the given value using shell style pattern matching. If no value is specified, the existence
253             of the sysfs attribute is checked. This option can be specified multiple times.</para>
254           </listitem>
255         </varlistentry>
256         <varlistentry>
257           <term><option>--property-match=<replaceable>property</replaceable>=<replaceable>value</replaceable></option></term>
258           <listitem>
259             <para>Trigger events for devices with a matching property value. This option can be
260             specified multiple times and supports shell style pattern matching.</para>
261           </listitem>
262         </varlistentry>
263         <varlistentry>
264           <term><option>--tag-match=<replaceable>property</replaceable></option></term>
265           <listitem>
266             <para>Trigger events for devices with a matching tag. This option can be
267             specified multiple times.</para>
268           </listitem>
269         </varlistentry>
270         <varlistentry>
271           <term><option>--sysname-match=<replaceable>name</replaceable></option></term>
272           <listitem>
273             <para>Trigger events for devices with a matching sys device name. This option can be
274             specified multiple times and supports shell style pattern matching.</para>
275           </listitem>
276         </varlistentry>
277         <varlistentry>
278           <term><option>--parent-match=<replaceable>syspath</replaceable></option></term>
279           <listitem>
280             <para>Trigger events for all children of a given device.</para>
281           </listitem>
282         </varlistentry>
283       </variablelist>
284     </refsect2>
285
286     <refsect2><title>udevadm settle <optional>options</optional></title>
287       <para>Watches the udev event queue, and exits if all current events are handled.</para>
288       <variablelist>
289         <varlistentry>
290           <term><option>--timeout=<replaceable>seconds</replaceable></option></term>
291           <listitem>
292             <para>Maximum number of seconds to wait for the event queue to become empty.
293             The default value is 120 seconds. A value of 0 will check if the queue is empty
294             and always return immediately.</para>
295           </listitem>
296         </varlistentry>
297         <varlistentry>
298           <term><option>--seq-start=<replaceable>seqnum</replaceable></option></term>
299           <listitem>
300             <para>Wait only for events after the given sequence number.</para>
301           </listitem>
302         </varlistentry>
303         <varlistentry>
304           <term><option>--seq-end=<replaceable>seqnum</replaceable></option></term>
305           <listitem>
306             <para>Wait only for events before the given sequence number.</para>
307           </listitem>
308         </varlistentry>
309         <varlistentry>
310           <term><option>--exit-if-exists=<replaceable>file</replaceable></option></term>
311           <listitem>
312             <para>Stop waiting if file exists.</para>
313           </listitem>
314         </varlistentry>
315         <varlistentry>
316           <term><option>--quiet</option></term>
317           <listitem>
318             <para>Do not print any output, like the remaining queue entries when reaching the timeout.</para>
319           </listitem>
320         </varlistentry>
321         <varlistentry>
322           <term><option>--help</option></term>
323           <listitem>
324             <para>Print help text.</para>
325           </listitem>
326         </varlistentry>
327       </variablelist>
328     </refsect2>
329
330     <refsect2><title>udevadm control <replaceable>command</replaceable></title>
331       <para>Modify the internal state of the running udev daemon.</para>
332       <variablelist>
333         <varlistentry>
334           <term><option>--exit</option></term>
335           <listitem>
336             <para>Signal and wait for systemd-udevd to exit.</para>
337           </listitem>
338         </varlistentry>
339         <varlistentry>
340           <term><option>--log-priority=<replaceable>value</replaceable></option></term>
341           <listitem>
342             <para>Set the internal log level of systemd-udevd. Valid values are the numerical
343             syslog priorities or their textual representations: <option>err</option>,
344             <option>info</option> and <option>debug</option>.</para>
345           </listitem>
346         </varlistentry>
347         <varlistentry>
348           <term><option>--stop-exec-queue</option></term>
349           <listitem>
350             <para>Signal systemd-udevd to stop executing new events. Incoming events
351             will be queued.</para>
352           </listitem>
353         </varlistentry>
354         <varlistentry>
355           <term><option>--start-exec-queue</option></term>
356           <listitem>
357             <para>Signal systemd-udevd to enable the execution of events.</para>
358           </listitem>
359         </varlistentry>
360         <varlistentry>
361           <term><option>--reload</option></term>
362           <listitem>
363             <para>Signal systemd-udevd to reload the rules files and other databases like the kernel
364             module index. Reloading rules and databases does not apply any changes to already
365             existing devices; the new configuration will only be applied to new events.</para>
366           </listitem>
367         </varlistentry>
368         <varlistentry>
369           <term><option>--property=<replaceable>KEY</replaceable>=<replaceable>value</replaceable></option></term>
370           <listitem>
371             <para>Set a global property for all events.</para>
372           </listitem>
373         </varlistentry>
374         <varlistentry>
375           <term><option>--children-max=</option><replaceable>value</replaceable></term>
376           <listitem>
377             <para>Set the maximum number of events, systemd-udevd will handle at the
378             same time.</para>
379           </listitem>
380         </varlistentry>
381         <varlistentry>
382           <term><option>--timeout=</option><replaceable>seconds</replaceable></term>
383           <listitem>
384             <para>The maximum number of seconds to wait for a reply from systemd-udevd.</para>
385           </listitem>
386         </varlistentry>
387         <varlistentry>
388           <term><option>--help</option></term>
389           <listitem>
390             <para>Print help text.</para>
391           </listitem>
392         </varlistentry>
393       </variablelist>
394     </refsect2>
395
396     <refsect2><title>udevadm monitor <optional>options</optional></title>
397       <para>Listens to the kernel uevents and events sent out by a udev rule
398       and prints the devpath of the event to the console. It can be used to analyze the
399       event timing, by comparing the timestamps of the kernel uevent and the udev event.
400       </para>
401       <variablelist>
402         <varlistentry>
403           <term><option>--kernel</option></term>
404           <listitem>
405             <para>Print the kernel uevents.</para>
406           </listitem>
407         </varlistentry>
408         <varlistentry>
409           <term><option>--udev</option></term>
410           <listitem>
411             <para>Print the udev event after the rule processing.</para>
412           </listitem>
413         </varlistentry>
414         <varlistentry>
415           <term><option>--property</option></term>
416           <listitem>
417             <para>Also print the properties of the event.</para>
418           </listitem>
419         </varlistentry>
420         <varlistentry>
421           <term><option>--subsystem-match=<replaceable>string[/string]</replaceable></option></term>
422           <listitem>
423             <para>Filter events by subsystem[/devtype]. Only udev events with a matching subsystem value will pass.</para>
424           </listitem>
425         </varlistentry>
426         <varlistentry>
427           <term><option>--tag-match=<replaceable>string</replaceable></option></term>
428           <listitem>
429             <para>Filter events by property. Only udev events with a given tag attached will pass.</para>
430           </listitem>
431         </varlistentry>
432         <varlistentry>
433           <term><option>--help</option></term>
434           <listitem>
435             <para>Print help text.</para>
436           </listitem>
437         </varlistentry>
438       </variablelist>
439     </refsect2>
440
441     <refsect2><title>udevadm hwdb <optional>options</optional></title>
442       <para>Maintain the hardware database index in <filename>/etc/udev/hwdb.bin</filename>.</para>
443       <variablelist>
444         <varlistentry>
445           <term><option>--update</option></term>
446           <listitem>
447             <para>Compile the hardware database information located in /usr/lib/udev/hwdb.d/,
448             /etc/udev/hwdb.d/ and store it in <filename>/etc/udev/hwdb.bin</filename>. This should be done after
449             any update to the source files; it will not be called automatically. The running
450             udev daemon will detect a new database on its own and does not need to be
451             notified about it.</para>
452           </listitem>
453         </varlistentry>
454         <varlistentry>
455           <term><option>--test=<replaceable>string</replaceable></option></term>
456           <listitem>
457             <para>Query the database with a modalias string, and print the
458             retrieved properties.</para>
459           </listitem>
460         </varlistentry>
461         <varlistentry>
462           <term><option>--root=<replaceable>string</replaceable></option></term>
463           <listitem>
464             <para>Alternative root path in the filesystem for reading and writing files.</para>
465           </listitem>
466         </varlistentry>
467       </variablelist>
468     </refsect2>
469
470     <refsect2><title>udevadm test <optional>options</optional> <replaceable>devpath</replaceable></title>
471       <para>Simulate a udev event run for the given device, and print debug output.</para>
472       <variablelist>
473         <varlistentry>
474           <term><option>--action=<replaceable>string</replaceable></option></term>
475           <listitem>
476             <para>The action string.</para>
477           </listitem>
478         </varlistentry>
479         <varlistentry>
480           <term><option>--resolve-names=<constant>early</constant>|<constant>late</constant>|<constant>never</constant></option></term>
481           <listitem>
482             <para>Specify when udevadm should resolve names of users
483             and groups.  When set to <constant>early</constant> (the
484             default), names will be resolved when the rules are
485             parsed. When set to <constant>late</constant>, names will
486             be resolved for every event. When set to
487             <constant>never</constant>, names will never be resolved
488             and all devices will be owned by root.</para>
489           </listitem>
490         </varlistentry>
491         <varlistentry>
492           <term><option>--help</option></term>
493           <listitem>
494             <para>Print help text.</para>
495           </listitem>
496         </varlistentry>
497       </variablelist>
498     </refsect2>
499
500     <refsect2><title>udevadm test-builtin <optional>options</optional> <replaceable>command</replaceable> <replaceable>devpath</replaceable></title>
501       <para>Run a built-in command for the given device, and print debug output.</para>
502       <variablelist>
503         <varlistentry>
504           <term><option>--help</option></term>
505           <listitem>
506             <para>Print help text.</para>
507           </listitem>
508         </varlistentry>
509       </variablelist>
510     </refsect2>
511   </refsect1>
512
513   <refsect1>
514     <title>See Also</title>
515     <para><citerefentry>
516         <refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum>
517     </citerefentry>
518     <citerefentry>
519         <refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum>
520     </citerefentry></para>
521   </refsect1>
522 </refentry>