Olivine logo
jpnt blog / Journal / Disable Suspend on Linux

Disable Suspend on Linux

#systems

Disable / Mask services using systemctl

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Edit "/etc/systemd/logind.conf" to avoid errors and high CPU usage

HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore

Restart systemd-logind

sudo systemctl restart systemd-logind

Check for errors

journalctl -xe

That's it!