Power management

From Alpine Linux
Revision as of 14:06, 2 May 2025 by Prabuanand (talk | contribs) (reformatted the page so that more content can be added)

Power management is a feature of computer CPUs, GPUs and peripherals such as monitors and printers, that turns off the power or switches the system to a low-power state when inactive based on a standard called ACPI, which has superseded APM. This page explains how to configure what happens

Installation

Install the acpid package:

# apk add acpid

Power management utilities

There are a number of power management utilities available in Alpine Linux.

Service configuration

Enable and start the acpid daemon using the OpenRC commands:

# rc-update add acpid && rc-service acpid start

Handling the pressing of power button

In case of desktop environments, it might be useful to allow for some control on what happens when you press the power button instead of shutting down the computer. This can be done via Busybox#acpid by creating/modifying the hook in /etc/acpi/PWRF/00000080.

Configuring for shutdown

In a newly installed system this might be already defined, however you can create the hook as follows:

Contents of /etc/acpi/PWRF/00000080

#!/bin/sh poweroff

Configuring for sleep

Use one of the power management utility, say zzz here and Modify the hook as follows:

Contents of /etc/acpi/PWRF/00000080

#!/bin/sh zzz

Disabling

To disable simply comment or remove the hook. This is useful to allow desktop environments like Gnome or KDE to handle the power button.

Contents of /etc/acpi/PWRF/00000080

#!/bin/sh #Nothing