0

I've set system to hibernate when I close laptop in KDE settings, both for battery and cable. Hibernation works fine when I execute it from KDE menu but does not work when I close laptop despite system settings. Strange, but recently it was working correctly, don't know what happened and why now it is broken, I haven't touched anything related, only upgraded system from time to time. Grep dmesg by "hibernation" shows nothing interesting. Laptop - ThinkPad X1 Carbon Gen 8.

Could anybody help me get hibernation back to work?

UPD-1: Answers to some questions

Q1)

$ sudo ls /etc/polkit-1/localauthority/
10-vendor.d  20-org.d  30-site.d  50-local.d  90-mandatory.d

also there is

$ ls /etc/polkit-1/localauthority.conf.d/
50-localauthority.conf  51-ubuntu-admin.conf

Q2)

$ dpkg -l | grep -E 'pm-utils|hibernate'

shows nothing, packages not installed

Q3)

$ cat /sys/power/state
freeze mem disk
9

1 Answer 1

0
+100

As per your answers, I suggest you try the following:

  1. Make sure you have a swap partition at least as large as your RAM size (and please confirm you did so).

  2. Install pm-utils and hibernate.

  3. Add file /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla with the following contents

    [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
    
  4. Execute sudo pm-hibernate.

I have Ubuntu 20.04 and this works. I am not certain this would avoid the freezes you get, but I guess it is worth trying.

Sources:

https://help.ubuntu.com/16.04/ubuntu-help/power-hibernate.html

http://www.linuxandubuntu.com/home/how-to-enable-hibernate-in-ubuntu-linux

https://ubuntuhandbook.org/index.php/2018/05/add-hibernate-option-ubuntu-18-04/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .