I have seen the answer on How to disable hibernating?, but I have no such file. Possibly because that suggestion was written for Ubuntu, not Kubuntu (KDE, not Gnome).
I do not have a swap on my encrypted SSD, my system freezes (cannot even change Caps Lock) if I accidentally press the "Hibernate" button at "Energy management". My keyboard has a Hibernate button (Fn + F4) next to the volume control buttons and every time I press the wrong key, the system will freeze after.
So, what is the correct way to disable it? If there is no solution, a work-around is welcome too.
Triggers for hibernation:
qdbus org.kde.kded /modules/powerdevil suspend 4
When hibernation is triggered, this is the execution flow:
/usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux
is called/usr/sbin/pm-hibernate
is called with some arguments/var/log/pm-suspend.log
/usr/lib/pm-utils/sleep.d/
and/etc/pm/sleep.d
, and sorted by name (numbers first)performing hibernate
is written to the logdo_hibernate
is called, instructing the system to hibernateTo disable hibernation, create
/etc/pm/sleep.d/000no-hibernation
with the next content:As
000no-hibernation
is called before scripts like00logging
(outputs modules and memory info in the log), no applications or modules are interrupted or unloaded. This name was inspired by/usr/lib/pm-utils/sleep.d/000kernel-change
. Beware of bug #665651 which makes non-zero return values of hooks fail to cancel suspend or hibernation.This fixes the hibernation issue for me. Although the screen gets locked, I can live with this. It's much better compared to a crashing system.