====== 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): systemctl mask sleep.target systemctl mask suspend.target systemctl mask hibernate.target systemctl mask hybrid-sleep.target 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.