![我如何知道是什么阻止了 Ubuntu 睡眠?我的盒子不会自动睡眠!](https://linux22.com/image/1008398/%E6%88%91%E5%A6%82%E4%BD%95%E7%9F%A5%E9%81%93%E6%98%AF%E4%BB%80%E4%B9%88%E9%98%BB%E6%AD%A2%E4%BA%86%20Ubuntu%20%E7%9D%A1%E7%9C%A0%EF%BC%9F%E6%88%91%E7%9A%84%E7%9B%92%E5%AD%90%E4%B8%8D%E4%BC%9A%E8%87%AA%E5%8A%A8%E7%9D%A1%E7%9C%A0%EF%BC%81.png)
通过菜单手动休眠 Ubuntu 桌面效果很好。我已将首选项设置为“不活动时暂停”并持续“5 分钟”。但计算机经常不休眠。
在 Windows 上,我使用它powercfg -requests
来查看延迟的原因。在 Mac 上,我可以使用它pmset -g assertions
来查看是什么阻止了睡眠 (来源)。
我认为 Chrome 可能正在阻止睡眠,但我不确定。
有没有 Linux 中类似的方法可以找到答案?动力顶可以这样使用吗?
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
您需要找到抑制因素,也就是哪些进程阻止了您的暂停:
systemd-inhibit --list --mode=block
这将列出那些“不想睡觉”的进程
答案2
您必须设置:
- 系统设置>电源设置为10分钟后关闭。
- 系统设置>亮度和锁定,10 分钟后关闭屏幕。
对于电池和“插入电源时”:
$ 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
您还可以设置:
org.gnome.settings-daemon.plugins.power
sleep-display-battery
设置为低于
sleep-inactive-battery-timeout