如何在 15.04 中启用休眠模式?

如何在 15.04 中启用休眠模式?

我全新安装了 15.04,尝试按照以下说明启用休眠功能:http://ubuntuhandbook.org/index.php/2014/10/enable-hibernate-option-in-ubuntu-14-10-unity/

但它仅在使用 upstart 启动而不是使用 systemd 启动时才有效。

我怎样才能让它与 systemd 一起工作?

编辑>安装休眠包后,我可以从终端运行它,但它仍然在关机菜单中不可用。

答案1

  1. 创建以下文件:/etc/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla

  2. 将以下内容复制/粘贴到其中:

    [Enable hibernate by default in upower]
    Identity=unix-user:*
    Action=org.freedesktop.upower.hibernate
    ResultActive=yes
    
    [Enable hibernate by default in logind]
    Identity=unix-user:*
    Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit
    ResultActive=yes
    
  3. 注销并检查是否可以在登录屏幕上看到休眠菜单项,登录后再执行相同的操作。

需要执行上述手动步骤的原因是他们似乎在 Ubuntu 15.04 中默认禁用了休眠模式。

答案2

Jinesh Choksi 给出的创建文件的答案/etc/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla似乎对我不起作用,当我恢复休眠时,它只会执行正常启动。我发现的最佳选项是经典的pm-hibernate,它可以毫无问题地运行:

sudo pm-hibernate

您还可以选择混合挂起/休眠模式。手册页中写道:

pm-suspend-hybrid
    Hybrid-suspend is the process where the system does everything it needs to hibernate, but suspends instead of shutting down. This means
    that your computer can wake up quicker than for normal hibernation if you do not run out of power, and you can resume even if you run
    out of power. s2both(8) is an hybrid-suspend implementation.

相关内容