5

With the help of questions here at SO (1, 2) I managed to find a way of hibernate my computer. The only approach that worked was with uswsusp, which made pm-hibernate work, but now I can only hibernate my machine via the command line even after creating the sleep module:

sudo cat /etc/pm/config.d/00sleep_module SLEEP_MODULE=uswsusp

How do I make pm-hibernate the default method? So that when I press the hibernate option in the menu or close the lid pm-hibernate is used instead of systemctl?

lf_araujo
  • 267

1 Answers1

2

Based on the idea of this post I have managed to get my systemctl-hibernate service using plain pm-hibernate.

I am currently on Ubuntu 18.10.

Change the content systemd-hibernate.service file (systemctl edit systemd-hibernate.service) to:

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

[Service] Type=oneshot ExecStart=/usr/sbin/pm-hibernate

Reload the daemon

systemctl daemon-reload

and go for it

systemctl hibernate

If you are using gnome and want to install the hibernate-button (which actually works with this solution) check out the solution presented here.

jkoop
  • 69