1

I have a machine that I access only via SSH that I just updated to Debian 10 a couple of days ago. Since the update it seems to be going to sleep when it is inactive. This has never happened with previous updates like from 7 to 8 or from 8 to 9. It seems like maybe the sleep settings have reverted to a default state. How can I view and edit the power and sleep settings in the command line? Any guidance much appreciated. Thanks!

  • check this askubuntu.com/questions/47311/… if it helps – asktyagi Jul 11 at 2:43
  • Do you have a desktop environment installed? (I know you’re asking about the command-line, but if you have gdm3 running, its configuration needs fixing in Debian 10 to avoid sleeping.) – Stephen Kitt Jul 11 at 5:26
  • Thanks for your reply. Yes, I do. I can go to where I have the machine running and log in to the GUI temporarily. What do you recommend? – user308520 Jul 11 at 9:52
3

I ran into this with gdm3 after upgrading to Debian 10: whenever the computer was left at the initial login screen, it would go to sleep after a while.

To fix this, I had to edit the power settings for GNOME when running the gdm3 session; these are stored in /etc/gdm3/greeter.dconf-defaults, and the the lines to edit are those in the “Automatic suspend” section at the end of the file:

# Automatic suspend
# =================
[org/gnome/settings-daemon/plugins/power]
# - Time inactive in seconds before suspending with AC power
#   1200=20 minutes, 0=never
# sleep-inactive-ac-timeout=1200
# - What to do after sleep-inactive-ac-timeout
#   'blank', 'suspend', 'shutdown', 'hibernate', 'interactive' or 'nothing'
sleep-inactive-ac-type='blank'
# - As above but when on battery
# sleep-inactive-battery-timeout=1200
# sleep-inactive-battery-type='suspend'

Specifically, I changed sleep-inactive-ac-type to 'blank'.

I didn’t have to make any changes to the systemd or logind setup; this means that if I want to, I can still suspend the system manually.

1

you can try the following based on your needs:
Disable suspend and hibernation:

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

To re-enable hibernate and suspend use the following command:

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

If you just want to prevent suspending when the lid is closed you can set the following options in /etc/systemd/logind.conf:

[Login]
HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore

restart the service or reboot your machine

systemctl restart systemd-logind.service

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.