Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#2151612) Restore pre-252 behavior of HibernateDelaySec= #134

Merged

Conversation

dtardon
Copy link
Contributor

@dtardon dtardon commented Jan 30, 2023

Resolves: #2151612

(cherry picked from commit 3d23df0)

Related: #2151612
(cherry picked from commit 2ed56af)

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

However, after 96d662f, 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.

(cherry picked from commit 4f58b65)

Resolves: #2151612
(cherry picked from commit 3c3f460)

Related: #2151612
- use device_get_sysattr_int(),
- drop redundant log message.

(cherry picked from commit 3d9ca76)

Related: #2151612
(cherry picked from commit 3332cfe)

Related: #2151612
The enumerator is now mostly consistent with on_ac_power() in
udev-util.c.

(cherry picked from commit fe8e0f8)

Related: #2151612
@systemd-rhel-bot systemd-rhel-bot added the pr/needs-review Formerly needs-review label Jan 30, 2023
@systemd-rhel-bot systemd-rhel-bot changed the title Restore pre-252 behavior of HibernateDelaySec= (#2151612) Restore pre-252 behavior of HibernateDelaySec= Jan 30, 2023
@mergify mergify bot added the pr/needs-ci Formerly needs-ci label Jan 30, 2023
@systemd-rhel-bot systemd-rhel-bot added the tracker/unapproved Formerly needs-acks label Jan 30, 2023
@dtardon dtardon added this to the RHEL-9.2.0 milestone Jan 30, 2023
@mergify mergify bot removed the pr/needs-ci Formerly needs-ci label Jan 30, 2023
@systemd-rhel-bot systemd-rhel-bot added tracker/missing Formerly needs-bz tracker/unapproved Formerly needs-acks and removed tracker/unapproved Formerly needs-acks tracker/missing Formerly needs-bz labels Feb 13, 2023
Copy link
Contributor

@msekletar msekletar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@systemd-rhel-bot systemd-rhel-bot removed pr/needs-review Formerly needs-review tracker/unapproved Formerly needs-acks labels Feb 16, 2023
@systemd-rhel-bot systemd-rhel-bot merged commit 49d6261 into redhat-plumbers:main Feb 16, 2023
29 checks passed
@dtardon dtardon deleted the bz2151612-suspend-then-hibernate branch February 16, 2023 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants