0

I have a latest Ubuntu 20 LTS dekstop with cinnamon UI. If I turn on my PC but don't log in, my PC go to sleep after a while, getting unreachable via SSH. I can wake it up by pressing a button on the keyboard locally, but with wake-on-lan.

How I can prevent to go into sleep?

I googled it a lot and tried to set IdleAction=ignore in /etc/systemd/logind.conf file and few other things as below, but nothing helped. What else I can do to avoid going into sleep state? I want to reach that PC remotely as well so quite important. Thanks a lot in advance! I guess this is something related to Ubuntu's login screen as logind.conf helped me in case of an Ubuntu server.

$ sudo su
# su lightdm -s /bin/bash
# gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
Halacs
  • 101
  • 3
  • I'm not sure, but I'd search on systemd, for example in my lubuntu I have the acpid that is running. Then I'd try to disable it with systemctl disable acpid.service then try to reboot. – Lews Oct 08 '20 at 20:37
  • Unfortunately there is no acpi/acpid service on my PC. – Halacs Oct 09 '20 at 13:52
  • anyway you have to search in the systemd services. Try to run the following to list the services: systemctl list-units *.service | grep running – Lews Oct 09 '20 at 14:14
  • I noticed an upower.service I don't know: https://gist.github.com/halacs/1629c1437743ffe1100e2d1f8f6affb7 – Halacs Oct 09 '20 at 17:21
  • I don't find anything of interesting. Then I'd try to search in the "power management" of your windows manager.. for example I have Lubuntu and in the control panel there is the power manager tab to control sleep and hibernate. – Lews Oct 09 '20 at 18:11
  • https://help.ubuntu.com/stable/ubuntu-help/power-autosuspend.html.en – Lews Oct 09 '20 at 18:15
  • Do you think that below X11 related error can block my change? I can reach my PC now only via SSH. I guess it should not. https://gist.github.com/halacs/fc2a0a95704dd823f4e802071f2310a9 – Halacs Oct 09 '20 at 18:36

1 Answers1

0

I did this : sudo -u gdm dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'

got it from Prevent sleep/suspend when not logged in to a specific account