Notebook doesn't suspend when lid is closed after update to 16.04

Bug #1574120 reported by patrick70 on 2016-04-23
518
This bug affects 112 people
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Medium
Unassigned

Bug Description

My notebook does not suspend after upgrading from 15.10 to 16.04.

According to system settings the notebook should suspend when lid is closed but actually this does not happen. Instead it continues to run as if nothing had happened.

With the previous versions of ubuntu (14.04-15.10) everything worked fine.

My System: HP Pavilion dv7.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: acpi (not installed)
ProcVersionSignature: Ubuntu 4.4.0-21.37-generic 4.4.6
Uname: Linux 4.4.0-21-generic x86_64
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
CurrentDesktop: Unity
Date: Sat Apr 23 23:11:15 2016
InstallationDate: Installed on 2015-10-29 (176 days ago)
InstallationMedia: Ubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
SourcePackage: acpi
UpgradeStatus: Upgraded to xenial on 2016-04-22 (1 days ago)

patrick70 (patrick70) wrote :
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in acpi (Ubuntu):
status: New → Confirmed
dlh (dolohow) wrote :

Happens on my HP ProBook 640 G2 too.

Bruno Santos (bsantos) wrote :

Same thing on a HP Sleekbook 15

Bruno Santos (bsantos) wrote :

Adding HandleLidSwitchDocked=suspend in /etc/systemd/logind.conf solved it in my system, but suspend was flawless before upgrading to 16.04.

patrick70 (patrick70) wrote :

I tried HandleLidSwitchDocked=suspend. After closing the lid the notebook appears to be half way suspended but the fan is still working. Worse: I could not get it to wake up again. Open the lid => nothing, pressing any key => nothing, pressing a mouse button => nothing.

When I suspend the notebook with the item in the system menu it gets into a similar state without any chance to wake it up again.

Betty (sturdyandserviceable) wrote :

This bug affects me on my HP Pavilion dv6, but adding HandleLidSwitchDocked=suspend in /etc/systemd/logind.conf appears to have solved it.

Changed in acpi (Ubuntu):
importance: Undecided → Medium
Pranav Sharma (sudopluto) wrote :

I had this problem as well, and adding the "HandleLidSwitchDocked=suspend" fixed it. Why would Ubuntu think that the laptop is docked 24/7?

Carl (carl-leach-public-b) wrote :

Same issue on HP G62-105SA Notebook PC.

The lid state is correctly reported in /proc/acpi/button/lid/LID0/state

Carl (carl-leach-public-b) wrote :

Confirm that adding HandleLidSwitchDocked=suspend in /etc/systemd/logind.conf solved issue on HP G62-105SA Notebook PC.

Richard Brooksby (rptb1) wrote :

Also affects my HP Stream 11.

Bruno Santos (bsantos) on 2016-04-26
affects: acpi (Ubuntu) → systemd (Ubuntu)
Bruno Santos (bsantos) wrote :

From https://www.freedesktop.org/software/systemd/man/logind.conf.html:
"If the system is inserted in a docking station, or if more than one display is connected, the action specified by HandleLidSwitchDocked= occurs; otherwise the HandleLidSwitch= action occurs."

In my case I don't have a docking station nor any other monitor attached to the laptop, so as Pranav suggested, there may be some issues with detecting the laptop as being docked or as having other connected monitors?

My machine has an Optimus card, with both Intel and Nvidia chips, could this be related to the bug? Any of you have machines with this system too?

Bruno Santos (bsantos) wrote :

patrick70 did you reboot or restart the systemd-logind service?

Carl (carl-leach-public-b) wrote :

VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02)

Carl (carl-leach-public-b) wrote :

~$ xrandr --query
Screen 0: minimum 8 x 8, current 1366 x 768, maximum 32767 x 32767
LVDS1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   1366x768 59.64*+
   1360x768 59.80 59.96
   1280x720 60.00
   1024x768 60.00
   1024x576 60.00
   960x540 60.00
   800x600 60.32 56.25
   864x486 60.00
   640x480 59.94
   720x405 60.00
   680x384 60.00
   640x360 60.00
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

Julien Olivier (julo) wrote :

I, too, have an Optimus Prime video card (Nvidia GeForce 830M/PCIe/SSE2).

patrick70 (patrick70) wrote :

@Bruno
I rebooted the system.

patrick70 (patrick70) wrote :

It seems that there are two issues:
1) Wrong detection oft closed lid
Can be worked around with the aforementioned settings.

2) Failure to suspend at all
Incorrect state, fan still operating.
Failure to wake up in any event.

I wonder if I shall file a different bug for 2.

Carl (carl-leach-public-b) wrote :

I don't think it is 'Wrong detection of closed lid' as '/proc/acpi/button/lid/LID0/state' reports the open and close state correctly.

Wayne Brown (fwbrown) wrote :

My HP Pavilion 15 Notebook PC (15f019dx) had the same problem after upgrading to 16.04. It would suspend from the menu with no problem, but would not suspend automatically when the lid was closed. /proc/acpi/button/lid/LID0/state was reporting the lid closed as it should. Adding HandleLidSwitchDocked=suspend to /etc/systemd/logind.conf and then rebooting fixed it.

patrick70 (patrick70) wrote :

I found a solution to the issue '2) Failure to suspend at all': I upgraded the kernel to 4.4.8.

Now patching HandleLidSwitchDocked=suspend in /etc/systemd/logind works for me too.

Martin Pitt (pitti) wrote :

@patrick70: As you already found out, failures in the actual suspend are hardware/kernel specific. Great to hear that the new kernel works.

As for not suspending in the default configuration (i. e. without HandleLidSwitchDocked=suspend):

 - Does suspend work from the session indicator (rightmost in the top panel)?
 - Can you please copy&paste the output of "systemd-inhibit" in a situation where closing the lid does not do anything?
 - After a lid close/open without suspend, please do "sudo journalctl -b > /tmp/journal.txt" and attach /tmp/journal.txt here.

Changed in systemd (Ubuntu):
status: Confirmed → Incomplete
patrick70 (patrick70) wrote :

Suspend from the session indicator works.

systemd-inhibit:
     Who: patrick (UID 1000/patrick, PID 1564/unity-settings-)
    What: sleep
     Why: GNOME needs to lock the screen
    Mode: delay

     Who: Unity (UID 1000/patrick, PID 1570/compiz)
    What: sleep
     Why: Unity needs to lock the screen
    Mode: delay

     Who: patrick (UID 1000/patrick, PID 1564/unity-settings-)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key
     Why: GNOME handling keypresses
    Mode: block

     Who: NetworkManager (UID 0/root, PID 722/NetworkManager)
    What: sleep
     Why: NetworkManager muss Netzwerke abschalten
    Mode: delay

4 inhibitors listed.

Bruno Santos (bsantos) wrote :

I removed the workaround in logind.conf and as expected suspend stopped working. It does work from panel menu.

$ systemd-inhibit
     Who: Telepathy (UID 1000/bruno, PID 2482/mission-control)
    What: shutdown:sleep
     Why: Disconnecting IM accounts before suspend/shutdown...
    Mode: delay

     Who: bruno (UID 1000/bruno, PID 2070/unity-settings-)
    What: sleep
     Why: GNOME needs to lock the screen
    Mode: delay

     Who: bruno (UID 1000/bruno, PID 2070/unity-settings-)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key
     Why: GNOME handling keypresses
    Mode: block

     Who: NetworkManager (UID 0/root, PID 904/NetworkManager)
    What: sleep
     Why: NetworkManager needs to turn off networks
    Mode: delay

4 inhibitors listed.

Richard Brooksby (rptb1) wrote :

rb@bluejay:~/git/mps/code$ systemd-inhibit
     Who: NetworkManager (UID 0/root, PID 812/NetworkManager)
    What: sleep
     Why: NetworkManager needs to turn off networks
    Mode: delay

     Who: rb (UID 1000/rb, PID 1589/unity-settings-)
    What: sleep
     Why: GNOME needs to lock the screen
    Mode: delay

     Who: rb (UID 1000/rb, PID 1589/unity-settings-)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key
     Why: GNOME handling keypresses
    Mode: block

     Who: Unity (UID 1000/rb, PID 1594/compiz)
    What: sleep
     Why: Unity needs to lock the screen
    Mode: delay

4 inhibitors listed.

Note: Closing the lid does switch off the display, but doesn't suspend the machine.

Here is the tail of the output of journalctl at the time I closed and opened the lid.

Apr 26 23:21:13 bluejay kernel: atkbd serio0: Unknown key pressed (translated set 2, code 0xd8 on isa0060/serio0).
Apr 26 23:21:13 bluejay kernel: atkbd serio0: Use 'setkeycodes e058 <keycode>' to make it known.
Apr 26 23:21:13 bluejay kernel: atkbd serio0: Unknown key released (translated set 2, code 0xd8 on isa0060/serio0).
Apr 26 23:21:13 bluejay kernel: atkbd serio0: Use 'setkeycodes e058 <keycode>' to make it known.
Apr 26 23:21:14 bluejay systemd-logind[828]: Lid closed.
Apr 26 23:21:17 bluejay systemd-logind[828]: Lid opened.
Apr 26 23:21:22 bluejay sudo[8534]: rb : TTY=pts/6 ; PWD=/home/rb/git/mps/code ; USER=root ; COMMAND=/bin/journalctl -b
Apr 26 23:21:22 bluejay sudo[8534]: pam_unix(sudo:session): session opened for user root by (uid=0)

On my HP255G1 I have six inhibitors listed, the two blocks being;

     Who: neilw (UID 1000/neilw, PID 1669/unity-settings-)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key
     Why: GNOME handling keypresses
    Mode: block

     Who: neilw (UID 1000/neilw, PID 1669/unity-settings-)
    What: handle-lid-switch
     Why: Multiple displays attached
    Mode: block

However, I certainly don't have multiple displays attached.

Martin Pitt (pitti) wrote :

@Neil: So for you, unity-settings-daemon mis-detects the displays and sets that inhibitor. This is a bug in unity-settings-daemon and thus a completely different root cause than the original one that patrick70 filed. Please file a separate bug about that, and include the output of "xrandr" there (or, if you have a bug marked as a duplicate, un-duplicate it).

Benoît Vézina (a-1enoit-n) wrote :

Same here dv7, closing lid, nothing happen

The problem persists after sorting the oddity with the unity-settings-daemon, which appears to have been a one-off problem. (See bug #1577906 for more detail.)

Now I find that suspend only works if "HandleLidSwitchDocked=suspend" is in logind.conf.

Without that I return to the bug condition.

In the bug condition suspend works fine from the session indicator.

neilw@NWPS-LAP:~$ systemd-inhibit
     Who: neilw (UID 1000/neilw, PID 1558/unity-settings-)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key
     Why: GNOME handling keypresses
    Mode: block

     Who: NetworkManager (UID 0/root, PID 2267/NetworkManager)
    What: sleep
     Why: NetworkManager needs to turn off networks
    Mode: delay

     Who: Telepathy (UID 1000/neilw, PID 1797/mission-control)
    What: shutdown:sleep
     Why: Disconnecting IM accounts before suspend/shutdown...
    Mode: delay

     Who: neilw (UID 1000/neilw, PID 1558/unity-settings-)
    What: sleep
     Why: GNOME needs to lock the screen
    Mode: delay

     Who: Unity (UID 1000/neilw, PID 1566/compiz)
    What: sleep
     Why: Unity needs to lock the screen
    Mode: delay

5 inhibitors listed.

Sam Brookfield (sbrookfield) wrote :

Affects HP Spectre z360 also (suspend works from interface but does not happen when lid closed despite setting in power settings) - had to both upgrade to kernel 4.4.8 from 4.4.0 and add the workarounds to /etc/systemd/login.d to get it to work - just upgrade / workaround did not work separately. No multiple displays or dock (xrandr confirmed) - but haven't checked if power connecter removed works without workaround (not any use to me).

systemd-inhibit output -
     Who: sam (UID 1000/sam, PID 1750/unity-settings-)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key
     Why: GNOME handling keypresses
    Mode: block

     Who: sam (UID 1000/sam, PID 1750/unity-settings-)
    What: sleep
     Why: GNOME needs to lock the screen
    Mode: delay

     Who: NetworkManager (UID 0/root, PID 873/NetworkManager)
    What: sleep
     Why: NetworkManager needs to turn off networks
    Mode: delay

     Who: sam (UID 1000/sam, PID 1757/gnome-session-b)
    What: shutdown:sleep
     Why: user session inhibited
    Mode: block

4 inhibitors listed.

Игорь (ifree92) wrote :

Have the same problem on HP Probook 450 G3
When lid was closed.. laptop didn't suspend. When I open lid.. I cannot click on some tray icon on top panel.

Игорь (ifree92) wrote :

On all previously versions all works fine.

Sebastien Bacher (seb128) wrote :

@Sam,

your log states that gnome-session inhibits suspends, it's usually because some code asked it to do so

what if you try to

$ dbus-send --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager org.gnome.SessionManager.GetInhibitors

then

$ dbus-send --print-reply --dest=org.gnome.SessionManager <object path> org.gnome.SessionManager.Inhibitor.GetAppId

where "object path" is the string returned by the previous call (e.g "/org/gnome/SessionManager/Inhibitor<n>")

Carl (carl-leach-public-b) wrote :

~$ systemd-inhibit
     Who: NetworkManager (UID 0/root, PID 686/NetworkManager)
    What: sleep
     Why: NetworkManager needs to turn off networks
    Mode: delay

     Who: Telepathy (UID 1000/carl, PID 1923/mission-control)
    What: shutdown:sleep
     Why: Disconnecting IM accounts before suspend/shutdown...
    Mode: delay

     Who: carl (UID 1000/carl, PID 1805/gnome-settings-)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key
     Why: GNOME handling keypresses
    Mode: block

     Who: carl (UID 1000/carl, PID 1805/gnome-settings-)
    What: sleep
     Why: GNOME needs to lock the screen
    Mode: delay

4 inhibitors listed.

Игорь (ifree92) wrote :

Also in additions I propose this error from `dmesg` (for my HP Probook 450 G3) when I trying to close lid:

[ 2736.262341] atkbd serio0: Unknown key pressed (translated set 2, code 0x85 on isa0060/serio0).
[ 2736.262355] atkbd serio0: Use 'setkeycodes e005 <keycode>' to make it known.

May be it should help to resolve this error

Zed (darkbroodzed) wrote :

notebook hp x360 13-4002dx
new install 16.04
same issue "Notebook doesn't suspend when lid is closed"
adding HandleLidSwitchDocked=suspend in /etc/systemd/logind.conf fix issue.

If need more info for making proper fix - ask

Sebastien Bacher (seb128) wrote :

Those who state that "HandleLidSwitchDocked=suspend" fixes their issue, could you undo that change and provide the "systemd-inhibit" "xrandr" and "loginctl" commands output?

Ok.

Commented out the HandleLidSwitchDocked=suspend line and restarted systemd-logind.

Closed lid, waited a minute, the bug showed itself, the system did not suspend.

neilw@NWPS-LAP:/etc/systemd$ systemd-inhibit
     Who: Unity (UID 1000/neilw, PID 1463/compiz)
    What: sleep
     Why: Unity needs to lock the screen
    Mode: delay

     Who: neilw (UID 1000/neilw, PID 1448/unity-settings-)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key
     Why: GNOME handling keypresses
    Mode: block

     Who: neilw (UID 1000/neilw, PID 1448/unity-settings-)
    What: sleep
     Why: GNOME needs to lock the screen
    Mode: delay

     Who: Telepathy (UID 1000/neilw, PID 1729/mission-control)
    What: shutdown:sleep
     Why: Disconnecting IM accounts before suspend/shutdown...
    Mode: delay

     Who: NetworkManager (UID 0/root, PID 2218/NetworkManager)
    What: sleep
     Why: NetworkManager needs to turn off networks
    Mode: delay

5 inhibitors listed.

neilw@NWPS-LAP:/etc/systemd$ xrandr
Screen 0: minimum 320 x 200, current 1366 x 768, maximum 8192 x 8192
LVDS connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   1366x768 60.07*+ 40.04
   1280x720 59.86
   1152x768 59.78
   1024x768 59.92
   800x600 59.86
   848x480 59.66
   720x480 59.71
   640x480 59.38
HDMI-0 disconnected (normal left inverted right x axis y axis)
VGA-0 disconnected (normal left inverted right x axis y axis)

neilw@NWPS-LAP:/etc/systemd$ loginctl
   SESSION UID USER SEAT
        c2 1000 neilw seat0

1 sessions listed.

I've reinstated the workaround and run the requested commands again.

As far as I can see, the output of all three is exactly the same as in the bug condition, apart from the items in the inhibitors list being shown in a different order.

Sebastien Bacher (seb128) wrote :

hum, could you get in the buggy state, run a "sleep 10; systemd-inhibit", close the lid, wait until the 10s are over, open it back and see what that listed? it could be that one of the processes delaying suspend is

Changed in systemd (Ubuntu):
status: Incomplete → New
Changed in systemd (Ubuntu):
status: New → Confirmed
37 comments hidden view all 117 comments
StefanF (stefan) wrote :

I have two different HP Notebooks where the suspend does not work on closing the lid.

HP 635: Does not suspend but wakes up properly when open the lid.
HP 350 G1: Also does not suspend but wakes up properly when open the lid.

However, my Acer AO756 is not affected by the issue.

The HP635 worked fine initially after installing Ubuntu 16.04. The problem has been introduced with any update. I cannot tell a date when the problem started because I did not install any update on that machine until today.

The other HP 350 G1 was used with Windows before, so I don't know how that machine runs with the initial 16.04 release.

Julien Olivier (julo) wrote :

I've just upgraded to 16.10 and removed the workaround (HandleLidSwitchDocked=suspend in login.d) to see if the bug was fixed. And, no, it isn't :(

Manuel (kketzal) wrote :

Same thing in MacBook 13" (White, mid 2006).

When suspend the machine, the screen turn black, and after few seconds (2 0 3 secs), the screen turn on, and the login screen appears.

Thanks.

XPS 13 on 16.10 neither HandleLidSwitchDocked=suspend nor HandleLidSwitch=suspend makes machine go sleep. Screen remains enabled (it is visible) until it turns of after some time due power settings.

/etc/systemd/logind.conf seemed to work in 16.04.

Zephyr (pasha-pivo) wrote :

Installing proprietary video driver solved the issue. This solved issue with wrong detection of an external monitor (that had been detected, but actually hadn't been connected).

Dave Hartley (lp0w) wrote :

HP Elitebook 850 G3 with a fresh install of 16.04.1 had the suspend bug (laptop would not suspend when the lid was closed).

Adding the line in login.confd worked for suspending, but I now have to press the power button to resume from suspend. Opening the lid does not resume.

Brian Deuel (swamprock) wrote :

I have the exact model of Macbook 13" to #80 above, and have, exactly, the same symptoms that kketzal outlined in that post. No workarounds listed here or elsewhere are effective at all.

Joe Giampaoli (joegiampaoli) wrote :

I can confirm same results:

HP G240
Xubuntu 16.04 64bit

Uncommented and changed HandleLidSwitchDocked=ignore to HandleLidSwitchDocked=suspend in /etc/systemd/logind.conf worked

Antti Teliö (antti-telio) wrote :

This affects also HP Spectre, and uncommenting "HandleLidSwitch=suspend" didn't change anything.

Antti Teliö (antti-telio) wrote :

Oh, but "HandleLidSwitchDocked=suspend" did fix the issue, although this model doesn't even have a docking connector :)

user name (user151) wrote :

confirmed "HandleLidSwitchDocked=suspend" worked for me. hp pavilion g6
Close lid, suspended and opening lid unsuspended automatially.

Marco Milone (milozzy) wrote :

The HandleLidSwitchDocked=suspend trick works on HP Stream 13 too.

Mark Leigh (mark-leigh) wrote :

Same bug on Lenovo Thinkpad T510.

     Who: NetworkManager (UID 0/root, PID 1042/NetworkManager)
    What: sleep
     Why: NetworkManager needs to turn off networks
    Mode: delay

     Who: bob (UID 1000/bob, PID 3529/cinnamon-settin)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key
     Why: Cinnamon handling keypresses
    Mode: block

     Who: bob (UID 1000/bob, PID 3529/cinnamon-settin)
    What: sleep
     Why: Cinnamon needs to lock the screen
    Mode: delay

     Who: bob (UID 1000/bob, PID 3529/cinnamon-settin)
    What: handle-lid-switch
     Why: Multiple displays attached
    Mode: block

4 inhibitors listed.

Mark Leigh (mark-leigh) wrote :

Although.... if I do the following steps, it will suspend

1: Close the lid
2: Open the lid (presented with unlock screen)
3: Close the lid
4: Wait 10s and notebook suspends...

Mark Leigh (mark-leigh) wrote :

I should add, even though it says I have multiple displays attached, I don't and I haven't since I installed 16.04.

Mark Leigh (mark-leigh) wrote :

I should add, one inhibitor listed was multiple displays, but I don't have that, nor have I attached any additional displays since the clean install of 16.04.

I tested the workaround suggest above (HandleLidSwitchDocked=suspend) and it (sort of) works. It takes 12-14 seconds after closing the lid before suspend starts. However, it also makes the system unstable. It now locks up during boot sometimes, and sometimes crashes and reboots during suspend.

Gábor Lipták (gliptak) wrote :

I also experienced this running 16.10 on an HP Envy laptop.

This bug persists in 16.10 on a December 2016 spec XP Spectre x360.

Uncommenting or commenting

HandleLidSwitch=suspend
HandleLidSwitchDocked=ignore

have no effect.

Should a separate bug be raised for 16.10? Or is it implied that it will be looked at during the lifecycle of 16.10 and backported to the LTS release?

Apologies, I misread the above fix (it's been a long day!) :-/

HandleLidSwitchDocked=suspend

fixes the issue on 16.10 as well on my HP (not XP!) Spectre x360.

Fans came on for a minute or two after resume but have since stopped.

Still happens on 16.10 on a HP Pavilion 15 (Skylake i5-6300HQ, Intel 530, Nvidia 950M).

HandleLidSwitchDocked=suspend and then reboot 'fixes' it.

However, it has the undesirable side effect of suspending when an external monitor is attached to the HDMI port (driven by the NVidia chip).

In the latter case, the system also fails to resume from suspend, leaving only a black screen. I'd be willing to believe that this particular case is due to bugs in the nouveau driver. But the system should not be suspending when there is an external display attached in any case - this appears to be systemd policy overriding GNOME policy.

Catch (catch22tb) wrote :

This occured to me today, seemingly after no update for changes made to my laptop. I fixed in in the following way. Hope this helps someone...

What did not work: Running the latest update, installing kernel 4.8.x or 4.4.25, or any of the fixes you can find doing a google search for kubuntu 16.04 suspend. I had finally tried a commond line common pm-suspend, which caused the laptop to freeze and then freeze on booting.

I have dell vostro 3500 laptop.

What worked: I reinstalled the kubuntu 16.04.1 base. I have a separate /home partition so that was not effected by the reinstall (i didn't format it. just specified to mount /home in the install setup).

reinstall was fast. After install finished, I also ran the update... to kernel 4.4.0-62-generic. I did not test the suspend here. I installed powernap and cpufreq, then rebooted. Later I closed the lid and the computer suspended. All set and it works fine.

Not sure what was the exact problem was or the fix.

Catch (catch22tb) wrote :

More on this, adding to my comment above... My computer ceases its ability to suspend again, without any updated etc. There was a notice that a program had crashed yesterday evening, but the computer suspended fine. This morning I noticed there was no sound (the speaker icon was red in kubuntu 16.04 task bar) and kwin-x11 was at 100% cpu. rebooting did not fix this.

I reinstalled pulseaudio, and cpufreqd cpufreuutil and rebooted. All fixed agin with sounds and suspend.

HP Pavilion g6 here.

After upgrading the past month from 14.04 to 16.04, I was also affected by this bug, where with 14.04 I closed the lid and my laptop suspended as it should.

I tried to set HandleLidSwitch=suspend in logind.conf but it made no change, the laptop wouldn't suspend.

Today I upgraded from 16.04 to 16.10 and it was all the same, closing the lid of my laptop does not suspend it.

Reading the comments on this thread, I added HandleLidSwitchDocked=suspend to my logind.conf and now it works perfectly.

jgm (jogama) wrote :

Lenovo T450s with Intel graphics suffering from this bug. Suspend does indeed work from my session indicator, however.

Updated kernel from 4.4 to 4.8, nothing happened. Uncommented HandleLidSwitchDocked and set it to suspend. Still broken.

 - Can you please copy&paste the output of "systemd-inhibit" in a situation where closing the lid does not do anything?
 - After a lid close/open without suspend, please do "sudo journalctl -b > /tmp/journal.txt" and attach /tmp/journal.txt here.

jgm (jogama) wrote :

Please help? The usual fixes haven't worked for me.

Lenovo T450s with Intel graphics suffering from this bug. Suspend does indeed work from my session indicator, however.

Updated kernel from 4.4 to 4.8, nothing happened. Uncommented HandleLidSwitchDocked and set it to suspend. Still broken.

$ systemd-inhibit
     Who: Unity (UID 1000/jogama, PID 3944/compiz)
    What: sleep
     Why: Unity needs to lock the screen
    Mode: delay

     Who: NetworkManager (UID 0/root, PID 1103/NetworkManager)
    What: sleep
     Why: NetworkManager needs to turn off networks
    Mode: delay

     Who: jogama (UID 1000/jogama, PID 3680/unity-settings-)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key
     Why: GNOME handling keypresses
    Mode: block

     Who: jogama (UID 1000/jogama, PID 3680/unity-settings-)
    What: sleep
     Why: GNOME needs to lock the screen
    Mode: delay

4 inhibitors listed.

Carlo (carlo-b) wrote :

Just FYI I posted this https://lkml.org/lkml/2017/4/9/57 yesterday. Still to be reviewed.
Hope it helps.

Alf Haakon Lund (alf-c) wrote :

Ubuntu Studio 16.04 on Toshiba Satellite p850

Regardless of settings in power manager or logind.conf, machine will not suspend on lid close. It will turn off the screen, though.

Suspend from menu, command or power button works.

Lid state is reported correct (cat /proc/acpi/button/lid/LID0/state)

However, as described here: https://bugs.launchpad.net/ubuntu/+source/acpid/+bug/1037860 lid close will suspend if I remove the power cable. As checked with acpi_listen, lid close alone does not generate any ACPI event.

Neither HandleLidSwitch, nor HandleLidSwitchDocked explicitly un-commented and set as "suspend" worked for me on Ubuntu 17.04.

The machine neither suspends on lid down, nor does it prompt me for a password on lid up.

Bob (caltinay) wrote :

I have the same issue on a HP ZBook G3 running Debian with the 4.11 kernel from experimental and after reading comment #103 I tried
rmmod hp_wmi
and this fixed it!

So hopefully an updated kernel will fix it properly with that driver loaded.

Kai-Heng Feng (kaihengfeng) wrote :

I think there are two ongoing patches are going to address this, maybe worth a try:

One is from Benjamin Tissoires:
https://patchwork.kernel.org/patch/9760869/

Another one is from Lv Zheng:
https://patchwork.kernel.org/patch/9771121/

zaharmd (zaharmd) wrote :

HP EliteBook 840 G3, Xubuntu 17.04
Workaround by - rmmod hp_wmi

HP ProBook 440 G4, fix in #108 works for me, but I'm not sure what the purpose of this module is and if it is save to blacklist.

dmesg also has some strange keycode on closing and opening the lid (see #38)

[ 750.004558] atkbd serio0: Unknown key pressed (translated set 2, code 0x85 on isa0060/serio0).
[ 750.004569] atkbd serio0: Use 'setkeycodes e005 <keycode>' to make it known.

quick update to #109

adding HandleLidSwitchDocked=suspend to

/etc/systemd/logind.conf

is also working

Kai-Heng Feng (kaihengfeng) wrote :

Please try latest mainline kernel - Carlo's patches are included.

Bob (caltinay) wrote :

Updated to 4.12.2 (from Debian experimental) and the issue is resolved on my HP ZBook G3.

Using 17.04 Gnome,
Kernel 4.10.0-28-generic

Problem is still here on Dell XPS 13 (9350).

Neither of this has no effect:
HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend

PC still runnning after lid is closed. However lid state is reported correctly.

$ sleep 5; cat /proc/acpi/button/lid/LID0/state
state: closed

Ok Sorry for misleading report on #113.
It actually works, however the problem was with Tweak tool setting which silently adds autostart script preventing notebook to suspend on lid closed regardless settings in /etc/systemd/logind.conf
More: https://unix.stackexchange.com/questions/307497/gnome-disable-sleep-on-lid-close

Bill Duetschler (bikergeek) wrote :

HP 450 G3 laptop here, just a few days old. Adding the "HandleLidSwitchDocked=suspend" worked for me. Ubuntu Zesty, kernel 4.10.0-32.

Bill Duetschler (bikergeek) wrote :

Looks like I misspoke, adding "HandleLidSwitchDocked=suspend" didn't work. I took the laptop offsite after closing the lid and when I arrived at my destination the laptop was still warm and there had been significant battery drain, as if it had been running full-blast all along.

Bill Duetschler (bikergeek) wrote :

Installing the "pm-utils" package--which for some reason wasn't installed on a fresh install of Ubuntu 17.04--fixed it, along with altering my /etc/systemd/logind.conf did the trick. I altered it to read:

HandleSuspendKey=suspend
HandleHibernateKey=suspend
HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend

And now everything works.

Displaying first 40 and last 40 comments. View all 117 comments or add a comment.