Linux – prevent desktop arch linux box from sleeping

arch linuxsystemd

I updated my ArchLinux box earlier this week and it has started going to sleep when nobody is logged in locally. I want to access this box remotely and continue running Cron jobs overnight, which this sleep currently breaks.

https://pastebin.com/qG4gHmrY contains journal entries around the time the system last went to sleep

I disabled auto-suspend in Gnome yesterday after noticing GDM displaying a message saying it was going to do this, but it didn't appear to have any effect.

Any suggestions would be appreciated! I've been struggling to know what details would be relevant/useful to help diagnose this, please let me know…

Things I've checked:

  • Config in /etc/systemd/logind.conf has #IdleAction=ignore
  • Lots of seaching for "sleep", "hibernate", "suspend" in /etc and journalctl output

Most search results seem to be people interested in making it work. It works amazingly well (so well I didn't notice it had been enabled at all), I think I just want to turn it off!

Best Answer

I asked about this on the arch linux IRC channel, and had the following response:

<Namarrgon> smason: it's a bug in gdm
<Namarrgon> when you disabl automatic suspend in gnome it doesn't affect gdm itself

based on this, I found a relevant looking exchange: https://unix.stackexchange.com/a/361275/90376

which I altered to the following commands:

sudo machinectl shell gdm@ /bin/bash
export GSETTINGS_BACKEND=dconf
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0

This has now been running for a couple of days and my cron and other background jobs remain running over night.

Related Question