Hi, whenever I put my laptop to sleep either through the sleep button in the start menu or by shutting the lid my computer will shutdown instead. This only happens if my laptop isn’t plugged in.
I’m using Fedora 42 and Plasma 6.5.1
Here the about for my laptop:
- Operating System: Fedora Linux 42
- KDE Plasma Version: 6.5.1
- KDE Frameworks Version: 6.19.0
- Qt Version: 6.9.3
- Kernel Version: 6.16.11-1.surface.fc42.x86_64 (64-bit)
- Graphics Platform: Wayland
- Processors: 12 × 12th Gen Intel® Core™ i7-1265U
- Memory: 32 GiB of RAM (31.2 GiB usable)
- Graphics Processor: Intel® Iris® Xe Graphics
- Manufacturer: OEMID
- Product Name: OEMID Product
- System Version: 124I:00099T:000M:0200000D:0B:04F:1C:04P:01Y:1U:00S:0
If there’s anything that woul be helpful to include please tell me.
Thanks
hi, welcome.
i believe this is a feature, not a bug.
when on battery power, the system is supposed to periodically wake up to check the battery status, then at a predetermined point in the battery charge state it will shutdown (or hibernate) to avoid data loss if the battery is nearly dead.
if this is occurring too much it could be the battery is failing or the threshold is set too high.
what are the contents of /etc/systemd/sleep.conf
what is the output of these commands
cat /sys/power/state
cat /sys/power/mem_sleep
cat /sys/power/disk
1 Like
Yes - in the Mangy forums, we talked about creating options to ‘sleep then hibernate’ or ‘sleep then shutdown’… It’s possible to go for a 4 hour delay, but also it’s important to have options to monitor laptop battery power and hibernate if it’s getting low.
You can adjust battery thresholds if that’s the trigger (sleep.conf) and you can also force a deeper sleep state (deep instead of s2idle).
Overall, you need Fedora specific answers here, not KDE.
sleep.conf (although it was in usr/lib/systemd so I hope its the right file) :
#AllowSuspend=yes
#AllowHibernation=yes
#AllowSuspendThenHibernate=yes
#AllowHybridSleep=yes
#SuspendState=mem standby freeze
#HibernateMode=platform shutdown
#MemorySleepMode=
#HibernateDelaySec=
#HibernateOnACPower=yes
#SuspendEstimationSec=60min
cat /sys/power/state:
freeze mem disk
cat /sys/power/mem_sleep:
[s2idle]
cat /sys/power/disk:
[platform] shutdown reboot suspend test_resume
those commented out lines are the system defaults…. to change a setting uncomment the line and change the value.
i would consider this edit as a first cut at investigating your issue.
#AllowSuspend=yes
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=no
#SuspendState=mem standby freeze
HibernateMode=shutdown
#MemorySleepMode=
HibernateDelaySec=60s
#HibernateOnACPower=yes
SuspendEstimationSec=60min
it should stop the machine from hibernation at all and should only suspend keeping everything in ram until the battery is exhausted… you don’t want to leave it like this, but should help troubleshoot.
man systemd-sleep.conf
for more info.
if that works to prevent hibernation, then change these two back to yes
AllowHibernation=yes
AllowSuspendThenHibernate=yes
and after one minute of sleep it should wake up and then shutdown instead of hibernate.
1 Like