1 <?xml version='
1.0'
?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4 <!ENTITY % entities SYSTEM
"custom-entities.ent" >
8 <refentry id=
"udevadm">
10 <title>udevadm
</title>
11 <productname>systemd
</productname>
14 <contrib>Developer
</contrib>
15 <firstname>Kay
</firstname>
16 <surname>Sievers
</surname>
17 <email>kay@vrfy.org
</email>
23 <refentrytitle>udevadm
</refentrytitle>
24 <manvolnum>8</manvolnum>
28 <refname>udevadm
</refname><refpurpose>udev management tool
</refpurpose>
33 <command>udevadm
</command>
34 <arg><option>--debug
</option></arg>
35 <arg><option>--version
</option></arg>
36 <arg><option>--help
</option></arg>
39 <command>udevadm info
<replaceable>options
</replaceable></command>
42 <command>udevadm trigger
<optional>options
</optional></command>
45 <command>udevadm settle
<optional>options
</optional></command>
48 <command>udevadm control
<replaceable>command
</replaceable></command>
51 <command>udevadm monitor
<optional>options
</optional></command>
54 <command>udevadm test
<optional>options
</optional> <replaceable>devpath
</replaceable></command>
57 <command>udevadm test-builtin
<optional>options
</optional> <replaceable>command
</replaceable> <replaceable>devpath
</replaceable></command>
61 <refsect1><title>Description
</title>
62 <para><command>udevadm
</command> expects a command and command
63 specific options. It controls the runtime behavior of
64 <command>systemd-udevd
</command>, requests kernel events, manages
65 the event queue, and provides simple debugging mechanisms.
</para>
68 <refsect1><title>Options
</title>
71 <term><option>--debug
</option></term>
73 <para>Print debug messages to standard error.
</para>
77 <term><option>--version
</option></term>
79 <para>Print version number.
</para>
83 <term><option>-h
</option></term>
84 <term><option>--help
</option></term>
86 <para>Print help text.
</para>
91 <refsect2><title>udevadm info
92 <arg choice=
"opt"><replaceable>options
</replaceable></arg>
93 <arg choice=
"opt"><replaceable>devpath
</replaceable>|
<replaceable>file
</replaceable></arg>
96 <para>Queries the udev database for device information
97 stored in the udev database. It can also query the properties
98 of a device from its sysfs representation to help creating udev
99 rules that match this device.
</para>
102 <term><option>-q
</option></term>
103 <term><option>--query=
<replaceable>TYPE
</replaceable></option></term>
105 <para>Query the database for the specified type of device
106 data. It needs the
<option>--path
</option> or
107 <option>--name
</option> to identify the specified device.
108 Valid
<replaceable>TYPE
</replaceable>s are:
109 <constant>name
</constant>,
<constant>symlink
</constant>,
110 <constant>path
</constant>,
<constant>property
</constant>,
111 <constant>all
</constant>.
</para>
115 <term><option>-p
</option></term>
116 <term><option>--path=
<replaceable>DEVPATH
</replaceable></option></term>
118 <para>The
<filename>/sys
</filename> path of the device to
120 <filename><optional>/sys
</optional>/class/block/sda
</filename>.
121 Note that this option usually is not very useful, since
122 <command>udev
</command> can guess the type of the
123 argument, so
<command>udevadm
124 --devpath=/class/block/sda
</command> is equivalent to
125 <command>udevadm /sys/class/block/sda
</command>.
</para>
129 <term><option>-n
</option></term>
130 <term><option>--name=
<replaceable>FILE
</replaceable></option></term>
132 <para>The name of the device node or a symlink to query,
133 e.g.
<filename><optional>/dev
</optional>/sda
</filename>.
134 Note that this option usually is not very useful, since
135 <command>udev
</command> can guess the type of the
136 argument, so
<command>udevadm --name=sda
</command> is
137 equivalent to
<command>udevadm /dev/sda
</command>.
</para>
141 <term><option>-r
</option></term>
142 <term><option>--root
</option></term>
144 <para>Print absolute paths in
<command>name
</command> or
<command>symlink
</command>
149 <term><option>-a
</option></term>
150 <term><option>--attribute-walk
</option></term>
152 <para>Print all sysfs properties of the specified device that can be used
153 in udev rules to match the specified device. It prints all devices
154 along the chain, up to the root of sysfs that can be used in udev rules.
</para>
158 <term><option>-x
</option></term>
159 <term><option>--export
</option></term>
161 <para>Print output as key/value pairs. Values are enclosed in single quotes.
</para>
165 <term><option>-P
</option></term>
166 <term><option>--export-prefix=
<replaceable>NAME
</replaceable></option></term>
168 <para>Add a prefix to the key name of exported values.
</para>
172 <term><option>-d
</option></term>
173 <term><option>--device-id-of-file=
<replaceable>FILE
</replaceable></option></term>
175 <para>Print major/minor numbers of the underlying device, where the file
180 <term><option>-e
</option></term>
181 <term><option>--export-db
</option></term>
183 <para>Export the content of the udev database.
</para>
187 <term><option>-c
</option></term>
188 <term><option>--cleanup-db
</option></term>
190 <para>Cleanup the udev database.
</para>
194 <term><option>--version
</option></term>
196 <para>Print version.
</para>
200 <term><option>-h
</option></term>
201 <term><option>--help
</option></term>
203 <para>Print help text.
</para>
208 <para>In addition an optional positional argument can be used
209 to specify a device name or a sys path. It must start with
210 <filename>/dev
</filename> or
<filename>/sys
</filename>
214 <refsect2><title>udevadm trigger
215 <arg choice=
"opt"><replaceable>options
</replaceable></arg>
216 <arg choice=
"opt" rep=
"repeat"><replaceable>devpath
</replaceable>|
<replaceable>file
</replaceable></arg></title>
217 <para>Request device events from the kernel. Primarily used to replay events at system coldplug time.
</para>
220 <term><option>-v
</option></term>
221 <term><option>--verbose
</option></term>
223 <para>Print the list of devices which will be triggered.
</para>
227 <term><option>-n
</option></term>
228 <term><option>--dry-run
</option></term>
230 <para>Do not actually trigger the event.
</para>
234 <term><option>-t
</option></term>
235 <term><option>--type=
<replaceable>TYPE
</replaceable></option></term>
237 <para>Trigger a specific type of devices. Valid types are:
238 <command>devices
</command>,
<command>subsystems
</command>.
239 The default value is
<command>devices
</command>.
</para>
243 <term><option>-c
</option></term>
244 <term><option>--action=
<replaceable>ACTION
</replaceable></option></term>
246 <para>Type of event to be triggered. The default value is
247 <command>change
</command>.
</para>
251 <term><option>-s
</option></term>
252 <term><option>--subsystem-match=
<replaceable>SUBSYSTEM
</replaceable></option></term>
254 <para>Trigger events for devices which belong to a
255 matching subsystem. This option can be specified multiple
256 times and supports shell style pattern matching.
</para>
260 <term><option>-S
</option></term>
261 <term><option>--subsystem-nomatch=
<replaceable>SUBSYSTEM
</replaceable></option></term>
263 <para>Do not trigger events for devices which belong to a matching subsystem. This option
264 can be specified multiple times and supports shell style pattern matching.
</para>
268 <term><option>-a
</option></term>
269 <term><option>--attr-match=
<replaceable>ATTRIBUTE
</replaceable>=
<replaceable>VALUE
</replaceable></option></term>
271 <para>Trigger events for devices with a matching sysfs
272 attribute. If a value is specified along with the
273 attribute name, the content of the attribute is matched
274 against the given value using shell style pattern
275 matching. If no value is specified, the existence of the
276 sysfs attribute is checked. This option can be specified
277 multiple times.
</para>
281 <term><option>-A
</option></term>
282 <term><option>--attr-nomatch=
<replaceable>ATTRIBUTE
</replaceable>=
<replaceable>VALUE
</replaceable></option></term>
284 <para>Do not trigger events for devices with a matching
285 sysfs attribute. If a value is specified along with the
286 attribute name, the content of the attribute is matched
287 against the given value using shell style pattern
288 matching. If no value is specified, the existence of the
289 sysfs attribute is checked. This option can be specified
290 multiple times.
</para>
294 <term><option>-p
</option></term>
295 <term><option>--property-match=
<replaceable>PROPERTY
</replaceable>=
<replaceable>VALUE
</replaceable></option></term>
297 <para>Trigger events for devices with a matching property
298 value. This option can be specified multiple times and
299 supports shell style pattern matching.
</para>
303 <term><option>-g
</option></term>
304 <term><option>--tag-match=
<replaceable>PROPERTY
</replaceable></option></term>
306 <para>Trigger events for devices with a matching tag. This
307 option can be specified multiple times.
</para>
311 <term><option>-y
</option></term>
312 <term><option>--sysname-match=
<replaceable>PATH
</replaceable></option></term>
314 <para>Trigger events for devices with a matching sys
315 device path. This option can be specified multiple times
316 and supports shell style pattern matching.
</para>
320 <term><option>--name-match=
<replaceable>NAME
</replaceable></option></term>
322 <para>Trigger events for devices with a matching
323 device path. This options can be specified multiple
328 <term><option>-b
</option></term>
329 <term><option>--parent-match=
<replaceable>SYSPATH
</replaceable></option></term>
331 <para>Trigger events for all children of a given
336 <term><option>-h
</option></term>
337 <term><option>--help
</option></term>
339 <para>Print help text.
</para>
344 <para>In addition optional positional arguments can be used
345 to specify device names or sys paths. They must start with
346 <filename>/dev
</filename> or
<filename>/sys
</filename>
350 <refsect2><title>udevadm settle
351 <arg choice=
"opt"><replaceable>options
</replaceable></arg>
353 <para>Watches the udev event queue, and exits if all current events are handled.
</para>
356 <term><option>-t
</option></term>
357 <term><option>--timeout=
<replaceable>SECONDS
</replaceable></option></term>
359 <para>Maximum number of seconds to wait for the event
360 queue to become empty. The default value is
120 seconds. A
361 value of
0 will check if the queue is empty and always
362 return immediately.
</para>
366 <term><option>-E
</option></term>
367 <term><option>--exit-if-exists=
<replaceable>FILE
</replaceable></option></term>
369 <para>Stop waiting if file exists.
</para>
373 <term><option>-h
</option></term>
374 <term><option>--help
</option></term>
376 <para>Print help text.
</para>
382 <refsect2><title>udevadm control
<replaceable>command
</replaceable></title>
383 <para>Modify the internal state of the running udev daemon.
</para>
386 <term><option>-x
</option></term>
387 <term><option>--exit
</option></term>
389 <para>Signal and wait for systemd-udevd to exit.
</para>
393 <term><option>-l
</option></term>
394 <term><option>--log-priority=
<replaceable>value
</replaceable></option></term>
396 <para>Set the internal log level of
397 <filename>systemd-udevd
</filename>. Valid values are the
398 numerical syslog priorities or their textual
399 representations:
<option>emerg
</option>,
400 <option>alert
</option>,
<option>crit
</option>,
401 <option>err
</option>,
<option>warning
</option>,
402 <option>notice
</option>,
<option>info
</option>, and
403 <option>debug
</option>.
</para>
407 <term><option>-s
</option></term>
408 <term><option>--stop-exec-queue
</option></term>
410 <para>Signal systemd-udevd to stop executing new events. Incoming events
411 will be queued.
</para>
415 <term><option>-S
</option></term>
416 <term><option>--start-exec-queue
</option></term>
418 <para>Signal systemd-udevd to enable the execution of events.
</para>
422 <term><option>-R
</option></term>
423 <term><option>--reload
</option></term>
425 <para>Signal systemd-udevd to reload the rules files and other databases like the kernel
426 module index. Reloading rules and databases does not apply any changes to already
427 existing devices; the new configuration will only be applied to new events.
</para>
431 <term><option>-p
</option></term>
432 <term><option>--property=
<replaceable>KEY
</replaceable>=
<replaceable>value
</replaceable></option></term>
434 <para>Set a global property for all events.
</para>
438 <term><option>-m
</option></term>
439 <term><option>--children-max=
</option><replaceable>value
</replaceable></term>
441 <para>Set the maximum number of events, systemd-udevd will handle at the
446 <term><option>--timeout=
</option><replaceable>seconds
</replaceable></term>
448 <para>The maximum number of seconds to wait for a reply from systemd-udevd.
</para>
452 <term><option>-h
</option></term>
453 <term><option>--help
</option></term>
455 <para>Print help text.
</para>
461 <refsect2><title>udevadm monitor
462 <arg choice=
"opt"><replaceable>options
</replaceable></arg>
464 <para>Listens to the kernel uevents and events sent out by a udev rule
465 and prints the devpath of the event to the console. It can be used to analyze the
466 event timing, by comparing the timestamps of the kernel uevent and the udev event.
470 <term><option>-k
</option></term>
471 <term><option>--kernel
</option></term>
473 <para>Print the kernel uevents.
</para>
477 <term><option>-u
</option></term>
478 <term><option>--udev
</option></term>
480 <para>Print the udev event after the rule processing.
</para>
484 <term><option>-p
</option></term>
485 <term><option>--property
</option></term>
487 <para>Also print the properties of the event.
</para>
491 <term><option>-s
</option></term>
492 <term><option>--subsystem-match=
<replaceable>string[/string]
</replaceable></option></term>
494 <para>Filter events by subsystem[/devtype]. Only udev events with a matching subsystem value will pass.
</para>
498 <term><option>-t
</option></term>
499 <term><option>--tag-match=
<replaceable>string
</replaceable></option></term>
501 <para>Filter events by property. Only udev events with a given tag attached will pass.
</para>
505 <term><option>-h
</option></term>
506 <term><option>--help
</option></term>
508 <para>Print help text.
</para>
514 <refsect2><title>udevadm test
515 <arg choice=
"opt"><replaceable>options
</replaceable></arg>
516 <arg><replaceable>devpath
</replaceable></arg>
518 <para>Simulate a udev event run for the given device, and print debug output.
</para>
521 <term><option>-a
</option></term>
522 <term><option>--action=
<replaceable>string
</replaceable></option></term>
524 <para>The action string.
</para>
528 <term><option>-N
</option></term>
529 <term><option>--resolve-names=
<constant>early
</constant>|
<constant>late
</constant>|
<constant>never
</constant></option></term>
531 <para>Specify when udevadm should resolve names of users
532 and groups. When set to
<constant>early
</constant> (the
533 default), names will be resolved when the rules are
534 parsed. When set to
<constant>late
</constant>, names will
535 be resolved for every event. When set to
536 <constant>never
</constant>, names will never be resolved
537 and all devices will be owned by root.
</para>
541 <term><option>-h
</option></term>
542 <term><option>--help
</option></term>
544 <para>Print help text.
</para>
550 <refsect2><title>udevadm test-builtin
551 <arg choice=
"opt"><replaceable>options
</replaceable></arg>
552 <arg><replaceable>command
</replaceable></arg>
553 <arg><replaceable>devpath
</replaceable></arg>
555 <para>Run a built-in command
<replaceable>COMMAND
</replaceable>
556 for device
<replaceable>DEVPATH
</replaceable>, and print debug
560 <term><option>-h
</option></term>
561 <term><option>--help
</option></term>
563 <para>Print help text.
</para>
571 <title>See Also
</title>
573 <refentrytitle>udev
</refentrytitle><manvolnum>7</manvolnum>
576 <refentrytitle>systemd-udevd.service
</refentrytitle><manvolnum>8</manvolnum>
577 </citerefentry></para>