2002-10-20 22:15:17 +00:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2002 M. Warner Losh
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. The name of the author may not be used to endorse or promote products
|
|
|
|
.\" derived from this software without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
2003-03-03 11:51:30 +00:00
|
|
|
.\" $FreeBSD$
|
2002-10-20 22:15:17 +00:00
|
|
|
.\"
|
|
|
|
.\" The section on comments was taken from named.conf.5, which has the
|
|
|
|
.\" following copyright:
|
|
|
|
.\" Copyright (c) 1999-2000 by Internet Software Consortium
|
|
|
|
.\"
|
|
|
|
.\" Permission to use, copy, modify, and distribute this software for any
|
|
|
|
.\" purpose with or without fee is hereby granted, provided that the above
|
|
|
|
.\" copyright notice and this permission notice appear in all copies.
|
|
|
|
.\"
|
|
|
|
.\" THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
|
|
|
.\" ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
|
|
|
.\" OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
|
|
|
.\" CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
|
|
|
.\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
|
|
|
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
|
|
.\" SOFTWARE.
|
2003-03-03 11:51:30 +00:00
|
|
|
.\"
|
2018-07-20 14:32:36 +00:00
|
|
|
.Dd July 20, 2018
|
2002-10-20 22:15:17 +00:00
|
|
|
.Dt DEVD.CONF 5
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm devd.conf
|
|
|
|
.Nd configuration file for
|
2003-01-06 08:03:00 +00:00
|
|
|
.Xr devd 8
|
2003-03-03 11:51:30 +00:00
|
|
|
.Sh DESCRIPTION
|
2002-10-20 22:15:17 +00:00
|
|
|
.Ss General Syntax
|
|
|
|
A
|
2002-12-27 12:15:40 +00:00
|
|
|
.Xr devd 8
|
2002-10-20 22:15:17 +00:00
|
|
|
configuration consists of two general features, statements
|
|
|
|
and comments.
|
|
|
|
All statements end with a semicolon.
|
2003-03-03 11:51:30 +00:00
|
|
|
Many statements can contain substatements, which are also
|
2002-10-20 22:15:17 +00:00
|
|
|
terminated with a semicolon.
|
|
|
|
.Pp
|
|
|
|
The following statements are supported:
|
2003-03-03 11:51:30 +00:00
|
|
|
.Bl -tag -width ".Ic options"
|
2002-10-20 22:15:17 +00:00
|
|
|
.It Ic attach
|
2006-10-07 21:15:40 +00:00
|
|
|
Specifies various matching criteria and actions to perform when
|
2002-10-20 22:15:17 +00:00
|
|
|
a newly attached device matches said criteria.
|
|
|
|
.It Ic detach
|
2006-10-07 21:15:40 +00:00
|
|
|
Specifies various matching criteria and actions to perform when
|
2003-03-03 11:51:30 +00:00
|
|
|
a newly detached device matches said criteria.
|
2002-10-20 22:15:17 +00:00
|
|
|
.It Ic nomatch
|
2006-10-07 21:15:40 +00:00
|
|
|
Specifies various matching criteria and actions to perform when
|
2002-10-20 22:15:17 +00:00
|
|
|
no device driver currently loaded in the kernel claims a (new)
|
|
|
|
device.
|
2006-10-07 21:15:40 +00:00
|
|
|
.It Ic notify
|
|
|
|
Specifies various matching criteria and actions to perform when the kernel
|
|
|
|
sends an event notification to userland.
|
|
|
|
.It Ic options
|
|
|
|
Specifies various options and parameters for the operation of
|
|
|
|
.Xr devd 8 .
|
2002-10-20 22:15:17 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
2003-03-03 11:51:30 +00:00
|
|
|
Statements may occur in any order in the configuration file, and may be
|
|
|
|
repeated as often as required.
|
|
|
|
Further details on the syntax and meaning of each statement and their
|
|
|
|
substatements are explained below.
|
2002-10-20 22:15:17 +00:00
|
|
|
.Pp
|
2006-10-07 21:15:40 +00:00
|
|
|
Each statement, except
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ic options
|
2006-10-07 21:15:40 +00:00
|
|
|
has a priority (an arbitrary number) associated with it, where
|
|
|
|
.Ql 0
|
|
|
|
is defined as the lowest priority.
|
|
|
|
If two statements match the same event, only the action of the statement with
|
|
|
|
highest priority will be executed.
|
|
|
|
In this way generic statements can be overridden for devices or
|
|
|
|
notifications that require special attention.
|
|
|
|
.Pp
|
|
|
|
The general syntax of a statement is:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
statement priority {
|
|
|
|
substatement "value";
|
|
|
|
...
|
|
|
|
substatement "value";
|
|
|
|
};
|
|
|
|
.Ed
|
|
|
|
.Ss Sub-statements
|
|
|
|
The following sub-statements are supported within the
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ic options
|
2006-10-07 21:15:40 +00:00
|
|
|
statement.
|
|
|
|
.Bl -tag -width ".Ic directory"
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Ic directory Qq Ar /some/path ;
|
2006-10-07 21:15:40 +00:00
|
|
|
Adds the given directory to the list of directories from which
|
|
|
|
.Xr devd 8
|
2008-12-14 11:47:39 +00:00
|
|
|
will read all files named "*.conf" as further
|
2006-10-21 17:15:11 +00:00
|
|
|
configuration files.
|
|
|
|
Any number of
|
|
|
|
.Ic directory
|
2006-10-07 21:15:40 +00:00
|
|
|
statements can be used.
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Ic pid-file Qq Pa /var/run/devd.pid ;
|
|
|
|
Specifies PID file.
|
|
|
|
.It Ic set Ar regexp-name Qq Ar (some|regexp) ;
|
2006-10-07 21:15:40 +00:00
|
|
|
Creates a regular expression and assigns it to the variable
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ar regexp-name .
|
2009-03-08 18:02:30 +00:00
|
|
|
The variable is available throughout the rest of
|
2006-10-07 21:15:40 +00:00
|
|
|
the configuration file.
|
2011-10-26 02:11:28 +00:00
|
|
|
If the string begins with
|
|
|
|
.Ql \&! ,
|
|
|
|
it matches if the regular expression formed by the rest of the string
|
|
|
|
does not match.
|
2006-10-07 21:15:40 +00:00
|
|
|
All regular expressions have an implicit
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ql ^$
|
2006-10-07 21:15:40 +00:00
|
|
|
around them.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The following sub-statements are supported within the
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ic attach
|
2006-10-07 21:15:40 +00:00
|
|
|
and
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ic detach
|
2006-10-07 21:15:40 +00:00
|
|
|
statements.
|
|
|
|
.Bl -tag -width ".Ic directory"
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Ic action Qq Ar command ;
|
2006-10-07 21:15:40 +00:00
|
|
|
Command to execute upon a successful match.
|
|
|
|
Example
|
2006-10-21 17:15:11 +00:00
|
|
|
.Dq Li "/etc/pccard_ether $device-name start" .
|
|
|
|
.It Ic class Qq Ar string ;
|
2006-10-07 21:15:40 +00:00
|
|
|
This is shorthand for
|
2006-10-21 17:15:11 +00:00
|
|
|
.Dq Ic match Qo Li class Qc Qq Ar string .
|
|
|
|
.It Ic device-name Qq string ;
|
2006-10-07 21:15:40 +00:00
|
|
|
This is shorthand for
|
2006-10-21 17:15:11 +00:00
|
|
|
.Dq Ic match Qo Li device-name Qc Qq Ar string .
|
2006-10-07 21:15:40 +00:00
|
|
|
This matches a device named
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ar string ,
|
2006-10-07 21:15:40 +00:00
|
|
|
which is allowed to be a regular expression or a variable previously created
|
|
|
|
containing a regular expression.
|
|
|
|
The
|
2006-10-21 17:15:11 +00:00
|
|
|
.Dq Li device-name
|
2006-10-07 21:15:40 +00:00
|
|
|
variable
|
2006-10-21 17:15:11 +00:00
|
|
|
is available for later use with the
|
|
|
|
.Ic action
|
|
|
|
statement.
|
|
|
|
.It Ic match Qo Ar variable Qc Qq Ar value ;
|
2006-10-07 21:15:40 +00:00
|
|
|
Matches the content of
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ar value
|
2006-10-07 21:15:40 +00:00
|
|
|
against
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ar variable ;
|
2006-10-07 21:15:40 +00:00
|
|
|
the content of
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ar value
|
2006-10-07 21:15:40 +00:00
|
|
|
may be a regular expression.
|
|
|
|
Not required during
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ic attach
|
2006-10-07 21:15:40 +00:00
|
|
|
nor
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ic detach
|
2006-10-07 21:15:40 +00:00
|
|
|
events since the
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ic device-name
|
2006-10-07 21:15:40 +00:00
|
|
|
statement takes care of all device matching.
|
|
|
|
For a partial list of variables, see below.
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Ic media-type Qq Ar string ;
|
2006-10-24 20:20:41 +00:00
|
|
|
For network devices,
|
|
|
|
.Ic media-type
|
|
|
|
will match devices that have the given media type.
|
|
|
|
Valid media types are:
|
|
|
|
.Dq Li Ethernet ,
|
|
|
|
.Dq Li Tokenring ,
|
|
|
|
.Dq Li FDDI ,
|
|
|
|
.Dq Li 802.11 ,
|
|
|
|
and
|
2013-02-21 21:35:09 +00:00
|
|
|
.Dq Li ATM .
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Ic subdevice Qq Ar string ;
|
2006-10-07 21:15:40 +00:00
|
|
|
This is shorthand for
|
2006-10-21 17:15:11 +00:00
|
|
|
.Dq Ic match Qo Li subdevice Qc Qq Ar string .
|
2006-10-07 21:15:40 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The following sub-statements are supported within the
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ic nomatch
|
2006-10-07 21:15:40 +00:00
|
|
|
statement.
|
|
|
|
.Bl -tag -width ".Ic directory"
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Ic action Qq Ar command ;
|
2006-10-07 21:15:40 +00:00
|
|
|
Same as above.
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Ic match Qo Ar variable Qc Qq Ar value ;
|
2006-10-07 21:15:40 +00:00
|
|
|
Matches the content of
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ar value
|
2006-10-07 21:15:40 +00:00
|
|
|
against
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ar variable ;
|
2006-10-07 21:15:40 +00:00
|
|
|
the content of
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ar value
|
2006-10-07 21:15:40 +00:00
|
|
|
may be a regular expression.
|
|
|
|
For a partial list of variables, see below.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The following sub-statements are supported within the
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ic notify
|
2006-10-07 21:15:40 +00:00
|
|
|
statement.
|
|
|
|
The
|
|
|
|
.Dq Li notify
|
2009-03-08 18:02:30 +00:00
|
|
|
variable is available inside this statement and contains, a value, depending
|
2006-10-07 21:15:40 +00:00
|
|
|
on which system and subsystem that delivered the event.
|
|
|
|
.Bl -tag -width ".Ic directory"
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Ic action Qq Ar command ;
|
|
|
|
Command to execute upon a successful match.
|
|
|
|
Example
|
|
|
|
.Dq Li "/etc/rc.d/power_profile $notify" .
|
|
|
|
.It Ic match Qo Ar system | subsystem | type | notify Qc Qq Ar value ;
|
2006-10-07 21:15:40 +00:00
|
|
|
Any number of
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ic match
|
|
|
|
statements can exist within a
|
|
|
|
.Ic notify
|
|
|
|
statement;
|
|
|
|
.Ar value
|
2006-10-07 21:15:40 +00:00
|
|
|
can be either a fixed string or a regular expression.
|
2009-03-08 18:02:30 +00:00
|
|
|
Below is a list of available systems, subsystems, and types.
|
2006-10-24 20:20:41 +00:00
|
|
|
.It Ic media-type Qq Ar string ;
|
|
|
|
See above.
|
2006-10-07 21:15:40 +00:00
|
|
|
.El
|
|
|
|
.Ss Variables that can be used with the match statement
|
|
|
|
A partial list of variables and their possible values that can be used together
|
|
|
|
with the
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ic match
|
2006-10-07 21:15:40 +00:00
|
|
|
statement.
|
2016-03-28 04:22:22 +00:00
|
|
|
The variables are published by the bus based on characteristics of the device
|
|
|
|
that generated the event (for device events).
|
|
|
|
Variables for other classes of events are dependent on those events.
|
2006-10-07 21:15:40 +00:00
|
|
|
.Pp
|
2006-10-21 17:15:11 +00:00
|
|
|
.Bl -tag -width ".Li manufacturer" -compact
|
2006-10-07 21:15:40 +00:00
|
|
|
.It Ic Variable
|
|
|
|
.Ic Description
|
2016-03-28 04:22:22 +00:00
|
|
|
.It Li *
|
2018-07-18 16:28:57 +00:00
|
|
|
The entire message from the current event.
|
2016-03-28 04:22:22 +00:00
|
|
|
.It Li _
|
2018-07-18 16:28:57 +00:00
|
|
|
The entire message from the current event, after the initial type character.
|
2016-04-03 20:29:21 +00:00
|
|
|
.It Li timestamp
|
2018-07-18 16:28:57 +00:00
|
|
|
The time this event was processed, in seconds since 1970 dot fraction.
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Li bus
|
|
|
|
Device name of parent bus.
|
2009-03-08 14:28:40 +00:00
|
|
|
.It Li cdev
|
|
|
|
Device node path if one is created by the
|
|
|
|
.Xr devfs 5
|
|
|
|
filesystem.
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Li cisproduct
|
|
|
|
CIS-product.
|
|
|
|
.It Li cisvendor
|
|
|
|
CIS-vendor.
|
|
|
|
.It Li class
|
|
|
|
Device class.
|
2018-07-20 14:32:36 +00:00
|
|
|
.It Li comm
|
|
|
|
Executable name (kernel).
|
|
|
|
.It Li core
|
|
|
|
Path to core file (kernel).
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Li device
|
|
|
|
Device ID.
|
2010-04-22 20:46:39 +00:00
|
|
|
.It Li devclass
|
2018-07-18 16:28:57 +00:00
|
|
|
Device Class (USB).
|
2010-04-22 20:46:39 +00:00
|
|
|
.It Li devsubclass
|
2018-07-18 16:28:57 +00:00
|
|
|
Device Sub-class (USB).
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Li device-name
|
|
|
|
Name of attached/detached device.
|
2010-04-22 20:46:39 +00:00
|
|
|
.It Li endpoints
|
2018-07-18 16:28:57 +00:00
|
|
|
Endpoint count (USB).
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Li function
|
|
|
|
Card functions.
|
2010-04-22 20:46:39 +00:00
|
|
|
.It Li interface
|
2018-07-18 16:28:57 +00:00
|
|
|
Interface ID (USB).
|
2010-04-22 20:46:39 +00:00
|
|
|
.It Li intclass
|
2018-07-18 16:28:57 +00:00
|
|
|
Interface Class (USB).
|
2010-04-22 20:46:39 +00:00
|
|
|
.It Li intprotocol
|
2018-07-18 16:28:57 +00:00
|
|
|
Interface Protocol (USB).
|
2010-04-22 20:46:39 +00:00
|
|
|
.It Li intsubclass
|
2018-07-18 16:28:57 +00:00
|
|
|
Interface Sub-class (USB).
|
2015-05-13 12:02:51 +00:00
|
|
|
.It Li jail
|
2018-07-18 16:28:57 +00:00
|
|
|
Jail name for the process triggering the rule (RCTL).
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Li manufacturer
|
|
|
|
Manufacturer ID (pccard).
|
2010-04-22 20:46:39 +00:00
|
|
|
.It Li mode
|
2018-07-18 16:28:57 +00:00
|
|
|
Peripheral mode (USB).
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Li notify
|
2006-10-07 21:15:40 +00:00
|
|
|
Match the value of the
|
|
|
|
.Dq Li notify
|
|
|
|
variable.
|
2010-04-22 20:46:39 +00:00
|
|
|
.It Li parent
|
2018-07-18 16:28:57 +00:00
|
|
|
Parent device.
|
2015-05-13 12:02:51 +00:00
|
|
|
.It Li pid
|
2018-07-18 16:28:57 +00:00
|
|
|
PID of the process triggering the rule (RCTL).
|
2010-04-22 20:46:39 +00:00
|
|
|
.It Li port
|
2018-07-18 16:28:57 +00:00
|
|
|
Hub port number (USB).
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Li product
|
2010-04-22 20:46:39 +00:00
|
|
|
Product ID (pccard/USB).
|
|
|
|
.It Li release
|
2018-07-18 16:28:57 +00:00
|
|
|
Hardware revision (USB).
|
2015-05-13 12:02:51 +00:00
|
|
|
.It Li ruid
|
2018-07-18 16:28:57 +00:00
|
|
|
Real UID of the process triggering the rule (RCTL).
|
2015-05-13 12:02:51 +00:00
|
|
|
.It Li rule
|
2018-07-18 16:28:57 +00:00
|
|
|
Rule (RCTL).
|
2011-05-10 02:34:11 +00:00
|
|
|
.It Li sernum
|
2006-10-21 17:15:11 +00:00
|
|
|
Serial Number (USB).
|
|
|
|
.It Li slot
|
|
|
|
Card slot.
|
|
|
|
.It Li subvendor
|
|
|
|
Sub-vendor ID.
|
|
|
|
.It Li subdevice
|
|
|
|
Sub-device ID.
|
|
|
|
.It Li subsystem
|
|
|
|
Matches a subsystem of a system, see below.
|
|
|
|
.It Li system
|
|
|
|
Matches a system type, see below.
|
|
|
|
.It Li type
|
|
|
|
Type of notification, see below.
|
|
|
|
.It Li vendor
|
|
|
|
Vendor ID.
|
2006-10-07 21:15:40 +00:00
|
|
|
.El
|
|
|
|
.Ss Notify matching
|
2006-10-21 17:15:11 +00:00
|
|
|
A partial list of systems, subsystems, and types used within the
|
|
|
|
.Ic notify
|
2006-10-07 21:15:40 +00:00
|
|
|
mechanism.
|
|
|
|
.Pp
|
2009-03-08 14:28:40 +00:00
|
|
|
.Bl -tag -width ".Li coretemp" -compact
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Sy System
|
|
|
|
.It Li ACPI
|
2006-10-07 21:15:40 +00:00
|
|
|
Events related to the ACPI subsystem.
|
2006-10-21 17:15:11 +00:00
|
|
|
.Bl -tag -width ".Sy Subsystem" -compact
|
|
|
|
.It Sy Subsystem
|
|
|
|
.It Li ACAD
|
|
|
|
AC line state ($notify=0x00 is offline, 0x01 is online).
|
|
|
|
.It Li Button
|
2006-10-07 21:15:40 +00:00
|
|
|
Button state ($notify=0x00 is power, 0x01 is sleep).
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Li CMBAT
|
2006-10-07 21:15:40 +00:00
|
|
|
Battery events.
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Li Lid
|
2006-10-07 21:15:40 +00:00
|
|
|
Lid state ($notify=0x00 is closed, 0x01 is open).
|
2012-10-20 09:40:34 +00:00
|
|
|
.It Li PROCESSOR
|
|
|
|
Processor state/configuration ($notify=0x81 is a change in available Cx states).
|
2015-07-18 12:24:54 +00:00
|
|
|
.It Li Resume
|
|
|
|
Resume notification.
|
|
|
|
.It Li Suspend
|
|
|
|
Suspend notification.
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Li Thermal
|
2006-10-07 21:15:40 +00:00
|
|
|
Thermal zone events.
|
|
|
|
.El
|
|
|
|
.Pp
|
2015-07-18 12:17:59 +00:00
|
|
|
.It Li CARP
|
|
|
|
Events related to the
|
2016-02-29 17:28:05 +00:00
|
|
|
.Xr carp 4
|
2015-07-18 12:17:59 +00:00
|
|
|
protocol.
|
|
|
|
.Bl -tag -width ".Sy Subsystem" -compact
|
|
|
|
.It Sy Subsystem
|
|
|
|
.It Ar vhid@interface
|
|
|
|
The
|
|
|
|
.Dq subsystem
|
|
|
|
contains the actual CARP vhid and the name of the network interface
|
|
|
|
on which the event took place.
|
|
|
|
.Bl -tag -width ".Li MASTER" -compact
|
|
|
|
.It Sy Type
|
|
|
|
.It Li MASTER
|
|
|
|
Node become the master for a virtual host.
|
|
|
|
.It Li BACKUP
|
|
|
|
Node become the backup for a virtual host.
|
|
|
|
.El
|
|
|
|
.El
|
|
|
|
.Pp
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Li IFNET
|
2006-10-07 21:15:40 +00:00
|
|
|
Events related to the network subsystem.
|
2006-10-21 17:15:11 +00:00
|
|
|
.Bl -tag -width ".Sy Subsystem" -compact
|
|
|
|
.It Sy Subsystem
|
|
|
|
.It Ar interface
|
2006-10-07 21:15:40 +00:00
|
|
|
The
|
|
|
|
.Dq subsystem
|
|
|
|
is the actual name of the network interface on which the event
|
|
|
|
took place.
|
2006-10-21 17:15:11 +00:00
|
|
|
.Bl -tag -width ".Li LINK_DOWN" -compact
|
|
|
|
.It Sy Type
|
|
|
|
.It Li LINK_UP
|
2006-10-07 21:15:40 +00:00
|
|
|
Carrier status changed to UP.
|
2006-10-21 17:15:11 +00:00
|
|
|
.It Li LINK_DOWN
|
2006-10-07 21:15:40 +00:00
|
|
|
Carrier status changed to DOWN.
|
2009-03-08 14:28:40 +00:00
|
|
|
.It Li ATTACH
|
2009-03-08 18:02:30 +00:00
|
|
|
The network interface is attached to the system.
|
2009-03-08 14:28:40 +00:00
|
|
|
.It Li DETACH
|
2009-03-08 18:02:30 +00:00
|
|
|
The network interface is detached from the system.
|
2009-03-08 14:28:40 +00:00
|
|
|
.El
|
|
|
|
.El
|
2013-02-21 20:45:19 +00:00
|
|
|
.Pp
|
2009-03-08 14:28:40 +00:00
|
|
|
.It Li DEVFS
|
|
|
|
Events related to the
|
|
|
|
.Xr devfs 5
|
|
|
|
filesystem.
|
|
|
|
.Bl -tag -width ".Sy Subsystem" -compact
|
|
|
|
.It Sy Subsystem
|
|
|
|
.It Li CDEV
|
|
|
|
.Bl -tag -width ".Li DESTROY" -compact
|
|
|
|
.It Sy Type
|
|
|
|
.It Li CREATE
|
|
|
|
The
|
|
|
|
.Xr devfs 5
|
|
|
|
node is created.
|
|
|
|
.It Li DESTROY
|
|
|
|
The
|
|
|
|
.Xr devfs 5
|
|
|
|
node is destroyed.
|
|
|
|
.El
|
|
|
|
.El
|
2013-02-21 20:45:19 +00:00
|
|
|
.Pp
|
2015-01-14 11:15:57 +00:00
|
|
|
.It Li GEOM
|
|
|
|
Events related to the
|
|
|
|
.Xr geom 4
|
|
|
|
framework.
|
|
|
|
The difference compared to
|
|
|
|
.Li DEVFS
|
|
|
|
is that
|
|
|
|
.Li GEOM
|
|
|
|
only includes disk-like devices.
|
|
|
|
.Bl -tag -width ".Sy Subsystem" -compact
|
|
|
|
.It Sy Subsystem
|
|
|
|
.It Li DEV
|
|
|
|
.Bl -tag -width ".Li MEDIACHANGE" -compact
|
|
|
|
.It Sy Type
|
|
|
|
.It Li CREATE
|
|
|
|
A
|
|
|
|
.Xr geom 4
|
|
|
|
device node is created.
|
|
|
|
.It Li DESTROY
|
|
|
|
A
|
|
|
|
.Xr geom 4
|
|
|
|
device node is destroyed.
|
2016-04-26 14:48:58 +00:00
|
|
|
.It Li GEOM::physpath
|
|
|
|
The physical path of a device has changed.
|
2015-01-14 11:15:57 +00:00
|
|
|
.It Li MEDIACHANGE
|
|
|
|
Physical media has changed.
|
|
|
|
.El
|
|
|
|
.El
|
|
|
|
.Pp
|
2015-05-13 12:02:51 +00:00
|
|
|
.It Li RCTL
|
|
|
|
Events related to the
|
|
|
|
.Xr rctl 8
|
|
|
|
framework.
|
|
|
|
.Bl -tag -width ".Sy Subsystem" -compact
|
|
|
|
.It Sy Subsystem
|
|
|
|
.It Li rule
|
|
|
|
.Bl -tag -width ".Li matched" -compact
|
|
|
|
.It Sy Type
|
|
|
|
.It Li matched
|
|
|
|
A rule with action specified as "devctl" was triggered.
|
|
|
|
.El
|
|
|
|
.El
|
|
|
|
.Pp
|
2010-04-22 20:46:39 +00:00
|
|
|
.It Li USB
|
|
|
|
Events related to the USB subsystem.
|
|
|
|
.Bl -tag -width ".Sy Subsystem" -compact
|
|
|
|
.It Sy Subsystem
|
|
|
|
.It Li DEVICE
|
|
|
|
.Bl -tag -width ".Li DETACH" -compact
|
|
|
|
.It Sy Type
|
|
|
|
.It Li ATTACH
|
|
|
|
USB device is attached to the system.
|
|
|
|
.It Li DETACH
|
|
|
|
USB device is detached from the system.
|
|
|
|
.El
|
|
|
|
.It Li INTERFACE
|
|
|
|
.Bl -tag -width ".Li DETACH" -compact
|
|
|
|
.It Sy Type
|
|
|
|
.It Li ATTACH
|
2010-08-16 15:18:30 +00:00
|
|
|
USB interface is attached to a device.
|
2010-04-22 20:46:39 +00:00
|
|
|
.It Li DETACH
|
|
|
|
USB interface is detached from a device.
|
|
|
|
.El
|
|
|
|
.El
|
2013-02-21 20:45:19 +00:00
|
|
|
.Pp
|
2009-03-08 14:28:40 +00:00
|
|
|
.It Li coretemp
|
|
|
|
Events related to the
|
|
|
|
.Xr coretemp 4
|
|
|
|
device.
|
|
|
|
.Bl -tag -width ".Sy Subsystem" -compact
|
|
|
|
.It Sy Subsystem
|
|
|
|
.It Li Thermal
|
|
|
|
Notification that the CPU core has reached critical temperature.
|
|
|
|
.Bl -tag -width ".Ar temperature" -compact
|
|
|
|
.It Sy Type
|
|
|
|
.It Ar temperature
|
|
|
|
String containing the temperature of the core that has become too hot.
|
|
|
|
.El
|
|
|
|
.El
|
2013-02-21 20:45:19 +00:00
|
|
|
.Pp
|
2009-03-08 14:28:40 +00:00
|
|
|
.It Li kern
|
|
|
|
Events related to the kernel.
|
|
|
|
.Bl -tag -width ".Sy Subsystem" -compact
|
|
|
|
.It Sy Subsystem
|
|
|
|
.It Li power
|
|
|
|
.Bl -tag -width ".li resume" -compact
|
|
|
|
.It Sy Type
|
|
|
|
.It Li resume
|
|
|
|
Notification that the system has woken from the suspended state.
|
2006-10-07 21:15:40 +00:00
|
|
|
.El
|
|
|
|
.El
|
2016-04-14 22:03:23 +00:00
|
|
|
.Pp
|
2018-07-20 14:32:36 +00:00
|
|
|
.It Li kernel
|
|
|
|
More events related to the kernel.
|
|
|
|
.Bl -tag -width ".Sy Subsystem" -compact
|
|
|
|
.It Sy Subsystem
|
|
|
|
.It Li signal
|
|
|
|
.Bl -tag -width ".li resume" -compact
|
|
|
|
.It Sy Type
|
|
|
|
.It Li coredump
|
|
|
|
Notification that a process has crashed and dumped core.
|
|
|
|
.El
|
|
|
|
.El
|
|
|
|
.Pp
|
2016-04-14 22:03:23 +00:00
|
|
|
.It Li CAM
|
|
|
|
Events related to the
|
|
|
|
.Xr cam 4
|
|
|
|
system.
|
|
|
|
.Bl -tag -width ".Sy Subsystem" -compact
|
|
|
|
.It Sy Subsystem
|
|
|
|
.It Li periph
|
|
|
|
Events related to peripheral devices.
|
|
|
|
.Bl -tag -width ".li timeout" -compact
|
|
|
|
.It Sy Type
|
|
|
|
.It Li error
|
|
|
|
Generic errors.
|
|
|
|
.It Li timeout
|
|
|
|
Command timeouts.
|
|
|
|
.El
|
|
|
|
.El
|
2006-10-07 21:15:40 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
A link state change to UP on the interface
|
2006-10-21 17:15:11 +00:00
|
|
|
.Dq Li fxp0
|
2006-10-07 21:15:40 +00:00
|
|
|
would result in the following notify event:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
system=IFNET, subsystem=fxp0, type=LINK_UP
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
An AC line state change to
|
|
|
|
.Dq offline
|
|
|
|
would result in the following event:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
system=ACPI, subsystem=ACAD, notify=0x00
|
|
|
|
.Ed
|
|
|
|
.Ss Comments
|
2002-12-07 08:04:36 +00:00
|
|
|
Comments may appear anywhere that whitespace may appear in a
|
2003-03-03 11:51:30 +00:00
|
|
|
configuration file.
|
|
|
|
To appeal to programmers of all kinds, they can
|
|
|
|
be written in C, C++, or shell/Perl constructs.
|
2002-10-20 22:15:17 +00:00
|
|
|
.Pp
|
|
|
|
C-style comments start with the two characters
|
2003-03-03 11:51:30 +00:00
|
|
|
.Ql /*
|
2002-10-20 22:15:17 +00:00
|
|
|
(slash, star) and end with
|
2003-03-03 11:51:30 +00:00
|
|
|
.Ql */
|
2002-10-20 22:15:17 +00:00
|
|
|
(star, slash).
|
|
|
|
Because they are completely delimited with these characters,
|
|
|
|
they can be used to comment only a portion of a line or to span
|
|
|
|
multiple lines.
|
|
|
|
.Pp
|
2003-03-03 11:51:30 +00:00
|
|
|
C-style comments cannot be nested.
|
|
|
|
For example, the following is
|
2002-10-20 22:15:17 +00:00
|
|
|
not valid because the entire comment ends with the first
|
2003-03-03 11:51:30 +00:00
|
|
|
.Ql */ :
|
2002-10-20 22:15:17 +00:00
|
|
|
.Bd -literal -offset indent
|
|
|
|
/* This is the start of a comment.
|
|
|
|
This is still part of the comment.
|
|
|
|
/* This is an incorrect attempt at nesting a comment. */
|
|
|
|
This is no longer in any comment. */
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
C++-style comments start with the two characters
|
2003-03-03 11:51:30 +00:00
|
|
|
.Ql //
|
2002-10-20 22:15:17 +00:00
|
|
|
(slash, slash) and continue to the end of the physical line.
|
|
|
|
They cannot be continued across multiple physical lines; to have
|
|
|
|
one logical comment span multiple lines, each line must use the
|
2006-10-21 17:15:11 +00:00
|
|
|
.Ql //
|
2003-03-03 11:51:30 +00:00
|
|
|
pair.
|
|
|
|
For example:
|
2002-10-20 22:15:17 +00:00
|
|
|
.Bd -literal -offset indent
|
|
|
|
// This is the start of a comment. The next line
|
|
|
|
// is a new comment, even though it is logically
|
|
|
|
// part of the previous comment.
|
|
|
|
.Ed
|
2006-10-21 17:15:11 +00:00
|
|
|
.Sh FILES
|
|
|
|
.Bl -tag -width ".Pa /etc/devd.conf" -compact
|
|
|
|
.It Pa /etc/devd.conf
|
|
|
|
The
|
|
|
|
.Xr devd 8
|
|
|
|
configuration file.
|
|
|
|
.El
|
2006-10-07 21:15:40 +00:00
|
|
|
.Sh EXAMPLES
|
|
|
|
.Bd -literal
|
|
|
|
#
|
|
|
|
# This will catch link down events on the interfaces fxp0 and ath0
|
|
|
|
#
|
|
|
|
notify 0 {
|
|
|
|
match "system" "IFNET";
|
|
|
|
match "subsystem" "(fxp0|ath0)";
|
|
|
|
match "type" "LINK_DOWN";
|
|
|
|
action "logger $subsystem is DOWN";
|
|
|
|
};
|
|
|
|
|
|
|
|
#
|
|
|
|
# Match lid open/close events
|
|
|
|
# These can be combined to a single event, by passing the
|
|
|
|
# value of $notify to the external script.
|
|
|
|
#
|
|
|
|
notify 0 {
|
|
|
|
match "system" "ACPI";
|
|
|
|
match "subsystem" "Lid";
|
|
|
|
match "notify" "0x00";
|
|
|
|
action "logger Lid closed, we can sleep now!";
|
|
|
|
};
|
|
|
|
|
|
|
|
notify 0 {
|
|
|
|
match "system" "ACPI";
|
|
|
|
match "subsystem" "Lid";
|
|
|
|
match "notify" "0x01";
|
|
|
|
action "logger Lid opened, the sleeper must awaken!";
|
|
|
|
};
|
|
|
|
|
2010-04-22 20:46:39 +00:00
|
|
|
#
|
|
|
|
# Match a USB device type
|
|
|
|
#
|
|
|
|
notify 0 {
|
|
|
|
match "system" "USB";
|
|
|
|
match "subsystem" "INTERFACE";
|
|
|
|
match "type" "ATTACH";
|
|
|
|
match "intclass" "0x0e";
|
|
|
|
action "logger USB video device attached";
|
|
|
|
};
|
|
|
|
|
2006-10-07 21:15:40 +00:00
|
|
|
#
|
|
|
|
# Try to configure ath and wi devices with pccard_ether
|
|
|
|
# as they are attached.
|
|
|
|
#
|
|
|
|
attach 0 {
|
|
|
|
device-name "(ath|wi)[0-9]+";
|
|
|
|
action "/etc/pccard_ether $device-name start";
|
|
|
|
};
|
|
|
|
|
|
|
|
#
|
|
|
|
# Stop ath and wi devices as they are detached from
|
|
|
|
# the system.
|
|
|
|
#
|
|
|
|
detach 0 {
|
|
|
|
device-name "(ath|wi)[0-9]+";
|
|
|
|
action "/etc/pccard_ether $device-name stop";
|
|
|
|
};
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The installed
|
|
|
|
.Pa /etc/devd.conf
|
|
|
|
has many additional examples.
|
2002-10-20 22:15:17 +00:00
|
|
|
.Sh SEE ALSO
|
2016-10-08 12:53:23 +00:00
|
|
|
.Xr cam 4 ,
|
2009-03-08 18:02:30 +00:00
|
|
|
.Xr coretemp 4 ,
|
2009-03-08 14:28:40 +00:00
|
|
|
.Xr devfs 5 ,
|
2011-12-19 05:09:08 +00:00
|
|
|
.Xr re_format 7 ,
|
2016-10-08 12:53:23 +00:00
|
|
|
.Xr devd 8
|