]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/udev.xml
Merge pull request #146 from arvidjaar/pr/udev-import-program-exit-code-man
[thirdparty/systemd.git] / man / udev.xml
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" >
5 %entities;
6 ]>
7
8 <refentry id="udev">
9 <refentryinfo>
10 <title>udev</title>
11 <productname>systemd</productname>
12 <authorgroup>
13 <author>
14 <contrib>Developer</contrib>
15 <firstname>Greg</firstname>
16 <surname>Kroah-Hartmann</surname>
17 <email>greg@kroah.com</email>
18 </author>
19 <author>
20 <contrib>Developer</contrib>
21 <firstname>Kay</firstname>
22 <surname>Sievers</surname>
23 <email>kay@vrfy.org</email>
24 </author>
25 </authorgroup>
26 </refentryinfo>
27
28 <refmeta>
29 <refentrytitle>udev</refentrytitle>
30 <manvolnum>7</manvolnum>
31 </refmeta>
32
33 <refnamediv>
34 <refname>udev</refname>
35 <refpurpose>Dynamic device management</refpurpose>
36 </refnamediv>
37
38 <refsect1><title>Description</title>
39 <para>udev supplies the system software with device events, manages permissions
40 of device nodes and may create additional symlinks in the <filename>/dev</filename>
41 directory, or renames network interfaces. The kernel usually just assigns unpredictable
42 device names based on the order of discovery. Meaningful symlinks or network device
43 names provide a way to reliably identify devices based on their properties or
44 current configuration.</para>
45
46 <para>The udev daemon, <citerefentry><refentrytitle>systemd-udevd.service</refentrytitle>
47 <manvolnum>8</manvolnum></citerefentry>, receives device uevents directly from
48 the kernel whenever a device is added or removed from the system, or it changes its
49 state. When udev receives a device event, it matches its configured set of rules
50 against various device attributes to identify the device. Rules that match may
51 provide additional device information to be stored in the udev database or
52 to be used to create meaningful symlink names.</para>
53
54 <para>All device information udev processes is stored in the udev database and
55 sent out to possible event subscribers. Access to all stored data and the event
56 sources is provided by the library libudev.</para>
57 </refsect1>
58
59 <refsect1><title>Rules Files</title>
60 <para>The udev rules are read from the files located in the
61 system rules directory <filename>&udevlibexecdir;/rules.d</filename>,
62 the volatile runtime directory <filename>/run/udev/rules.d</filename>
63 and the local administration directory <filename>/etc/udev/rules.d</filename>.
64 All rules files are collectively sorted and processed in lexical order,
65 regardless of the directories in which they live. However, files with
66 identical filenames replace each other. Files in <filename>/etc</filename>
67 have the highest priority, files in <filename>/run</filename> take precedence
68 over files with the same name in <filename>&rootprefix;/lib</filename>. This can be
69 used to override a system-supplied rules file with a local file if needed;
70 a symlink in <filename>/etc</filename> with the same name as a rules file in
71 <filename>&rootprefix;/lib</filename>, pointing to <filename>/dev/null</filename>,
72 disables the rules file entirely. Rule files must have the extension
73 <filename>.rules</filename>; other extensions are ignored.</para>
74
75 <para>Every line in the rules file contains at least one key-value pair.
76 Except for empty lines or lines beginning with <literal>#</literal>, which are ignored.
77 There are two kinds of keys: match and assignment.
78 If all match keys match against their values, the rule gets applied and the
79 assignment keys get the specified values assigned.</para>
80
81 <para>A matching rule may rename a network interface, add symlinks
82 pointing to the device node, or run a specified program as part of
83 the event handling.</para>
84
85 <para>A rule consists of a comma-separated list of one or more key-value pairs.
86 Each key has a distinct operation, depending on the used operator. Valid
87 operators are:</para>
88 <variablelist>
89 <varlistentry>
90 <term><literal>==</literal></term>
91 <listitem>
92 <para>Compare for equality.</para>
93 </listitem>
94 </varlistentry>
95
96 <varlistentry>
97 <term><literal>!=</literal></term>
98 <listitem>
99 <para>Compare for inequality.</para>
100 </listitem>
101 </varlistentry>
102
103 <varlistentry>
104 <term><literal>=</literal></term>
105 <listitem>
106 <para>Assign a value to a key. Keys that represent a list are reset
107 and only this single value is assigned.</para>
108 </listitem>
109 </varlistentry>
110
111 <varlistentry>
112 <term><literal>+=</literal></term>
113 <listitem>
114 <para>Add the value to a key that holds a list of entries.</para>
115 </listitem>
116 </varlistentry>
117
118 <varlistentry>
119 <term><literal>-=</literal></term>
120 <listitem>
121 <para>Remove the value from a key that holds a list of entries.</para>
122 </listitem>
123 </varlistentry>
124
125 <varlistentry>
126 <term><literal>:=</literal></term>
127 <listitem>
128 <para>Assign a value to a key finally; disallow any later changes.</para>
129 </listitem>
130 </varlistentry>
131 </variablelist>
132
133 <para>The following key names can be used to match against device properties.
134 Some of the keys also match against properties of the parent devices in sysfs,
135 not only the device that has generated the event. If multiple keys that match
136 a parent device are specified in a single rule, all these keys must match at
137 one and the same parent device.</para>
138 <variablelist class='udev-directives'>
139 <varlistentry>
140 <term><varname>ACTION</varname></term>
141 <listitem>
142 <para>Match the name of the event action.</para>
143 </listitem>
144 </varlistentry>
145
146 <varlistentry>
147 <term><varname>DEVPATH</varname></term>
148 <listitem>
149 <para>Match the devpath of the event device.</para>
150 </listitem>
151 </varlistentry>
152
153 <varlistentry>
154 <term><varname>KERNEL</varname></term>
155 <listitem>
156 <para>Match the name of the event device.</para>
157 </listitem>
158 </varlistentry>
159
160 <varlistentry>
161 <term><varname>NAME</varname></term>
162 <listitem>
163 <para>Match the name of a network interface. It can be used once the
164 NAME key has been set in one of the preceding rules.</para>
165 </listitem>
166 </varlistentry>
167
168 <varlistentry>
169 <term><varname>SYMLINK</varname></term>
170 <listitem>
171 <para>Match the name of a symlink targeting the node. It can
172 be used once a SYMLINK key has been set in one of the preceding
173 rules. There may be multiple symlinks; only one needs to match.
174 </para>
175 </listitem>
176 </varlistentry>
177
178 <varlistentry>
179 <term><varname>SUBSYSTEM</varname></term>
180 <listitem>
181 <para>Match the subsystem of the event device.</para>
182 </listitem>
183 </varlistentry>
184 <varlistentry>
185 <term><varname>DRIVER</varname></term>
186 <listitem>
187 <para>Match the driver name of the event device. Only set this key for devices
188 which are bound to a driver at the time the event is generated.</para>
189 </listitem>
190 </varlistentry>
191 <varlistentry>
192 <term><varname>ATTR{<replaceable>filename</replaceable>}</varname></term>
193 <listitem>
194 <para>Match sysfs attribute values of the event device. Trailing
195 whitespace in the attribute values is ignored unless the specified match
196 value itself contains trailing whitespace.
197 </para>
198 </listitem>
199 <term><varname>SYSCTL{<replaceable>kernel parameter</replaceable>}</varname></term>
200 <listitem>
201 <para>Match a kernel parameter value.
202 </para>
203 </listitem>
204 </varlistentry>
205
206 <varlistentry>
207 <term><varname>KERNELS</varname></term>
208 <listitem>
209 <para>Search the devpath upwards for a matching device name.</para>
210 </listitem>
211 </varlistentry>
212
213 <varlistentry>
214 <term><varname>SUBSYSTEMS</varname></term>
215 <listitem>
216 <para>Search the devpath upwards for a matching device subsystem name.</para>
217 </listitem>
218 </varlistentry>
219
220 <varlistentry>
221 <term><varname>DRIVERS</varname></term>
222 <listitem>
223 <para>Search the devpath upwards for a matching device driver name.</para>
224 </listitem>
225 </varlistentry>
226
227 <varlistentry>
228 <term><varname>ATTRS{<replaceable>filename</replaceable>}</varname></term>
229 <listitem>
230 <para>Search the devpath upwards for a device with matching sysfs attribute values.
231 If multiple <varname>ATTRS</varname> matches are specified, all of them
232 must match on the same device. Trailing whitespace in the attribute values is ignored
233 unless the specified match value itself contains trailing whitespace.</para>
234 </listitem>
235 </varlistentry>
236
237 <varlistentry>
238 <term><varname>TAGS</varname></term>
239 <listitem>
240 <para>Search the devpath upwards for a device with matching tag.</para>
241 </listitem>
242 </varlistentry>
243
244 <varlistentry>
245 <term><varname>ENV{<replaceable>key</replaceable>}</varname></term>
246 <listitem>
247 <para>Match against a device property value.</para>
248 </listitem>
249 </varlistentry>
250
251 <varlistentry>
252 <term><varname>TAG</varname></term>
253 <listitem>
254 <para>Match against a device tag.</para>
255 </listitem>
256 </varlistentry>
257
258 <varlistentry>
259 <term><varname>TEST{<replaceable>octal mode mask</replaceable>}</varname></term>
260 <listitem>
261 <para>Test the existence of a file. An octal mode mask can be specified
262 if needed.</para>
263 </listitem>
264 </varlistentry>
265
266 <varlistentry>
267 <term><varname>PROGRAM</varname></term>
268 <listitem>
269 <para>Execute a program to determine whether there
270 is a match; the key is true if the program returns
271 successfully. The device properties are made available to the
272 executed program in the environment. The program's standard output
273 is available in the <varname>RESULT</varname> key.</para>
274 <para>This can only be used for very short-running foreground tasks. For details,
275 see <varname>RUN</varname>.</para>
276 </listitem>
277 </varlistentry>
278
279 <varlistentry>
280 <term><varname>RESULT</varname></term>
281 <listitem>
282 <para>Match the returned string of the last <varname>PROGRAM</varname> call.
283 This key can be used in the same or in any later rule after a
284 <varname>PROGRAM</varname> call.</para>
285 </listitem>
286 </varlistentry>
287 </variablelist>
288
289 <para>Most of the fields support shell glob pattern matching and
290 alternate patterns. The following special characters are supported:</para>
291 <variablelist>
292 <varlistentry>
293 <term><literal>*</literal></term>
294 <listitem>
295 <para>Matches zero or more characters.</para>
296 </listitem>
297 </varlistentry>
298 <varlistentry>
299 <term><literal>?</literal></term>
300 <listitem>
301 <para>Matches any single character.</para>
302 </listitem>
303 </varlistentry>
304 <varlistentry>
305 <term><literal>[]</literal></term>
306 <listitem>
307 <para>Matches any single character specified within the brackets. For
308 example, the pattern string <literal>tty[SR]</literal>
309 would match either <literal>ttyS</literal> or <literal>ttyR</literal>.
310 Ranges are also supported via the <literal>-</literal> character.
311 For example, to match on the range of all digits, the pattern
312 <literal>[0-9]</literal> could be used. If the first character
313 following the <literal>[</literal> is a <literal>!</literal>,
314 any characters not enclosed are matched.</para>
315 </listitem>
316 </varlistentry>
317 <varlistentry>
318 <term><literal>|</literal></term>
319 <listitem>
320 <para>Separates alternative patterns. For example, the pattern string
321 <literal>abc|x*</literal> would match either <literal>abc</literal>
322 or <literal>x*</literal>.</para>
323 </listitem>
324 </varlistentry>
325 </variablelist>
326
327 <para>The following keys can get values assigned:</para>
328 <variablelist class='udev-directives'>
329 <varlistentry>
330 <term><varname>NAME</varname></term>
331 <listitem>
332 <para>The name to use for a network interface. See
333 <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>
334 for a higher-level mechanism for setting the interface name.
335 The name of a device node cannot be changed by udev, only additional
336 symlinks can be created.</para>
337 </listitem>
338 </varlistentry>
339
340 <varlistentry>
341 <term><varname>SYMLINK</varname></term>
342 <listitem>
343 <para>The name of a symlink targeting the node. Every matching rule adds
344 this value to the list of symlinks to be created.</para>
345 <para>The set of characters to name a symlink is limited. Allowed
346 characters are <literal>0-9A-Za-z#+-.:=@_/</literal>, valid UTF-8 character
347 sequences, and <literal>\x00</literal> hex encoding. All other
348 characters are replaced by a <literal>_</literal> character.</para>
349 <para>Multiple symlinks may be specified by separating the names by the
350 space character. In case multiple devices claim the same name, the link
351 always points to the device with the highest link_priority. If the current
352 device goes away, the links are re-evaluated and the device with the
353 next highest link_priority becomes the owner of the link. If no
354 link_priority is specified, the order of the devices (and which one of
355 them owns the link) is undefined.</para>
356 <para>Symlink names must never conflict with the kernel's default device
357 node names, as that would result in unpredictable behavior.
358 </para>
359 </listitem>
360 </varlistentry>
361
362 <varlistentry>
363 <term><varname>OWNER</varname>, <varname>GROUP</varname>, <varname>MODE</varname></term>
364 <listitem>
365 <para>The permissions for the device node. Every specified value overrides
366 the compiled-in default value.</para>
367 </listitem>
368 </varlistentry>
369
370 <varlistentry>
371 <term><varname>SECLABEL{<replaceable>module</replaceable>}</varname></term>
372 <listitem>
373 <para>Applies the specified Linux Security Module label to the device node.</para>
374 </listitem>
375 </varlistentry>
376
377 <varlistentry>
378 <term><varname>ATTR{<replaceable>key</replaceable>}</varname></term>
379 <listitem>
380 <para>The value that should be written to a sysfs attribute of the
381 event device.</para>
382 </listitem>
383 </varlistentry>
384
385 <varlistentry>
386 <term><varname>SYSCTL{<replaceable>kernel parameter</replaceable>}</varname></term>
387 <listitem>
388 <para>The value that should be written to kernel parameter.</para>
389 </listitem>
390 </varlistentry>
391
392 <varlistentry>
393 <term><varname>ENV{<replaceable>key</replaceable>}</varname></term>
394 <listitem>
395 <para>Set a device property value. Property names with a leading <literal>.</literal>
396 are neither stored in the database nor exported to events or
397 external tools (run by, for example, the <varname>PROGRAM</varname>
398 match key).</para>
399 </listitem>
400 </varlistentry>
401
402 <varlistentry>
403 <term><varname>TAG</varname></term>
404 <listitem>
405 <para>Attach a tag to a device. This is used to filter events for users
406 of libudev's monitor functionality, or to enumerate a group of tagged
407 devices. The implementation can only work efficiently if only a few
408 tags are attached to a device. It is only meant to be used in
409 contexts with specific device filter requirements, and not as a
410 general-purpose flag. Excessive use might result in inefficient event
411 handling.</para>
412 </listitem>
413 </varlistentry>
414
415 <varlistentry>
416 <term><varname>RUN{<replaceable>type</replaceable>}</varname></term>
417 <listitem>
418 <para>Add a program to the list of programs to be executed after
419 processing all the rules for a specific event, depending on
420 <literal>type</literal>:</para>
421 <variablelist>
422 <varlistentry>
423 <term><literal>program</literal></term>
424 <listitem>
425 <para>Execute an external program specified as the assigned
426 value. If no absolute path is given, the program is expected
427 to live in <filename>&udevlibexecdir;</filename>; otherwise, the
428 absolute path must be specified.</para>
429 <para>This is the default if no <replaceable>type</replaceable>
430 is specified.</para>
431 </listitem>
432 </varlistentry>
433 <varlistentry>
434 <term><literal>builtin</literal></term>
435 <listitem>
436 <para>As <varname>program</varname>, but use one of the
437 built-in programs rather than an external one.</para>
438 </listitem>
439 </varlistentry>
440 </variablelist>
441 <para>The program name and following arguments are separated by spaces.
442 Single quotes can be used to specify arguments with spaces.</para>
443 <para>This can only be used for very short-running foreground tasks. Running an
444 event process for a long period of time may block all further events for
445 this or a dependent device.</para>
446 <para>Starting daemons or other long-running processes is not appropriate
447 for udev; the forked processes, detached or not, will be unconditionally
448 killed after the event handling has finished.</para>
449 </listitem>
450 </varlistentry>
451
452 <varlistentry>
453 <term><varname>LABEL</varname></term>
454 <listitem>
455 <para>A named label to which a <varname>GOTO</varname> may jump.</para>
456 </listitem>
457 </varlistentry>
458
459 <varlistentry>
460 <term><varname>GOTO</varname></term>
461 <listitem>
462 <para>Jumps to the next <varname>LABEL</varname> with a matching name.</para>
463 </listitem>
464 </varlistentry>
465
466 <varlistentry>
467 <term><varname>IMPORT{<replaceable>type</replaceable>}</varname></term>
468 <listitem>
469 <para>Import a set of variables as device properties,
470 depending on <literal>type</literal>:</para>
471 <variablelist>
472 <varlistentry>
473 <term><literal>program</literal></term>
474 <listitem>
475 <para>Execute an external program specified as the assigned
476 value and if it returns successfully
477 import its output, which must be in environment key
478 format. Path specification, command/argument separation,
479 and quoting work like in <varname>RUN</varname>.</para>
480 </listitem>
481 </varlistentry>
482 <varlistentry>
483 <term><literal>builtin</literal></term>
484 <listitem>
485 <para>Similar to <literal>program</literal>, but use one of the
486 built-in programs rather than an external one.</para>
487 </listitem>
488 </varlistentry>
489 <varlistentry>
490 <term><literal>file</literal></term>
491 <listitem>
492 <para>Import a text file specified as the assigned value, the content
493 of which must be in environment key format.</para>
494 </listitem>
495 </varlistentry>
496 <varlistentry>
497 <term><literal>db</literal></term>
498 <listitem>
499 <para>Import a single property specified as the assigned value from the
500 current device database. This works only if the database is already populated
501 by an earlier event.</para>
502 </listitem>
503 </varlistentry>
504 <varlistentry>
505 <term><literal>cmdline</literal></term>
506 <listitem>
507 <para>Import a single property from the kernel command line. For simple flags
508 the value of the property is set to <literal>1</literal>.</para>
509 </listitem>
510 </varlistentry>
511 <varlistentry>
512 <term><literal>parent</literal></term>
513 <listitem>
514 <para>Import the stored keys from the parent device by reading
515 the database entry of the parent device. The value assigned to
516 <option>IMPORT{parent}</option> is used as a filter of key names
517 to import (with the same shell glob pattern matching used for
518 comparisons).</para>
519 </listitem>
520 </varlistentry>
521 </variablelist>
522 <para>This can only be used for very short-running foreground tasks. For details
523 see <option>RUN</option>.</para>
524 </listitem>
525 </varlistentry>
526
527 <varlistentry>
528 <term><varname>WAIT_FOR</varname></term>
529 <listitem>
530 <para>Wait for a file to become available or until a timeout of
531 10 seconds expires. The path is relative to the sysfs device;
532 if no path is specified, this waits for an attribute to appear.</para>
533 </listitem>
534 </varlistentry>
535
536 <varlistentry>
537 <term><varname>OPTIONS</varname></term>
538 <listitem>
539 <para>Rule and device options:</para>
540 <variablelist class='udev-directives'>
541 <varlistentry>
542 <term><option>link_priority=<replaceable>value</replaceable></option></term>
543 <listitem>
544 <para>Specify the priority of the created symlinks. Devices with higher
545 priorities overwrite existing symlinks of other devices. The default is 0.</para>
546 </listitem>
547 </varlistentry>
548 <varlistentry>
549 <term><option>string_escape=<replaceable>none|replace</replaceable></option></term>
550 <listitem>
551 <para>Usually control and other possibly unsafe characters are replaced
552 in strings used for device naming. The mode of replacement can be specified
553 with this option.</para>
554 </listitem>
555 </varlistentry>
556 <varlistentry>
557 <term><option>static_node=</option></term>
558 <listitem>
559 <para>Apply the permissions specified in this rule to the
560 static device node with the specified name. Also, for every
561 tag specified in this rule, create a symlink
562 in the directory
563 <filename>/run/udev/static_node-tags/<replaceable>tag</replaceable></filename>
564 pointing at the static device node with the specified name.
565 Static device node creation is performed by systemd-tmpfiles
566 before systemd-udevd is started. The static nodes might not
567 have a corresponding kernel device; they are used to trigger
568 automatic kernel module loading when they are accessed.</para>
569 </listitem>
570 </varlistentry>
571 <varlistentry>
572 <term><option>watch</option></term>
573 <listitem>
574 <para>Watch the device node with inotify; when the node is
575 closed after being opened for writing, a change uevent is
576 synthesized.</para>
577 </listitem>
578 </varlistentry>
579 <varlistentry>
580 <term><option>nowatch</option></term>
581 <listitem>
582 <para>Disable the watching of a device node with inotify.</para>
583 </listitem>
584 </varlistentry>
585 </variablelist>
586 </listitem>
587 </varlistentry>
588 </variablelist>
589
590 <para>The <varname>NAME</varname>, <varname>SYMLINK</varname>,
591 <varname>PROGRAM</varname>, <varname>OWNER</varname>,
592 <varname>GROUP</varname>, <varname>MODE</varname>, and
593 <varname>RUN</varname> fields support simple string substitutions.
594 The <varname>RUN</varname> substitutions are performed after all rules
595 have been processed, right before the program is executed, allowing for
596 the use of device properties set by earlier matching rules. For all other
597 fields, substitutions are performed while the individual rule is being
598 processed. The available substitutions are:</para>
599 <variablelist class='udev-directives'>
600 <varlistentry>
601 <term><option>$kernel</option>, <option>%k</option></term>
602 <listitem>
603 <para>The kernel name for this device.</para>
604 </listitem>
605 </varlistentry>
606
607 <varlistentry>
608 <term><option>$number</option>, <option>%n</option></term>
609 <listitem>
610 <para>The kernel number for this device. For example,
611 <literal>sda3</literal> has kernel number <literal>3</literal>.
612 </para>
613 </listitem>
614 </varlistentry>
615
616 <varlistentry>
617 <term><option>$devpath</option>, <option>%p</option></term>
618 <listitem>
619 <para>The devpath of the device.</para>
620 </listitem>
621 </varlistentry>
622
623 <varlistentry>
624 <term><option>$id</option>, <option>%b</option></term>
625 <listitem>
626 <para>The name of the device matched while searching the devpath
627 upwards for <option>SUBSYSTEMS</option>, <option>KERNELS</option>,
628 <option>DRIVERS</option>, and <option>ATTRS</option>.
629 </para>
630 </listitem>
631 </varlistentry>
632
633 <varlistentry>
634 <term><option>$driver</option></term>
635 <listitem>
636 <para>The driver name of the device matched while searching the
637 devpath upwards for <option>SUBSYSTEMS</option>,
638 <option>KERNELS</option>, <option>DRIVERS</option>, and
639 <option>ATTRS</option>.
640 </para>
641 </listitem>
642 </varlistentry>
643
644 <varlistentry>
645 <term><option>$attr{<replaceable>file</replaceable>}</option>, <option>%s{<replaceable>file</replaceable>}</option></term>
646 <listitem>
647 <para>The value of a sysfs attribute found at the device where
648 all keys of the rule have matched. If the matching device does not
649 have such an attribute, and a previous <option>KERNELS</option>,
650 <option>SUBSYSTEMS</option>, <option>DRIVERS</option>, or
651 <option>ATTRS</option> test selected a parent device, then the
652 attribute from that parent device is used.
653 </para>
654 <para>If the attribute is a symlink, the last element of the
655 symlink target is returned as the value.
656 </para>
657 </listitem>
658 </varlistentry>
659
660 <varlistentry>
661 <term><option>$env{<replaceable>key</replaceable>}</option>, <option>%E{<replaceable>key</replaceable>}</option></term>
662 <listitem>
663 <para>A device property value.</para>
664 </listitem>
665 </varlistentry>
666
667 <varlistentry>
668 <term><option>$major</option>, <option>%M</option></term>
669 <listitem>
670 <para>The kernel major number for the device.</para>
671 </listitem>
672 </varlistentry>
673
674 <varlistentry>
675 <term><option>$minor</option>, <option>%m</option></term>
676 <listitem>
677 <para>The kernel minor number for the device.</para>
678 </listitem>
679 </varlistentry>
680
681 <varlistentry>
682 <term><option>$result</option>, <option>%c</option></term>
683 <listitem>
684 <para>The string returned by the external program requested with
685 <varname>PROGRAM</varname>.
686 A single part of the string, separated by a space character, may be selected
687 by specifying the part number as an attribute: <literal>%c{N}</literal>.
688 If the number is followed by the <literal>+</literal> character, this part plus all remaining parts
689 of the result string are substituted: <literal>%c{N+}</literal>.</para>
690 </listitem>
691 </varlistentry>
692
693 <varlistentry>
694 <term><option>$parent</option>, <option>%P</option></term>
695 <listitem>
696 <para>The node name of the parent device.</para>
697 </listitem>
698 </varlistentry>
699
700 <varlistentry>
701 <term><option>$name</option></term>
702 <listitem>
703 <para>The current name of the device. If not changed by a rule, it is the
704 name of the kernel device.</para>
705 </listitem>
706 </varlistentry>
707
708 <varlistentry>
709 <term><option>$links</option></term>
710 <listitem>
711 <para>A space-separated list of the current symlinks. The value is
712 only set during a remove event or if an earlier rule assigned a value.</para>
713 </listitem>
714 </varlistentry>
715
716 <varlistentry>
717 <term><option>$root</option>, <option>%r</option></term>
718 <listitem>
719 <para>The udev_root value.</para>
720 </listitem>
721 </varlistentry>
722
723 <varlistentry>
724 <term><option>$sys</option>, <option>%S</option></term>
725 <listitem>
726 <para>The sysfs mount point.</para>
727 </listitem>
728 </varlistentry>
729
730 <varlistentry>
731 <term><option>$devnode</option>, <option>%N</option></term>
732 <listitem>
733 <para>The name of the device node.</para>
734 </listitem>
735 </varlistentry>
736
737 <varlistentry>
738 <term><option>%%</option></term>
739 <listitem>
740 <para>The <literal>%</literal> character itself.</para>
741 </listitem>
742 </varlistentry>
743
744 <varlistentry>
745 <term><option>$$</option></term>
746 <listitem>
747 <para>The <literal>$</literal> character itself.</para>
748 </listitem>
749 </varlistentry>
750 </variablelist>
751 </refsect1>
752
753 <refsect1>
754 <title>See Also</title>
755 <para>
756 <citerefentry>
757 <refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum>
758 </citerefentry>,
759 <citerefentry>
760 <refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum>
761 </citerefentry>,
762 <citerefentry>
763 <refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum>
764 </citerefentry>
765 </para>
766 </refsect1>
767 </refentry>