Ubuntu Server Continuously "goes to sleep"

Add the kernel options acpi=off apm=off to the contents of GRUB_CMDLINE_LINUX_DEFAULT in file /etc/default/grub

Then run sudo update-grub

Finally reboot your computer.


On Ubuntu 16.04 LTS, I successfully used the following to disable suspend:

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

And this to re-enable it:

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

Add the kernel options acpi=off apm=off to the contents of GRUB_CMDLINE_LINUX_DEFAULT in file /etc/default/grub

Then run sudo update-grub

Finally reboot your computer.

According to https://wiki.ubuntuusers.de/Bootoptionen its a bad idea to turn off acpi complete as it may cause overheating because of turning off fan control.

This is a very old question. Just for other people who may have similar issue check /etc/systemd/logind.conf if it fits to the configuration you need. It may be that IdleActionSec is set to an unusual high value and IdleAction is set to suspend.