LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 09-17-2019, 05:09 PM   #1
Geoff_L
Member
 
Registered: Jan 2013
Posts: 42

Rep: Reputation: Disabled
How to prevent Debian Buster from hibernating?


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.
 
Old 09-17-2019, 07:35 PM   #2
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
Hi.

Good choice on distro!

Debian says try:
Code:
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
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
 
Old 09-18-2019, 04:09 AM   #3
Geoff_L
Member
 
Registered: Jan 2013
Posts: 42

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jamison20000e View Post
Good choice on distro!

Debian says try:
Code:
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
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'!

Thanks again, Geoff
 
1 members found this post helpful.
Old 09-18-2019, 05:07 AM   #4
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
Thumbs up

Glad it worked.

As for the workaround, I do stuff like that all the time. Who cares about proper if it don't hurt anything!
 
Old 02-08-2022, 02:52 PM   #5
tchor
LQ Newbie
 
Registered: Feb 2022
Posts: 1

Rep: Reputation: 0
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
 
  


Reply

Tags
buster, hibernation



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How To: Remastering Debian Stretch/Buster using Linux-live-debian-050419 into a Live CD/DVD/USB/HDD linus72 Debian 1 10-14-2019 01:25 PM
LXer: Debian 11 "Bullseye" and Debian 12 "Bookworm" Are Coming After Debian 10 "Buster" LXer Syndicated Linux News 0 04-18-2018 12:26 PM
About hibernating the Debian wheezy system rupeshforu Linux - Newbie 13 05-28-2013 09:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 05:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration