在 17.10 中,Hibernate 无法与 systemd 配合使用

在 17.10 中,Hibernate 无法与 systemd 配合使用

我通过编辑文件在新安装的 Kubuntu 17.10 中启用了休眠模式:

/var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla

该机器是联想 V310,已禁用安全启动。

当我运行时,s2disk系统会正常休眠并恢复。我使用的是 TuxOnIce。但是,当我运行时sudo systemctl hibernate(我猜想这就是菜单中的 GUI 按钮的作用,也是我最终想要做的事情),系统似乎会暂停并在之后立即唤醒。

根据互联网的建议,我把以下内容放入/etc/systemd/system/systemd-hibernate.service

[Unit]
Description=Hibernate
Documentation=man:systemd-suspend.service(8)
DefaultDependencies=no
Requires=sleep.target
After=sleep.target

[Service]
Type=oneshot
ExecStart=
ExecStartPre=-/bin/run-parts -v -a pre /lib/systemd/system-sleep
ExecStart=/usr/sbin/s2disk
ExecStartPost=-/bin/run-parts -v --reverse -a post /lib/systemd/system-sleep

因此,看起来 systemd 实际上并未运行s2disk或未正确运行。或者,非 root 用户可能需要一些额外权限?有什么办法吗?

相关内容