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
suspend-then-hibernate: add option to force early hibernate #25269
Comments
|
What does "not work" mean? Describe the problem in details, and pastebin verbose logs |
|
@bluca As I mentioned on my main post. When executing I checked dmesg but it doesn't show any errors. If you have any other way of tracking it, then I can paste it here. |
|
That's expected, see the manpage. Hibernate will happen when low on battery. |
|
@bluca I think you are miss understanding my issue. I did have it working before systemd 252. |
Maybe the functionality was broken in v252 and is now fixed 🤔 Maybe we need an extra setting in Manjaro-KDE to set a time period for
Where the There seems to be a setting already which sounds like that but i have no idea how to configure that last delay, and if it indeed does what i said above... |
|
I set mine to go into suspend-then-hibernate by default. Either way, if I execute the systemd command or wait until it gets to 5%, hibernate is never followed after suspend. |
Looks like you are messing manually with your systemd there 🤔 Why didn't you choose the documented way to configure stuff? On my current Manjaro, See: To change settings it's highly recommended to create "drop-ins" in the Here is the current original contents on my Manjaro for you to be able to restore the file you removed:
Like with all changes to systemd's config files, always do a Anyhow i don't use this stuff at moment on my desktop, but you might try these pointers 😉 |
Well this is a little bit easy to refer to the latest docs which changed since v252. On v251 the manual entry for this option was: Why did this change instead of creating another power saving mode (for instance I dont want my computer to stay in S3 state when it is >5% battery. I want it to go to S4 state after |
|
That is not supported anymore, as it was half-broken and made very little sense, it was just a workaround for missing functionality that is now implemented. If you want to hibernate it immediately, then just do that. |
I don't want to hibernate. Resume from hibernation is around 45s on my system while resume from suspend is instantaneous. I want to always suspend, then after 30m hibernate. If I need to quickly reuse my computer after I suspended it, it resumes instantaneously. And if I need to use it later, then I can probably wait 45s, so I want it to hibernate to save power. |
|
Why 30 minutes and not, say, 4 hours? |
Why is it important? This is my setup, which was previously configurable with I also have this bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1023483 which is a little bit different, and forced me to rollback to v251. Should I open a new issue here for this ? It might be related to #24336 |
|
@n-peugnet I also had to downgrade |
|
Tentatively reopen this to make more users can easily find this 'issue' and join the discussion. Though, I am not sure the current behavior is expected or not. |
|
The current behaviour is fully expected and documented |
|
Hmm, but as reported, v252 changes the behavior. That's true regardless of it is expected or not. How about to honor the setting if specified instead of using ACPI_BTP or calculated discharging rate? Anyway, please do not close this page so quickly. |
And make HibernateDelaySec= work as v251 to keep backward compatibility. Fixes systemd#25269.
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 systemd#25269. To keep the backward compatibility, let's introduce another setting DefaultSuspendIntervalSec= 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 systemd#25269.
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 systemd#25269. To keep the backward compatibility, let's introduce another setting DefaultSuspendIntervalSec= 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 systemd#25269.
Yes, please. This breaking change cost me countless hours and pain over the last few days, because I was debugging a dead end: https://bbs.archlinux.org/viewtopic.php?id=281373 I also miss the old behaviour of HibernateDelaySeconds... |
Where's this '30m' coming from @bluca? Mine was set to 2h and working nicely as I intended it to.
I don't want to hibernate immediately - consider using a laptop in an office for example, you close it to take it to a meeting room, re-open it a few minutes later, you don't want to wait for resume from hibernation. But if plans change and it ends up suspended for hours, I want to save the battery and probably don't mind the start-up delay so much coming back to it after a longer period. (That's just for illustration - my usual use case is actually at home with a personal laptop, using and closing, not knowing if I'll use it again or not that evening, but if I do it's probably for something quick and won't be bothered if it takes too long. But if I don't, I don't want it suspended all night.)
I appreciate the effort that has gone in to this related work, but I checked the changelog; there's this, buried in 'changes to other components', not mentioned as a compatibility break - the only mention of 'hibernate' (and not the To me, that's not at all clear that it will now never hibernate while powered; nor that with the delay option manually set to a fixed value it will power off (with potential data loss!) if the battery runs flat. (I'm not sure that's intended, sounds like not - though I'm unclear with the behaviour change why the option still exists at all - but seems to be what's happening.)
Oh, so I suppose that's why - I experience the above when the battery is insufficient to last for |
Indeed, the default |
|
while it's nice that it will hibernate if there is only 5% power left, there is one big benefit if we can get back force early hibernate: if you can set it to hibernate after 30 minutes (as it was possible previously), then your computer will have 90% battery!! This is very important if you need to continue working on it and do not have a charger, something that the new (and only) mode makes impossible and would require a careful manual hibernate planning now |
|
I'm a bit late to the party but want to put my two cents anyway: I think the fact that this was a breaking change for the "HibernateDelaySec" option for that, at least, I didn't found a reference in the release notes should be argument enough to restore the previous functionality. Don't get me wrong, I appreciate the new feature for guarantee hibernation on low battery. But if it had been possible to maintain backward compatibility this should be considered as a regression.
One use case is to safe battery as @n-peugnet described. My use case is to combine fast resume within the configured delay (comfort) and automatically secure the system after that delay with hibernation (suspend to disk) with full disk encryption (security). |
|
This is a serious security regression, as anyone who was relying on systemd to do what it said it would until version 252 is now potentially vulnerable. I need my (fully encrypted, verified boot) system to hibernate when I tell it to for security reasons, and until recently it did. And now it doesnt. This is an extremely serious vulnerability and its baffling theres been a month of "debate" on whether a silent, backwards incompatible change, to an existing feature and option, that causes real world security issues is a problem or not. Before anyone gets into it: Your threat model is not my threat model. This is within mine, and i'm sure also within plenty of organizations. Not to mention the basic usability issues, I for one like to come back to my laptop and resume where I left off with my battery where I left it, not empty or at 5%. |
|
@DianaNites I would not name it a serious security regression. You can still just hibernate your system to secure the sleep state with full disk encryption. And I wouldn't rely too much on the interrupt for hibernate after a delay when your security concerns are strong. ;) Meanwhile, anyone who can't wait for the feature to return and isn't able to downgrade can work around the regression by using a custom suspend-then-hibernate script. I once wrote one for the purpose of using uswsusp with systemd but it can be adopted easily.
@n-peugnet you did you not open an issue for that, or did you? I have a very similar problem on Arch since updating from v252.1 to v252.2. Maybe you could check if v252.1 works for you as well. |
This issue is tracked there: #25356 |
|
Just because it can be worked around doesn't mean it isnt a regression. The behavior worked and was secure, and an update made it not. Thats called a security regression. Now if everyone who was using it wants that same security, they have to first know about this issue somehow(CVE?), and then manually work around it until the proper fix comes out. |
|
Given trolling has started, time to lock |
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 systemd#25269. To keep the backward compatibility, let's introduce another setting DefaultSuspendIntervalSec= 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 systemd#25269.
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 systemd#25269. To keep the backward compatibility, let's introduce another setting InitialSuspendIntervalSec= 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 systemd#25269.
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 systemd#25269. To keep the backward compatibility, let's introduce another setting InitialSuspendIntervalSec= 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 systemd#25269.
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 systemd#25269. To keep the backward compatibility, let's introduce another setting InitialSuspendIntervalSec= 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 systemd#25269.
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 systemd#25269. To keep the backward compatibility, let's introduce another setting InitialSuspendIntervalSec= 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 systemd#25269.
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 systemd#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 systemd#25269.
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 systemd#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 systemd#25269.
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 systemd#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 systemd#25269.
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 systemd#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 systemd#25269. (cherry picked from commit 4f58b65)
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 systemd#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 systemd#25269.
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 systemd#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 systemd#25269. (cherry picked from commit 4f58b65)

systemd version the issue has been seen with
252-2
Used distribution
Debian Bookworm
Linux kernel version used
6.0.0-2-amd64
CPU architectures issue was seen on
x86_64
Component
No response
Expected behaviour you didn't see
Since 252 I can no longer suspend-then-hibernate using
systemctl suspend-then-hibernate.If I execute the commands to
suspendonly it does work, same forhibernate. But not in combinationUPDATE: I tested on
Manjarowhich is usingsystemd 251.7and is working fine.The text was updated successfully, but these errors were encountered: