I am getting a web server setup at home on an older AMD 2400+ desktop. I have Ubuntu 11.04 installed and running however, after a time, I can no longer browse to the server. When I go to the keyboard and press a key, everything magically works again.
I have looked through the BIOS and I am not seeing any power saving features enabled. Is there anything like that in Ubuntu? Can it be disabled?
I don't have any GUI installed. This is console only.
On Ubuntu 16.04 LTS, I successfully used the following to disable suspend:
And this to re-enable it:
From
man systemctl
:GUI
Have you looked at:
System -> Preferences -> Power Management
On AC Power Tab, Put computer to sleep when inactive for: "Never"
Terminal
Can you open up "gconf-editor"?
Look in:
/apps/gnome-power-manager/timeout
Try setting
sleep_computer_ac
to0
I'm not positive if anything else needs to be changed as well.
The right answer for this located here:
None of these described solutions worked for me. The laptop was still going to sleep. Using the Grub Linux command line option of acpi=off caused the laptop to fail to boot. I finally found this solution.
Based on the original solution from Stephan here: Keep Ubuntu Server running on a laptop with the lid closed?
Please try looking into these links - cyberciti.biz and Arch forums
This is an excerpt from the cyberciti.biz link:
In addition to the systemctl mask/unmask options, I also use the following to turn suspend on/off for the Gnome desktop.
or
I found these by exploring the settings revealed by the commands listed in How to dump ALL dconf/gsettings so that I can compare them between two different machines?
Just wanted to note my problems with the accepted answer and provide an alternative solution:
Masking
sleep.target
,suspend.target
etc. usingsystemctl
does do the job, but know thatsystemd-logind
will still try to callsleep.target
(or which ever)!@Djizeus reports that this resulted in an indefinite CPU usage of 70-100% after closing the lid. Personally I experienced
systemd-logind
spamming my/var/log/auth.log
until it filled the disk (tens and tens of lines per second reportingsleep
is masked).Taken again from @Djizeus' comment: "[t]he solution is to ignore the lid with
HandleLidSwitch=ignore
in/etc/systemd/logind.conf
".I found Light Locker, as I have Ubuntu 14.04.2 with LXDE (Lubuntu) Desktop; if you have this desktop you can change the default and manage the monitor through that. Otherwise you might have to install gconf-editor through terminal if you don't have it. Light Locker is in can be found in Preferences in the main menu.