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
  • 2
  • 10
  • I am in same boat. With no answer so far – Dr. Xperience Dec 09 '18 at 18:04
  • @Dr.Xperience Hi guys, same issue here. pm-hibernate works great, while the default systemctl hibernate randomly gets stuck on blank screen. I would like to replace the default command with pm-hibernate so that I could use it with the power button. I tried this solution but with no success... Do you guys have updates? – Tropilio Mar 03 '19 at 15:53
  • @FrancescoBoccardo I moved to Ubuntu 18.10 and ditched pm-hibernate and uswusp all together in favour of systemctl hibernate. I highly recommend moving to ubuntu18.10 it fixed many other issues for me. – Dr. Xperience Mar 03 '19 at 17:31
  • @Dr.Xperience Yea well, I'd rather stay on a LTS release, but thanks. – Tropilio Mar 04 '19 at 09:06

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
  • 59
  • 6