FS#29333 - [laptop-mode-tools] 'laptop_mode auto' no longer suspends when lid closed

Attached to Project: Community Packages
Opened by Jamie Kitson (JamieKitson) - Sunday, 08 April 2012, 10:22 GMT
Last edited by Lukas Jirkovsky (6xx) - Monday, 18 June 2012, 10:09 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Lukas Jirkovsky (6xx)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

My laptop stopped suspending to RAM when I closed the lid. On investigation I found that the ACPI event and action were still being fired, but 'laptop_mode auto' was no longer causing the machine to suspend. Replacing that line in actions/lm_lid.sh with pm-suspend fixed the issue.

Additional info:
* package version(s)

community/laptop-mode-tools 1.60-2 [installed]

* config and/or log files etc.

[jamie@jamie-laptop ~]$ cat /etc/acpi/events/lm_lid
event=button[ /]lid
action=/etc/acpi/actions/lm_lid.sh %e
[jamie@jamie-laptop ~]$ cat /etc/acpi/actions/lm_lid.sh
#! /bin/sh

test -f /usr/sbin/laptop_mode || exit 0

# lid button pressed/released event handler

/usr/sbin/laptop_mode auto

This task depends upon

Closed by  Lukas Jirkovsky (6xx)
Monday, 18 June 2012, 10:09 GMT
Reason for closing:  Not a bug
Comment by Jamie Kitson (JamieKitson) - Tuesday, 10 April 2012, 21:47 GMT
Note for the work around: So as not to cause a sleep when the lid is opened add this line:

grep -q open /proc/acpi/button/lid/LID/state && exit 0
Comment by Lukas Jirkovsky (6xx) - Thursday, 26 April 2012, 19:52 GMT
Jamie: I can't find anything related to autosuspend in the laptop-mode-tools code. It seems to me that automatic suspend is handled by pm-utils and not by laptop-mode-tools. Did you update pm-utils lately?

Also is it possible that you used some desktop environment before? Eg. KDE handles suspend on lid closed independently on daemons such as pm-utils and laptop-mode-tools.
Comment by Jamie Kitson (JamieKitson) - Thursday, 26 April 2012, 21:54 GMT
Thanks for your reply.

In the package is the file:

---

[jamie@jamie-laptop laptop-mode-tools_1.60]$ cat etc/acpi/actions/lm_lid.sh
#! /bin/sh

test -f /usr/sbin/laptop_mode || exit 0

# lid button pressed/released event handler

/usr/sbin/laptop_mode auto

---

So my question would be, what does that do? I suppose it is possible that that file (or /etc/acpi/handler.sh from acpid) has been overwritten on my system. I use dwm, so I'm pretty sure there isn't any desktop stuff interfering.
Comment by Lukas Jirkovsky (6xx) - Friday, 27 April 2012, 06:02 GMT
According to /usr/sbin/laptop-mode, line 663 and following, it is used only to enable laptop-mode, similarly to eg. when an AC plug is pulled out. Using grep -Ri suspend on all laptop-mode-tools files doesn't reveal any call to suspend either. I'm pretty sure this is pm-utils issue.

Quick googling on "laptop-mode-tools suspend on lid close" mostly refers to acpid and pm-utils for suspend or to enabling the same power saving settings that are used on battery.

Neither Arch Wiki lists anything related to suspend in the laptop-mode-page apart from the talk mentioning laptop-mode doesn't do that: https://wiki.archlinux.org/index.php/Talk:Laptop_Mode_Tools However acpid page mentions using pm-utils for suspend: https://wiki.archlinux.org/index.php/Acpid#Extending_acpid_with_pm-utils

Finally when I used OpenSuSE on my laptop, suspend on lid closed worked without was handled by pm-utils without actually having laptop-mode-tools installed.

Maybe you can ask on mailing list or forums to get more feedback.
Comment by Jamie Kitson (JamieKitson) - Friday, 27 April 2012, 09:15 GMT
Ok. I think I'm going to assume that my handler.sh was overwritten some how.
Comment by Lukas Jirkovsky (6xx) - Sunday, 17 June 2012, 14:33 GMT
Any news on this? Can I close this bug?

I tried downgrading all power-related tools to the versions before laptop-mode-tools-1.60-2 came out and autosuspend didn't work for me out of the box either. I was able to get it working using the handler.sh from acpid, but that works with the new laptop-mode-tools too.
Comment by Jamie Kitson (JamieKitson) - Monday, 18 June 2012, 09:39 GMT
Yes.
Comment by Lukas Jirkovsky (6xx) - Monday, 18 June 2012, 10:08 GMT
Thanks, I'll close it.

Loading...