4 ms·
Note that suspend-then-hibernate is badly broken in some systemd versions. It will always wait until the battery is drained to 5% SOC before waking up and tryi
by zozbot234 4y ago
Note that suspend-then-hibernate is badly broken in some systemd versions. It will always wait until the battery is drained to 5% SOC before waking up and trying to hibernate - of course, this can easily fail and lead to lost data, plus a completely drained battery (with the ensuing wear-and-tear on the battery itself). What's especially broken about this is that options intended to set a different behavior for hibernation are ignored, the 5% threshold is effectively made mandatory. Fixes for this issue are apparently ongoing and not yet ready for release.
Reference: https://github.com/systemd/systemd/issues/25269 https://github.com/systemd/systemd/issues/25269
- b112 4y agoNote that suspend-then-hibernate is badly broken in some systemd versions What?! How could this be??!
- pxc 4y agotl;dr: if you're not on a bleeding edge rolling release, this will probably be fixed before the affected versions hit you. If not, read below for a summary of what happened, a workaround, and a proper fix you can apply as a patch. God that's annoying as hell. Apparently the Systemd dev who added this functionality intended it for a different use case than mine or yours. They revised their implementation to better serve their original purpose without realizing it broke our (mis)use of their feature. For convenience for anyone running a sufficiently bleeding edge distro to have this very latest release already, here's a direct link to a comment with a configuration workaround which restores the old behavior: https://github.com/systemd/systemd/issues/25269#issuecomment-1311583322 https://github.com/systemd/systemd/issues/25269#issuecomment... And here's the PR for the formal fix, which combines the old behavior (new config value name, read carefully) with that new 5% emergency fallback behavior, for folks who want to patch it themselves: https://github.com/systemd/systemd/pull/25374 https://github.com/systemd/systemd/pull/25374 It's not merged yet but maintainers have approved it for merging with a few comments on config value names, so it should be safe to add as a patch.
- db48x 4y agoMan, reading systemd issue #25269 is like pulling teeth. Person A reports that he wants to hibernate after being suspended for 30 minutes, and that it used to work and is now broken. Person B doesn’t understand why, so asks why 30 minutes and not 4 hours? Person A thinks Person B is judging them for their personal preferences, and says that they chose 30 minutes because they like it. Person B then deduces that Person A is an idiot who thinks that the systemd default behavior should be determined Person A’s personal preferences. What Person A really wants is to pull their laptop out in the morning and have it still be at 90% charge instead of 5% (or 0%!) charge. Given no other configuration options, they chose to have it hibernate after 30 minutes. They would not choose to configure the delay to 4 hours because then the battery would be a lower the next morning. Then Person C comes along and tries to correct the misunderstandings by suggesting that there’s no reason why it cannot do both at the same time. Person B is still focused on improving safety, and still sees the configurable time as unsafe (because someone might configure it for longer than their battery can last), and misunderstands Person C. Person C has to return and reexplain, with amplification from Person D, that the default behavior should be to hibernate when the battery is low for safety, but also to hibernate at the expiration of the timer, if the timer fires first. This would satisfy everyone, even the weirdos who want their battery to stay charged when they’re not using their laptop. Person B finally understands and says that would be fine. Elapsed time? 6.5 excruciating days, plus two more days for Person E to push a patch. Then Persons F, G, H, I and J chime in to add their own amplifying explanations, congratulations, thanks, etc. Even I wanted to re–explain it to Person B.
- Zuiii 4y agoIf I have a choice between fixing an issue locally vs interacting with a large upstream project - who tend to always have a Person B (someone who isn't equipped to handle the subject but will nontheless form a premature opinion and attack anyone who challenges it), then I ALWAYS fix it locally because it takes more effort to convince Person B. Sometimes they silently fix it in a couple of years later, other times another project comes in and renders their project (and my local fix) obsolete. Perhaps projects should have policies and codes of conduct that protect them against this type of harmful behavior.
- cstrahan 4y agoSystemd has been fine in my experience, but rather nvidia has to go and mess everything up: https://forums.developer.nvidia.com/t/systemds-suspend-then-hibernate-not-working-in-nvidia-optimus-laptop/213690/4 https://forums.developer.nvidia.com/t/systemds-suspend-then-...