[SOLVED] How to prevent Debian Buster from hibernating?
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
One of my servers suffered a hard disk crash so I bit the bullet and fitted a new SSD onto which I did a netinst of Debian 10 and chose the Gnome desktop. In the Settings->Power UI dialog, I've turned off Automatic Suspend but the machine still goes into 'hibernation' (is this the same as 'suspend') after a short time. I have a virtual machine running on this host, so the host has at least one active process all the time.
How can I stop this machine from 'going to sleep'? Any help gratefully received.
from a simple web search:( How to prevent Debian Buster from hibernating? https://wiki.debian.org/Suspend#Disa...nd_hibernation,) hope it helps? I used KDE which also needs a little messing around stopping it but I do that all through the GUI.
Have fun!
Last edited by jamison20000e; 09-17-2019 at 07:44 PM.
Reason: Typ0s
from a simple web search:( How to prevent Debian Buster from hibernating? https://wiki.debian.org/Suspend#Disa...nd_hibernation,) hope it helps? I used KDE which also needs a little messing around stopping it but I do that all through the GUI.
Have fun!
Many thanks for the link. Using the systemctl mask command resulted in the ".target" symlinks being reset to point to /dev/null, which makes a lot of sense.
FWIW, I tried searching the net but only found info on enabling hibernation. [turns and walks slowly from keyboard!].
FWIW2, I had kludged it by adding an instruction in crontab to echo something to /dev/null every five minutes. That achieved the objective, but didn't seem 'proper'!
On debian 11, gnome settings are not effective, if you are not logged in gnome. Bellow setting is ignored as well and the system is going to sleep after time.
Code:
# /etc/systemd/logind.conf
IdleAction=ignore
Here is workaround, which works for me:
Create service (maybe with another test expression) and enable it.
Code:
# /usr/lib/systemd/system/inhibit-sleep.service
[Unit]
Description=If AC is online, inhibit sleep
Before=sleep.target
[Service]
Type=oneshot
ExecStart=/bin/sh -c 'grep -qv 1 /sys/class/power_supply/AC/online'
[Install]
RequiredBy=sleep.target
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.