25

Manually sleeping my Ubuntu desktop from a menu works fine. I've set preferences to "Suspend when inactive" for "5 Minutes". Yet the computer often does not sleep.

On Windows, I use powercfg -requests to see what the hold-up is. On a Mac, I can use pmset -g assertions to see what's preventing sleep (Source).

I think maybe Chrome is preventing sleep, but I can't be sure.

Is there a Linux equivalent way to find out? Can powertop be used this way?

14.04 LTS> gsettings list-recursively | grep plugins.power
org.gnome.settings-daemon.plugins.power button-power 'interactive'
org.gnome.settings-daemon.plugins.power critical-battery-action 'suspend'
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 'hibernate'
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'suspend'
org.gnome.settings-daemon.plugins.power button-sleep 'suspend'
org.gnome.settings-daemon.plugins.power button-suspend 'suspend'
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 'suspend'
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 'suspend'
org.gnome.settings-daemon.plugins.power time-action 120
org.gnome.settings-daemon.plugins.power lid-close-battery-action 'suspend'
org.gnome.settings-daemon.plugins.power idle-brightness 30
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 300
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
org.gnome.settings-daemon.plugins.power button-power 'interactive'
org.gnome.settings-daemon.plugins.power critical-battery-action 'suspend'
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 'hibernate'
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'suspend'
org.gnome.settings-daemon.plugins.power button-sleep 'suspend'
org.gnome.settings-daemon.plugins.power button-suspend 'suspend'
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 'suspend'
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 'suspend'
org.gnome.settings-daemon.plugins.power time-action 120
org.gnome.settings-daemon.plugins.power lid-close-battery-action 'suspend'
org.gnome.settings-daemon.plugins.power idle-brightness 30
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 300
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


cat /etc/default/acpi-support | grep SUSPEND_METHODS

SUSPEND_METHODS="dbus-pm dbus-hal pm-utils"
  • 1
    Which version of ubuntu are you running? On a recent one, with systemd, you can check the logs with journalctl. On older systems, without systemd, you might want to check dmesgand /var/log/syslog for messages that tell you what is going on. You could also check with iotop to see if something is active on your disk. – Robert Riedl Jun 12 '18 at 6:26
  • 1
    Ubuntu 14.04 in this case. dmesg and syslog don't really give any clues. It seems it could be a web browser related issue, but of course a web browser is always running. – Bryce Jun 12 '18 at 8:30
  • 1
    Could you edit your question and provide the output to gsettings list-recursively | grep plugins.power and ping me @Fabby? – Fabby Jun 16 '18 at 10:21
  • 3
    Have you tried to suspend it form the command line ? With powermanagement-interface installed you can try pmi action suspend of pm-suspend. May need sudo. That could help you debug, as you don't have to wait for your PC to try and suspend on tits own. – Robert Riedl Sep 14 '18 at 6:24
  • 3
    I am looking for an canonical answer to how one lists what services are blocking sleep, for general debugging now and into the future. – Bryce Sep 18 '18 at 1:26
2

You need to find the inhibitors, a.k.a. which processes are preventing your suspend:

systemd-inhibit --list --mode=block

That will list the processes which do not "want to sleep"

| improve this answer | |
1

You have to set:

  • System Settings > Power set to turn off after 10 minutes.
  • System Settings > Brightness and Lock to turn off the screen after 10 minutes.

for both battery and "when plugged in":

$ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 300
$ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 300

you can also set:

org.gnome.settings-daemon.plugins.power sleep-display-battery to a value lower than the value of sleep-inactive-battery-timeout

| improve this answer | |

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