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.
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.
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.
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!
@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.