Laptop mode not enabled on lid closed

Bug #324918 reported by Hanno Stock (hefe_bia)
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
laptop-mode-tools (Ubuntu)
New
Undecided
Unassigned

Bug Description

I have ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED=1 but laptop mode is not enabled when I close the lid.
(Display is properly turned off, so ACPI is working.)

I verified that it is not working by running:

hanno@sputnik2:~$ sleep 30 && cat /proc/sys/vm/laptop_mode
0

...and closing the lid, so the command is executed during lid closed.

Any hints on how to debug this further?

hanno@sputnik2:~$ lsb_release -rd
Description: Ubuntu 8.10
Release: 8.10

(latest updates installed)

Revision history for this message
Hanno Stock (hefe_bia) (hanno-stock) wrote :
Revision history for this message
Tormod Volden (tormodvolden) wrote :

Thanks for your report. You say the display is properly turned off, you mean it goes black? That could be a hardware switch turning of the backlight. Or do you get the locked screen (password dialog) when you open it? Can you try:
 sleep 10 && cat /proc/acpi/button/lid/LID/state

Revision history for this message
Hanno Stock (hefe_bia) (hanno-stock) wrote : Re: [Bug 324918] Re: Laptop mode not enabled on lid closed

Tormod Volden schrieb:
> Thanks for your report. You say the display is properly turned off, you mean it goes black? That could be a hardware switch turning of the backlight. Or do you get the locked screen (password dialog) when you open it? Can you try:
> sleep 10 && cat /proc/acpi/button/lid/LID/state
>

I don't get the locked screen, but:

hanno@sputnik2:~$ sleep 20 && cat /proc/acpi/button/lid/LID/state
state: closed

hanno@sputnik2:~$ cat /proc/acpi/button/lid/LID/state
state: open

So ACPI works.

Revision history for this message
Tormod Volden (tormodvolden) wrote :

In the old times, the acpid should react on the event defined in /etc/acpi/events/lidbtn and run /etc/acpi/lid.sh. You can verify this by restarting acpid in debug mode:
 sudo pkill ^acpid
 sudo acpid -d
... now close the lid and open it again
Afterwards stop the debug one and restart it normally:
 (ctrl-C)
 sudo acpid

Nowadays, gnome-power-manager is responsible for these things. So /etc/acpi/lid.sh exits because it sees gnome-power-manager running. You can see g-p-m in action like this:
 sudo pkill gnome-power-manager
 sudo gnome-power-manager --no-daemon --verbose
... and close the lid
Restart with
 (ctrl-C)
 sudo gnome-power-manager

However I am not sure how laptop mode is hooked into g-p-m (or should have been) for lid actions.

Revision history for this message
Ritesh Raj Sarraf (rrs) wrote :

Looks like you too are affected with the same bug as in: #387057

Can you try the same steps as mentioned there in the comments ?

Revision history for this message
Steve Langasek (vorlon) wrote :

This doesn't work because the /etc/acpi/events/lm_lid script has been intentionally removed from the Ubuntu package of laptop-mode-tools.

I'm not sure this is something we want to support. Why would you not simply set a policy of suspending the laptop on lid close, instead of turning on laptop-mode? Which features of laptop-mode-tools are the ones that you're concerned about setting when the lid is closed?

Revision history for this message
Steve Langasek (vorlon) wrote :

(Note that acpid itself is considered deprecated in Ubuntu, and will cease to be installed by default once acpi-support is no longer needed.)

Revision history for this message
ceg (ceg) wrote :

If the /etc/acpi/events/lm_lid script has been removed from the ubuntu package of laptop-mode-tools (as the laptop-mode-tools are adapted to the invocation by pm-utils used in ubuntu), do pm-tools not provide a replacement hook for the lid closed event?

I wonder because as aunt carry would have said, breaking something by intent and not leaving even a note in the package/config is something we'd stay away from.

Revision history for this message
ceg (ceg) wrote :

> Why would you not simply set a policy of suspending the laptop on lid close, instead of turning on laptop-mode?

Because laptop-mode (with all the additional disk idleing features of the laptop-mode-tools) is different from suspending into a unresponsive state.

And doesn't gnome-power provide only a user limited solution instead of a system wide solution and without relying on the well tested and supported code of laptop-mode-tools for disk idleing?

Revision history for this message
Gurmeet (gurmeet1109) wrote :

+ me-too on the bug

When the lid on the laptop is closed, only the display gets turned off, not the machine. Everything internally is working.

Expected behavior : On lid close, laptop should suspend with all peripherals, disk, CPU, wireless etc off. On lid open, laptop should Resume normal working behavior. Optionally present a password prompt (if set).

# uname -a
Linux ubnode6 2.6.35-23-server #40-Ubuntu SMP Wed Nov 17 23:31:10 UTC 2010 x86_64 GNU/Linux

Revision history for this message
ceg (ceg) wrote :

Of course, you want to be able to close the lid and save power but not suspending completely. For example when your laptop is supposed to monitor or control a service or device.

The fix for this is to ship l-m-t with an an appropriate hook for pm-utils that replaces the old acpid hook (/etc/acpi/events/lm_lid).

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.