]> git.ipfire.org Git - thirdparty/systemd.git/commit
sleep: introduce SuspendEstimationSec=
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 13 Nov 2022 17:08:05 +0000 (02:08 +0900)
committerLuca Boccassi <bluca@debian.org>
Fri, 27 Jan 2023 20:52:12 +0000 (20:52 +0000)
commit4f58b656d92b09a953b7cffcfd1ee6d5136a57ed
treedaebdcf6edbbdf02694ded0566b00c77c3e0bb39
parent2ed56afeb3c26596dbe44858559c92307778ff82
sleep: introduce SuspendEstimationSec=

Before v252, HibernateDelaySec= specifies the maximum timespan that the
system in suspend state, and the system hibernate after the timespan.

However, after 96d662fa4c8cab24da57523c5e49e6ef3967fc13, the setting is
repurposed as the default interval to measure battery charge level and
estimate the battery discharging late. And if the system has enough
battery capacity, then the system will stay in suspend state and not
hibernate even if the time passed. See issue #25269.

To keep the backward compatibility, let's introduce another setting
SuspendEstimationSec= for controlling the interval to measure
battery charge level, and make HibernateDelaySec= work as of v251.

This also drops implementation details from the man page.

Fixes #25269.
man/systemd-sleep.conf.xml
src/shared/sleep-config.c
src/shared/sleep-config.h
src/sleep/sleep.c
src/sleep/sleep.conf