我在网上搜索了一些答案,虽然我在 google、这里或 reddit 上找到的一些答案似乎有帮助,但实际上都没有帮助。
[问题]
当我打开电源管理器应用程序时,我可以选择当盖子关闭时要做什么。我选择的是“挂起”。当我关闭盖子时,问题就出现了。关闭后,笔记本电脑进入挂起状态,然后当我打开盖子时,屏幕变黑。如果我再次关闭盖子并立即打开,笔记本电脑就会从挂起状态唤醒。
[一些相关信息]
CPU i7-7500u (kaby) Intel HD 620 显卡 Xubuntu 16.04
启用英特尔专有驱动程序
我还通过英特尔的“图形更新工具”下载并安装了驱动程序
uname -a(我已经更新了内核,希望它能解决这个问题)
Linux pcname 4.7.0-040700-generic #201608021801 SMP 2016 年 8 月 2 日星期二 22:03:09 UTC x86_64 x86_64 x86_64 GNU/Linux
[我试过]
取消注释#HandleLidSwitch=暂停代替/etc/systemd/logind.conf并重新启动 logind 服务虽然我不清楚是否还应该打开电源管理器应用程序并将盖子操作切换为除暂停之外的其他操作?
我也尝试通过 acpi 来执行此操作: lid.sh.post里面的脚本/etc/acpi/本地(该脚本也使用 chmod 755 ):
#!/bin/bash
if grep -q closed /proc/acpi/button/lid/*/state
then
/usr/sbin/pm-suspend
fi
它也不起作用。
有趣的是,如果我登录到第一个虚拟控制台并发出 pm-suspend,然后恢复并切换到第 7 个控制台(我的 GUI 所在的位置),它会正常唤醒。不确定这是否有助于进一步确定问题?
我已经束手无策了……我只想让这个混蛋正常暂停并恢复……我对暂停过程了解不多,所以如果有人需要我发布更多信息,请告诉我。我尽量提前发布尽可能多的信息。
暂停时的系统日志条目
Nov 16 00:48:36 dev-pc systemd[1]: Starting Network Manager Script Dispatcher Service...
Nov 16 00:48:36 dev-pc systemd[1]: Reached target Sleep.
Nov 16 00:48:36 dev-pc systemd[1]: Starting Suspend...
Nov 16 00:48:36 dev-pc dbus[921]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Nov 16 00:48:36 dev-pc systemd[1]: Started Network Manager Script Dispatcher Service.
Nov 16 00:48:36 dev-pc nm-dispatcher: req:1 'down' [wlp1s0]: new request (1 scripts)
Nov 16 00:48:36 dev-pc nm-dispatcher: req:1 'down' [wlp1s0]: start running ordered scripts...
Nov 16 00:48:36 dev-pc wpa_supplicant[1290]: nl80211: deinit ifname=wlp1s0 disabled_11b_rates=0
Nov 16 00:48:46 dev-pc systemd-sleep[6120]: Selected interface 'p2p-dev-wlp1s0'
Nov 16 00:48:46 dev-pc systemd-sleep[6120]: 'SUSPEND' command timed out.
Nov 16 00:48:46 dev-pc systemd-sleep[6122]: /lib/systemd/system-sleep/wpasupplicant failed with error code 254.
Nov 16 00:48:46 dev-pc systemd-sleep[6120]: Suspending system...
内核接管……一段时间后
Nov 16 00:48:54 dev-pc systemd[1]: snapd.refresh.timer: Adding 1h 59min 13.126529s random time.
Nov 16 00:48:54 dev-pc systemd[1378]: Time has been changed
Nov 16 00:48:54 dev-pc systemd[1]: Starting Load/Save RF Kill Switch Status...
Nov 16 00:48:54 dev-pc systemd[1]: bluetooth.target: Unit not needed anymore. Stopping.
Nov 16 00:48:54 dev-pc systemd[1]: Stopped target Bluetooth.
Nov 16 00:48:54 dev-pc systemd[1]: Reached target Bluetooth.
Nov 16 00:48:54 dev-pc systemd[1]: Started Load/Save RF Kill Switch Status.
Nov 16 00:48:54 dev-pc kernel: [ 1180.631857] Bluetooth: hci0: using NVM file: qca/nvm_usb_00000302.bin
Nov 16 00:48:54 dev-pc systemd-sleep[6120]: System resumed.
Nov 16 00:48:54 dev-pc systemd-sleep[6120]: Failed to connect to non-global ctrl_ifname: (nil) error: No such file or directory
Nov 16 00:48:54 dev-pc systemd-sleep[6221]: /lib/systemd/system-sleep/wpasupplicant failed with error code 255.
Nov 16 00:48:54 dev-pc systemd[1]: Started Suspend.
Nov 16 00:48:54 dev-pc systemd[1]: sleep.target: Unit not needed anymore. Stopping.
Nov 16 00:48:54 dev-pc systemd[1]: Stopped target Sleep.
Nov 16 00:48:54 dev-pc systemd[1]: Reached target Suspend.
Nov 16 00:48:54 dev-pc systemd[1]: suspend.target: Unit is bound to inactive unit systemd-suspend.service. Stopping, too.
Nov 16 00:48:54 dev-pc systemd[1]: Stopped target Suspend.
Nov 16 00:48:54 dev-pc kernel: [ 1180.767368] IPv6: ADDRCONF(NETDEV_UP): wlp1s0: link is not ready
Nov 16 00:48:54 dev-pc NetworkManager[937]: <info> [1479257334.3510] manager: wake requested (sleeping: yes enabled: yes)
Nov 16 00:48:54 dev-pc NetworkManager[937]: <info> [1479257334.3510] manager: waking up...
Nov 16 00:48:54 dev-pc NetworkManager[937]: <info> [1479257334.3511] device (wlp1s0): state change: unmanaged -> unavailable (reason 'managed')
完整 Pastebin http://pastebin.com/DCjBZMJx
答案1
根据您对 HDMI 的评论。/etc/systemd/logind.conf
设置以下两行(第一行已根据您的问题设置):
HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend
为了回答您的问题,systemd
和Power
选项都需要设置相同(至少在我的系统上)。
您可以做的另一件事是查看/var/log/syslog
,导航到您暂停和恢复的时间,并查找任何异常事件。