From bcfcc4ec03c6e17a313c90ea3e6c8365ac38a56f Mon Sep 17 00:00:00 2001 From: njl Date: Sat, 25 Oct 2003 05:03:25 +0000 Subject: Add devctl(4) notify support to ACPI. Various subsystems now notify userland whenever events occur. See the example in devd.conf below to see how to use it. --- etc/devd.conf | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'etc') diff --git a/etc/devd.conf b/etc/devd.conf index 2999115..4f46415 100644 --- a/etc/devd.conf +++ b/etc/devd.conf @@ -93,4 +93,30 @@ detach 10 { action "/etc/pccard_ether $device-name stop"; }; +# Examples of notify hooks. A notify is a generic way for a kernel +# subsystem to send event notification to userland. +# +# Here are some examples of ACPI notify handlers. ACPI subsystems that +# generate notifies include the AC adapter, power/sleep buttons, +# control method batteries, lid switch, and thermal zones. +# +# Information returned is not always the same as the ACPI notify +# events. See the ACPI specification for more information about +# notifies. Here is the information returned for each subsystem: +# +# ACAD: AC line state (0 is offline, 1 is online) +# Button: Button pressed (0 for power, 1 for sleep) +# CMBAT: ACPI battery events +# Lid: Lid state (0 is closed, 1 is open) +# Thermal: ACPI thermal zone events +# +# This example calls a script when the AC state changes, passing the +# notify value as the first argument. If the state is 0x00, it might +# call some sysctls to implement economy mode. If 0x01, it might set +# the mode to performance. +notify 10 { + match "system" "ACPI"; + match "subsystem" "ACAD"; + action "/etc/acpi_ac $notify"; +}; */ -- cgit v1.1