User Tools

Site Tools


wiki:linux:disable_system_sleep

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
wiki:linux:disable_system_sleep [2025/01/07 12:36] – removed - external edit (Unknown date) 127.0.0.1wiki:linux:disable_system_sleep [2025/01/07 12:37] (current) – ↷ Page moved from wiki:linux:install_davinci_resolve:wiki:linux:disable_system_sleep to wiki:linux:disable_system_sleep Greg
Line 1: Line 1:
 +====== Disable System Sleep on Linux (SystemD) ======
  
 +Sometimes (a lot of times...) you have systems that you don't want to go to sleep. While you could login to each system and disable it through your desktop environment or push out a change through DConf (ugh **shudders**), there is a much better way to do so programmatically that is also much easier to script or codify for configuration management systems (yay for Puppet!).
 +
 +Run the commands below (as root, or prefix with sudo):
 +
 +<code>
 +systemctl mask sleep.target
 +systemctl mask suspend.target
 +systemctl mask hibernate.target
 +systemctl mask hybrid-sleep.target
 +</code>
 +
 +Nice and easy. You can run that script via SSH or Ansible-ize it or however you prefer to push those changes out to systems at scale.
 +
 +SystemD has its warts, but this isn't one of them.