Standby then hibernate doesn't work

Sleep is working, hibernate is working, but selecting “Standby, then hibernate” in power saving settings doesn’t work, it actually performs a normal sleep, and what is that unknown period it needs to jump from normal sleep to hibernate?

Operating System: Manjaro Linux 
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1
Kernel Version: 6.9.1-2-MANJARO (64-bit)
Graphics Platform: Wayland

The unknown period is only configurable through systemd config files, the HibernateDelaySec entry in /etc/systemd/sleep.conf can modify the default which depends on your system’s capabilities and is described in man systemd-sleep.conf (see the “suspend-then-hibernate” section).

1 Like

HibernateDelaySec is effectively empty in /etc/systemd/sleep.conf,

[Sleep]
#AllowSuspend=yes
#AllowHibernation=yes
#AllowSuspendThenHibernate=yes
#AllowHybridSleep=yes
#SuspendState=mem standby freeze
#HibernateMode=platform shutdown
#HibernateDelaySec=
#SuspendEstimationSec=60min

With a laptop left connected to power, it seems it will always fail to hibernate after sleeping

If the system has battery and HibernateDelaySec= is not set, low-battery alarms (ACPI _BTP) are tried first for detecting battery percentage and wake up the system for hibernation. If not available, or HibernateDelaySec= is set, the system would regularly wake up to check the time and detect the battery percentage/discharging rate. The rate is used to schedule the next detection. If that is also not available, SuspendEstimationSec= is used as last resort.

After setting HibernateDelaySec to a value, now it works fine as it should.

you must uncomment that line with the parameter in order for the value to be read, yes?

[Sleep]
#AllowSuspend=yes
#AllowHibernation=yes
#AllowSuspendThenHibernate=yes
#AllowHybridSleep=yes
#SuspendState=mem standby freeze
#HibernateMode=platform shutdown
#HibernateDelaySec=
SuspendEstimationSec=60min

I simply created a new file
/etc/systemd/sleep.conf.d/sleep-then-hibernate.conf

with the following content:

[Sleep]
HibernateDelaySec=3600
2 Likes

Thank you, I always wondered when that’d happen or if it was broken. So I was never using it after testing.
Seems to be set to

HibernateDelaySec=4

by default …?
So that mean it did not work here.

Hibernate needs some prior preparation depending on your distro, does hibernate alone works for you?

Perfectly.
:grinning:

4 seconds might not be enough time
try 4min instead.

1 Like

i like that better (recommended approach).

does the initramfs need to be rebuilt for these changes take effect, or do you just reboot?

Maybe these defaults need to be adjusted. Or maybe distros set them individually.

I simply restarted my laptop and it worked.