acpi_available
Check if ACPI is available
SYNOPSIS
acpi_available
DESCRIPTION
The `acpi_available` command, or rather the process it invokes, attempts to determine if the Advanced Configuration and Power Interface (ACPI) is available and properly initialized on a Linux system. It achieves this by examining the `/proc/acpi/info` file. If the file exists and contains information, it indicates that the ACPI subsystem is active. The command typically returns an exit code of 0 if ACPI is available and a non-zero exit code if it's not.
While not a formal command in the sense of having a standalone executable, `acpi_available` is commonly implemented as a small script or function within larger scripts, particularly those involved in power management or system monitoring. Its main purpose is to provide a quick and reliable way to check for ACPI presence before proceeding with operations that rely on its functionality, such as reading battery status, controlling fan speeds, or managing power states. The check can be especially important in environments where ACPI might be disabled at boot time or not fully supported by the hardware.
CAVEATS
This isn't a standardized standalone command. It's usually part of a larger script or a check within a power management utility. The existence of `/proc/acpi/info` doesn't guarantee *fully functional* ACPI, but simply indicates its presence. Newer systems often rely on `/sys/class/acpi`.
IMPLEMENTATION DETAILS
The simplest implementations of `acpi_available` involve testing the existence and readability of `/proc/acpi/info`. More robust implementations might parse the contents of the file to verify the ACPI version or check for specific devices.
A common shell script implementation looks like this:
`if [ -f /proc/acpi/info ]; then
echo "ACPI Available"
exit 0
else
echo "ACPI Not Available"
exit 1
fi`
MODERN ALTERNATIVES
On newer Linux systems, especially those utilizing `systemd`, checking for ACPI functionality might involve querying the systemd journal or using `udevadm` to inspect ACPI device information in `/sys/class/acpi`. The `/proc/acpi` interface is considered deprecated. Therefore, scripts relying on `/proc/acpi` might need adjustments for modern distributions.