acpi_listen
Listen for ACPI events
TLDR
Listen to any ACPI event while the daemon is running
Display help
SYNOPSIS
acpi_listen
DESCRIPTION
acpi_listen is a utility designed to monitor and display ACPI (Advanced Configuration and Power Interface) events as they occur on a Linux system. It typically listens on the ACPI daemon's socket (commonly /var/run/acpid.socket) for events generated by hardware actions. These events include, but are not limited to, power button presses, laptop lid closures or openings, battery status changes (e.g., AC adapter plug/unplug), and docking/undocking events.
The primary purpose of acpi_listen is for debugging and diagnostics, allowing system administrators and developers to observe exactly what ACPI events the operating system is receiving. This is crucial for configuring the acpid daemon's event handling scripts correctly or for troubleshooting issues related to power management and hardware interaction. It outputs event details to standard output, making it easy to see the event type, device, and relevant codes.
CAVEATS
- acpi_listen typically requires the acpid (ACPI daemon) service to be running on the system to receive events. It acts as a client to acpid, listening on its communication socket. If acpid is not active, acpi_listen may not display any events.
- The output from acpi_listen consists of raw ACPI event data, which might require some understanding of ACPI event types and codes to interpret fully. It is primarily a debugging tool, not intended for direct scripting of system actions without further processing.
USAGE EXAMPLE
To observe ACPI events, simply open a terminal and execute the command:
acpi_listen
Then, perform an action like closing or opening your laptop lid, pressing the power button, or plugging/unplugging your AC adapter. You will see output similar to these examples:
button/lid LID open
button/power PWRF 00000080 00000000
ac_adapter ACAD 00000080 00000000 (for AC adapter plugged in)
INTERACTION WITH ACPID
While acpi_listen shows ACPI events, it's important to understand its relationship with the acpid daemon. The Linux kernel handles raw ACPI events. acpid reads these raw events, parses them, and then dispatches them to various clients, including acpi_listen, via a Unix domain socket. Therefore, acpi_listen is observing the processed events from acpid, not directly from the kernel's ACPI event queue.
HISTORY
acpi_listen has been an integral part of the acpi utilities package for Linux since the widespread adoption of ACPI as the standard for power management on modern computers, succeeding the older APM (Advanced Power Management) specification. It was developed to provide a crucial diagnostic tool for debugging and configuring how Linux systems react to hardware-generated ACPI events, supporting the transition to more sophisticated power management schemes.