[RESPONDED] PSA: systemd suspend-then-hibernate behavior changed in v252

The behavior of suspend-then-hibernate has changed as of v252.

HibernateDelaySec no longer specifies the time a system will sleep and then go into hibernation. The new behavior is that the system will sleep until there is 5% battery left and then go into hibernation.

man systemd-sleep.conf

...
If the current battery capacity is higher than 5%, the system suspends for interval calculated
           using battery discharge rate per hour or HibernateDelaySec= if former is not available.
...

I wondered why my laptop wasn’t hibernating all week and came across this issue this morning. It looks like there is a new option being added to achieve the previous behavior.

6 Likes

Thank you for the notice. I am running manjaro which is not yet on v252. Hopefully the change to allow the trigger to be time-based is available before the distro moves to 252 or higher.

FYI, this is now fixed by https://github.com/systemd/systemd/pull/25374

Does anyone know what configuration is needed to get back to hibernating after a delay?

Yes, it works again in v253, thankfully. I believe that as long as you have HibernateDelaySec configured in sleep.conf as well as suspend-then-hibernate in logind.conf it will work. On my system (manjaro-gnome) I had to extend the delay in gnome settings to be longer than the IdleActionSec parameter in logind.conf.

1 Like

Does anyone know how long these changes take to hit ubuntu packaging (on non-LTS, 23.04)?

Is it worth me patching the source package if this feature is important to me (it is!)?

EDIT: Patched out the shipping 252 version on Ubuntu with the fixes from 253, and seems to work fine. Not sure how patching / trac works for dpkgs, may work it out if I have time at some point!

2 Likes

yeah, to hasten the fix, I think someone needs to advocate it to the deb package maintainer

1 Like

@Bdav how did you manage to do the patch? I’ve been trying to find a solution as I have one laptop that’s stuck on an Ubuntu version with v252 on it. Any pointers would be greatly appreciated.

Good question - Moved to windows since for various reasons. Can’t remember exactly, but I used the ubuntu dpkg patching: Link and then hand-merged this commit in to systemd.

I’d share the dpkg if I still had it!