Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== 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. wiki/linux/disable_system_sleep.txt Last modified: 2025/01/07 12:37by Greg