pm-is-supported
Check if power management is supported
SYNOPSIS
pm-is-supported [ACTION]
PARAMETERS
suspend
Checks if suspend-to-RAM (system sleep to memory) is supported.
hibernate
Checks if suspend-to-disk (hibernation) is supported.
hybrid-sleep
Checks if hybrid sleep (suspend to RAM, then hibernate, then power off) is supported.
suspend-hybrid
An alias for hybrid-sleep.
DESCRIPTION
pm-is-supported is a utility designed to determine if specific power management operations, such as system suspend (to RAM), system hibernate (to disk), or hybrid sleep, are supported by the current Linux system. It typically verifies kernel support for these features by examining interfaces like /sys/power/state and other ACPI-related kernel files.
The command returns an exit status of 0 if the requested operation is supported, and a non-zero status if it is not. This makes it particularly useful for scripting power management actions reliably, allowing scripts to adapt to the system's capabilities and prevent attempting unsupported power states that could lead to errors or instability.
CAVEATS
This command primarily checks kernel-level and ACPI support. It might not account for all factors, such as specific hardware quirks, driver issues, or ongoing processes that could prevent successful power state transitions.
On modern Linux distributions, its functionality is often provided by systemd, and systemctl commands (e.g., systemctl suspend) are generally preferred for managing power states. pm-is-supported often exists as a compatibility layer.
EXIT STATUS
The command communicates support primarily through its exit status:
0: The requested power management action is supported.
1: The requested power management action is not supported.
2: An invalid argument or action was provided.
3: An internal error occurred.
HOW IT DETERMINES SUPPORT
The command typically checks the contents of /sys/power/state (for available sleep states like freeze, mem, disk) and /sys/power/disk (for hibernation configuration). It may also examine kernel command line parameters and other system capabilities to determine support.
HISTORY
The pm-is-supported command originated as part of the pm-utils package, a collection of utilities for power management on Linux systems. It provided a straightforward way for scripts and users to query hardware and kernel support for various suspend and hibernate states.
With the widespread adoption of systemd as the primary init system, much of pm-utils' functionality, including power management, has been absorbed and re-implemented within systemd. pm-is-supported now often exists as a compatibility symlink or script that leverages systemd-sleep to perform its checks, ensuring backward compatibility for older scripts that rely on its presence and behavior.
SEE ALSO
systemctl(1), pm-suspend(8), pm-hibernate(8), systemd-sleep(8), sleep.conf(5)