]> git.ipfire.org Git - thirdparty/systemd.git/commit
sleep: allow HibernateDelaySec and low-battery hibernation to work together
authorgvenugo3 <gvenugo3@asu.edu>
Tue, 3 Feb 2026 03:57:30 +0000 (20:57 -0700)
committerLennart Poettering <lennart@poettering.net>
Thu, 5 Feb 2026 09:28:47 +0000 (10:28 +0100)
commit8950f6426350dbb87f908a0a0b1f70e683876828
tree9388c5fcacaf2cc3bbfcbe67489c5a78aafd0ab7
parent2ac64e5715b270c68656e28f165e358f881087a2
sleep: allow HibernateDelaySec and low-battery hibernation to work together

Previously, setting HibernateDelaySec= would disable ACPI battery trip
point (_BTP) alarms, forcing the system to rely solely on software
polling for battery checks. This could result in the battery draining
to 0% between polling intervals, causing data loss.

Now, when ACPI _BTP is available AND HibernateDelaySec= is set, both
mechanisms work together. The system will hibernate on whichever comes
first: low battery (instant hardware alarm) or the configured timeout.

This also properly respects HibernateOnACPower=no by resetting the
timer while on AC power, matching the documented behavior.

Fixes: https://github.com/systemd/systemd/issues/26498
man/systemd-sleep.conf.xml
src/sleep/sleep.c