7

My Lenovo P50 laptop used to suspend nicely when I closed the lid on Ubuntu 19.10. After the upgrade this doesn't work anymore. When I execute the command sudo systemctl suspend then the laptop still goes into a very rapid full functional suspend. So something seems to go wrong somewhere in handling the lid close event from acpi.

I'm using gnome-tweak-tools and it has the toggle to suspend on lid close enabled as expected.

I also checked the configuration in /etc/systemd/logind.conf and it seems perfect:

HandleLidSwitch=suspend
HandleLidSwitchExternalPower=suspend
HandleLidSwitchDocked=suspend
LidSwitchIgnoreInhibited=yes

I haven't found anything noticable in the /var/log/syslog.

The workaround I found is the following:

Create a file called /etc/acpi/events/laptop-lid-close with the following content:

event=button/lid LID close
action=/etc/acpi/laptop-lid-close.sh

And create a file /etc/acpi/laptop-lid-close.sh with the following content and gave it execute rights (chmod +x /etc/acpi/laptop-lid-close.sh):

#!/bin/sh

systemctl suspend

Would be better if this workaround would not be necessary ofcourse

Acpi seems to fire off 'lid close' events as it should, otherwise the workaround would not work. Also the suspend itself must be working on my laptop as well for the same reason.

Any clues on how to learn why this doesn't work out of the box?

3

1 Answer 1

3

I had similar with a fresh UbuntuDDE install. I found answers in various sources (this one is probably the most relevant Ubuntu 18.04 - Dell XPS13 9370 no longer suspends on lid close). The issue is the laptop not going into "deep" sleep. Run this command

cat /sys/power/mem_sleep

And if you get the result below, then this is the issue.

[s2idle] deep

To change it, edit your grub file (location: /etc/default/grub) to add this text to the GRUB_CMDLINE_LINUX_DEFAULT line

mem_sleep_default=deep

Then update grub

sudo update-grub

and reboot. After reboot, run this again

cat /sys/power/mem_sleep

and confirm now that your result is

s2idle [deep]

Then you should be good to go.

4
  • 2
    Good addition and great that it works for you, but in my case it already reports s2idle [deep] before I changed anything
    – Maarten
    May 14, 2020 at 12:00
  • 3
    maybe you can explicitly mention the location of the grub file: /etc/default/grub
    – Maarten
    Aug 26, 2020 at 10:17
  • 2
    Did you mean to say "If you do not get the result below, then this is the issue"? Jan 23, 2021 at 21:28
  • In my case the output is just [s2idle] and it doesn't change after editing the grub file.
    – user178834
    Sep 9, 2021 at 10:51

You must log in to answer this question.

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