20.04 LTS Since upgrade from 19.10 laptop doesn't suspend anymore after lid close

6,275

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.

Share:
6,275

Related videos on Youtube

Rishi Kumar
Author by

Rishi Kumar

Updated on September 18, 2022

Comments

  • Rishi Kumar
    Rishi Kumar over 1 year

    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?

  • Rishi Kumar
    Rishi Kumar almost 4 years
    Good addition and great that it works for you, but in my case it already reports s2idle [deep] before I changed anything
  • Rishi Kumar
    Rishi Kumar over 3 years
    maybe you can explicitly mention the location of the grub file: /etc/default/grub
  • Dan Christensen
    Dan Christensen over 3 years
    Did you mean to say "If you do not get the result below, then this is the issue"?
  • user178834
    user178834 over 2 years
    In my case the output is just [s2idle] and it doesn't change after editing the grub file.