Python / Odoo Developer

Welcome!

This community is for professionals and enthusiasts of our products and services. Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

0

Disable shutdown / sleep / hibernate Linux MASK

Avatar
Administrator

Open

One option is to use the Gnome "suspend-button" extension at https://extensions.gnome.org/extension/826/suspend-button/

Another option, under Gnome shell, is to simply press ALT before clicking the shutdown button in the user menu.

Disable suspend and hibernation

For systems which should never attempt any type of suspension, these targets can be disabled at the systemd level with the following:

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

To re-enable hibernate and suspend use the following command:

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

If you just want to prevent suspending when the lid is closed you can set the following options in /etc/systemd/logind.conf:

[Login]
HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore

Then run systemctl restart systemd-logind.service or reboot.

More information is available in the manpage: man logind.conf

Avatar
Discard