Ubuntu Mate Auto Suspend 20 Minutes After It Restart

Hello,

in May i upgraded to Ubuntu Mate 18.04 coming from Ubuntu Mate 17.04, so in the same day i perform two system upgrade (17.04->17.10 and 17.10->18.04).

Since the upgrade to 18.04 my server automatically suspend exactly 20 minutes after a reboot, no matter if i’m using it or not (e.g. it suspend even if i’m controlling it with xrdp):

Aug 23 15:22:34 Server_Kimsufi systemd[1]: Mounted Huge Pages File System.
Aug 23 15:22:34 Server_Kimsufi systemd[1]: Mounted Kernel Debug File System.
Aug 23 15:22:34 Server_Kimsufi systemd[1]: Started Uncomplicated firewall.
Aug 23 15:22:34 Server_Kimsufi kernel: [    0.000000] Linux version 4.15.0-32-generic ([email protected]) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #35-Ubuntu SMP Fri Aug 10 17:58:07 UTC 2018 (Ubuntu 4.15.0-32.35-generic 4.15.18)
Aug 23 15:22:34 Server_Kimsufi kernel: [    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.15.0-32-generic root=UUID=0e1a682a-ce60-44e1-9686-0bb567077d7f ro net.ifnames=0
.
.
.
.
.
.
Aug 23 15:42:45 Server_Kimsufi NetworkManager[927]: <info>  [1535031765.8742] manager: sleep: sleep requested (sleeping: no  enabled: yes)
Aug 23 15:42:45 Server_Kimsufi NetworkManager[927]: <info>  [1535031765.8941] manager: sleep: wake requested (sleeping: yes  enabled: yes)

This force me to do a restart on the server web control panel to be able to use the server again, from scratch, for another 20 minutes.

To be able to use the server for more than 20 minutes i was forced to mask the suspend service, to disable suspend in the hard way:

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

Unfortunately this create problem with systemd-logind.service causing it to crash and restart when suspend occurred:

Aug 23 15:42:45 Server_Kimsufi NetworkManager[927]: <info>  [1535031765.8742] manager: sleep: sleep requested (sleeping: no  enabled: yes)
Aug 23 15:42:45 Server_Kimsufi NetworkManager[927]: <info>  [1535031765.8941] manager: sleep: wake requested (sleeping: yes  enabled: yes)
Aug 23 15:42:45 Server_Kimsufi systemd[1]: systemd-logind.service: Main process exited, code=exited, status=1/FAILURE
Aug 23 15:42:45 Server_Kimsufi systemd[1]: systemd-logind.service: Failed with result 'exit-code'.
Aug 23 15:42:45 Server_Kimsufi systemd[1]: systemd-logind.service: Service has no hold-off time, scheduling restart.
Aug 23 15:42:45 Server_Kimsufi upowerd[2046]: Could not acquire inhibitor lock: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
Aug 23 15:42:45 Server_Kimsufi systemd[1]: systemd-logind.service: Scheduled restart job, restart counter is at 1.
Aug 23 15:42:46 Server_Kimsufi systemd[1]: Stopped Login Service.
Aug 23 15:42:46 Server_Kimsufi ModemManager[922]: <warn>  [sleep-monitor] inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
Aug 23 15:42:46 Server_Kimsufi systemd[1]: Starting Login Service...
Aug 23 15:42:46 Server_Kimsufi systemd[1]: Started Login Service.

Looking on internet i found something related to this problem:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=893574
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=893964#22
https://gitlab.gnome.org/GNOME/gnome-control-center/issues/22
https://bugzilla.redhat.com/show_bug.cgi?id=1558485

I tried to disable the power saving setting in the Ubuntu Mate Power GUI, and also to follow the suggestion of the above posts, disabling with dconf all the power setting and timeout under:

org/gnome/settings-daemon/plugins/power

Unfortunately this doesn’t help, and my system still suspend 20 minutes after a restart.

The strange thing is: with the systemctl mask on sleep service (as shown above), after a restart the system try to suspend after 20 minute. It fails to suspend since the service is disable but after that it doesn’t try to go to sleep in the next 20 minutes. So the system want to sleep only one time (20 minutes after the restart) and not periodically (every 20 minutes).

Does someone know if i’m missing some new power setting or if it is a bug?

That’s the default behavior- suspending the system after 20 minutes(1200 seconds) of inactivity…
Did you try changing the time using gsettings?

Try this to suspend after 2 hours i.e. 7200 seconds…(assuming you’re machine is on AC power)
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 7200

I already tried to change the timeout using dconf, setting it to 0 (infinite).

In fact, gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout return 0.

I already tried to disable every parameter under org.gnome.settings-daemon.plugins.power but nothing worked.

gsettings list-recursively org.gnome.settings-daemon.plugins.power return:

org.gnome.settings-daemon.plugins.power button-power 'nothing'
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
org.gnome.settings-daemon.plugins.power power-button-action 'nothing'
org.gnome.settings-daemon.plugins.power critical-battery-action 'nothing'
org.gnome.settings-daemon.plugins.power percentage-low 10
org.gnome.settings-daemon.plugins.power priority 0
org.gnome.settings-daemon.plugins.power lid-close-suspend-with-external-monitor false
org.gnome.settings-daemon.plugins.power idle-dim true
org.gnome.settings-daemon.plugins.power button-hibernate 'nothing'
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
org.gnome.settings-daemon.plugins.power button-suspend 'nothing'
org.gnome.settings-daemon.plugins.power button-sleep 'nothing'
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0
org.gnome.settings-daemon.plugins.power time-low 1200
org.gnome.settings-daemon.plugins.power lid-close-ac-action 'nothing'
org.gnome.settings-daemon.plugins.power notify-perhaps-recall true
org.gnome.settings-daemon.plugins.power percentage-critical 3
org.gnome.settings-daemon.plugins.power percentage-action 2
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'nothing'
org.gnome.settings-daemon.plugins.power time-action 120
org.gnome.settings-daemon.plugins.power lid-close-battery-action 'nothing'
org.gnome.settings-daemon.plugins.power idle-brightness 30
org.gnome.settings-daemon.plugins.power ambient-enabled true
org.gnome.settings-daemon.plugins.power time-critical 300
org.gnome.settings-daemon.plugins.power active true
org.gnome.settings-daemon.plugins.power use-time-for-policy true

I’m seeing a lot of nothing

For example sleep-inactive-ac-type should be suspend for the sleep-inactive-timeout to work…

Even with all the nothing, does your machine go to suspend after 20 minutes? In the power management, there is an option called put your computer to sleep when inactive for… that should be set to never.

I voluntarily set all these nothing trying to disable this automatic sleep problem; despite these settings my machine still suspend 20 minutes after a restart.

My machine is a server so i don’t want it to suspend, or hibernate or anything else; it must stay always on.

I also just tried to set:

org.gnome.settings-daemon.plugins.power active false
org.gnome.settings-daemon.plugins.power use-time-for-policy false

but it still suspend.

Under power management GUi i already set both time to never.

See if this works:
gsettings set org.gnome.desktop.session idle-delay 0
Before doing this get the default value of idle-delay in case you need to revert…

Unfortunately it did not work:

Aug 27 11:42:30 Server_Kimsufi NetworkManager[830]: <info>  [1535362950.9872] manager: sleep: sleep requested (sleeping: no  enabled: yes)
Aug 27 11:42:31 Server_Kimsufi NetworkManager[830]: <info>  [1535362951.0034] manager: sleep: wake requested (sleeping: yes  enabled: yes)