chiark / gitweb /
add udev_rules_run() to handle RUN list
[elogind.git] / udev.7
diff --git a/udev.7 b/udev.7
index 207214821d3c740aa013cea1eee45da7c895357a..d3ed4b71d680a794c4ff63d8064b4b50a42a611e 100644 (file)
--- a/udev.7
+++ b/udev.7
@@ -20,9 +20,9 @@ directory, or it renames network interfaces.
 .PP
 Usually udev runs as
 \fBudevd\fR(8)
-and receives uevents directly from the kernel if a device is added or removed form the system.
+and receives uevents directly from the kernel if a device is added or removed from the system.
 .PP
-If udev receives a device event, it matches its configured rules against the available device attributes provided in sysfs to identify the device. Rules that match, may provide additional device information or specify a device node name and multiple symlink names and instruct udev to run additional programs as part of the device event handling.
+If udev receives a device event, it matches its configured rules against the available device attributes provided in sysfs to identify the device. Rules that match may provide additional device information or specify a device node name and multiple symlink names and instruct udev to run additional programs as part of the device event handling.
 .SH "CONFIGURATION"
 .PP
 All udev configuration files are placed in
@@ -57,9 +57,11 @@ and
 .PP
 The udev rules are read from the files located in the
 \fI/etc/udev/rules.d\fR
-directory or at the location specified value in the configuration file. Every line in the rules file contains at least one key value pair. There are two kind of keys, match and assignment keys. If all match keys are matching against its value, the rule gets applied and the assign keys get the specified value assigned. A matching rule may specify the name of the device node, add a symlink pointing to the node, or run a specified program as part of the event handling. If no matching rule is found, the default device node name is used.
+directory or at the location specified value in the configuration file. Every line in the rules file contains at least one key value pair. There are two kind of keys, match and assignment keys. If all match keys are matching against its value, the rule gets applied and the assign keys get the specified value assigned.
 .PP
-A rule may consists of a list of one or more key value pairs separated by a comma. Each key has a distinct operation, depending on the used operator. Valid operators are:
+A matching rule may specify the name of the device node, add a symlink pointing to the node, or run a specified program as part of the event handling. If no matching rule is found, the default device node name is used.
+.PP
+A rule may consist of a list of one or more key value pairs separated by a comma. Each key has a distinct operation, depending on the used operator. Valid operators are:
 .PP
 \fB==\fR
 .RS 4
@@ -86,7 +88,7 @@ Add the value to a key that holds a list of entries.
 Assign a value to a key finally; disallow any later changes, which may be used to prevent changes by any later rules.
 .RE
 .PP
-The following key names can be used to match against device properties:
+The following key names can be used to match against device properties. Some of the keys also match against properties of the parent devices in sysfs, not only the device that has generated the event. If multiple keys that match a parent device are specified in a single rule, all these keys must match at one and the same parent device.
 .PP
 \fBACTION\fR
 .RS 4
@@ -108,6 +110,11 @@ Match the name of the event device.
 Match the subsystem of the event device.
 .RE
 .PP
+\fBDRIVER\fR
+.RS 4
+Match the driver name of the event device. Only set for devices which are bound to a driver at the time the event is generated.
+.RE
+.PP
 \fBATTR{\fR\fB\fIfilename\fR\fR\fB}\fR
 .RS 4
 Match sysfs attribute values of the event device. Up to five
@@ -134,7 +141,7 @@ Search the devpath upwards for a matching device driver name.
 .RS 4
 Search the devpath upwards for a device with matching sysfs attribute values. Up to five
 \fBATTRS\fR
-keys can be specified per rule. All attributes must match on the same device. Trailing whitespace in the attribute values is ignored, if the specified match value does not contain trailing whitespace itself.
+keys can be specified per rule, but all of them must match on the same device. Trailing whitespace in the attribute values is ignored, if the specified match value does not contain trailing whitespace itself.
 .RE
 .PP
 \fBENV{\fR\fB\fIkey\fR\fR\fB}\fR
@@ -144,9 +151,14 @@ Match against the value of an environment variable. Up to five
 keys can be specified per rule. Depending on the type of operator, this key is also used to export a variable to the environment.
 .RE
 .PP
+\fBTEST{\fR\fB\fIoctal mode mask\fR\fR\fB}\fR
+.RS 4
+Test the existence of a file. An octal mode mask can be specified if needed.
+.RE
+.PP
 \fBPROGRAM\fR
 .RS 4
-Execute external program. The key is true, if the program returns without exit code zero. The whole event environment is available to the executed program. The program's output printed to stdout is available for the RESULT key.
+Execute external program. The key is true, if the program returns with exit code zero. The whole event environment is available to the executed program. The program's output printed to stdout, is available in the RESULT key.
 .RE
 .PP
 \fBRESULT\fR
@@ -241,7 +253,7 @@ If no option is given, udev will choose between
 \fBprogram\fR
 and
 \fBfile\fR
-based on the executable bit of of the file permissions.
+based on the executable bit of the file permissions.
 .RE
 .PP
 \fBWAIT_FOR_SYSFS\fR
@@ -251,14 +263,39 @@ Wait for the specified sysfs file of the device to be created. Can be used to fi
 .PP
 \fBOPTIONS\fR
 .RS 4
+Rule and device options:
+.RS 4
+.PP
 \fBlast_rule\fR
-stops further rules application. No later rules will have any effect.
+.RS 4
+Stops further rules application. No later rules will have any effect.
+.RE
+.PP
 \fBignore_device\fR
-will ignore this event completely.
+.RS 4
+Ignore this event completely.
+.RE
+.PP
 \fBignore_remove\fR
-will ignore any later remove event for this device. This may be useful as a workaround for broken device drivers.
+.RS 4
+Ignore any later remove event for this device. This may be useful as a workaround for broken device drivers.
+.RE
+.PP
+\fBlink_priority=\fR\fB\fIvalue\fR\fR
+.RS 4
+Specify the priority of the created symlinks. Devices with higher priorities overwrite existing symlinks of other devices.
+.RE
+.PP
 \fBall_partitions\fR
-will create the device nodes for all available partitions of a block device. This may be useful for removable media devices where media changes are not detected.
+.RS 4
+Create the device nodes for all available partitions of a block device. This may be useful for removable media devices where media changes are not detected.
+.RE
+.PP
+\fBstring_escape=\fR\fB\fInone|replace\fR\fR
+.RS 4
+Usually control and other possibly unsafe characters are replaced in strings used for device naming. The mode of replacement can be specified with this option.
+.RE
+.RE
 .RE
 .PP
 The
@@ -313,7 +350,7 @@ The value of an environment variable.
 The kernel major number for the device.
 .RE
 .PP
-\fB$minor\fR \fB%m\fR
+\fB$minor\fR, \fB%m\fR
 .RS 4
 The kernel minor number for the device.
 .RE
@@ -335,6 +372,11 @@ The node name of the parent device.
 The udev_root value.
 .RE
 .PP
+\fB$sys\fR, \fB%S\fR
+.RS 4
+The sysfs mount point.
+.RE
+.PP
 \fB$tempnode\fR, \fB%N\fR
 .RS 4
 The name of a created temporary device node to provide access to the device from a external program before the real node is created.