]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sbin/devd/devd.conf.5
MFC r364725, r364726
[FreeBSD/FreeBSD.git] / sbin / devd / devd.conf.5
1 .\"
2 .\" Copyright (c) 2002 M. Warner Losh
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. The name of the author may not be used to endorse or promote products
11 .\"    derived from this software without specific prior written permission.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .\" The section on comments was taken from named.conf.5, which has the
28 .\" following copyright:
29 .\" Copyright (c) 1999-2000 by Internet Software Consortium
30 .\"
31 .\" Permission to use, copy, modify, and distribute this software for any
32 .\" purpose with or without fee is hereby granted, provided that the above
33 .\" copyright notice and this permission notice appear in all copies.
34 .\"
35 .\" THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
36 .\" ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
37 .\" OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
38 .\" CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
39 .\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
40 .\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
41 .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
42 .\" SOFTWARE.
43 .\"
44 .Dd August 18, 2020
45 .Dt DEVD.CONF 5
46 .Os
47 .Sh NAME
48 .Nm devd.conf
49 .Nd configuration file for
50 .Xr devd 8
51 .Sh DESCRIPTION
52 .Ss General Syntax
53 A
54 .Xr devd 8
55 configuration consists of two general features, statements
56 and comments.
57 All statements end with a semicolon.
58 Many statements can contain substatements, which are also
59 terminated with a semicolon.
60 .Pp
61 The following statements are supported:
62 .Bl -tag -width ".Ic options"
63 .It Ic attach
64 Specifies various matching criteria and actions to perform when
65 a newly attached device matches said criteria.
66 .It Ic detach
67 Specifies various matching criteria and actions to perform when
68 a newly detached device matches said criteria.
69 .It Ic nomatch
70 Specifies various matching criteria and actions to perform when
71 no device driver currently loaded in the kernel claims a (new)
72 device.
73 .It Ic notify
74 Specifies various matching criteria and actions to perform when the kernel
75 sends an event notification to userland.
76 .It Ic options
77 Specifies various options and parameters for the operation of
78 .Xr devd 8 .
79 .El
80 .Pp
81 Statements may occur in any order in the configuration file, and may be
82 repeated as often as required.
83 Further details on the syntax and meaning of each statement and their
84 substatements are explained below.
85 .Pp
86 Each statement, except
87 .Ic options
88 has a priority (an arbitrary number) associated with it, where
89 .Ql 0
90 is defined as the lowest priority.
91 If two statements match the same event, only the action of the statement with
92 highest priority will be executed.
93 In this way generic statements can be overridden for devices or
94 notifications that require special attention.
95 .Pp
96 The general syntax of a statement is:
97 .Bd -literal -offset indent
98 statement priority {
99         substatement "value";
100         ...
101         substatement "value";
102 };
103 .Ed
104 .Ss Sub-statements
105 The following sub-statements are supported within the
106 .Ic options
107 statement.
108 .Bl -tag -width ".Ic directory"
109 .It Ic directory Qq Ar /some/path ;
110 Adds the given directory to the list of directories from which
111 .Xr devd 8
112 will read all files named "*.conf" as further
113 configuration files.
114 Any number of
115 .Ic directory
116 statements can be used.
117 .It Ic pid-file Qq Pa /var/run/devd.pid ;
118 Specifies PID file.
119 .It Ic set Ar regexp-name Qq Ar (some|regexp) ;
120 Creates a regular expression and assigns it to the variable
121 .Ar regexp-name .
122 The variable is available throughout the rest of
123 the configuration file.
124 If the string begins with
125 .Ql \&! ,
126 it matches if the regular expression formed by the rest of the string
127 does not match.
128 All regular expressions have an implicit
129 .Ql ^$
130 around them.
131 .El
132 .Pp
133 The following sub-statements are supported within the
134 .Ic attach
135 and
136 .Ic detach
137 statements.
138 .Bl -tag -width ".Ic directory"
139 .It Ic action Qq Ar command ;
140 Command to execute upon a successful match.
141 Example
142 .Dq Li "/etc/pccard_ether $device-name start" .
143 .It Ic class Qq Ar string ;
144 This is shorthand for
145 .Dq Ic match Qo Li class Qc Qq Ar string .
146 .It Ic device-name Qq string ;
147 This is shorthand for
148 .Dq Ic match Qo Li device-name Qc Qq Ar string .
149 This matches a device named
150 .Ar string ,
151 which is allowed to be a regular expression or a variable previously created
152 containing a regular expression.
153 The
154 .Dq Li device-name
155 variable
156 is available for later use with the
157 .Ic action
158 statement.
159 .It Ic match Qo Ar variable Qc Qq Ar value ;
160 Matches the content of
161 .Ar value
162 against
163 .Ar variable ;
164 the content of
165 .Ar value
166 may be a regular expression.
167 Not required during
168 .Ic attach
169 nor
170 .Ic detach
171 events since the
172 .Ic device-name
173 statement takes care of all device matching.
174 For a partial list of variables, see below.
175 .It Ic media-type Qq Ar string ;
176 For network devices,
177 .Ic media-type
178 will match devices that have the given media type.
179 Valid media types are:
180 .Dq Li Ethernet ,
181 .Dq Li Tokenring ,
182 .Dq Li FDDI ,
183 .Dq Li 802.11 ,
184 and
185 .Dq Li ATM .
186 .It Ic subdevice Qq Ar string ;
187 This is shorthand for
188 .Dq Ic match Qo Li subdevice Qc Qq Ar string .
189 .El
190 .Pp
191 The following sub-statements are supported within the
192 .Ic nomatch
193 statement.
194 .Bl -tag -width ".Ic directory"
195 .It Ic action Qq Ar command ;
196 Same as above.
197 .It Ic match Qo Ar variable Qc Qq Ar value ;
198 Matches the content of
199 .Ar value
200 against
201 .Ar variable ;
202 the content of
203 .Ar value
204 may be a regular expression.
205 For a partial list of variables, see below.
206 .El
207 .Pp
208 The following sub-statements are supported within the
209 .Ic notify
210 statement.
211 The
212 .Dq Li notify
213 variable is available inside this statement and contains, a value, depending
214 on which system and subsystem that delivered the event.
215 .Bl -tag -width ".Ic directory"
216 .It Ic action Qq Ar command ;
217 Command to execute upon a successful match.
218 Example
219 .Dq Li "/etc/rc.d/power_profile $notify" .
220 .It Ic match Qo Ar system | subsystem | type | notify Qc Qq Ar value ;
221 Any number of
222 .Ic match
223 statements can exist within a
224 .Ic notify
225 statement;
226 .Ar value
227 can be either a fixed string or a regular expression.
228 Below is a list of available systems, subsystems, and types.
229 .It Ic media-type Qq Ar string ;
230 See above.
231 .El
232 .Ss Variables that can be used with the match statement
233 A partial list of variables and their possible values that can be used together
234 with the
235 .Ic match
236 statement.
237 The variables are published by the bus based on characteristics of the device
238 that generated the event (for device events).
239 Variables for other classes of events are dependent on those events.
240 .Pp
241 .Bl -tag -width ".Li manufacturer" -compact
242 .It Ic Variable
243 .Ic Description
244 .It Li *
245 The entire message from the current event.
246 .It Li _
247 The entire message from the current event, after the initial type character.
248 .It Li timestamp
249 The time this event was processed, in seconds since 1970 dot fraction.
250 .It Li bus
251 Device name of parent bus.
252 .It Li cdev
253 Device node path if one is created by the
254 .Xr devfs 5
255 filesystem.
256 .It Li class
257 Device class.
258 .It Li comm
259 Executable name (kernel).
260 .It Li core
261 Path to core file (kernel).
262 .It Li device
263 Device ID.
264 .It Li devclass
265 Device Class (USB).
266 .It Li devsubclass
267 Device Sub-class (USB).
268 .It Li device-name
269 Name of attached/detached device.
270 .It Li endpoints
271 Endpoint count (USB).
272 .It Li function
273 Card functions.
274 .It Li interface
275 Interface ID (USB).
276 .It Li intclass
277 Interface Class (USB).
278 .It Li intprotocol
279 Interface Protocol (USB).
280 .It Li intsubclass
281 Interface Sub-class (USB).
282 .It Li jail
283 Jail name for the process triggering the rule (RCTL).
284 .It Li mode
285 Peripheral mode (USB).
286 .It Li notify
287 Match the value of the
288 .Dq Li notify
289 variable.
290 .It Li parent
291 Parent device.
292 .It Li pid
293 PID of the process triggering the rule (RCTL).
294 .It Li port
295 Hub port number (USB).
296 .It Li product
297 Product ID (USB).
298 .It Li release
299 Hardware revision (USB).
300 .It Li ruid
301 Real UID of the process triggering the rule (RCTL).
302 .It Li rule
303 Rule (RCTL).
304 .It Li sernum
305 Serial Number (USB).
306 .It Li slot
307 Card slot.
308 .It Li subvendor
309 Sub-vendor ID (PCI).
310 .It Li subdevice
311 Sub-device ID (PCI).
312 .It Li subsystem
313 Matches a subsystem of a system, see below.
314 .It Li system
315 Matches a system type, see below.
316 .It Li type
317 Type of notification, see below.
318 .It Li vendor
319 Vendor ID.
320 .El
321 .Ss Notify matching
322 A partial list of systems, subsystems, and types used within the
323 .Ic notify
324 mechanism.
325 .\"
326 .\" Please keep these tables sorted. Also, please use the same parameters
327 .\" for each of the tables so that things line up in columns nicely.
328 .\" Please do not omit the type column for notifiers that omit it.
329 .Pp
330 .Bl -column "System" "Subsystem" "1234567" -compact
331 .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
332 .It Li ACPI Ta Ta Ta
333 Events related to the ACPI Subsystem.
334 .It Li ACPI Ta Li ACAD Ta Ta
335 AC line state ($notify=0x00 is offline, 0x01 is online).
336 .It Li ACPI Ta Li Button Ta Ta
337 Button state ($notify=0x00 is power, 0x01 is sleep).
338 .It Li ACPI Ta Li CMBAT Ta Ta
339 Battery events.
340 .It Li ACPI Ta Li Dock Ta Ta
341 Dock state ($notify=0x00 is undocked, 0x01 is docked).
342 .It Li ACPI Ta Li Lid Ta Ta
343 Lid state ($notify=0x00 is closed, 0x01 is open).
344 .It Li ACPI Ta Li PROCESSOR Ta Ta
345 Processor state/configuration ($notify=0x81 is a change in available Cx states).
346 .It Li ACPI Ta Li Resume Ta Ta
347 Resume notification.
348 .It Li ACPI Ta Li Suspend Ta Ta
349 Suspend notification.
350 .It Li ACPI Ta Li Thermal Ta Ta
351 Thermal zone events.
352 .El
353 .Pp
354 .Bl -column "System" "Subsystem" "1234567" -compact
355 .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
356 .It Li AEON Ta Li power Ta Li press Ta
357 The power button on an Amiga has been pressed.
358 .El
359 .Pp
360 .Bl -column "System" "Subsystem" "1234567" -compact
361 .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
362 .It Li CAM Ta Ta Ta
363 Events related to the
364 .Xr cam 4
365 system.
366 .It Li CAM Ta Li periph Ta Ta
367 Events related to peripheral devices.
368 .It Li CAM Ta Li periph Ta Li error Ta
369 Generic errors.
370 .It Li CAM Ta Li periph Ta Li timeout Ta
371 Command timeouts.
372 .El
373 .Pp
374 .Bl -column "System" "Subsystem" "1234567" -compact
375 .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
376 .It Li CARP Ta Ta Ta
377 Events related to the
378 .Xr carp 4
379 protocol.
380 .It CARP Ta Ar vhid@inet Ta Ta
381 The
382 .Dq subsystem
383 contains the actual CARP vhid and the name of the network interface
384 on which the event took place.
385 .It CARP Ta Ar vhid@inet Ta MASTER Ta
386 Node become the master for a virtual host.
387 .It CARP Ta Ar vhid@inet Ta BACKUP Ta
388 Node become the backup for a virtual host.
389 .El
390 .Pp
391 .Bl -column "System" "Subsystem" "1234567" -compact
392 .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
393 .It Li coretemp Ta Ta Ta
394 Events related to the
395 .Xr coretemp 4
396 device.
397 .It Li coretemp Ta Li Thermal Ta Ta
398 Notification that the CPU core has reached critical temperature.
399 .It Li coretemp Ta Li Thermal Ta Li temperature Ta
400 String containing the temperature of the core that has become too hot.
401 .El
402 .Pp
403 .Bl -column "System" "Subsystem" "1234567" -compact
404 .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
405 .It Li IFNET
406 .It Li IFNET Ta Ar inet Ta Ta
407 The
408 .Dq subsystem
409 is the actual name of the network interface on which the event
410 took place.
411 .It Li IFNET Ta Ar inet Ta Li LINK_UP Ta
412 Carrier status changed to UP.
413 .It Li IFNET Ta Ar inet Ta Li LINK_DOWN Ta
414 Carrier status changed to DOWN.
415 .It Li IFNET Ta Ar inet Ta Li ATTACH Ta
416 The network interface is attached to the system.
417 .It Li IFNET Ta Ar inet Ta Li DETACH Ta
418 The network interface is detached from the system.
419 .El
420 .Pp
421 .Bl -column "System" "Subsystem" "1234567" -compact
422 .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
423 .It Li DEVFS
424 .It Li DEVFS Ta Li CDEV Ta Li CREATE Ta
425 The
426 .Xr devfs 5
427 node is created.
428 .It Li DEVFS Ta Li CDEV Ta Li DESTROY Ta
429 The
430 .Xr devfs 5
431 node is destroyed.
432 .El
433 .Pp
434 .Bl -column "System" "Subsystem" "1234567" -compact
435 .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
436 .It Li GEOM Ta Ta Ta
437 Events related to the
438 .Xr geom 4
439 framework.
440 The difference compared to
441 .Li DEVFS
442 is that
443 .Li GEOM
444 only includes disk-like devices.
445 .It Li GEOM Ta Li DEV Ta Li CREATE Ta
446 A
447 .Xr geom 4
448 device node is created.
449 .It Li GEOM Ta Li DEV Ta Li DESTROY Ta
450 A
451 .Xr geom 4
452 device node is destroyed.
453 .It Li GEOM Ta Li DEV Ta Li GEOM::physpath Ta
454 The physical path of a device has changed.
455 .It Li GEOM Ta Li DEV Ta Li GEOM::rotation_rate Ta
456 The rotation rate of the disk has changed.
457 .It Li GEOM Ta Li DEV Ta Li MEDIACHANGE Ta
458 Physical media has changed.
459 .It Li GEOM Ta Li DEV Ta Li SIZECHANGE Ta
460 A
461 .Xr geom 4
462 provider size has changed.
463 .El
464 .Pp
465 .Bl -column "System" "Subsystem" "1234567" -compact
466 .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
467 .It Li kern Ta Li power Ta Li resume Ta
468 Notification that the system has woken from the suspended state.
469 Note: this notification is deprecated and will be removed in
470 .Fx 14.0 .
471 .El
472 .Pp
473 .Pp
474 .Bl -column "System" "Subsystem" "1234567" -compact
475 .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
476 .It Li kernel Ta Li signal Ta Li coredump Ta
477 Notification that a process has crashed and dumped core.
478 .It Li kernel Ta Li power Ta Li resume Ta
479 Notification that the system has woken from the suspended state.
480 .El
481 .Pp
482 .Bl -column "System" "Subsystem" "1234567" -compact
483 .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
484 .It Li PMU Ta Ta Ta
485 Notification of events from various types of Power Management Units.
486 .It Li PMU Ta Li "AC" Ta Ta
487 Notifications of AC power related events.
488 .It Li PMU Ta Li "AC" Ta Li overvoltage Ta
489 An over-voltage condition was detected on the AC power line.
490 .It Li PMU Ta Li "AC" Ta Li plugged Ta
491 Power has been applied to the AC power line.
492 .It Li PMU Ta Li "AC" Ta Li unplugged Ta
493 Power has been removed from the AC power line.
494 .It Li PMU Ta Li Battery Ta Ta
495 .It Li PMU Ta Li Battery Ta absent Ta
496 Battery is no longer absent.
497 .It Li PMU Ta Li Battery Ta charged Ta
498 The battery has become charged.
499 .It Li PMU Ta Li Battery Ta charging Ta
500 The battery has started charging.
501 .It Li PMU Ta Li Battery Ta disconnected Ta
502 The battery has been disconnected.
503 .It Li PMU Ta Li Battery Ta high-temp Ta
504 The battery reported a temperature over the limit.
505 .It Li PMU Ta Li Battery Ta low-temp Ta
506 The battery reported a temperature under the limit.
507 .It Li PMU Ta Li Battery Ta plugged Ta
508 The battery has become plugged (eg connected).
509 .It Li PMU Ta Li Battery Ta shutdown-threshold Ta
510 The power in the battery has fallen below the shutdown threshold.
511 .It Li PMU Ta Li Battery Ta warning-threshold Ta
512 The power in the battery has fallen below the warn the user threshold.
513 .It Li PMU Ta Li Button Ta pressed Ta
514 A button on a
515 .Xr adb 4
516 or
517 .Xr pmu 4
518 has been pressed.
519 .It Li PMU Ta Li keys Ta Ta
520 One of the keys on the
521 .Xr adb 4
522 keyboard has been pressed.
523 .It Li PMU Ta Li keys Ta brightness Ta
524 A brightness level change has been requested.
525 Direction is in the $notify variable.
526 .It Li PMU Ta Li keys Ta mute Ta
527 The mute key 
528 .It Li PMU Ta Li keys Ta volume Ta
529 A volume level change has been requested.
530 Direction is in the $notify variable.
531 .It Li PMU Ta Li keys Ta eject Ta
532 An ejection has been requested.
533 .It Li PMU Ta Li lid Ta close Ta
534 The
535 .Xr pmc 4
536 device has detected the lid closing.
537 .It Li PMU Ta Li lid Ta open Ta
538 The
539 .Xr pmc 4
540 device has detected the lid openinging.
541 .It Li PMU Ta Li POWER Ta ACLINE Ta
542 The
543 .Xr pmc 4
544 device has deteted an AC line state ($notify=0x00 is offline, 0x01 is online).
545 .It Li PMU Ta Li USB Ta overvoltage Ta
546 An over-voltage condition on the power lines for the USB power pins.
547 .It Li PMU Ta Li USB Ta plugged Ta
548 A device has been plugged into a USB device.
549 .It Li PMU Ta Li USB Ta undervoltage Ta
550 An under-voltage condition on the power lines for the USB power pins.
551 .It Li PMU Ta Li USB Ta unplugged Ta
552 A device has been unplugged into a USB device.
553 .El
554 .Pp
555 .Bl -column "System" "Subsystem" "1234567" -compact
556 .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
557 .It Li RCTL Ta Ta Ta
558 Events related to the
559 .Xr rctl 8
560 framework.
561 .It Li RCTL Ta Li rule Ta Li matched Ta
562 A rule with action specified as "devctl" was triggered.
563 .El
564 .Pp
565 .Bl -column "System" "Subsystem" "1234567" -compact
566 .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
567 .It Li USB Ta Ta Ta
568 Events related to the USB subsystem.
569 .It Li USB Ta Li DEVICE Ta Li ATTACH Ta
570 USB device is attached to the system.
571 .It Li USB Ta Li DEVICE Ta Li DETACH Ta
572 USB device is detached to the system.
573 .It Li USB Ta Li INTERFACE Ta Li ATTACH Ta
574 USB interface is attached to a device.
575 .It Li USB Ta Li INTERFACE Ta Li DETACH Ta
576 USB interface is detached from a device.
577 .El
578 .Pp
579 .\"
580 .\" End of tables
581 .\"
582 A link state change to UP on the interface
583 .Dq Li fxp0
584 would result in the following notify event:
585 .Bd -literal -offset indent
586 system=IFNET subsystem=fxp0 type=LINK_UP
587 .Ed
588 .Pp
589 An AC line state change to
590 .Dq offline
591 would result in the following event:
592 .Bd -literal -offset indent
593 system=ACPI subsystem=ACAD notify=0x00
594 .Ed
595 .Ss Comments
596 Comments may appear anywhere that whitespace may appear in a
597 configuration file.
598 To appeal to programmers of all kinds, they can
599 be written in C, C++, or shell/Perl constructs.
600 .Pp
601 C-style comments start with the two characters
602 .Ql /*
603 (slash, star) and end with
604 .Ql */
605 (star, slash).
606 Because they are completely delimited with these characters,
607 they can be used to comment only a portion of a line or to span
608 multiple lines.
609 .Pp
610 C-style comments cannot be nested.
611 For example, the following is
612 not valid because the entire comment ends with the first
613 .Ql */ :
614 .Bd -literal -offset indent
615 /* This is the start of a comment.
616    This is still part of the comment.
617 /* This is an incorrect attempt at nesting a comment. */
618    This is no longer in any comment. */
619 .Ed
620 .Pp
621 C++-style comments start with the two characters
622 .Ql //
623 (slash, slash) and continue to the end of the physical line.
624 They cannot be continued across multiple physical lines; to have
625 one logical comment span multiple lines, each line must use the
626 .Ql //
627 pair.
628 For example:
629 .Bd -literal -offset indent
630 // This is the start of a comment.  The next line
631 // is a new comment, even though it is logically
632 // part of the previous comment.
633 .Ed
634 .Sh FILES
635 .Bl -tag -width ".Pa /etc/devd.conf" -compact
636 .It Pa /etc/devd.conf
637 The
638 .Xr devd 8
639 configuration file.
640 .El
641 .Sh EXAMPLES
642 .Bd -literal
643 #
644 # This will catch link down events on the interfaces fxp0 and ath0
645 #
646 notify 0 {
647         match "system"                  "IFNET";
648         match "subsystem"               "(fxp0|ath0)";
649         match "type"                    "LINK_DOWN";
650         action "logger $subsystem is DOWN";
651 };
652
653 #
654 # Match lid open/close events
655 # These can be combined to a single event, by passing the
656 # value of $notify to the external script.
657 #
658 notify 0 {
659         match "system"                  "ACPI";
660         match "subsystem"               "Lid";
661         match "notify"                  "0x00";
662         action "logger Lid closed, we can sleep now!";
663 };
664
665 notify 0 {
666         match "system"                  "ACPI";
667         match "subsystem"               "Lid";
668         match "notify"                  "0x01";
669         action "logger Lid opened, the sleeper must awaken!";
670 };
671
672 #
673 # Match a USB device type
674 #
675 notify 0 {
676         match "system"                  "USB";
677         match "subsystem"               "INTERFACE";
678         match "type"                    "ATTACH";
679         match "intclass"                "0x0e";
680         action "logger USB video device attached";
681 };
682
683 #
684 # Try to configure ath and iwn devices with pccard_ether
685 # as they are attached.
686 #
687 attach 0 {
688         device-name "(ath|iwn)[0-9]+";
689         action "/etc/pccard_ether $device-name start";
690 };
691
692 #
693 # Stop ath and iwn devices as they are detached from
694 # the system.
695 #
696 detach 0 {
697         device-name "(ath|iwn)[0-9]+";
698         action "/etc/pccard_ether $device-name stop";
699 };
700 .Ed
701 .Pp
702 The installed
703 .Pa /etc/devd.conf
704 has many additional examples.
705 .Sh SEE ALSO
706 .Xr cam 4 ,
707 .Xr coretemp 4 ,
708 .Xr devfs 5 ,
709 .Xr re_format 7 ,
710 .Xr devd 8