No suspend on lid close in 11.1

I just upgraded from 11.0 to 11.1, and now my laptop won’t suspend when I close the lid. The hibernate key also doesn’t work.

Suspending works just fine if I use pm-suspend or echo “mem” > /sys/power/state or s2ram. The problem is that it’s not getting triggered by the keys or the lid.

As far as I can tell from quite a bit of research, a lid close is supposed to generate an ACPI event, and in 11.0 those events were handled by powersaved. But powersaved has disappeared in 11.1, and for the life of me I can’t figure out what took over for it. I’ve done all the obvious things, like verifying that /etc/sysconfig/powersave has the right settings. Since it worked in 11.0, they ought to be fine, but I checked anyway.

Can anybody point me to how the lid close is detected in 11.1?

Gnome or KDE?

You can generate those events yourself, no?

Not that this is the answer to your problems, but if the suspend and hibernate DO work correctly by command, couldn’t you go into the power configuration in Yast and say, when Power button pressed do X and when lid is closed do Y?

I am sorry, I don’t have a laptop on 11.1, but that has worked for me in the past…

Good Luck!

Since moving to pm-suspend, openSUSE no longer uses generic ACPI triggers for power-management, they’re basically ignored. This has vexed me in the past, as I used to prefer using my own custom scripts for suspend handling. You’ll need to use the appropriate system utilities to configure behavior.

If you’re using KDE4, then check your system-settings power management configuration, to make sure that the lid close is set to trigger suspend. Previously this was handled through kpowersave, now it’s handled through the new Powerdevil utility.

Hope this helps?

Cheers,
KV

Gnome or KDE?

Neither. I use the command line. That makes powerdevil unhelpful, since it’s tied deeply to KDE. (I just love these provincial utilities that only work in a single environment. Not.)

AFAICT, YaST doesn’t have a power configuration area any more. The closest I could find is the clumsy /etc/sysconfig editor, but /etc/sysconfig definitely has the correct settings.

In any case, there needs to be a daemon of some sort. I’m quite capable of writing scripts to be run by acpid, but one would like to think that SuSE didn’t expect every single non-KDE customer to do the same.

In any case, there needs to be a daemon of some sort. I’m quite capable of writing scripts to be run by acpid, but one would like to think that SuSE didn’t expect every single non-KDE customer to do the same.

Agreed. You may find this page useful: ACPI Hibernate How To

Thanks; I’ve been looking at that page. It’s kind of my fallback position in case there’s no proper automation in 11.1.

Keep us posted on how this works out for you. It would be good to get a how to on this in the opensuse database for alternative desktop users.

gkuenning wrote:

>
> I just upgraded from 11.0 to 11.1, and now my laptop won’t suspend when
> I close the lid. The hibernate key also doesn’t work.
>
> Suspending works just fine if I use pm-suspend or echo “mem” >
> /sys/power/state or s2ram. The problem is that it’s not getting
> triggered by the keys or the lid.
>
> As far as I can tell from quite a bit of research, a lid close is
> supposed to generate an ACPI event, and in 11.0 those events were
> handled by powersaved. But powersaved has disappeared in 11.1, and for
> the life of me I can’t figure out what took over for it. I’ve done all
> the obvious things, like verifying that /etc/sysconfig/powersave has the
> right settings. Since it worked in 11.0, they ought to be fine, but I
> checked anyway.

On both of my laptops I get the same problem - but only on the initial
closure. If I open then re-close the lid, it hibernates. WTF??? Anyway,
that has been my solution to the nuisance.


Will Honea

Repeated opens and closes of the lid don’t resolve the problem for me, so I adapted the solution given in Linux.com :: How to suspend and hibernate a laptop under Linux as follows:

You need to create three files under /etc/acpi:

/etc/acpi/events/lid:


event=button/lid
action=/etc/acpi/actions/suspend %e

/etc/acpi/events/sleep_button:


event=button/sleep
action=/etc/acpi/actions/suspend %e

/etc/acpi/actions/suspend:


#!/bin/sh

logger "/etc/acpi/actions/suspend called with $*"

case "$1" in
    button/lid*)
        # if launched through a lid event and lid is open, do nothing
        grep -q open /proc/acpi/button/lid/LID/state  &&  exit 0
        #s2ram
        pm-suspend
        ;;
    button/sleep*)
        # s2disk doesn't work on my machine
        #s2disk
        pm-hibernate
        ;;
esac

The last file has to be executable (chmod +x /etc/acpi/actions/suspend).

After creating these files, reload acpid (/etc/init.d/acpid reload).

Closing the lid should now suspend to RAM, and the sleep button (on my Dell Latitude D820 it’s labeled “Standby”) should suspend to disk.

A couple of notes for the anal:

  • The logger line makes syslog entries; comment it out or change it if you choose.
  • If pm-suspend/pm-hibernate don’t work, try using s2ram/s2disk instead.
  • If you choose, you could point /etc/acpid/events/sleep directly at pm-hibernate instead of using the suspend script. That won’t work for lid closing, though, because you need something that checks the actual state of the lid.

Good work. Thanks for the update. :slight_smile: