On Friday 16 February 2007 19:13, Raymond Lewis Rebbeck wrote: > On Saturday, 17 February 2007 5:31, Mick wrote: > > Hi All, > > > > A few weeks ago I updated acpi and hibernate and their relevant > > configuration files. Since then when I press the power button on my > > laptop nothing happens. > > > > Clearly something was changed, intentionally or otherwise, and this > > feature is no longer available to me. Would you care to point me in the > > right direction - how do I set my power button to run the hibernate > > script? > > I assume you're using acpid. Look in /etc/acpi/ there is a default script > that is run for acpi events, it handles the power button by calling > /sbin/init 0. Replace the command it runs with hibernate or similar.
Thanks Raymond, I have this in my /etc/acpi/events/default:
==========================
event=button[/]power.*
action=/usr/sbin/hibernate
==========================
but nothing happens or gets logged when I press the power button. Could this
be something to do with the /etc/acpi/default.sh file perhaps? I vaguely
remember hacking it unashamedly in the mist of time to get the button
working.
==========================
#!/bin/sh
# /etc/acpi/default.sh
# Default acpi script that takes an entry for all actions
set $*
group=${1/\/*/}
action=${1/*\//}
device=$2
id=$3
value=$4
log_unhandled() {
logger "ACPI event unhandled:
$*" }
case "$group" in
button)
case "$action" in
power)
/sbin/init 0
;;
sleep)
/usr/sbin/hibernate
;;
thermal_zone)
;; # I don't care, the fan works anyway.
# if your laptop doesnt turn on/off the display via hardware
# switch and instead just generates an acpi event, you can force
# X to turn off the display via dpms. note you will have to run
# 'xhost +local:0' so root can access the X DISPLAY.
#lid)
xset dpms force off
# ;;
*) log_unhandled $* ;;
esac
;;
ac_adapter)
case "$value" in
# Add code here to handle when the system is unplugged
# (maybe change cpu scaling to powersave mode)
#*0)
# ;;
# Add code here to handle when the system is plugged
in
# (maybe change cpu scaling to performance mode)
#*1)
# ;;
*) log_unhandled $* ;;
esac
==========================
Can you spot anything out of place?
--
Regards,
Mick
pgpwEUebi2V0b.pgp
Description: PGP signature

