[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: suspend to RAM not waking up

On Mon, May 28, 2007 at 13:55:24 +0100, Jose Rodriguez wrote:
> Hello
> Whenever I try to suspend to RAM my laptop (Amilo 1425 running Etch) hangs 
> when trying to wake it up by pressing the power button. I believe it hangs 
> for I can't switch it off unless holding the button for several seconds, 
> discarding therefore a merely blank screen problem.
> Issuing "s2ram" works, though (but not "hibernate"). I first played with 
> the VBE options in /etc/hibernate/*.conf, but to no avail. I then changed 
> /etc/acpi/events/sleepbt from
> action=/etc/acpi/sleep.sh to
> action=/usr/sbin/s2ram
> but what it now does is shutting down inmediately after it wakes up. I 
> checked the powerbt.sh and it does the following:
> #If powersaved is running, let it process the acpi event
> if pidof powersaved; then
>    exit 0
> fi
> if ps -Af ¦ grep -q '[k]desktop' && test -f /usr/bin/dcop
> then
>     dcop --all-sessions --all users ksmserver logout 0 2 0 && exit 0
> else
>     /sbin/shutdown -h now "Power button pressed"
> fi
> I don't know when the powersaved is called nor where its configuration 
> files are. Neither I know what the dcop lines are.

If you have powersaved installed (see "dpkg -l powersaved") then you can
configure it using the files in /etc/powersave. The default for the
power button is set up in "events" as EVENT_BUTTON_POWER="ignore".

The dcop line ensures a clean shutdown of KDE if it is running when the
power button is pressed. Since you don't run KDE this will be skipped
and you end up with the "/sbin/shutdown ..." command being executed.

> I noticed as well than when I press the power button (not suspending here) 
> I'm shown the gnome window asking what do I want to do, but this dissapears 
> before I can do anything and the computer shuts down.
> I've already run out of ideas, does anybody have any suggestion?

I would first try to comment out the line

     /sbin/shutdown -h now "Power button pressed"

This should allow you to test if the system comes back from suspend at
all. If this works then you can either decide that you don't mind if the
power button can no longer be used to shut down the system, or you have
to change powerbtn.sh so that it can tell the difference between "power
button was pressed to wake me up from suspend" and "power button was
pressed because the user wants to shut me down".

I did the following: I changed hibernate.conf so that

touch /tmp/powerbtn_flag_hibernate

is executed before the system suspends. Then I added this line before
all the other commands in powerbtn.sh:

[ -e /tmp/powerbtn_flag_hibernate ] && rm -f /tmp/powerbtn_flag_hibernate && exit 0

This means that pressing the power button to wake the system will no
longer result in an immediate shutdown. Pressing it while the system is
awake, on the other hand, will initiate a shutdown just like in the
default configuration (provided that the shutdown line is no longer
commented out, of course).

Regards,            | http://users.icfo.es/Florian.Kulzer
          Florian   |

Reply to: