]> git.proxmox.com Git - systemd.git/blob - man/udevadm.8
Imported Upstream version 218
[systemd.git] / man / udevadm.8
1 '\" t
2 .TH "UDEVADM" "8" "" "systemd 218" "udevadm"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 udevadm \- udev management tool
24 .SH "SYNOPSIS"
25 .HP \w'\fBudevadm\fR\ 'u
26 \fBudevadm\fR [\fB\-\-debug\fR] [\fB\-\-version\fR] [\fB\-\-help\fR]
27 .HP \w'\fBudevadm\ info\ \fR\fB\fIoptions\fR\fR\ 'u
28 \fBudevadm info \fR\fB\fIoptions\fR\fR
29 .HP \w'\fBudevadm\ trigger\ \fR\fB[options]\fR\ 'u
30 \fBudevadm trigger \fR\fB[options]\fR
31 .HP \w'\fBudevadm\ settle\ \fR\fB[options]\fR\ 'u
32 \fBudevadm settle \fR\fB[options]\fR
33 .HP \w'\fBudevadm\ control\ \fR\fB\fIcommand\fR\fR\ 'u
34 \fBudevadm control \fR\fB\fIcommand\fR\fR
35 .HP \w'\fBudevadm\ monitor\ \fR\fB[options]\fR\ 'u
36 \fBudevadm monitor \fR\fB[options]\fR
37 .HP \w'\fBudevadm\ hwdb\ \fR\fB[options]\fR\ 'u
38 \fBudevadm hwdb \fR\fB[options]\fR
39 .HP \w'\fBudevadm\ test\ \fR\fB[options]\fR\fB\ \fR\fB\fIdevpath\fR\fR\ 'u
40 \fBudevadm test \fR\fB[options]\fR\fB \fR\fB\fIdevpath\fR\fR
41 .HP \w'\fBudevadm\ test\-builtin\ \fR\fB[options]\fR\fB\ \fR\fB\fIcommand\fR\fR\fB\ \fR\fB\fIdevpath\fR\fR\ 'u
42 \fBudevadm test\-builtin \fR\fB[options]\fR\fB \fR\fB\fIcommand\fR\fR\fB \fR\fB\fIdevpath\fR\fR
43 .SH "DESCRIPTION"
44 .PP
45 \fBudevadm\fR
46 expects a command and command specific options\&. It controls the runtime behavior of
47 \fBsystemd\-udevd\fR, requests kernel events, manages the event queue, and provides simple debugging mechanisms\&.
48 .SH "OPTIONS"
49 .PP
50 \fB\-\-debug\fR
51 .RS 4
52 Print debug messages to standard error\&.
53 .RE
54 .PP
55 \fB\-\-version\fR
56 .RS 4
57 Print version number\&.
58 .RE
59 .PP
60 \fB\-h\fR, \fB\-\-help\fR
61 .RS 4
62 Print help text\&.
63 .RE
64 .SS "udevadm info [\fIoptions\fR] [\fIdevpath\fR|\fIfile\fR]"
65 .PP
66 Queries the udev database for device information stored in the udev database\&. It can also query the properties of a device from its sysfs representation to help creating udev rules that match this device\&.
67 .PP
68 \fB\-q\fR, \fB\-\-query=\fR\fB\fITYPE\fR\fR
69 .RS 4
70 Query the database for the specified type of device data\&. It needs the
71 \fB\-\-path\fR
72 or
73 \fB\-\-name\fR
74 to identify the specified device\&. Valid
75 \fITYPE\fRs are:
76 \fBname\fR,
77 \fBsymlink\fR,
78 \fBpath\fR,
79 \fBproperty\fR,
80 \fBall\fR\&.
81 .RE
82 .PP
83 \fB\-p\fR, \fB\-\-path=\fR\fB\fIDEVPATH\fR\fR
84 .RS 4
85 The
86 /sys
87 path of the device to query, e\&.g\&.
88 [/sys]/class/block/sda\&. Note that this option usually is not very useful, since
89 \fBudev\fR
90 can guess the type of the argument, so
91 \fBudevadm \-\-devpath=/class/block/sda\fR
92 is equivalent to
93 \fBudevadm /sys/class/block/sda\fR\&.
94 .RE
95 .PP
96 \fB\-n\fR, \fB\-\-name=\fR\fB\fIFILE\fR\fR
97 .RS 4
98 The name of the device node or a symlink to query, e\&.g\&.
99 [/dev]/sda\&. Note that this option usually is not very useful, since
100 \fBudev\fR
101 can guess the type of the argument, so
102 \fBudevadm \-\-name=sda\fR
103 is equivalent to
104 \fBudevadm /dev/sda\fR\&.
105 .RE
106 .PP
107 \fB\-r\fR, \fB\-\-root\fR
108 .RS 4
109 Print absolute paths in
110 \fBname\fR
111 or
112 \fBsymlink\fR
113 query\&.
114 .RE
115 .PP
116 \fB\-a\fR, \fB\-\-attribute\-walk\fR
117 .RS 4
118 Print all sysfs properties of the specified device that can be used in udev rules to match the specified device\&. It prints all devices along the chain, up to the root of sysfs that can be used in udev rules\&.
119 .RE
120 .PP
121 \fB\-x\fR, \fB\-\-export\fR
122 .RS 4
123 Print output as key/value pairs\&. Values are enclosed in single quotes\&.
124 .RE
125 .PP
126 \fB\-P\fR, \fB\-\-export\-prefix=\fR\fB\fINAME\fR\fR
127 .RS 4
128 Add a prefix to the key name of exported values\&.
129 .RE
130 .PP
131 \fB\-d\fR, \fB\-\-device\-id\-of\-file=\fR\fB\fIFILE\fR\fR
132 .RS 4
133 Print major/minor numbers of the underlying device, where the file lives on\&.
134 .RE
135 .PP
136 \fB\-e\fR, \fB\-\-export\-db\fR
137 .RS 4
138 Export the content of the udev database\&.
139 .RE
140 .PP
141 \fB\-c\fR, \fB\-\-cleanup\-db\fR
142 .RS 4
143 Cleanup the udev database\&.
144 .RE
145 .PP
146 \fB\-\-version\fR
147 .RS 4
148 Print version\&.
149 .RE
150 .PP
151 \fB\-h\fR, \fB\-\-help\fR
152 .RS 4
153 Print help text\&.
154 .RE
155 .PP
156 In addition an optional positional argument can be used to specify a device name or a sys path\&. It must start with
157 /dev
158 or
159 /sys
160 respectively\&.
161 .SS "udevadm trigger [\fIoptions\fR] [\fIdevpath\fR|\fIfile\fR...]"
162 .PP
163 Request device events from the kernel\&. Primarily used to replay events at system coldplug time\&.
164 .PP
165 \fB\-v\fR, \fB\-\-verbose\fR
166 .RS 4
167 Print the list of devices which will be triggered\&.
168 .RE
169 .PP
170 \fB\-n\fR, \fB\-\-dry\-run\fR
171 .RS 4
172 Do not actually trigger the event\&.
173 .RE
174 .PP
175 \fB\-t\fR, \fB\-\-type=\fR\fB\fITYPE\fR\fR
176 .RS 4
177 Trigger a specific type of devices\&. Valid types are:
178 \fBdevices\fR,
179 \fBsubsystems\fR\&. The default value is
180 \fBdevices\fR\&.
181 .RE
182 .PP
183 \fB\-c\fR, \fB\-\-action=\fR\fB\fIACTION\fR\fR
184 .RS 4
185 Type of event to be triggered\&. The default value is
186 \fBchange\fR\&.
187 .RE
188 .PP
189 \fB\-s\fR, \fB\-\-subsystem\-match=\fR\fB\fISUBSYSTEM\fR\fR
190 .RS 4
191 Trigger events for devices which belong to a matching subsystem\&. This option can be specified multiple times and supports shell style pattern matching\&.
192 .RE
193 .PP
194 \fB\-S\fR, \fB\-\-subsystem\-nomatch=\fR\fB\fISUBSYSTEM\fR\fR
195 .RS 4
196 Do not trigger events for devices which belong to a matching subsystem\&. This option can be specified multiple times and supports shell style pattern matching\&.
197 .RE
198 .PP
199 \fB\-a\fR, \fB\-\-attr\-match=\fR\fB\fIATTRIBUTE\fR\fR\fB=\fR\fB\fIVALUE\fR\fR
200 .RS 4
201 Trigger events for devices with a matching sysfs attribute\&. If a value is specified along with the attribute name, the content of the attribute is matched against the given value using shell style pattern matching\&. If no value is specified, the existence of the sysfs attribute is checked\&. This option can be specified multiple times\&.
202 .RE
203 .PP
204 \fB\-A\fR, \fB\-\-attr\-nomatch=\fR\fB\fIATTRIBUTE\fR\fR\fB=\fR\fB\fIVALUE\fR\fR
205 .RS 4
206 Do not trigger events for devices with a matching sysfs attribute\&. If a value is specified along with the attribute name, the content of the attribute is matched against the given value using shell style pattern matching\&. If no value is specified, the existence of the sysfs attribute is checked\&. This option can be specified multiple times\&.
207 .RE
208 .PP
209 \fB\-p\fR, \fB\-\-property\-match=\fR\fB\fIPROPERTY\fR\fR\fB=\fR\fB\fIVALUE\fR\fR
210 .RS 4
211 Trigger events for devices with a matching property value\&. This option can be specified multiple times and supports shell style pattern matching\&.
212 .RE
213 .PP
214 \fB\-g\fR, \fB\-\-tag\-match=\fR\fB\fIPROPERTY\fR\fR
215 .RS 4
216 Trigger events for devices with a matching tag\&. This option can be specified multiple times\&.
217 .RE
218 .PP
219 \fB\-y\fR, \fB\-\-sysname\-match=\fR\fB\fIPATH\fR\fR
220 .RS 4
221 Trigger events for devices with a matching sys device path\&. This option can be specified multiple times and supports shell style pattern matching\&.
222 .RE
223 .PP
224 \fB\-\-name\-match=\fR\fB\fINAME\fR\fR
225 .RS 4
226 Trigger events for devices with a matching device path\&. This options can be specified multiple times\&.
227 .RE
228 .PP
229 \fB\-b\fR, \fB\-\-parent\-match=\fR\fB\fISYSPATH\fR\fR
230 .RS 4
231 Trigger events for all children of a given device\&.
232 .RE
233 .PP
234 \fB\-h\fR, \fB\-\-help\fR
235 .RS 4
236 Print help text\&.
237 .RE
238 .PP
239 In addition optional positional arguments can be used to specify device names or sys paths\&. They must start with
240 /dev
241 or
242 /sys
243 respectively\&.
244 .SS "udevadm settle [\fIoptions\fR]"
245 .PP
246 Watches the udev event queue, and exits if all current events are handled\&.
247 .PP
248 \fB\-t\fR, \fB\-\-timeout=\fR\fB\fISECONDS\fR\fR
249 .RS 4
250 Maximum number of seconds to wait for the event queue to become empty\&. The default value is 120 seconds\&. A value of 0 will check if the queue is empty and always return immediately\&.
251 .RE
252 .PP
253 \fB\-E\fR, \fB\-\-exit\-if\-exists=\fR\fB\fIFILE\fR\fR
254 .RS 4
255 Stop waiting if file exists\&.
256 .RE
257 .PP
258 \fB\-h\fR, \fB\-\-help\fR
259 .RS 4
260 Print help text\&.
261 .RE
262 .SS "udevadm control \fIcommand\fR"
263 .PP
264 Modify the internal state of the running udev daemon\&.
265 .PP
266 \fB\-x\fR, \fB\-\-exit\fR
267 .RS 4
268 Signal and wait for systemd\-udevd to exit\&.
269 .RE
270 .PP
271 \fB\-l\fR, \fB\-\-log\-priority=\fR\fB\fIvalue\fR\fR
272 .RS 4
273 Set the internal log level of
274 systemd\-udevd\&. Valid values are the numerical syslog priorities or their textual representations:
275 \fBemerg\fR,
276 \fBalert\fR,
277 \fBcrit\fR,
278 \fBerr\fR,
279 \fBwarning\fR,
280 \fBnotice\fR,
281 \fBinfo\fR, and
282 \fBdebug\fR\&.
283 .RE
284 .PP
285 \fB\-s\fR, \fB\-\-stop\-exec\-queue\fR
286 .RS 4
287 Signal systemd\-udevd to stop executing new events\&. Incoming events will be queued\&.
288 .RE
289 .PP
290 \fB\-S\fR, \fB\-\-start\-exec\-queue\fR
291 .RS 4
292 Signal systemd\-udevd to enable the execution of events\&.
293 .RE
294 .PP
295 \fB\-R\fR, \fB\-\-reload\fR
296 .RS 4
297 Signal systemd\-udevd to reload the rules files and other databases like the kernel module index\&. Reloading rules and databases does not apply any changes to already existing devices; the new configuration will only be applied to new events\&.
298 .RE
299 .PP
300 \fB\-p\fR, \fB\-\-property=\fR\fB\fIKEY\fR\fR\fB=\fR\fB\fIvalue\fR\fR
301 .RS 4
302 Set a global property for all events\&.
303 .RE
304 .PP
305 \fB\-m\fR, \fB\-\-children\-max=\fR\fIvalue\fR
306 .RS 4
307 Set the maximum number of events, systemd\-udevd will handle at the same time\&.
308 .RE
309 .PP
310 \fB\-\-timeout=\fR\fIseconds\fR
311 .RS 4
312 The maximum number of seconds to wait for a reply from systemd\-udevd\&.
313 .RE
314 .PP
315 \fB\-h\fR, \fB\-\-help\fR
316 .RS 4
317 Print help text\&.
318 .RE
319 .SS "udevadm monitor [\fIoptions\fR]"
320 .PP
321 Listens to the kernel uevents and events sent out by a udev rule and prints the devpath of the event to the console\&. It can be used to analyze the event timing, by comparing the timestamps of the kernel uevent and the udev event\&.
322 .PP
323 \fB\-k\fR, \fB\-\-kernel\fR
324 .RS 4
325 Print the kernel uevents\&.
326 .RE
327 .PP
328 \fB\-u\fR, \fB\-\-udev\fR
329 .RS 4
330 Print the udev event after the rule processing\&.
331 .RE
332 .PP
333 \fB\-p\fR, \fB\-\-property\fR
334 .RS 4
335 Also print the properties of the event\&.
336 .RE
337 .PP
338 \fB\-s\fR, \fB\-\-subsystem\-match=\fR\fB\fIstring[/string]\fR\fR
339 .RS 4
340 Filter events by subsystem[/devtype]\&. Only udev events with a matching subsystem value will pass\&.
341 .RE
342 .PP
343 \fB\-t\fR, \fB\-\-tag\-match=\fR\fB\fIstring\fR\fR
344 .RS 4
345 Filter events by property\&. Only udev events with a given tag attached will pass\&.
346 .RE
347 .PP
348 \fB\-h\fR, \fB\-\-help\fR
349 .RS 4
350 Print help text\&.
351 .RE
352 .SS "udevadm hwdb [\fIoptions\fR]"
353 .PP
354 Maintain the hardware database index in
355 /etc/udev/hwdb\&.bin\&.
356 .PP
357 \fB\-u\fR, \fB\-\-update\fR
358 .RS 4
359 Compile the hardware database information located in /usr/lib/udev/hwdb\&.d/, /etc/udev/hwdb\&.d/ and store it in
360 /etc/udev/hwdb\&.bin\&. This should be done after any update to the source files; it will not be called automatically\&. The running udev daemon will detect a new database on its own and does not need to be notified about it\&.
361 .RE
362 .PP
363 \fB\-\-usr\fR
364 .RS 4
365 Put the compiled database into
366 /usr/lib/udev/hwdb\&.bin
367 instead\&. Use this if you want to ship a pre\-compiled database in immutable system images, or don\*(Aqt use
368 /etc/udev/hwdb\&.d
369 and want to avoid large binary files in
370 /etc\&.
371 .RE
372 .PP
373 \fB\-t\fR, \fB\-\-test=\fR\fB\fIstring\fR\fR
374 .RS 4
375 Query the database with a modalias string, and print the retrieved properties\&.
376 .RE
377 .PP
378 \fB\-r\fR, \fB\-\-root=\fR\fB\fIstring\fR\fR
379 .RS 4
380 Alternative root path in the file system for reading and writing files\&.
381 .RE
382 .PP
383 \fB\-h\fR, \fB\-\-help\fR
384 .RS 4
385 Print help text\&.
386 .RE
387 .SS "udevadm test [\fIoptions\fR] [\fIdevpath\fR]"
388 .PP
389 Simulate a udev event run for the given device, and print debug output\&.
390 .PP
391 \fB\-a\fR, \fB\-\-action=\fR\fB\fIstring\fR\fR
392 .RS 4
393 The action string\&.
394 .RE
395 .PP
396 \fB\-N\fR, \fB\-\-resolve\-names=\fR\fB\fBearly\fR\fR\fB|\fR\fB\fBlate\fR\fR\fB|\fR\fB\fBnever\fR\fR
397 .RS 4
398 Specify when udevadm should resolve names of users and groups\&. When set to
399 \fBearly\fR
400 (the default), names will be resolved when the rules are parsed\&. When set to
401 \fBlate\fR, names will be resolved for every event\&. When set to
402 \fBnever\fR, names will never be resolved and all devices will be owned by root\&.
403 .RE
404 .PP
405 \fB\-h\fR, \fB\-\-help\fR
406 .RS 4
407 Print help text\&.
408 .RE
409 .SS "udevadm test\-builtin [\fIoptions\fR] [\fIcommand\fR] [\fIdevpath\fR]"
410 .PP
411 Run a built\-in command
412 \fICOMMAND\fR
413 for device
414 \fIDEVPATH\fR, and print debug output\&.
415 .PP
416 \fB\-h\fR, \fB\-\-help\fR
417 .RS 4
418 Print help text\&.
419 .RE
420 .SH "SEE ALSO"
421 .PP
422 \fBudev\fR(7),
423 \fBsystemd-udevd.service\fR(8)