Suspend isn't triggered by lid close

Bug #1160995 reported by Julien Olivier
98
This bug affects 20 people
Affects Status Importance Assigned to Milestone
Ubuntu GNOME
Fix Released
Medium
Unassigned
systemd (Ubuntu)
Fix Released
High
Martin Pitt
Raring
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
On the current systemd in raring there are the following two power related issues.

* Suspend does not get triggered when laptop lid is closed
* Power off does not work due to a missing poweroff target.

[Test Case]

* Install systemd and a logind enabled build of g-s-d
* Close laptop lid, system will not suspend
* select poweroff from usermenu, machine will not power off

NB: gnome3-staging PPA has temporary workarounds for both these issues, so it shouldnt be used for testing.

[Regression Potential]
Very Low, both these fixes are rather trivial, however they fix very serious issues.

=== Original Bug Report ===

In raring, using Ubuntu GNOME, when you close the lid nothing happens. It used to suspend in Quantal. It seems that the problem comes from the lack of systemd according to http://www.infty.nl/wordpress/2012/12/gnome-3-on-ubuntu-raring-and-suspend/. From the same webpage, there is a workaround: put the following into /etc/acpi/local/lid.sh.post, and make it executable.

#!/bin/bash

grep -q closed /proc/acpi/button/lid/*/state
if [ $? = 0 ]; then
   pm-suspend
fi

ProblemType: BugDistroRelease: Ubuntu 13.04
Package: gnome-session 3.7.92-0ubuntu1~raring1 [origin: LP-PPA-gnome3-team-gnome3]
ProcVersionSignature: Ubuntu 3.8.0-14.24-generic 3.8.4
Uname: Linux 3.8.0-14-generic i686
ApportVersion: 2.9.2-0ubuntu5
Architecture: i386
Date: Wed Mar 27 17:09:41 2013
InstallationDate: Installed on 2010-09-15 (923 days ago)InstallationMedia: Ubuntu 10.04.1 LTS "Lucid Lynx" - Release i386 (20100816.1)
MarkForUpload: True
PackageArchitecture: allSourcePackage: gnome-session
UpgradeStatus: Upgraded to raring on 2011-04-01 (726 days ago)

Revision history for this message
Julien Olivier (julo) wrote :
Revision history for this message
aaronpoweruser (aaronpoweruser) wrote :

Confirmed

Revision history for this message
Julien Olivier (julo) wrote :

Using libpam-systemd on Ubuntu raring with the staging PPA doesn't fix this bug for me.

Tim Lunn (darkxst)
Changed in ubuntu-gnome:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Tim Lunn (darkxst) wrote :

(gnome-settings-daemon:4992): power-plugin-DEBUG: up changed: lid is now closed
(gnome-settings-daemon:4992): power-plugin-DEBUG: Suspend is inhibited but lid is closed, locking the screen

(gnome-settings-daemon:4992): GLib-GIO-CRITICAL **: g_dbus_proxy_call_sync_internal: assertion `G_IS_DBUS_PROXY (proxy)' failed
(gnome-settings-daemon:4992): power-plugin-DEBUG: up changed: lid is now open

Martin Pitt (pitti)
Changed in systemd (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
importance: Undecided → High
milestone: none → ubuntu-13.05
status: New → Triaged
Revision history for this message
Tim Lunn (darkxst) wrote :

So as a workaround until pitti takes a proper look at this, now triggering an explicit suspend in gnome-settings-daemon. I have uploaded to the ppa, although I had some issues with suspend being inhibited when it shouldn't be while debugging. This will get better once we update to 3.8.1

Martin Pitt (pitti)
Changed in systemd (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 202-0ubuntu5

---------------
systemd (202-0ubuntu5) saucy; urgency=low

  * Drop 0016-Add-poweroff-reboot-suspend-hibernate-fallback.patch.
    systemd-shim 3 has a much better implementation of pm-utils fallback.
    Recommend systemd or systemd-shim >= 3 for that.
  * Ship 70-power-switch.rules. (LP: #1160995)
 -- Martin Pitt <email address hidden> Thu, 02 May 2013 11:19:42 -0700

Changed in systemd (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Tim Lunn (darkxst) wrote :

pitti,
   can we SRU 198-0ubuntu12 into raring?

Revision history for this message
Martin Pitt (pitti) wrote :

For ubuntu-gnome I guess we want to SRU this particular fix, plus these two from 198-0ubuntu12:

 * debian/rules: Don't build ddebs for blacklisted binary packages.

  * Use the shutdown fallback for "poweroff.target" too; this is invoked by
    org.freedesktop.login1.Manager.PowerOff (LP: #1171504)

Adding a raring task here and to bug 1171504.

Revision history for this message
Martin Pitt (pitti) wrote :

Uploaded SRU to raring-proposed review queue.

Changed in systemd (Ubuntu Raring):
status: New → In Progress
Tim Lunn (darkxst)
description: updated
Tim Lunn (darkxst)
description: updated
description: updated
Revision history for this message
Adam Conrad (adconrad) wrote : Please test proposed package

Hello Julien, or anyone else affected,

Accepted systemd into raring-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/systemd/198-0ubuntu11.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in systemd (Ubuntu Raring):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Tim Lunn (darkxst) wrote :

tested on raring, both suspend on lid close and power off from user menu are now working correctly

tags: added: verification-done
removed: verification-needed
Revision history for this message
Scott Kitterman (kitterman) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 198-0ubuntu11.1

---------------
systemd (198-0ubuntu11.1) raring-proposed; urgency=low

  [ Iain Lane ]
  * Use the shutdown fallback for "poweroff.target" too; this is invoked by
    org.freedesktop.login1.Manager.PowerOff. (LP: #1171504)

  [ Martin Pitt ]
  * debian/rules: Don't build ddebs for blacklisted binary packages, to avoid
    confusing Launchpad.
  * Ship 70-power-switch.rules, to make suspend on lid close work with GNOME
    3.8, and fix shutdown with the power button in a VT. (LP: #1160995)
 -- Martin Pitt <email address hidden> Fri, 10 May 2013 07:35:15 +0200

Changed in systemd (Ubuntu Raring):
status: Fix Committed → Fix Released
Tim Lunn (darkxst)
Changed in ubuntu-gnome:
status: Confirmed → Fix Released
Revision history for this message
Johan Nenzén (dev-johnan) wrote :

I still have this issue using libpam-systemd 202-0ubuntu7~ubuntu13.04.1 which I suppose should include the fix. I'm attaching a apport-cli report.

Issues
* Do not suspend when closing lid
* Do not suspend or shutdown when using menu

Works
* sudo shutdown -r now from terminal reboots fine

Revision history for this message
Johan Nenzén (dev-johnan) wrote :

The attached file contains debug info from gnome-settings-deaemon when pressing Power Off in the menu.

Revision history for this message
Tim Lunn (darkxst) wrote : Re: [Bug 1160995] Re: Suspend isn't triggered by lid close

You need to install systemd-shim >= 3

On Wednesday, 29 May 2013 at 11:39 PM, Johan Nenzén wrote:

> The attached file contains debug info from gnome-settings-deaemon when
> pressing Power Off in the menu.
>
> ** Attachment added: "gnome-settings-daemon.txt"
> https://bugs.launchpad.net/ubuntu-gnome/+bug/1160995/+attachment/3689887/+files/gnome-settings-daemon.txt
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1160995
>
> Title:
> Suspend isn't triggered by lid close
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu-gnome/+bug/1160995/+subscriptions
>
>

Revision history for this message
Johan Nenzén (dev-johnan) wrote :

Thanks, that worked!
May I ask how you saw that?

Revision history for this message
Christian González (droetker) wrote :

I use systemd 198-0ubuntu11.1 (not having enabled ubuntu-proposed) and the lid switch does not work. So I can't see the "fix" - systemd-shim >=3 is only for saucy - I'm using 13.04.

Revision history for this message
Christian González (droetker) wrote :

Sorry, forget my post. Everything works as expected here, my fault ;-)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.