Running Xubuntu 18.04 LTS, I've set up hibernation with uswsusp, and it works flawlessly (s2disk).

Then, I've integrated s2disk to Systemd (systemctl hibernate) by overriding the systemd-hibernate service to

ExecStartPre=-/bin/run-parts -v -a pre /usr/lib/systemd/system-sleep
ExecStartPost=-/bin/run-parts -v --reverse -a post /usr/lib/systemd/system-sleep

As expected, sudo systemctl hibernate works without any issues.

The problem appears when clicking the hibernate button on the power menu (enabled via polkit) fails - it looks like it worked, but when resuming the system freezes completely upon login.

I suspect that the button does not actually run the same commands as the other methods, but I couldn't find how to set it.

Update: This seems to be machine-specific. I have another PC, with very similar setup (same Xubuntu version and hibernation configuration - from here). On the other PC, it works correctly, but for the machine in question (it's a laptop), it still does not.

Update 2: I've tried to restart Plymouth upon resume (this is a solution to similar issues I've found), but it didn't help.

  • It should run the same commands via logind's bus methods. Did you make your service Type=oneshot? No idea why that should matter, though. – intelfx May 12 '18 at 17:50
  • Yes, it is oneshot. Just to clarify, sudo systemctl hibernate works as expected (no freezing at login or anything). Only from the XFCE powr dialog, the issue appears. – matan129 May 12 '18 at 19:03
  • Would be creating a .desktop file on your desktop be a suitable solution? – Fabby May 17 '18 at 19:56
  • 1
    @Fabby It's not a bad idea, but I want to specifically make the hibernate button on the power menu work. So.. no. – matan129 May 17 '18 at 21:26
  • Give some comments on the laptop model and hardware, so we can see if there are any compatibility issues. – Leo May 21 '18 at 23:51

Perhaps you forgot (like me) to specify the resume & resume_offset Linux boot parameters? Without the resume_offset I had nearly the same problem: black screen on "s2disk: Returned to userspace" message.

I've written here a full answer to be able to resume from a swap file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.