6

On installing uswsusp, sudo pm-hibernate works perfectly, but systemctl hibernate does not. How can I make the default hibernate button run the pm-hibernate command?

muru
  • 197,895
  • 55
  • 485
  • 740
Sam
  • 311
  • I have that same question, but didn't find your question before asking it this way https://askubuntu.com/questions/1079661/another-question-about-hibernate-in-18-04-not-a-duplicate – Stewart Oct 13 '18 at 14:03
  • @Stewart I have exactly the same problem and haven't found a solution... have you got updates on this? – Tropilio Mar 03 '19 at 14:34

1 Answers1

4

I faced the same problem on Ubuntu 18.10. You need to edit the hibernation service :

sudo systemctl edit systemd-hibernate.service

then paste this:

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

Save, then:

sudo systemctl daemon-reload

Run sudo systemctl hibernate it should work now.