LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   how to disable suspension in Ubuntu 20.04? (https://www.linuxquestions.org/questions/ubuntu-63/how-to-disable-suspension-in-ubuntu-20-04-a-4175685368/)

linuxUser247 11-17-2020 02:54 AM

how to disable suspension in Ubuntu 20.04?
 
How can i disable suspension in Ubuntu 20? I think i solved my problem but i wanted someone to look over it.

I applied the following solution:

Code:

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

based on https://askubuntu.com/a/1043652/881300

and this is perfectly working. I now am no longer able to select these options in the power off menu from the desktop.


Is this only disabled for the user or also for the system? I don't have `pm-hibernate` installed.

I tried to apply this solution to additionally disable automatic suspension. But the path to the file does not exist, i think it changed from

`/etc/polkit-1/localauthority/50-local.d/com.ubuntu.disable-suspend.pkla` to
`/etc/polkit-1/localauthority.conf.d/50-localauthority.conf`

but the file contents are very different.

I found this but power settings are no longer available.

Pentium4User 11-17-2020 11:31 PM

As I know, this will disable the functionality.
Try
Code:

systemctl suspend
This should result in an error.

linuxUser247 11-18-2020 05:54 AM

I just tried that and it works:

Quote:

systemctl suspend
Code:

Failed to suspend system via logind: Access denied
Failed to start suspend.target: Unit suspend.target is masked.



All times are GMT -5. The time now is 08:17 AM.