aboutsummaryrefslogtreecommitdiff
path: root/sbin/devd/devd.conf.5
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/devd/devd.conf.5')
-rw-r--r--sbin/devd/devd.conf.5211
1 files changed, 166 insertions, 45 deletions
diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5
index c9c421090ab9..8df3e910e076 100644
--- a/sbin/devd/devd.conf.5
+++ b/sbin/devd/devd.conf.5
@@ -38,12 +38,12 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.Dd December 1, 2022
+.Dd July 9, 2025
.Dt DEVD.CONF 5
.Os
.Sh NAME
.Nm devd.conf
-.Nd configuration file for
+.Nd configuration file format for
.Xr devd 8
.Sh DESCRIPTION
.Ss General Syntax
@@ -322,7 +322,7 @@ mechanism.
.\" for each of the tables so that things line up in columns nicely.
.\" Please do not omit the type column for notifiers that omit it.
.Pp
-.Bl -column "System" "Subsystem" "1234567" -compact
+.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
.It Li ACPI Ta Ta Ta
Events related to the ACPI Subsystem.
@@ -346,13 +346,13 @@ Suspend notification.
Thermal zone events.
.El
.Pp
-.Bl -column "System" "Subsystem" "1234567" -compact
+.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
.It Li AEON Ta Li power Ta Li press Ta
The power button on an Amiga has been pressed.
.El
.Pp
-.Bl -column "System" "Subsystem" "1234567" -compact
+.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
.It Li CAM Ta Ta Ta
Events related to the
@@ -366,24 +366,24 @@ Generic errors.
Command timeouts.
.El
.Pp
-.Bl -column "System" "Subsystem" "1234567" -compact
+.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
.It Li CARP Ta Ta Ta
Events related to the
.Xr carp 4
protocol.
-.It CARP Ta Ar vhid@inet Ta Ta
+.It Li CARP Ta Ar vhid@inet Ta Ta
The
.Dq subsystem
contains the actual CARP vhid and the name of the network interface
on which the event took place.
-.It CARP Ta Ar vhid@inet Ta MASTER Ta
+.It Li CARP Ta Ar vhid@inet Ta Li MASTER Ta
Node become the master for a virtual host.
-.It CARP Ta Ar vhid@inet Ta BACKUP Ta
+.It Li CARP Ta Ar vhid@inet Ta Li BACKUP Ta
Node become the backup for a virtual host.
.El
.Pp
-.Bl -column "System" "Subsystem" "1234567" -compact
+.Bl -column "CORETEMP" "SUBSYSTEM" "TEMPERATURE" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
.It Li coretemp Ta Ta Ta
Events related to the
@@ -395,7 +395,7 @@ Notification that the CPU core has reached critical temperature.
String containing the temperature of the core that has become too hot.
.El
.Pp
-.Bl -column "System" "Subsystem" "1234567" -compact
+.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
.It Li DEVFS
.It Li DEVFS Ta Li CDEV Ta Li CREATE Ta
@@ -408,7 +408,7 @@ The
node is destroyed.
.El
.Pp
-.Bl -column "System" "Subsystem" "1234567" -compact
+.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
.It Li ETHERNET Ta Ar inet Ta IFATTACH Ta
Notification when the default VNET instance of the
@@ -416,7 +416,7 @@ Notification when the default VNET instance of the
interface is attached.
.El
.Pp
-.Bl -column "System" "Subsystem" "1234567" -compact
+.Bl -column "SYSTEM" "SUBSYSTEM" "GEOM::ROTATION_RATE" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
.It Li GEOM Ta Ta Ta
Events related to the
@@ -447,7 +447,7 @@ A
provider size has changed.
.El
.Pp
-.Bl -column "System" "Subsystem" "1234567" -compact
+.Bl -column "SYSTEM" "SUBSYSTEM" "LINK_DOWN" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
.It Li IFNET
.It Li IFNET Ta Em inet Ta Ta
@@ -471,7 +471,7 @@ The network interface address added.
The network interface address removed.
.El
.Pp
-.Bl -column "System" "Subsystem" "1234567" -compact
+.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
.It Li kernel Ta Li signal Ta Li coredump Ta
Notification that a process has crashed and dumped core.
@@ -479,7 +479,49 @@ Notification that a process has crashed and dumped core.
Notification that the system has woken from the suspended state.
.El
.Pp
-.Bl -column "System" "Subsystem" "1234567" -compact
+.Bl -column "SYSTEM" "SUBSYSTEM" "SMART_ERROR" -compact
+.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
+.It Li nvme Ta Li controller Ta Ta
+Controller events provide the controller name
+.Pq for example, Li nvme0
+in $name.
+.It Li nvme Ta Li controller Ta Li SMART_ERROR Ta
+A SMART Critical Warning State change has happened.
+$state has a hex bitmask of the bits that changed, as defined
+in the NVMe Standard for Critical Warning field of log page 2
+.Dq SMART / Health Information Log :
+.Pp
+.Bl -tag -width "Bit Value" -compact
+.It Sy "Bit Value"
+.Sy Meaning
+.It 0x1
+Spare capacity below threshold
+.It 0x2
+Temperature outside acceptable range
+.It 0x4
+Reliability of media degraded
+.It 0x8
+Media placed into read-only mode
+.It 0x10
+Volatime memory backup failure
+.It 0x20
+Persistent memory read-only or degraded
+.El
+.It Li nvme Ta Li controller Ta Li RESET Ta
+A controller reset event has happened.
+$event is one of
+.Dq start ,
+.Dq success ,
+and
+.Dq timed_out
+representing the start of a controller reset, the successful completion of a
+controller reset, or a timeout while waiting for the controller to reset,
+respectively.
+.It Li nvme Ta Li controller Ta Li RECONNECT Ta
+An NVMe over Fabrics host has disconnected and is requesting a reconnect.
+.El
+.Pp
+.Bl -column "SYSTEM" "SUBSYSTEM" "SHUTDOWN-THRESHOLD" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
.It Li PMU Ta Ta Ta
Notification of events from various types of Power Management Units.
@@ -492,25 +534,25 @@ Power has been applied to the AC power line.
.It Li PMU Ta Li "AC" Ta Li unplugged Ta
Power has been removed from the AC power line.
.It Li PMU Ta Li Battery Ta Ta
-.It Li PMU Ta Li Battery Ta absent Ta
+.It Li PMU Ta Li Battery Ta Li absent Ta
Battery is no longer absent.
-.It Li PMU Ta Li Battery Ta charged Ta
+.It Li PMU Ta Li Battery Ta Li charged Ta
The battery has become charged.
-.It Li PMU Ta Li Battery Ta charging Ta
+.It Li PMU Ta Li Battery Ta Li charging Ta
The battery has started charging.
-.It Li PMU Ta Li Battery Ta disconnected Ta
+.It Li PMU Ta Li Battery Ta Li disconnected Ta
The battery has been disconnected.
-.It Li PMU Ta Li Battery Ta high-temp Ta
+.It Li PMU Ta Li Battery Ta Li high-temp Ta
The battery reported a temperature over the limit.
-.It Li PMU Ta Li Battery Ta low-temp Ta
+.It Li PMU Ta Li Battery Ta Li low-temp Ta
The battery reported a temperature under the limit.
-.It Li PMU Ta Li Battery Ta plugged Ta
+.It Li PMU Ta Li Battery Ta Li plugged Ta
The battery has become plugged (eg connected).
-.It Li PMU Ta Li Battery Ta shutdown-threshold Ta
+.It Li PMU Ta Li Battery Ta Li shutdown-threshold Ta
The power in the battery has fallen below the shutdown threshold.
-.It Li PMU Ta Li Battery Ta warning-threshold Ta
+.It Li PMU Ta Li Battery Ta Li warning-threshold Ta
The power in the battery has fallen below the warn the user threshold.
-.It Li PMU Ta Li Button Ta pressed Ta
+.It Li PMU Ta Li Button Ta Li pressed Ta
A button on a
.Xr adb 4
or
@@ -520,39 +562,39 @@ has been pressed.
One of the keys on the
.Xr adb 4
keyboard has been pressed.
-.It Li PMU Ta Li keys Ta brightness Ta
+.It Li PMU Ta Li keys Ta Li brightness Ta
A brightness level change has been requested.
Direction is in the $notify variable.
-.It Li PMU Ta Li keys Ta mute Ta
+.It Li PMU Ta Li keys Ta Li mute Ta
The mute key
-.It Li PMU Ta Li keys Ta volume Ta
+.It Li PMU Ta Li keys Ta Li volume Ta
A volume level change has been requested.
Direction is in the $notify variable.
-.It Li PMU Ta Li keys Ta eject Ta
+.It Li PMU Ta Li keys Ta Li eject Ta
An ejection has been requested.
-.It Li PMU Ta Li lid Ta close Ta
+.It Li PMU Ta Li lid Ta Li close Ta
The
.Xr pmc 4
device has detected the lid closing.
-.It Li PMU Ta Li lid Ta open Ta
+.It Li PMU Ta Li lid Ta Li open Ta
The
.Xr pmc 4
device has detected the lid openinging.
-.It Li PMU Ta Li POWER Ta ACLINE Ta
+.It Li PMU Ta Li POWER Ta Li ACLINE Ta
The
.Xr pmc 4
device has detected an AC line state ($notify=0x00 is offline, 0x01 is online).
-.It Li PMU Ta Li USB Ta overvoltage Ta
+.It Li PMU Ta Li USB Ta Li overvoltage Ta
An over-voltage condition on the power lines for the USB power pins.
-.It Li PMU Ta Li USB Ta plugged Ta
+.It Li PMU Ta Li USB Ta Li plugged Ta
A device has been plugged into a USB device.
-.It Li PMU Ta Li USB Ta undervoltage Ta
+.It Li PMU Ta Li USB Ta Li undervoltage Ta
An under-voltage condition on the power lines for the USB power pins.
-.It Li PMU Ta Li USB Ta unplugged Ta
-A device has been unplugged into a USB device.
+.It Li PMU Ta Li USB Ta Li unplugged Ta
+A device has been unplugged from a USB device.
.El
.Pp
-.Bl -column "System" "Subsystem" "1234567" -compact
+.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
.It Li RCTL Ta Ta Ta
Events related to the
@@ -562,7 +604,7 @@ framework.
A rule with action specified as "devctl" was triggered.
.El
.Pp
-.Bl -column "System" "Subsystem" "1234567" -compact
+.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
.It Li USB Ta Ta Ta
Events related to the USB subsystem.
@@ -576,7 +618,7 @@ USB interface is attached to a device.
USB interface is detached from a device.
.El
.Pp
-.Bl -column "System" "Subsystem" "1234567" -compact
+.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
.It Li VFS Ta Ta Ta
Events from the vfs system.
@@ -590,18 +632,18 @@ Notification of a filesystem is remounted (whether or not the options actually c
Notification of a filesystem being unmounted.
.El
.Pp
-.Bl -column "System" "Subsystem" "1234567" -compact
+.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
-.It Li VT Ta BELL Ta RING Ta
+.It Li VT Ta Li BELL Ta Li RING Ta
Notification that the console bell has rung.
See
.Xr vt 4
for details.
.El
.Pp
-.Bl -column "System" "Subsystem" "1234567" -compact
+.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
-.It Li ZFS Ta ZFS Ta Ta
+.It Li ZFS Ta Li ZFS Ta Ta
Events about the ZFS subsystem.
See
.Xr zfsd 8
@@ -610,6 +652,22 @@ and
for details.
.El
.Pp
+.Bl -column "System" "Subsystem" "1234567" -compact
+.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
+.It Li SND Ta Ta Ta
+Events related to the
+.Xr sound 4
+driver.
+.It Li SND Ta Li CONN Ta Li IN Ta
+Connected input device specified in
+.Pa cdev
+variable.
+.It Li SND Ta Li CONN Ta Li OUT Ta
+Connected output device specified in
+.Pa cdev
+variable.
+.El
+.Pp
.\"
.\" End of tables
.\"
@@ -666,6 +724,26 @@ For example:
// part of the previous comment.
.Ed
.Ss Notes on Variable Expansion
+Variables are expanded by preceding them by a
+.Dq $
+sign.
+Any text immediately following that sign, starting with a letter, a minus sign
+.Dq - ,
+an underscore
+.Dq _ ,
+or an asterisk
+.Dq *
+is considered an internal variable, and expanded accordingly.
+If that variable does not exist, it silently expands to an empty string.
+Consequently, if the intention is to pass a
+.Xr sh 1
+variable, it must be surrounded by braces to prevent it from being
+considered an internal variable.
+.Pp
+See
+.Sx EXAMPLES
+for a detailed example.
+.Pp
To prevent issues with special shell characters, the following happens for each
variable
.Ic $foo .
@@ -683,6 +761,10 @@ The value of the
.Ic foo
variable is inserted into the buffer with all single quote characters
prefixed by a backslash.
+.It
+A final
+.Dq '
+is inserted.
.El
.Pp
See
@@ -724,6 +806,14 @@ regardless of the value of the variable.
The
.Xr devd 8
configuration file.
+.It Pa /etc/devd
+A directory that
+.Nm devd
+searches for additional configuration files.
+.It Pa /usr/local/etc/devd
+A directory that
+.Nm devd
+searches for additional configuration files.
.El
.Sh EXAMPLES
.Bd -literal
@@ -786,6 +876,37 @@ detach 0 {
};
.Ed
.Pp
+The following example illustrates the difference betwen internal and shell variables:
+.Bd -literal
+attach 20 {
+ device-name "umodem[0-9]+";
+ match "vendor" "0x2047";
+ match "product" "0x001(0|3|4)";
+ match "interface" "0";
+ action "cd /dev; p=$product; dn=$device-name; \\
+ un=$(sysctl -n dev.umodem.${dn#umodem}.ttyname); \\
+ chmod 666 cua${un}; ln -sf cua${un} mspfet${p#0x}";
+};
+.Ed
+.Pp
+.Dq product ,
+and
+.Dq device-name
+are internal variables.
+Their contents are initially assigned to shell variables
+.Dq p ,
+and
+.Dq dn ,
+respectively.
+Then, variable
+.Dq dn
+is used inside a shell command substitution, assigning to shell variable
+.Dq un .
+Finally, this shell variable is used in two other shell statements, where
+it needs to be wrapped in braces in order to prevent it from being
+considered in internal variable to
+.Nm devd .
+.Pp
The installed
.Pa /etc/devd.conf
has many additional examples.