Ubuntu Disable Suspend: Difference between revisions

From CompleteNoobs
Jump to navigation Jump to search
Created page with "Tested on Ubuntu-mate 20.04<br \> Tested on Ubuntu-server 20.04<br \> <br \> installed ubuntu server 20.04 on giga home server and found it would suspend every 30 minutes if i was not logged in with ssh. does not suspend on virtualbox just on real hardware when xorg is installed. disable suspend:<br \> <code>sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target</code> and if you want to re-enable suspend:<br \> <code>sudo systemctl unmask..."
 
(No difference)

Latest revision as of 17:21, 5 March 2023

Tested on Ubuntu-mate 20.04
Tested on Ubuntu-server 20.04

installed ubuntu server 20.04 on giga home server and found it would suspend every 30 minutes if i was not logged in with ssh. does not suspend on virtualbox just on real hardware when xorg is installed.

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

and if you want to re-enable suspend:
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target

for more on the mask and unmask check 'man systemctl'

mask UNIT...
           Mask one or more units, as specified on the command line. This will link these unit files to /dev/null, making it impossible to start them. This is a stronger version of disable, since it
           prohibits all kinds of activation of the unit, including enablement and manual activation. Use this option with care. This honors the --runtime option to only mask temporarily until the next
           reboot of the system. The --now option may be used to ensure that the units are also stopped. This command expects valid unit names only, it does not accept unit file paths.
unmask UNIT...
           Unmask one or more unit files, as specified on the command line. This will undo the effect of mask. This command expects valid unit names only, it does not accept unit file paths.