Ubuntu – Hibernation in Status Menu Not Working

18.04gnome-shellhibernatestatusbar

First of all hibernation via the command

sudo pm-hibernate

works fine from command line on my newly installed Ubuntu 18.04.

I've a fine gnome extension called Hibernate status button which displays an hibernate button in my system menu, as depicted in this image

status bar

But when I click on it is hibernating and power down, but when I start up the next time it opens with a completley new session.

Has anyone a working solution to this problem?

Best Answer

According to this document, you did right things except that you have to create the file
/etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

You can do it by copy/paste the following in a termnial

sudo tee -a /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla << END1
[Re-enable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

[Re-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
END1