[ale] Howto suspend on power button press

Jim Popovitch jimpop at yahoo.com
Tue Jun 7 00:17:49 EDT 2005


Hi Michael,

I just went through this a few months back... quite painful, but
productive.  In the end, however, I had to switch back to APM due to
some BIOS/hw issues.   You need to look in /etc/acpi/events/*
and /etc/acpi/actions/*.  

In my (leftover) /etc/acpi/events/lid file (laptop) I have this:

     event=button[ /]lid
     action=/etc/acpi/actions/suspend.sh

In my /etc/acpi/actions/suspend.sh I have this:

     #!/bin/sh

     # pre-suspend actions here
     /etc/init.d/hotplug stop
     /etc/init.d/alsa suspend
     /etc/init.d/hwclock.sh stop

     # suspend
     echo 3 > /proc/acpi/sleep

     # when this returns, we are resuming
     sleep 2
     /etc/init.d/hwclock.sh start
     /etc/init.d/alsa resume
     /etc/init.d/hotplug start

You can create a similar events file that contains things like:

     event=button[ /]power

and point it to a similar script that contains
  
     echo 4 > /proc/acpi/sleep 

which will put your system into hibernation (if I remember correctly)

hth,

-Jim P.


On Mon, 2005-06-06 at 21:53 -0600, Michael Hirsch wrote:
> A while ago I had a computer that would suspend to ram when I pressed
> the power button.  This rather surprised me, but was actually quite
> nice, but I don't know why it did that.
> 
> I have a nice machine now and I'd like to be able to do that.  I've
> been reading ACPI howtos, and getting almost nothing out of them. 
> They seem to spend all their time talking about how to compile ACPI
> into the kernel, but no time at all talking about how you control it.
> 
> Can anyone point me to a nice write-up of how to configure and use
> ACPI assuming that it is already installed?
> 
> Thanks,
> 
> Michael
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale



More information about the Ale mailing list