chiark / gitweb /
060 release
[elogind.git] / udev.8.in
index a246efdb45fbc0ea4d4d293a396eb5c9f95c5825..b4edd5aebddfd723d5183e017d69d1cefbd844c2 100644 (file)
--- a/udev.8.in
+++ b/udev.8.in
@@ -2,7 +2,7 @@
 .SH NAME
 udev \- Linux configurable dynamic device naming support
 .SH SYNOPSIS
-.BI udev " hotplug-subsystem"
+.BI udev
 .SH "DESCRIPTION"
 .B udev
 provides a dynamic device directory containing only the files for actually
@@ -15,18 +15,23 @@ As part of the
 subsystem,
 .B udev
 is executed if a kernel device is added or removed from the system.
-On device creation,
+A list of rules is used to match against specific device attributes.
+.br
+On device addition,
 .B udev
-reads the sysfs directory of the given device to collect device attributes
-like label, serial number or bus device number.
-These attributes may be used as keys to determine a
-unique name for the device.
+matches its configured rules against the available device attributes to
+uniquely name the device.
 .B udev
-maintains a database for devices present on the system.
+maintains its own database for devices present on the system. This database
+can be queried for the relationship of the kernel device path and the
+name of the device file.
 .br
 On device removal,
 .B udev
 queries its database for the name of the device file to be deleted.
+.br
+After the device node handling, a list of collected programs specific to this
+device is executed.
 .SH "CONFIGURATION"
 All
 .B udev
@@ -56,25 +61,28 @@ All rule files are read in lexical order. The default value is
 .IR /etc/udev/rules.d/ .
 .TP
 .B udev_log
-The switch to enable/disable logging of udev information
+The logging priority which can be set to
+.IR "err " , "info "
+or the corresponding numerical
+.BR syslog (3)
+value.
 The default value is
-.IR yes .
+.IR err .
 .P
 .RI "A sample " udev.conf " file might look like this:
 .sp
 .nf
-# udev_root - where to place the device nodes in the filesystem
-udev_root="/udev"
+# Where in the filesystem to place the device nodes
+udev_root="@udevdir@"
 
-# udev_db - The name and location of the udev database
-udev_db="/udev/.udevdb"
+# The name and location of the udev database.
+udev_db="@udevdir@/.udevdb"
 
-# udev_rules - The name of the udev rules file or directory to look
-               for files with the suffix .rules
-udev_rules="/etc/udev/rules.d/"
+# The name and location of the udev rules file(s).
+udev_rules="@configdir@/rules.d"
 
-# udev_log - set to "yes" if you want logging, else "no"
-udev_log="yes"
+# The syslog(3) priority: "err", "info", or the numerical value.
+udev_log="err"
 .fi
 .P
 The rules for device naming are read from the files located in the
@@ -96,6 +104,36 @@ Every rule consists of a list of comma separated key value fields:
 .sp
 .IR "key " ,[ "key " ,...]
 .P
+Each key has the following format:
+.sp
+.IR "name op value"
+.P
+There are distinct key operation types, depending on the type of the key, it
+does a comparison or an assignment.
+.P
+Comparison operators are:
+.TP
+.B ==
+Compare for equality.
+.TP
+.B !=
+Compare for non-equality.
+.P
+Assignment operators are:
+.TP
+.B +=
+Add the value to a key that holds a list of entries.
+.TP
+.B :=
+Assign a value to a key finally; disallow any later changes, which
+is useful to prevent changes by any later rules.
+.TP
+.B =
+Asign a value to a key. Keys that represent a list, are reset and only this
+single value is assigned.  While this operator still works inplicitely as
+comparison on keys that can't get a value assigned, its usage as an comparison
+operator is deprecated.
+.P
 The following key names can be used to match against device properties:
 .TP
 .B BUS
@@ -108,6 +146,9 @@ Match the kernel device name.
 .B SUBSYSTEM
 Match the kernel subsystem name.
 .TP
+.B ACTION
+Match the kernel action name.
+.TP
 .B DRIVER
 Match the kernel driver name.
 .TP
@@ -147,33 +188,28 @@ The following keys can get values assigned:
 .TP
 .B NAME
 The name of the node to be created, or the name, the network interface
-should be renamed to.
+should be renamed to. Only one rule can set the a name, all later rules
+with a NAME key will be ignored.
 .TP
 .B SYMLINK
-The name of a symlink targeting the node. Multiple symlinks may be
-specified by separating the names by the space character.
-.br
-If both the name and the symlink fields are omitted or its
-values are empty, the device will be ignored and no node will be created.
-.br
-If only the symlink field is given and the name field is omitted,
-the rule will not be applied immediately, but the symlink field is added
-to the symlink list of the rule which will create the node.
-This makes it possible to specify additional symlinks in a possibly
-separate rules file, while the device nodes are maintained by the
-distribution provided rules file.
+The name of a symlink targeting the node. Every matching rule can add
+this value to the list of symlinks to be created along with the device node.
+Multiple symlinks may be specified by separating the names by the space
+character.
 .TP
 .B OWNER, GROUP, MODE
 The permissions for the device node. Every specified value overwrites the
 compiled-in default value.
 .TP
+.B RUN
+Add a program to the list of programs to be executed for a specific device.
+.TP
 .B OPTIONS
 .B last_rule
-will be the last rule applied. No later rules will have any effect.
+stops further rules application. No later rules will have any effect.
 .sp
-.B OPTIONS
 .B ignore_device
-will ignore this device. No node will be created.
+will ignore this device. No node will be created or program executed.
 .sp
 .B ignore_remove
 will ignore any later remove event for this device.
@@ -232,6 +268,9 @@ The node name of the parent device.
 .BI %s{ filename }
 The content of a sysfs attribute.
 .TP
+.B %r
+The udev_root value.
+.TP
 .B %e
 If a device node already exists with the name, the smallest positive
 decimal integer N is substituted such that the resulting name doesn't
@@ -250,7 +289,7 @@ where device can come and go at any time is not recomended.
 .B %%
 The '%' character itself.
 .P
-The count of charcters to insert may be limited by specifying
+The count of characters to insert may be limited by specifying
 the format length value. For example, '%3s{file}' will only insert
 the first three characters of the sysfs attribute.
 .P
@@ -277,13 +316,6 @@ KERNEL=="ttyUSB1", NAME="pda", SYMLINK="palmtop handheld"
 
 # multiple USB webcams with symlinks to be called webcam0, webcam1, ...
 BUS=="usb", SYSFS{model}=="XV3", NAME=="video%n", SYMLINK="webcam%n"
-
-# grouping of optical drives from multiple kernel subsystems
-KERNEL=="sr*", NAME="%k", SYMLINK="cdrom%e"
-KERNEL=="scd*", NAME="%k", SYMLINK="cdrom%e"
-KERNEL=="pcd*", NAME="%k", SYMLINK="cdrom%e"
-KERNEL=="hd[a-z]", PROGRAM=="/bin/cat /proc/ide/%k/media", RESULT=="cdrom",
-  NAME="%k", SYMLINK="cdrom%e"
 .fi
 .P
 A number of different fields in the above configuration files support a simple
@@ -304,27 +336,18 @@ following the '[' is a '!', any characters not enclosed are matched.
 .P
 After device node creation, removal, or network device renaming,
 .B udev
-executes the programs located in the directory tree under
-.IR /etc/dev.d/ .
-The name of a program must have the suffix
-.I .dev
-to be recognized.
+executes the programs specified by the
+.B RUN
+key.
 .br
-In addition to the hotplug environment variables,
+In addition to the kernel provided hotplug environment variables,
 .B UDEV_LOG
-is set if udev is configured to use the syslog facility. Executed programs may
-want to follow that setting.
+is set and contains the numerical priority value, if udev is configured to use
+.BR syslog (3).
+Executed programs may want to follow that setting.
 .B DEVNAME
 is exported to make the name of the created node, or the name the network
-device is renamed to, available to the executed program. The programs in every
-directory are sorted in lexical order, while the directories are searched in
-the following order:
-.sp
-.nf
-/etc/dev.d/$(DEVNAME)/*.dev
-/etc/dev.d/$(SUBSYSTEM)/*.dev
-/etc/dev.d/default/*.dev
-.fi
+device is renamed to, available to the executed programs.
 .SH "ENVIRONMENT"
 .P
 The following variables are read from the environment:
@@ -345,20 +368,15 @@ Overrides the default location of the
 .B udev
 config file.
 .TP
-.B UDEV_NO_DEVD
-The default behavior of
-.B udev
-is to execute programs in the
-.I /etc/dev.d/
-directory after device handling. If set,
-.B udev
-will skip this step.
+.B UDEV_LOG
+Overrides the log priority specified in the config file.
+.TP
+.B UDEV_RUN
+If set to "0", it disables the execution of programs added by rules.
 .SH "FILES"
 .nf
 /sbin/udev                           udev program
 /etc/udev/*                          udev config files
-/etc/hotplug.d/default/udev.hotplug  hotplug symlink to udev program
-/etc/dev.d/*                         programs invoked by udev
 .fi
 .SH "SEE ALSO"
 .BR udevinfo (8),
@@ -367,8 +385,8 @@ will skip this step.
 .PP
 .B Web resources:
 .nf
-.I http://linux\-hotplug.sourceforge.net/
 .I http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
+.I http://linux\-hotplug.sourceforge.net/
 .fi
 .SH AUTHORS
 .B udev