Date: Thu, 18 Aug 2005 21:13:06 +0200 (CEST) From: Fredrik Lindberg <fli+freebsd@shapeshifter.se> To: FreeBSD-gnats-submit@FreeBSD.org Subject: docs/85097: [patch] devd.conf.5 lacks a lot of vital information. Message-ID: <20050818191306.60BF04140@biocandy.shapeshifter.se> Resent-Message-ID: <200508181920.j7IJKF9k055036@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 85097 >Category: docs >Synopsis: [patch] devd.conf.5 lacks a lot of vital information. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Thu Aug 18 19:20:15 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Fredrik Lindberg >Release: FreeBSD 7.0-CURRENT i386 >Organization: >Environment: System: FreeBSD biocandy.shapeshifter.se 7.0-CURRENT FreeBSD 7.0-CURRENT #2: Sun Aug 14 12:18:18 CEST 2005 root@biocandy.shapeshifter.se:/usr/obj/usr/src/sys/BIOCANDY-CURRENT i386 >Description: The manual page for devd.conf(5) is very sparse. This patch adds information on how you actually configure devd and explains the syntax and meaning of the avaiable substatements. >How-To-Repeat: >Fix: Index: devd.conf.5 =================================================================== RCS file: /home/ncvs/src/sbin/devd/devd.conf.5,v retrieving revision 1.8 diff -u -r1.8 devd.conf.5 --- devd.conf.5 3 Mar 2003 11:51:30 -0000 1.8 +++ devd.conf.5 18 Aug 2005 18:59:21 -0000 @@ -41,7 +41,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd October 17, 2002 +.Dd August 18, 2005 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -73,6 +73,9 @@ specifies various matching criteria and actions to perform when no device driver currently loaded in the kernel claims a (new) device. +.It Ic notify +specifies various matching criteria and actions to perform when the kernel +sends an event notification to user land. .El .Pp Statements may occur in any order in the configuration file, and may be @@ -80,6 +83,162 @@ Further details on the syntax and meaning of each statement and their substatements are explained below. .Pp +Each statement, except +.Ql options +has a priority (arbitrary number) associated with it, where +0 is defined as the lowest priority. +If two statements matches the same event, only the action of the statement with +highest priority will be carried out. In this way generic statements can be +overridden for devices/notifications that requires special attention. +.Pp +The general syntax to create a statement is as follows +.Pp +.Bd -literal +statement priority { + substatement "value"; + ... + substatement "value"; +}; +.Ed +.Pp +.Ss Substatements +The following statements are supported within the +.Ql options +statement. +.Bl -tag -width ".Ic directory" +.It Ic directory \*q/some/path\*q; +Adds the given directory to the list of directories from which devd will read +configuration files. Any number of this directive is valid. +.It Ic pid-file \*q/var/run/devd.pid\*q; +Specifies pid file. +.It Ic set regexp-name \*q(some|regexp)\*q; +Creates a regular expression and assigns it to the variable +regexp-name, this variable is then avaiable through out the rest of +the configuration file. +All regular expressions have an implicit ^$ around them. +.El +.Pp +The following statements are supported within the +.Ql attach +and +.Ql detach +statements. +.Bl -tag -width ".Ic directory" +.It Ic device-name \*qstring\*q; +Actually a shorthand to `match device-name'. Matches a device named string. +string is allowed to be a regular expression or a variable previously created +containing a regular expression. +The variable $device-name is avaiable for later use with the action-statement. +.It Ic match \*qvariable\*q \*qvalue\*q; +Matches the content of value against variable. value can be a regular expression. +Not really needed during attach/detach events since the device-name statement +takes care of all device matching. +For a partial list of variables, see below. +.It Ic action \*qcommand\*q; +Command to execute upon a successful match. +Example /etc/pccard_ether $device-name start +.El +.Pp +The following statements are supported within the +.Ql nomatch +statement. +.Bl -tag -width ".Ic directory" +.It Ic match \*qvariable\*q \*qvalue\*q; +Matches the content of value against variable. value can be a regular expression. +For a partial list of variables, see below. +.It Ic action \*qcommand\*q; +Same as above. +.El +.Pp +The following statements are supported within the +.Ql notify +statement. +The variable +.Ql $notify +is avaiable inside this statement and contains, possibly, a value depending +on which system and subsystem that delivered the event. +.Bl -tag -width ".Ic directory" +.It Ic match \*qsystem|subsystem|type\*q \*qvalue\*q; +Any number of match-statements can exists within a notify-statement. +value can be either a fixed string or a regular expression. +Below is a list of avaiable systems, subsystems and types. +.It Ic action \*qcommand\*q; +Command to execute upon a successful match. For example +/etc/rc.d/power_profile $notify +.El +.Ss Variables that can be used with the match-statement +Partial list of variables and their possible values that can be used together +with the +.Ql match +statement. +.Pp +.Bl -tag -width "manufacturer" -compact +.It Ic Variable +.Ic Possible value +.It bus +pccard[0-9]+, cardbus[0-9]+ +.It vendor +Vendor ID +.It device +Device ID +.It subvendor +Sub-vendor ID +.It subdevice +Sub-device ID +.It class +Device class +.It slot +Card slot +.It function +Card functions +.It manufacturer +Manufacturer ID (pccard) +.It product +Product ID (pccard) +.It cisvendor +CIS-vendor +.It cisproduct +CIS-product +.El +.Ss Notify matching +Partial list of systems, subsystems and types used within the +.Ql notify +mechanism. +.Pp +.Bl -tag -width "IFNET" -compact +.It Ic System +.It ACPI +Events related to the ACPI subsystem. +.Bl -tag -compact +.It Ic Subsystem +.It ACAD +AC Line state ($notify=0 is offline, 1 is online) +.It Button +Button state ($notify=0 is power, 1 is sleep) +.It CMBAT +Battery events. +.It Lid +Lid state ($notify=0 is closed, 1 is open) +.It Thermal +Thermal zone events. +.El +.It IFNET +Events related to the network subsystem. +.Bl -tag -compact +.It Ic Subsystem +.It [interface] +Subsystem is the actual name of the network interface on which the event +took place. +.Bl -tag -compact +.It Ic Type +.It LINK_UP +Carrier status changed to UP. +.It LINK_DOWN +Carrier status changed to DOWN. +.El +.El +.El +.Ss Comments Comments may appear anywhere that whitespace may appear in a configuration file. To appeal to programmers of all kinds, they can @@ -118,6 +277,10 @@ // is a new comment, even though it is logically // part of the previous comment. .Ed +.Sh EXAMPLES +The file +.Pa /etc/devd.conf +contains numerous of different examples. .Sh FILES .Bl -tag -width ".Pa /etc/devd.conf" -compact .It Pa /etc/devd.conf >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050818191306.60BF04140>