xref: /freebsd/sbin/devd/devd.conf.5 (revision 1fc7922f9f905b62ef9a6c03be498c282e7b382e)
1e530e044SWarner Losh.\"
2f86e6000SWarner Losh.\" Copyright (c) 2002 M. Warner Losh <imp@FreeBSD.org>
3e530e044SWarner Losh.\"
4e530e044SWarner Losh.\" Redistribution and use in source and binary forms, with or without
5e530e044SWarner Losh.\" modification, are permitted provided that the following conditions
6e530e044SWarner Losh.\" are met:
7e530e044SWarner Losh.\" 1. Redistributions of source code must retain the above copyright
8e530e044SWarner Losh.\"    notice, this list of conditions and the following disclaimer.
9e530e044SWarner Losh.\" 2. The name of the author may not be used to endorse or promote products
10e530e044SWarner Losh.\"    derived from this software without specific prior written permission.
11e530e044SWarner Losh.\"
12e530e044SWarner Losh.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13e530e044SWarner Losh.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14e530e044SWarner Losh.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15e530e044SWarner Losh.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16e530e044SWarner Losh.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17e530e044SWarner Losh.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18e530e044SWarner Losh.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19e530e044SWarner Losh.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20e530e044SWarner Losh.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21e530e044SWarner Losh.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22e530e044SWarner Losh.\" SUCH DAMAGE.
23e530e044SWarner Losh.\"
24e530e044SWarner Losh.\" The section on comments was taken from named.conf.5, which has the
25e530e044SWarner Losh.\" following copyright:
26e530e044SWarner Losh.\" Copyright (c) 1999-2000 by Internet Software Consortium
27e530e044SWarner Losh.\"
28e530e044SWarner Losh.\" Permission to use, copy, modify, and distribute this software for any
29e530e044SWarner Losh.\" purpose with or without fee is hereby granted, provided that the above
30e530e044SWarner Losh.\" copyright notice and this permission notice appear in all copies.
31e530e044SWarner Losh.\"
32e530e044SWarner Losh.\" THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
33e530e044SWarner Losh.\" ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
34e530e044SWarner Losh.\" OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
35e530e044SWarner Losh.\" CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
36e530e044SWarner Losh.\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
37e530e044SWarner Losh.\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
38e530e044SWarner Losh.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
39e530e044SWarner Losh.\" SOFTWARE.
40f1e65894SRuslan Ermilov.\"
41*1fc7922fSJoerg Wunsch.Dd December 20, 2024
42e530e044SWarner Losh.Dt DEVD.CONF 5
43e530e044SWarner Losh.Os
44e530e044SWarner Losh.Sh NAME
45e530e044SWarner Losh.Nm devd.conf
467c6af209SWarner Losh.Nd configuration file format for
47267e74adSWarner Losh.Xr devd 8
48f1e65894SRuslan Ermilov.Sh DESCRIPTION
49e530e044SWarner Losh.Ss General Syntax
50e530e044SWarner LoshA
51e530e044SWarner Losh.Xr devd 8
52e530e044SWarner Loshconfiguration consists of two general features, statements
53e530e044SWarner Loshand comments.
54e530e044SWarner LoshAll statements end with a semicolon.
55f1e65894SRuslan ErmilovMany statements can contain substatements, which are also
56e530e044SWarner Loshterminated with a semicolon.
57e530e044SWarner Losh.Pp
58e530e044SWarner LoshThe following statements are supported:
59f1e65894SRuslan Ermilov.Bl -tag -width ".Ic options"
60e530e044SWarner Losh.It Ic attach
61e0c10c6eSJohn-Mark GurneySpecifies various matching criteria and actions to perform when
62e530e044SWarner Losha newly attached device matches said criteria.
63e530e044SWarner Losh.It Ic detach
64e0c10c6eSJohn-Mark GurneySpecifies various matching criteria and actions to perform when
65f1e65894SRuslan Ermilova newly detached device matches said criteria.
66e530e044SWarner Losh.It Ic nomatch
67e0c10c6eSJohn-Mark GurneySpecifies various matching criteria and actions to perform when
68e530e044SWarner Loshno device driver currently loaded in the kernel claims a (new)
69e530e044SWarner Loshdevice.
70e0c10c6eSJohn-Mark Gurney.It Ic notify
71e0c10c6eSJohn-Mark GurneySpecifies various matching criteria and actions to perform when the kernel
72e0c10c6eSJohn-Mark Gurneysends an event notification to userland.
73e0c10c6eSJohn-Mark Gurney.It Ic options
74e0c10c6eSJohn-Mark GurneySpecifies various options and parameters for the operation of
75e0c10c6eSJohn-Mark Gurney.Xr devd 8 .
76e530e044SWarner Losh.El
77e530e044SWarner Losh.Pp
78f1e65894SRuslan ErmilovStatements may occur in any order in the configuration file, and may be
79f1e65894SRuslan Ermilovrepeated as often as required.
80f1e65894SRuslan ErmilovFurther details on the syntax and meaning of each statement and their
81f1e65894SRuslan Ermilovsubstatements are explained below.
82e530e044SWarner Losh.Pp
83e0c10c6eSJohn-Mark GurneyEach statement, except
84ebd1e4e6SRuslan Ermilov.Ic options
85e0c10c6eSJohn-Mark Gurneyhas a priority (an arbitrary number) associated with it, where
86e0c10c6eSJohn-Mark Gurney.Ql 0
87e0c10c6eSJohn-Mark Gurneyis defined as the lowest priority.
88e0c10c6eSJohn-Mark GurneyIf two statements match the same event, only the action of the statement with
89e0c10c6eSJohn-Mark Gurneyhighest priority will be executed.
90e0c10c6eSJohn-Mark GurneyIn this way generic statements can be overridden for devices or
91e0c10c6eSJohn-Mark Gurneynotifications that require special attention.
92e0c10c6eSJohn-Mark Gurney.Pp
93e0c10c6eSJohn-Mark GurneyThe general syntax of a statement is:
94e0c10c6eSJohn-Mark Gurney.Bd -literal -offset indent
95e0c10c6eSJohn-Mark Gurneystatement priority {
96e0c10c6eSJohn-Mark Gurney	substatement "value";
97e0c10c6eSJohn-Mark Gurney	...
98e0c10c6eSJohn-Mark Gurney	substatement "value";
99e0c10c6eSJohn-Mark Gurney};
100e0c10c6eSJohn-Mark Gurney.Ed
101e0c10c6eSJohn-Mark Gurney.Ss Sub-statements
102e0c10c6eSJohn-Mark GurneyThe following sub-statements are supported within the
103ebd1e4e6SRuslan Ermilov.Ic options
104e0c10c6eSJohn-Mark Gurneystatement.
105e0c10c6eSJohn-Mark Gurney.Bl -tag -width ".Ic directory"
106ebd1e4e6SRuslan Ermilov.It Ic directory Qq Ar /some/path ;
107e0c10c6eSJohn-Mark GurneyAdds the given directory to the list of directories from which
108e0c10c6eSJohn-Mark Gurney.Xr devd 8
109877ed37aSPoul-Henning Kampwill read all files named "*.conf" as further
110ebd1e4e6SRuslan Ermilovconfiguration files.
111ebd1e4e6SRuslan ErmilovAny number of
112ebd1e4e6SRuslan Ermilov.Ic directory
113e0c10c6eSJohn-Mark Gurneystatements can be used.
114ebd1e4e6SRuslan Ermilov.It Ic pid-file Qq Pa /var/run/devd.pid ;
115ebd1e4e6SRuslan ErmilovSpecifies PID file.
116ebd1e4e6SRuslan Ermilov.It Ic set Ar regexp-name Qq Ar (some|regexp) ;
117e0c10c6eSJohn-Mark GurneyCreates a regular expression and assigns it to the variable
118ebd1e4e6SRuslan Ermilov.Ar regexp-name .
11901cd0a97SMaxim KonovalovThe variable is available throughout the rest of
120e0c10c6eSJohn-Mark Gurneythe configuration file.
1210321b694SHiroki SatoIf the string begins with
1220321b694SHiroki Sato.Ql \&! ,
1230321b694SHiroki Satoit matches if the regular expression formed by the rest of the string
1240321b694SHiroki Satodoes not match.
125e0c10c6eSJohn-Mark GurneyAll regular expressions have an implicit
126ebd1e4e6SRuslan Ermilov.Ql ^$
127e0c10c6eSJohn-Mark Gurneyaround them.
128e0c10c6eSJohn-Mark Gurney.El
129e0c10c6eSJohn-Mark Gurney.Pp
130e0c10c6eSJohn-Mark GurneyThe following sub-statements are supported within the
131ebd1e4e6SRuslan Ermilov.Ic attach
132e0c10c6eSJohn-Mark Gurneyand
133ebd1e4e6SRuslan Ermilov.Ic detach
134e0c10c6eSJohn-Mark Gurneystatements.
135e0c10c6eSJohn-Mark Gurney.Bl -tag -width ".Ic directory"
136ebd1e4e6SRuslan Ermilov.It Ic action Qq Ar command ;
137e0c10c6eSJohn-Mark GurneyCommand to execute upon a successful match.
138e0c10c6eSJohn-Mark GurneyExample
139ebd1e4e6SRuslan Ermilov.Dq Li "/etc/pccard_ether $device-name start" .
140ebd1e4e6SRuslan Ermilov.It Ic class Qq Ar string ;
141e0c10c6eSJohn-Mark GurneyThis is shorthand for
142ebd1e4e6SRuslan Ermilov.Dq Ic match Qo Li class Qc Qq Ar string .
143ebd1e4e6SRuslan Ermilov.It Ic device-name Qq string ;
144e0c10c6eSJohn-Mark GurneyThis is shorthand for
145ebd1e4e6SRuslan Ermilov.Dq Ic match Qo Li device-name Qc Qq Ar string .
146e0c10c6eSJohn-Mark GurneyThis matches a device named
147ebd1e4e6SRuslan Ermilov.Ar string ,
148e0c10c6eSJohn-Mark Gurneywhich is allowed to be a regular expression or a variable previously created
149e0c10c6eSJohn-Mark Gurneycontaining a regular expression.
150e0c10c6eSJohn-Mark GurneyThe
151ebd1e4e6SRuslan Ermilov.Dq Li device-name
152e0c10c6eSJohn-Mark Gurneyvariable
153ebd1e4e6SRuslan Ermilovis available for later use with the
154ebd1e4e6SRuslan Ermilov.Ic action
155ebd1e4e6SRuslan Ermilovstatement.
156ebd1e4e6SRuslan Ermilov.It Ic match Qo Ar variable Qc Qq Ar value ;
157e0c10c6eSJohn-Mark GurneyMatches the content of
158ebd1e4e6SRuslan Ermilov.Ar value
159e0c10c6eSJohn-Mark Gurneyagainst
160ebd1e4e6SRuslan Ermilov.Ar variable ;
161e0c10c6eSJohn-Mark Gurneythe content of
162ebd1e4e6SRuslan Ermilov.Ar value
163e0c10c6eSJohn-Mark Gurneymay be a regular expression.
164e0c10c6eSJohn-Mark GurneyNot required during
165ebd1e4e6SRuslan Ermilov.Ic attach
166e0c10c6eSJohn-Mark Gurneynor
167ebd1e4e6SRuslan Ermilov.Ic detach
168e0c10c6eSJohn-Mark Gurneyevents since the
169ebd1e4e6SRuslan Ermilov.Ic device-name
170e0c10c6eSJohn-Mark Gurneystatement takes care of all device matching.
171e0c10c6eSJohn-Mark GurneyFor a partial list of variables, see below.
172ebd1e4e6SRuslan Ermilov.It Ic media-type Qq Ar string ;
173f8553712SRuslan ErmilovFor network devices,
174f8553712SRuslan Ermilov.Ic media-type
175f8553712SRuslan Ermilovwill match devices that have the given media type.
176f8553712SRuslan ErmilovValid media types are:
177f8553712SRuslan Ermilov.Dq Li Ethernet ,
178f8553712SRuslan Ermilov.Dq Li 802.11 ,
179f8553712SRuslan Ermilovand
18075dbe5f2SSergey Kandaurov.Dq Li ATM .
181ebd1e4e6SRuslan Ermilov.It Ic subdevice Qq Ar string ;
182e0c10c6eSJohn-Mark GurneyThis is shorthand for
183ebd1e4e6SRuslan Ermilov.Dq Ic match Qo Li subdevice Qc Qq Ar string .
184e0c10c6eSJohn-Mark Gurney.El
185e0c10c6eSJohn-Mark Gurney.Pp
186e0c10c6eSJohn-Mark GurneyThe following sub-statements are supported within the
187ebd1e4e6SRuslan Ermilov.Ic nomatch
188e0c10c6eSJohn-Mark Gurneystatement.
189e0c10c6eSJohn-Mark Gurney.Bl -tag -width ".Ic directory"
190ebd1e4e6SRuslan Ermilov.It Ic action Qq Ar command ;
191e0c10c6eSJohn-Mark GurneySame as above.
192ebd1e4e6SRuslan Ermilov.It Ic match Qo Ar variable Qc Qq Ar value ;
193e0c10c6eSJohn-Mark GurneyMatches the content of
194ebd1e4e6SRuslan Ermilov.Ar value
195e0c10c6eSJohn-Mark Gurneyagainst
196ebd1e4e6SRuslan Ermilov.Ar variable ;
197e0c10c6eSJohn-Mark Gurneythe content of
198ebd1e4e6SRuslan Ermilov.Ar value
199e0c10c6eSJohn-Mark Gurneymay be a regular expression.
200e0c10c6eSJohn-Mark GurneyFor a partial list of variables, see below.
201e0c10c6eSJohn-Mark Gurney.El
202e0c10c6eSJohn-Mark Gurney.Pp
203e0c10c6eSJohn-Mark GurneyThe following sub-statements are supported within the
204ebd1e4e6SRuslan Ermilov.Ic notify
205e0c10c6eSJohn-Mark Gurneystatement.
206e0c10c6eSJohn-Mark GurneyThe
207e0c10c6eSJohn-Mark Gurney.Dq Li notify
20801cd0a97SMaxim Konovalovvariable is available inside this statement and contains, a value, depending
209e0c10c6eSJohn-Mark Gurneyon which system and subsystem that delivered the event.
210e0c10c6eSJohn-Mark Gurney.Bl -tag -width ".Ic directory"
211ebd1e4e6SRuslan Ermilov.It Ic action Qq Ar command ;
212ebd1e4e6SRuslan ErmilovCommand to execute upon a successful match.
213ebd1e4e6SRuslan ErmilovExample
214ebd1e4e6SRuslan Ermilov.Dq Li "/etc/rc.d/power_profile $notify" .
215ebd1e4e6SRuslan Ermilov.It Ic match Qo Ar system | subsystem | type | notify Qc Qq Ar value ;
216e0c10c6eSJohn-Mark GurneyAny number of
217ebd1e4e6SRuslan Ermilov.Ic match
218ebd1e4e6SRuslan Ermilovstatements can exist within a
219ebd1e4e6SRuslan Ermilov.Ic notify
220ebd1e4e6SRuslan Ermilovstatement;
221ebd1e4e6SRuslan Ermilov.Ar value
222e0c10c6eSJohn-Mark Gurneycan be either a fixed string or a regular expression.
22301cd0a97SMaxim KonovalovBelow is a list of available systems, subsystems, and types.
224f8553712SRuslan Ermilov.It Ic media-type Qq Ar string ;
225f8553712SRuslan ErmilovSee above.
226e0c10c6eSJohn-Mark Gurney.El
227e0c10c6eSJohn-Mark Gurney.Ss Variables that can be used with the match statement
228e0c10c6eSJohn-Mark GurneyA partial list of variables and their possible values that can be used together
229e0c10c6eSJohn-Mark Gurneywith the
230ebd1e4e6SRuslan Ermilov.Ic match
231e0c10c6eSJohn-Mark Gurneystatement.
232b3d32292SWarner LoshThe variables are published by the bus based on characteristics of the device
233b3d32292SWarner Loshthat generated the event (for device events).
234b3d32292SWarner LoshVariables for other classes of events are dependent on those events.
235e0c10c6eSJohn-Mark Gurney.Pp
236ebd1e4e6SRuslan Ermilov.Bl -tag -width ".Li manufacturer" -compact
237e0c10c6eSJohn-Mark Gurney.It Ic Variable
238e0c10c6eSJohn-Mark Gurney.Ic Description
239b3d32292SWarner Losh.It Li *
2409b63ed8bSEdward Tomasz NapieralaThe entire message from the current event.
241b3d32292SWarner Losh.It Li _
2429b63ed8bSEdward Tomasz NapieralaThe entire message from the current event, after the initial type character.
2433b336ac3SWarner Losh.It Li timestamp
2449b63ed8bSEdward Tomasz NapieralaThe time this event was processed, in seconds since 1970 dot fraction.
245ebd1e4e6SRuslan Ermilov.It Li bus
246ebd1e4e6SRuslan ErmilovDevice name of parent bus.
2472e170559SKonstantin Belousov.It Li cdev
2482e170559SKonstantin BelousovDevice node path if one is created by the
2492e170559SKonstantin Belousov.Xr devfs 5
2502e170559SKonstantin Belousovfilesystem.
251ebd1e4e6SRuslan Ermilov.It Li class
252ebd1e4e6SRuslan ErmilovDevice class.
25339ebf767SEdward Tomasz Napierala.It Li comm
25439ebf767SEdward Tomasz NapieralaExecutable name (kernel).
25539ebf767SEdward Tomasz Napierala.It Li core
25639ebf767SEdward Tomasz NapieralaPath to core file (kernel).
257ebd1e4e6SRuslan Ermilov.It Li device
258ebd1e4e6SRuslan ErmilovDevice ID.
259139e9ad4SAndrew Thompson.It Li devclass
2609b63ed8bSEdward Tomasz NapieralaDevice Class (USB).
261139e9ad4SAndrew Thompson.It Li devsubclass
2629b63ed8bSEdward Tomasz NapieralaDevice Sub-class (USB).
263ebd1e4e6SRuslan Ermilov.It Li device-name
264ebd1e4e6SRuslan ErmilovName of attached/detached device.
265139e9ad4SAndrew Thompson.It Li endpoints
2669b63ed8bSEdward Tomasz NapieralaEndpoint count (USB).
267ebd1e4e6SRuslan Ermilov.It Li function
268ebd1e4e6SRuslan ErmilovCard functions.
269139e9ad4SAndrew Thompson.It Li interface
2709b63ed8bSEdward Tomasz NapieralaInterface ID (USB).
271139e9ad4SAndrew Thompson.It Li intclass
2729b63ed8bSEdward Tomasz NapieralaInterface Class (USB).
273139e9ad4SAndrew Thompson.It Li intprotocol
2749b63ed8bSEdward Tomasz NapieralaInterface Protocol (USB).
275139e9ad4SAndrew Thompson.It Li intsubclass
2769b63ed8bSEdward Tomasz NapieralaInterface Sub-class (USB).
27728616c3cSEdward Tomasz Napierala.It Li jail
2789b63ed8bSEdward Tomasz NapieralaJail name for the process triggering the rule (RCTL).
279139e9ad4SAndrew Thompson.It Li mode
2809b63ed8bSEdward Tomasz NapieralaPeripheral mode (USB).
281ebd1e4e6SRuslan Ermilov.It Li notify
282e0c10c6eSJohn-Mark GurneyMatch the value of the
283e0c10c6eSJohn-Mark Gurney.Dq Li notify
284e0c10c6eSJohn-Mark Gurneyvariable.
285139e9ad4SAndrew Thompson.It Li parent
2869b63ed8bSEdward Tomasz NapieralaParent device.
28728616c3cSEdward Tomasz Napierala.It Li pid
2889b63ed8bSEdward Tomasz NapieralaPID of the process triggering the rule (RCTL).
289139e9ad4SAndrew Thompson.It Li port
2909b63ed8bSEdward Tomasz NapieralaHub port number (USB).
291ebd1e4e6SRuslan Ermilov.It Li product
29231178c8aSWarner LoshProduct ID (USB).
293139e9ad4SAndrew Thompson.It Li release
2949b63ed8bSEdward Tomasz NapieralaHardware revision (USB).
29528616c3cSEdward Tomasz Napierala.It Li ruid
2969b63ed8bSEdward Tomasz NapieralaReal UID of the process triggering the rule (RCTL).
29728616c3cSEdward Tomasz Napierala.It Li rule
2989b63ed8bSEdward Tomasz NapieralaRule (RCTL).
299e1e3c301SBruce M Simpson.It Li sernum
300ebd1e4e6SRuslan ErmilovSerial Number (USB).
301ebd1e4e6SRuslan Ermilov.It Li slot
302ebd1e4e6SRuslan ErmilovCard slot.
303ebd1e4e6SRuslan Ermilov.It Li subvendor
30431178c8aSWarner LoshSub-vendor ID (PCI).
305ebd1e4e6SRuslan Ermilov.It Li subdevice
30631178c8aSWarner LoshSub-device ID (PCI).
307ebd1e4e6SRuslan Ermilov.It Li subsystem
308ebd1e4e6SRuslan ErmilovMatches a subsystem of a system, see below.
309ebd1e4e6SRuslan Ermilov.It Li system
310ebd1e4e6SRuslan ErmilovMatches a system type, see below.
311ebd1e4e6SRuslan Ermilov.It Li type
312ebd1e4e6SRuslan ErmilovType of notification, see below.
313ebd1e4e6SRuslan Ermilov.It Li vendor
314ebd1e4e6SRuslan ErmilovVendor ID.
315e0c10c6eSJohn-Mark Gurney.El
316e0c10c6eSJohn-Mark Gurney.Ss Notify matching
317ebd1e4e6SRuslan ErmilovA partial list of systems, subsystems, and types used within the
318ebd1e4e6SRuslan Ermilov.Ic notify
319e0c10c6eSJohn-Mark Gurneymechanism.
320e3c77e31SWarner Losh.\"
321e3c77e31SWarner Losh.\" Please keep these tables sorted. Also, please use the same parameters
322e3c77e31SWarner Losh.\" for each of the tables so that things line up in columns nicely.
323e3c77e31SWarner Losh.\" Please do not omit the type column for notifiers that omit it.
324e0c10c6eSJohn-Mark Gurney.Pp
325e3c77e31SWarner Losh.Bl -column "System" "Subsystem" "1234567" -compact
326e3c77e31SWarner Losh.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
327e3c77e31SWarner Losh.It Li ACPI Ta Ta Ta
328d7e357f8SWarner LoshEvents related to the ACPI Subsystem.
329e3c77e31SWarner Losh.It Li ACPI Ta Li ACAD Ta Ta
330ebd1e4e6SRuslan ErmilovAC line state ($notify=0x00 is offline, 0x01 is online).
331e3c77e31SWarner Losh.It Li ACPI Ta Li Button Ta Ta
332e0c10c6eSJohn-Mark GurneyButton state ($notify=0x00 is power, 0x01 is sleep).
333e3c77e31SWarner Losh.It Li ACPI Ta Li CMBAT Ta Ta
334e0c10c6eSJohn-Mark GurneyBattery events.
335e3c77e31SWarner Losh.It Li ACPI Ta Li Dock Ta Ta
3368e9105dbSMark JohnstonDock state ($notify=0x00 is undocked, 0x01 is docked).
337e3c77e31SWarner Losh.It Li ACPI Ta Li Lid Ta Ta
338e0c10c6eSJohn-Mark GurneyLid state ($notify=0x00 is closed, 0x01 is open).
339e3c77e31SWarner Losh.It Li ACPI Ta Li PROCESSOR Ta Ta
340fcc6af50SAndriy GaponProcessor state/configuration ($notify=0x81 is a change in available Cx states).
341e3c77e31SWarner Losh.It Li ACPI Ta Li Resume Ta Ta
3424a2a0449SEdward Tomasz NapieralaResume notification.
343e3c77e31SWarner Losh.It Li ACPI Ta Li Suspend Ta Ta
3444a2a0449SEdward Tomasz NapieralaSuspend notification.
345e3c77e31SWarner Losh.It Li ACPI Ta Li Thermal Ta Ta
346e0c10c6eSJohn-Mark GurneyThermal zone events.
347e0c10c6eSJohn-Mark Gurney.El
348e0c10c6eSJohn-Mark Gurney.Pp
349e3c77e31SWarner Losh.Bl -column "System" "Subsystem" "1234567" -compact
350e3c77e31SWarner Losh.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
35177f4a809SWarner Losh.It Li AEON Ta Li power Ta Li press Ta
352346da457SWarner LoshThe power button on an Amiga has been pressed.
35377f4a809SWarner Losh.El
35477f4a809SWarner Losh.Pp
35577f4a809SWarner Losh.Bl -column "System" "Subsystem" "1234567" -compact
35677f4a809SWarner Losh.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
357e3c77e31SWarner Losh.It Li CAM Ta Ta Ta
358e3c77e31SWarner LoshEvents related to the
359e3c77e31SWarner Losh.Xr cam 4
360e3c77e31SWarner Loshsystem.
361e3c77e31SWarner Losh.It Li CAM Ta Li periph Ta Ta
362e3c77e31SWarner LoshEvents related to peripheral devices.
363e3c77e31SWarner Losh.It Li CAM Ta Li periph Ta Li error Ta
364e3c77e31SWarner LoshGeneric errors.
365e3c77e31SWarner Losh.It Li CAM Ta Li periph Ta Li timeout Ta
366e3c77e31SWarner LoshCommand timeouts.
367e3c77e31SWarner Losh.El
368e3c77e31SWarner Losh.Pp
369e3c77e31SWarner Losh.Bl -column "System" "Subsystem" "1234567" -compact
370e3c77e31SWarner Losh.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
371e3c77e31SWarner Losh.It Li CARP Ta Ta Ta
372cdff9958SEdward Tomasz NapieralaEvents related to the
3734641226cSEdward Tomasz Napierala.Xr carp 4
374cdff9958SEdward Tomasz Napieralaprotocol.
375e3c77e31SWarner Losh.It CARP Ta Ar vhid@inet Ta Ta
376cdff9958SEdward Tomasz NapieralaThe
377cdff9958SEdward Tomasz Napierala.Dq subsystem
378cdff9958SEdward Tomasz Napieralacontains the actual CARP vhid and the name of the network interface
379cdff9958SEdward Tomasz Napieralaon which the event took place.
380e3c77e31SWarner Losh.It CARP Ta Ar vhid@inet Ta MASTER Ta
381cdff9958SEdward Tomasz NapieralaNode become the master for a virtual host.
382e3c77e31SWarner Losh.It CARP Ta Ar vhid@inet Ta BACKUP Ta
383cdff9958SEdward Tomasz NapieralaNode become the backup for a virtual host.
384cdff9958SEdward Tomasz Napierala.El
385e3c77e31SWarner Losh.Pp
386e3c77e31SWarner Losh.Bl -column "System" "Subsystem" "1234567" -compact
387e3c77e31SWarner Losh.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
388e3c77e31SWarner Losh.It Li coretemp Ta Ta Ta
389e3c77e31SWarner LoshEvents related to the
390e3c77e31SWarner Losh.Xr coretemp 4
391e3c77e31SWarner Loshdevice.
392e3c77e31SWarner Losh.It Li coretemp Ta Li Thermal Ta Ta
393e3c77e31SWarner LoshNotification that the CPU core has reached critical temperature.
394e3c77e31SWarner Losh.It Li coretemp Ta Li Thermal Ta Li temperature Ta
395e3c77e31SWarner LoshString containing the temperature of the core that has become too hot.
396cdff9958SEdward Tomasz Napierala.El
397cdff9958SEdward Tomasz Napierala.Pp
398e3c77e31SWarner Losh.Bl -column "System" "Subsystem" "1234567" -compact
399e3c77e31SWarner Losh.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
4002e170559SKonstantin Belousov.It Li DEVFS
401e3c77e31SWarner Losh.It Li DEVFS Ta Li CDEV Ta Li CREATE Ta
4022e170559SKonstantin BelousovThe
4032e170559SKonstantin Belousov.Xr devfs 5
4042e170559SKonstantin Belousovnode is created.
405e3c77e31SWarner Losh.It Li DEVFS Ta Li CDEV Ta Li DESTROY Ta
4062e170559SKonstantin BelousovThe
4072e170559SKonstantin Belousov.Xr devfs 5
4082e170559SKonstantin Belousovnode is destroyed.
4092e170559SKonstantin Belousov.El
410fe9a7607SSergey Kandaurov.Pp
411e3c77e31SWarner Losh.Bl -column "System" "Subsystem" "1234567" -compact
412e3c77e31SWarner Losh.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
413b87de064SWarner Losh.It Li ETHERNET Ta Ar inet Ta IFATTACH Ta
414b87de064SWarner LoshNotification when the default VNET instance of the
415b7169662SWarner Losh.Em inet
416b87de064SWarner Loshinterface is attached.
417b87de064SWarner Losh.El
418b87de064SWarner Losh.Pp
419b87de064SWarner Losh.Bl -column "System" "Subsystem" "1234567" -compact
420b87de064SWarner Losh.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
421e3c77e31SWarner Losh.It Li GEOM Ta Ta Ta
42201de1a06SEdward Tomasz NapieralaEvents related to the
42301de1a06SEdward Tomasz Napierala.Xr geom 4
42401de1a06SEdward Tomasz Napieralaframework.
42501de1a06SEdward Tomasz NapieralaThe difference compared to
42601de1a06SEdward Tomasz Napierala.Li DEVFS
42701de1a06SEdward Tomasz Napieralais that
42801de1a06SEdward Tomasz Napierala.Li GEOM
42901de1a06SEdward Tomasz Napieralaonly includes disk-like devices.
430e3c77e31SWarner Losh.It Li GEOM Ta Li DEV Ta Li CREATE Ta
43101de1a06SEdward Tomasz NapieralaA
43201de1a06SEdward Tomasz Napierala.Xr geom 4
433e6b0d5ebSPawel Jakub Dawidekprovider is created.
434e3c77e31SWarner Losh.It Li GEOM Ta Li DEV Ta Li DESTROY Ta
43501de1a06SEdward Tomasz NapieralaA
43601de1a06SEdward Tomasz Napierala.Xr geom 4
437e6b0d5ebSPawel Jakub Dawidekprovider is destroyed.
438e3c77e31SWarner Losh.It Li GEOM Ta Li DEV Ta Li GEOM::physpath Ta
43996edd3f3SAlan SomersThe physical path of a device has changed.
44017910c7fSWarner Losh.It Li GEOM Ta Li DEV Ta Li GEOM::rotation_rate Ta
441d7e357f8SWarner LoshThe rotation rate of the disk has changed.
442e3c77e31SWarner Losh.It Li GEOM Ta Li DEV Ta Li MEDIACHANGE Ta
44301de1a06SEdward Tomasz NapieralaPhysical media has changed.
444e3c77e31SWarner Losh.It Li GEOM Ta Li DEV Ta Li SIZECHANGE Ta
445e6b0d5ebSPawel Jakub DawidekA
446e6b0d5ebSPawel Jakub Dawidek.Xr geom 4
447e6b0d5ebSPawel Jakub Dawidekprovider size has changed.
44801de1a06SEdward Tomasz Napierala.El
449e3c77e31SWarner Losh.Pp
450e3c77e31SWarner Losh.Bl -column "System" "Subsystem" "1234567" -compact
451e3c77e31SWarner Losh.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
4527daa93c4SWarner Losh.It Li IFNET
453b7169662SWarner Losh.It Li IFNET Ta Em inet Ta Ta
4547daa93c4SWarner LoshThe
4557daa93c4SWarner Losh.Dq subsystem
4567daa93c4SWarner Loshis the actual name of the network interface on which the event
4577daa93c4SWarner Loshtook place.
458b7169662SWarner Losh.It Li IFNET Ta Em inet Ta Li LINK_UP Ta
4597daa93c4SWarner LoshCarrier status changed to UP.
460b7169662SWarner Losh.It Li IFNET Ta Em inet Ta Li LINK_DOWN Ta
4617daa93c4SWarner LoshCarrier status changed to DOWN.
462b7169662SWarner Losh.It Li IFNET Ta Em inet Ta Li ATTACH Ta
4637daa93c4SWarner LoshThe network interface is attached to the system.
464b7169662SWarner Losh.It Li IFNET Ta Em inet Ta Li DETACH Ta
4657daa93c4SWarner LoshThe network interface is detached from the system.
4664fb3e0bbSRozhuk Ivan.It Li IFNET Ta Em inet Ta Li RENAME Ta
4674fb3e0bbSRozhuk IvanThe network interface is renamed.
468a7581946SRozhuk Ivan.It Li IFNET Ta Em inet Ta Li ADDR_ADD Ta
469a7581946SRozhuk IvanThe network interface address added.
470a7581946SRozhuk Ivan.It Li IFNET Ta Em inet Ta Li ADDR_DEL Ta
471a7581946SRozhuk IvanThe network interface address removed.
4727daa93c4SWarner Losh.El
4737daa93c4SWarner Losh.Pp
4747daa93c4SWarner Losh.Bl -column "System" "Subsystem" "1234567" -compact
4757daa93c4SWarner Losh.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
476e3c77e31SWarner Losh.It Li kernel Ta Li signal Ta Li coredump Ta
477e3c77e31SWarner LoshNotification that a process has crashed and dumped core.
478f87655ecSWarner Losh.It Li kernel Ta Li power Ta Li resume Ta
479f87655ecSWarner LoshNotification that the system has woken from the suspended state.
480e3c77e31SWarner Losh.El
481e3c77e31SWarner Losh.Pp
482e3c77e31SWarner Losh.Bl -column "System" "Subsystem" "1234567" -compact
483e3c77e31SWarner Losh.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
4846a3877a0SWarner Losh.It Li nvme Ta Li controller Ta Li SMART_ERROR Ta
4856a3877a0SWarner LoshA SMART Critical Warning State change has happened.
4866a3877a0SWarner Losh$state has a hex bitmask of the bits that changed, as defined
4876a3877a0SWarner Loshin the NVMe Standard for Critical Warning field of log page 2
4886a3877a0SWarner Losh.Dq SMART / Health Information Log :
4896a3877a0SWarner Losh.Bl -column "Bit Value" "Meaning" -compact
4906a3877a0SWarner Losh.Sy "Bit Value" Ta Sy "Meaning"
4916a3877a0SWarner Losh.It 0x1 Ta Spare capacity below threshold
4926a3877a0SWarner Losh.It 0x2 Ta Temperature outside acceptable range
4936a3877a0SWarner Losh.It 0x4 Ta Reliability of media degraded
4946a3877a0SWarner Losh.It 0x8 Ta Media placed into read-only mode
4956a3877a0SWarner Losh.It 0x10 Ta Volatime memory backup failure
4966a3877a0SWarner Losh.It 0x20 Ta Persistent memrory read-only or degraded
4976a3877a0SWarner Losh.El
4986a3877a0SWarner Losh.It Li nvme Ta Li controller Ta Li RESET Ta
4996a3877a0SWarner LoshA controller reset event has happened.
5006a3877a0SWarner Losh$event is one of
5016a3877a0SWarner Losh.Dq start ,
5026a3877a0SWarner Losh.Dq success ,
5036a3877a0SWarner Loshand
5046a3877a0SWarner Losh.Dq timed_out
5056a3877a0SWarner Loshrepresenting the start of a controller reset, the successful completion of a
5066a3877a0SWarner Loshcontroller reset, and a timeout while waiting for the controller to reset
5076a3877a0SWarner Loshrespectively.
5086a3877a0SWarner Losh.El
5096a3877a0SWarner Losh.Pp
5106a3877a0SWarner Losh.Bl -column "System" "Subsystem" "1234567" -compact
5116a3877a0SWarner Losh.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
512428668ccSWarner Losh.It Li PMU Ta Ta Ta
513428668ccSWarner LoshNotification of events from various types of Power Management Units.
514428668ccSWarner Losh.It Li PMU Ta Li "AC" Ta Ta
515428668ccSWarner LoshNotifications of AC power related events.
516428668ccSWarner Losh.It Li PMU Ta Li "AC" Ta Li overvoltage Ta
517346da457SWarner LoshAn over-voltage condition was detected on the AC power line.
518428668ccSWarner Losh.It Li PMU Ta Li "AC" Ta Li plugged Ta
519428668ccSWarner LoshPower has been applied to the AC power line.
520428668ccSWarner Losh.It Li PMU Ta Li "AC" Ta Li unplugged Ta
521428668ccSWarner LoshPower has been removed from the AC power line.
522428668ccSWarner Losh.It Li PMU Ta Li Battery Ta Ta
523428668ccSWarner Losh.It Li PMU Ta Li Battery Ta absent Ta
524428668ccSWarner LoshBattery is no longer absent.
525428668ccSWarner Losh.It Li PMU Ta Li Battery Ta charged Ta
526428668ccSWarner LoshThe battery has become charged.
527428668ccSWarner Losh.It Li PMU Ta Li Battery Ta charging Ta
528428668ccSWarner LoshThe battery has started charging.
529428668ccSWarner Losh.It Li PMU Ta Li Battery Ta disconnected Ta
530428668ccSWarner LoshThe battery has been disconnected.
531428668ccSWarner Losh.It Li PMU Ta Li Battery Ta high-temp Ta
532428668ccSWarner LoshThe battery reported a temperature over the limit.
533428668ccSWarner Losh.It Li PMU Ta Li Battery Ta low-temp Ta
534428668ccSWarner LoshThe battery reported a temperature under the limit.
535428668ccSWarner Losh.It Li PMU Ta Li Battery Ta plugged Ta
536428668ccSWarner LoshThe battery has become plugged (eg connected).
537428668ccSWarner Losh.It Li PMU Ta Li Battery Ta shutdown-threshold Ta
538428668ccSWarner LoshThe power in the battery has fallen below the shutdown threshold.
539428668ccSWarner Losh.It Li PMU Ta Li Battery Ta warning-threshold Ta
540428668ccSWarner LoshThe power in the battery has fallen below the warn the user threshold.
541428668ccSWarner Losh.It Li PMU Ta Li Button Ta pressed Ta
542428668ccSWarner LoshA button on a
543428668ccSWarner Losh.Xr adb 4
544428668ccSWarner Loshor
545428668ccSWarner Losh.Xr pmu 4
546428668ccSWarner Loshhas been pressed.
547428668ccSWarner Losh.It Li PMU Ta Li keys Ta Ta
548428668ccSWarner LoshOne of the keys on the
549428668ccSWarner Losh.Xr adb 4
550428668ccSWarner Loshkeyboard has been pressed.
551428668ccSWarner Losh.It Li PMU Ta Li keys Ta brightness Ta
552428668ccSWarner LoshA brightness level change has been requested.
553428668ccSWarner LoshDirection is in the $notify variable.
554428668ccSWarner Losh.It Li PMU Ta Li keys Ta mute Ta
555428668ccSWarner LoshThe mute key
556428668ccSWarner Losh.It Li PMU Ta Li keys Ta volume Ta
557428668ccSWarner LoshA volume level change has been requested.
558428668ccSWarner LoshDirection is in the $notify variable.
559428668ccSWarner Losh.It Li PMU Ta Li keys Ta eject Ta
560428668ccSWarner LoshAn ejection has been requested.
561428668ccSWarner Losh.It Li PMU Ta Li lid Ta close Ta
562428668ccSWarner LoshThe
563428668ccSWarner Losh.Xr pmc 4
564428668ccSWarner Loshdevice has detected the lid closing.
565428668ccSWarner Losh.It Li PMU Ta Li lid Ta open Ta
566428668ccSWarner LoshThe
567428668ccSWarner Losh.Xr pmc 4
568428668ccSWarner Loshdevice has detected the lid openinging.
569428668ccSWarner Losh.It Li PMU Ta Li POWER Ta ACLINE Ta
570428668ccSWarner LoshThe
571428668ccSWarner Losh.Xr pmc 4
572328ebd46SGordon Berglingdevice has detected an AC line state ($notify=0x00 is offline, 0x01 is online).
573428668ccSWarner Losh.It Li PMU Ta Li USB Ta overvoltage Ta
574428668ccSWarner LoshAn over-voltage condition on the power lines for the USB power pins.
575428668ccSWarner Losh.It Li PMU Ta Li USB Ta plugged Ta
576428668ccSWarner LoshA device has been plugged into a USB device.
577428668ccSWarner Losh.It Li PMU Ta Li USB Ta undervoltage Ta
578428668ccSWarner LoshAn under-voltage condition on the power lines for the USB power pins.
579428668ccSWarner Losh.It Li PMU Ta Li USB Ta unplugged Ta
580428668ccSWarner LoshA device has been unplugged into a USB device.
581428668ccSWarner Losh.El
582428668ccSWarner Losh.Pp
583428668ccSWarner Losh.Bl -column "System" "Subsystem" "1234567" -compact
584428668ccSWarner Losh.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
585e3c77e31SWarner Losh.It Li RCTL Ta Ta Ta
58628616c3cSEdward Tomasz NapieralaEvents related to the
58728616c3cSEdward Tomasz Napierala.Xr rctl 8
58828616c3cSEdward Tomasz Napieralaframework.
589e3c77e31SWarner Losh.It Li RCTL Ta Li rule Ta Li matched Ta
59028616c3cSEdward Tomasz NapieralaA rule with action specified as "devctl" was triggered.
59128616c3cSEdward Tomasz Napierala.El
59228616c3cSEdward Tomasz Napierala.Pp
593e3c77e31SWarner Losh.Bl -column "System" "Subsystem" "1234567" -compact
594e3c77e31SWarner Losh.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
595e3c77e31SWarner Losh.It Li USB Ta Ta Ta
596139e9ad4SAndrew ThompsonEvents related to the USB subsystem.
597e3c77e31SWarner Losh.It Li USB Ta Li DEVICE Ta Li ATTACH Ta
598139e9ad4SAndrew ThompsonUSB device is attached to the system.
599e3c77e31SWarner Losh.It Li USB Ta Li DEVICE Ta Li DETACH Ta
600e3c77e31SWarner LoshUSB device is detached to the system.
601e3c77e31SWarner Losh.It Li USB Ta Li INTERFACE Ta Li ATTACH Ta
602c2025a76SJoel DahlUSB interface is attached to a device.
603e3c77e31SWarner Losh.It Li USB Ta Li INTERFACE Ta Li DETACH Ta
604139e9ad4SAndrew ThompsonUSB interface is detached from a device.
605139e9ad4SAndrew Thompson.El
606fe9a7607SSergey Kandaurov.Pp
60797f74490SWarner Losh.Bl -column "System" "Subsystem" "1234567" -compact
60897f74490SWarner Losh.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
609350711aaSWarner Losh.It Li VFS Ta Ta Ta
610350711aaSWarner LoshEvents from the vfs system.
611350711aaSWarner Losh.It Li VFS Ta Li FS Ta Ta
612350711aaSWarner LoshEvents that change what is mounted to the system.
613350711aaSWarner Losh.It Li VFS Ta Li FS Ta Li MOUNT Ta
614350711aaSWarner LoshNotification of a filesystem is mounted for the first time.
615350711aaSWarner Losh.It Li VFS Ta Li FS Ta Li REMOUNT Ta
616350711aaSWarner LoshNotification of a filesystem is remounted (whether or not the options actually change).
617350711aaSWarner Losh.It Li VFS Ta Li FS Ta Li UNMOUNT Ta
618350711aaSWarner LoshNotification of a filesystem being unmounted.
619350711aaSWarner Losh.El
620350711aaSWarner Losh.Pp
621350711aaSWarner Losh.Bl -column "System" "Subsystem" "1234567" -compact
622350711aaSWarner Losh.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
6234ac3d08aSWarner Losh.It Li VT Ta BELL Ta RING Ta
62480f21bb0SWarner LoshNotification that the console bell has rung.
6254ac3d08aSWarner LoshSee
6264ac3d08aSWarner Losh.Xr vt 4
6274ac3d08aSWarner Loshfor details.
6284ac3d08aSWarner Losh.El
6294ac3d08aSWarner Losh.Pp
6304ac3d08aSWarner Losh.Bl -column "System" "Subsystem" "1234567" -compact
6314ac3d08aSWarner Losh.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
63297f74490SWarner Losh.It Li ZFS Ta ZFS Ta Ta
63397f74490SWarner LoshEvents about the ZFS subsystem.
63497f74490SWarner LoshSee
63597f74490SWarner Losh.Xr zfsd 8
63697f74490SWarner Loshand
63797f74490SWarner Losh.Pa /etc/devd/zfs.conf
63897f74490SWarner Loshfor details.
63997f74490SWarner Losh.El
64097f74490SWarner Losh.Pp
641e3c77e31SWarner Losh.\"
642e3c77e31SWarner Losh.\" End of tables
643e3c77e31SWarner Losh.\"
644e0c10c6eSJohn-Mark GurneyA link state change to UP on the interface
645ebd1e4e6SRuslan Ermilov.Dq Li fxp0
646e0c10c6eSJohn-Mark Gurneywould result in the following notify event:
647e0c10c6eSJohn-Mark Gurney.Bd -literal -offset indent
648e3c77e31SWarner Loshsystem=IFNET subsystem=fxp0 type=LINK_UP
649e0c10c6eSJohn-Mark Gurney.Ed
650e0c10c6eSJohn-Mark Gurney.Pp
651e0c10c6eSJohn-Mark GurneyAn AC line state change to
652e0c10c6eSJohn-Mark Gurney.Dq offline
653e0c10c6eSJohn-Mark Gurneywould result in the following event:
654e0c10c6eSJohn-Mark Gurney.Bd -literal -offset indent
655e3c77e31SWarner Loshsystem=ACPI subsystem=ACAD notify=0x00
656e0c10c6eSJohn-Mark Gurney.Ed
657e0c10c6eSJohn-Mark Gurney.Ss Comments
6583054f218SWarner LoshComments may appear anywhere that whitespace may appear in a
659f1e65894SRuslan Ermilovconfiguration file.
660f1e65894SRuslan ErmilovTo appeal to programmers of all kinds, they can
661f1e65894SRuslan Ermilovbe written in C, C++, or shell/Perl constructs.
662e530e044SWarner Losh.Pp
663e530e044SWarner LoshC-style comments start with the two characters
664f1e65894SRuslan Ermilov.Ql /*
665e530e044SWarner Losh(slash, star) and end with
666f1e65894SRuslan Ermilov.Ql */
667e530e044SWarner Losh(star, slash).
668e530e044SWarner LoshBecause they are completely delimited with these characters,
669e530e044SWarner Loshthey can be used to comment only a portion of a line or to span
670e530e044SWarner Loshmultiple lines.
671e530e044SWarner Losh.Pp
672f1e65894SRuslan ErmilovC-style comments cannot be nested.
673f1e65894SRuslan ErmilovFor example, the following is
674e530e044SWarner Loshnot valid because the entire comment ends with the first
675f1e65894SRuslan Ermilov.Ql */ :
676e530e044SWarner Losh.Bd -literal -offset indent
677e530e044SWarner Losh/* This is the start of a comment.
678e530e044SWarner Losh   This is still part of the comment.
679e530e044SWarner Losh/* This is an incorrect attempt at nesting a comment. */
680e530e044SWarner Losh   This is no longer in any comment. */
681e530e044SWarner Losh.Ed
682e530e044SWarner Losh.Pp
683e530e044SWarner LoshC++-style comments start with the two characters
684f1e65894SRuslan Ermilov.Ql //
685e530e044SWarner Losh(slash, slash) and continue to the end of the physical line.
686e530e044SWarner LoshThey cannot be continued across multiple physical lines; to have
687e530e044SWarner Loshone logical comment span multiple lines, each line must use the
688ebd1e4e6SRuslan Ermilov.Ql //
689f1e65894SRuslan Ermilovpair.
690f1e65894SRuslan ErmilovFor example:
691e530e044SWarner Losh.Bd -literal -offset indent
692e530e044SWarner Losh// This is the start of a comment.  The next line
693e530e044SWarner Losh// is a new comment, even though it is logically
694e530e044SWarner Losh// part of the previous comment.
695e530e044SWarner Losh.Ed
696eb93b08fSWarner Losh.Ss Notes on Variable Expansion
697*1fc7922fSJoerg WunschVariables are expanded by preceding them by a
698*1fc7922fSJoerg Wunsch.Dq $
699*1fc7922fSJoerg Wunschsign.
700*1fc7922fSJoerg WunschAny text immediately following that sign, starting with a letter, a minus sign
701*1fc7922fSJoerg Wunsch.Dq - ,
702*1fc7922fSJoerg Wunschan underscore
703*1fc7922fSJoerg Wunsch.Dq _ ,
704*1fc7922fSJoerg Wunschor an asterisk
705*1fc7922fSJoerg Wunsch.Dq *
706*1fc7922fSJoerg Wunschis considered an internal variable, and expanded accordingly.
707*1fc7922fSJoerg WunschIf that variable does not exist, it silently expands to an empty string.
708*1fc7922fSJoerg WunschConsequently, if the intention is to pass a
709*1fc7922fSJoerg Wunsch.Xr sh 1
710*1fc7922fSJoerg Wunschvariable, it must be surrounded by braces to prevent it from being
711*1fc7922fSJoerg Wunschconsidered an internal variable.
712*1fc7922fSJoerg Wunsch.Pp
713*1fc7922fSJoerg WunschSee
714*1fc7922fSJoerg Wunsch.Sx EXAMPLES
715*1fc7922fSJoerg Wunschfor a detailed example.
716*1fc7922fSJoerg Wunsch.Pp
717eb93b08fSWarner LoshTo prevent issues with special shell characters, the following happens for each
718eb93b08fSWarner Loshvariable
719eb93b08fSWarner Losh.Ic $foo .
720eb93b08fSWarner Losh.Bl -enum
721eb93b08fSWarner Losh.It
722eb93b08fSWarner LoshThe characters
723eb93b08fSWarner Losh.Dq $'
724eb93b08fSWarner Loshare inserted.
725eb93b08fSWarner Losh.It
726eb93b08fSWarner LoshThe string
727eb93b08fSWarner Losh.Dq $foo
728eb93b08fSWarner Loshis removed.
729eb93b08fSWarner Losh.It
730eb93b08fSWarner LoshThe value of the
731eb93b08fSWarner Losh.Ic foo
732eb93b08fSWarner Loshvariable is inserted into the buffer with all single quote characters
733eb93b08fSWarner Loshprefixed by a backslash.
734*1fc7922fSJoerg Wunsch.It
735*1fc7922fSJoerg WunschA final
736*1fc7922fSJoerg Wunsch.Dq '
737*1fc7922fSJoerg Wunschis inserted.
738eb93b08fSWarner Losh.El
739eb93b08fSWarner Losh.Pp
740eb93b08fSWarner LoshSee
741eb93b08fSWarner Losh.Xr sh 1
742eb93b08fSWarner Loshfor what this construct means.
743eb93b08fSWarner LoshIt is safe in all context, except one: inside single quotes.
744eb93b08fSWarner LoshIf foo=meta and bar=var, then a rule like the following:
745eb93b08fSWarner Losh.Bd -literal -offset indent -compact
746eb93b08fSWarner Loshaction "echo '$foo $bar'";
747eb93b08fSWarner Losh.Ed
748eb93b08fSWarner Loshwill be presented to the shell via
749eb93b08fSWarner Losh.Xr system 3
750eb93b08fSWarner Loshas
751eb93b08fSWarner Losh.Bd -literal -offset indent -compact
752eb93b08fSWarner Loshecho '$'meta' $'var''
753eb93b08fSWarner Losh.Ed
754eb93b08fSWarner Loshwhich produces the following output:
755eb93b08fSWarner Losh.Bd -literal -offset indent -compact
756eb93b08fSWarner Losh$meta $var
757eb93b08fSWarner Losh.Ed
758eb93b08fSWarner Loshas its output.
759eb93b08fSWarner LoshThis is an unanticipated result.
760eb93b08fSWarner LoshA future version of this software will change this behavior.
761eb93b08fSWarner LoshUsers are discouraged from using single quotes inside
762eb93b08fSWarner Losh.Ic action
763eb93b08fSWarner Loshvalue without due care.
764eb93b08fSWarner Losh.Pp
765eb93b08fSWarner LoshThe above should be written as
766eb93b08fSWarner Losh.Bd -literal -offset indent -compact
767eb93b08fSWarner Loshaction "echo $foo' '$bar"
768eb93b08fSWarner Losh.Ed
769eb93b08fSWarner Loshto produce a single argument to echo.
770eb93b08fSWarner LoshGiven the above expansion, juxtaposing bare variables with
771eb93b08fSWarner Loshsingle quote expressions will produce the right output,
772eb93b08fSWarner Loshregardless of the value of the variable.
773ebd1e4e6SRuslan Ermilov.Sh FILES
774ebd1e4e6SRuslan Ermilov.Bl -tag -width ".Pa /etc/devd.conf" -compact
775ebd1e4e6SRuslan Ermilov.It Pa /etc/devd.conf
776ebd1e4e6SRuslan ErmilovThe
777ebd1e4e6SRuslan Ermilov.Xr devd 8
778ebd1e4e6SRuslan Ermilovconfiguration file.
7797c6af209SWarner Losh.It Pa /etc/devd
7807c6af209SWarner LoshA directory that
7817c6af209SWarner Losh.Nm devd
7827c6af209SWarner Loshsearches for additional configuration files.
7837c6af209SWarner Losh.It Pa /usr/local/etc/devd
7847c6af209SWarner LoshA directory that
7857c6af209SWarner Losh.Nm devd
7867c6af209SWarner Loshsearches for additional configuration files.
787ebd1e4e6SRuslan Ermilov.El
788e0c10c6eSJohn-Mark Gurney.Sh EXAMPLES
789e0c10c6eSJohn-Mark Gurney.Bd -literal
790e0c10c6eSJohn-Mark Gurney#
791e0c10c6eSJohn-Mark Gurney# This will catch link down events on the interfaces fxp0 and ath0
792e0c10c6eSJohn-Mark Gurney#
793e0c10c6eSJohn-Mark Gurneynotify 0 {
794e0c10c6eSJohn-Mark Gurney	match "system"			"IFNET";
795e0c10c6eSJohn-Mark Gurney	match "subsystem"		"(fxp0|ath0)";
796e0c10c6eSJohn-Mark Gurney	match "type"			"LINK_DOWN";
797e0c10c6eSJohn-Mark Gurney	action "logger $subsystem is DOWN";
798e0c10c6eSJohn-Mark Gurney};
799e0c10c6eSJohn-Mark Gurney
800e0c10c6eSJohn-Mark Gurney#
801e0c10c6eSJohn-Mark Gurney# Match lid open/close events
802e0c10c6eSJohn-Mark Gurney# These can be combined to a single event, by passing the
803e0c10c6eSJohn-Mark Gurney# value of $notify to the external script.
804e0c10c6eSJohn-Mark Gurney#
805e0c10c6eSJohn-Mark Gurneynotify 0 {
806e0c10c6eSJohn-Mark Gurney	match "system"			"ACPI";
807e0c10c6eSJohn-Mark Gurney	match "subsystem"		"Lid";
808e0c10c6eSJohn-Mark Gurney	match "notify"			"0x00";
809e0c10c6eSJohn-Mark Gurney	action "logger Lid closed, we can sleep now!";
810e0c10c6eSJohn-Mark Gurney};
811e0c10c6eSJohn-Mark Gurney
812e0c10c6eSJohn-Mark Gurneynotify 0 {
813e0c10c6eSJohn-Mark Gurney	match "system"			"ACPI";
814e0c10c6eSJohn-Mark Gurney	match "subsystem"		"Lid";
815e0c10c6eSJohn-Mark Gurney	match "notify"			"0x01";
816e0c10c6eSJohn-Mark Gurney	action "logger Lid opened, the sleeper must awaken!";
817e0c10c6eSJohn-Mark Gurney};
818e0c10c6eSJohn-Mark Gurney
819e0c10c6eSJohn-Mark Gurney#
820139e9ad4SAndrew Thompson# Match a USB device type
821139e9ad4SAndrew Thompson#
822139e9ad4SAndrew Thompsonnotify 0 {
823139e9ad4SAndrew Thompson	match "system"			"USB";
824139e9ad4SAndrew Thompson	match "subsystem"		"INTERFACE";
825139e9ad4SAndrew Thompson	match "type"			"ATTACH";
826139e9ad4SAndrew Thompson	match "intclass"		"0x0e";
827139e9ad4SAndrew Thompson	action "logger USB video device attached";
828139e9ad4SAndrew Thompson};
829139e9ad4SAndrew Thompson
830139e9ad4SAndrew Thompson#
83131178c8aSWarner Losh# Try to configure ath and iwn devices with pccard_ether
832e0c10c6eSJohn-Mark Gurney# as they are attached.
833e0c10c6eSJohn-Mark Gurney#
834e0c10c6eSJohn-Mark Gurneyattach 0 {
83531178c8aSWarner Losh        device-name "(ath|iwn)[0-9]+";
836e0c10c6eSJohn-Mark Gurney        action "/etc/pccard_ether $device-name start";
837e0c10c6eSJohn-Mark Gurney};
838e0c10c6eSJohn-Mark Gurney
839e0c10c6eSJohn-Mark Gurney#
84031178c8aSWarner Losh# Stop ath and iwn devices as they are detached from
841e0c10c6eSJohn-Mark Gurney# the system.
842e0c10c6eSJohn-Mark Gurney#
843e0c10c6eSJohn-Mark Gurneydetach 0 {
84431178c8aSWarner Losh        device-name "(ath|iwn)[0-9]+";
845e0c10c6eSJohn-Mark Gurney        action "/etc/pccard_ether $device-name stop";
846e0c10c6eSJohn-Mark Gurney};
847e0c10c6eSJohn-Mark Gurney.Ed
848e0c10c6eSJohn-Mark Gurney.Pp
849*1fc7922fSJoerg WunschThe following example illustrates the difference betwen internal and shell variables:
850*1fc7922fSJoerg Wunsch.Bd -literal
851*1fc7922fSJoerg Wunschattach 20 {
852*1fc7922fSJoerg Wunsch        device-name             "umodem[0-9]+";
853*1fc7922fSJoerg Wunsch        match "vendor"          "0x2047";
854*1fc7922fSJoerg Wunsch        match "product"         "0x001(0|3|4)";
855*1fc7922fSJoerg Wunsch        match "interface"       "0";
856*1fc7922fSJoerg Wunsch        action "cd /dev; p=$product; dn=$device-name; \\
857*1fc7922fSJoerg Wunsch                un=$(sysctl -n dev.umodem.${dn#umodem}.ttyname); \\
858*1fc7922fSJoerg Wunsch                chmod 666 cua${un}; ln -sf cua${un} mspfet${p#0x}";
859*1fc7922fSJoerg Wunsch};
860*1fc7922fSJoerg Wunsch.Ed
861*1fc7922fSJoerg Wunsch.Pp
862*1fc7922fSJoerg Wunsch.Dq product ,
863*1fc7922fSJoerg Wunschand
864*1fc7922fSJoerg Wunsch.Dq device-name
865*1fc7922fSJoerg Wunschare internal variables.
866*1fc7922fSJoerg WunschTheir contents are initially assigned to shell variables
867*1fc7922fSJoerg Wunsch.Dq p ,
868*1fc7922fSJoerg Wunschand
869*1fc7922fSJoerg Wunsch.Dq dn ,
870*1fc7922fSJoerg Wunschrespectively.
871*1fc7922fSJoerg WunschThen, variable
872*1fc7922fSJoerg Wunsch.Dq dn
873*1fc7922fSJoerg Wunschis used inside a shell command substitution, assigning to shell variable
874*1fc7922fSJoerg Wunsch.Dq un .
875*1fc7922fSJoerg WunschFinally, this shell variable is used in two other shell statements, where
876*1fc7922fSJoerg Wunschit needs to be wrapped in braces in order to prevent it from being
877*1fc7922fSJoerg Wunschconsidered in internal variable to
878*1fc7922fSJoerg Wunsch.Nm devd .
879*1fc7922fSJoerg Wunsch.Pp
880e0c10c6eSJohn-Mark GurneyThe installed
881e0c10c6eSJohn-Mark Gurney.Pa /etc/devd.conf
882e0c10c6eSJohn-Mark Gurneyhas many additional examples.
883e530e044SWarner Losh.Sh SEE ALSO
884da8fc885SSevan Janiyan.Xr cam 4 ,
88501cd0a97SMaxim Konovalov.Xr coretemp 4 ,
8862e170559SKonstantin Belousov.Xr devfs 5 ,
88747483045SMaxim Konovalov.Xr re_format 7 ,
888da8fc885SSevan Janiyan.Xr devd 8
889226f43e7SGordon Bergling.Sh BUGS
890226f43e7SGordon BerglingThe variable expansion's interaction with single quotes is
891226f43e7SGordon Berglingsuboptimal and surprising.
892