You are not logged in.

#1 2007-12-21 02:54:23

semperfiguy
Member
Registered: 2007-12-03
Posts: 224

Power Button activating hibernate

I recently managed to get hibernate working properly by adding my custom hooks for netcfg2.  Now I would like to be able to just push the power button and have it hibernate. 

I tried following the wiki here:  http://wiki.archlinux.org/index.php/Shu … wer_button

but still nothing happens when I push the button.

My /etc/acpi/events/power file reads:

# /etc/acpi/events/power
# This is called when the user presses the power button

event=button/power (PWR.||PBTN)
action=/usr/sbin/pm-hibernate

Offline

#2 2007-12-21 03:42:13

SiD
Member
From: Germany
Registered: 2006-09-21
Posts: 729

Re: Power Button activating hibernate

Try to put the command in the /etc/acpi/handler.sh script.

case "$1" in
        button/power)
                #echo "PowerButton pressed!">/dev/tty5
                case "$2" in
                        PWRF) /usr/sbin/pm-hibernate
                              logger "PowerButton pressed: $2" ;;
                        *)    logger "ACPI action undefined: $2" ;;
                esac
                ;;

Last edited by SiD (2007-12-21 03:43:29)

Offline

#3 2007-12-22 16:05:08

semperfiguy
Member
Registered: 2007-12-03
Posts: 224

Re: Power Button activating hibernate

I tried that with no luck.  Where is the log file this is writing to so I can see if its even registering.

Offline

#4 2007-12-22 17:44:18

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: Power Button activating hibernate

So you can issue 'pm-hibernate' and it will go to sleep, but pushing the power button does nothing?

Offline

#5 2007-12-22 17:55:39

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: Power Button activating hibernate

Look in the system logs to check the exact name of the event triggered by the botton. Sometimes it is botton.power, some others button.<somethingelse>. And with some broken ACPIs there is alas no event seen at all... Modify the line with 'event' in the acpid configuration.

The logs of acpi are now passed to the system logger, so just grep for 'button' in /var/log/*.


Mortuus in anima, curam gero cutis

Offline

#6 2007-12-22 20:45:07

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: Power Button activating hibernate

what DE you are using?


Give what you have. To someone, it may be better than you dare to think.

Offline

#7 2007-12-22 23:45:08

semperfiguy
Member
Registered: 2007-12-03
Posts: 224

Re: Power Button activating hibernate

I am using fluxbox.  Running pm-hibernate works beautifully from the command line but I am trying to set it so the power button sends the pm-hibernate command.  Right now the button does nothing.

ran cat * | grep button

with the files I ran through it being: syslog.log, acpid.log, messages.log, user.log, errors.log, and everything.log

the only hits I got where mouse button related.

Last edited by semperfiguy (2007-12-22 23:53:16)

Offline

#8 2007-12-23 12:34:27

Jack B
Member
Registered: 2006-06-27
Posts: 107
Website

Re: Power Button activating hibernate

At terminal run acpi_listen, then press the power button.  If the button triggers an ACPI event, it will appear in the terminal.
You can then edit the ACPI script to use that event.

HTH
Jack

Offline

#9 2007-12-23 15:53:58

SiD
Member
From: Germany
Registered: 2006-09-21
Posts: 729

Re: Power Button activating hibernate

Is the acpi daemon (acpid) running? And the kernel modul "button" loaded?

Offline

#10 2007-12-23 18:07:32

semperfiguy
Member
Registered: 2007-12-03
Posts: 224

Re: Power Button activating hibernate

I ran acpi_listen and pressing the power button does nothing at all.

I ran lsmod | grep button and it returned as button being listed so I assume its being loaded.

So its not picking up the button at all. thats a little frusterating.

Offline

#11 2007-12-23 18:14:00

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: Power Button activating hibernate

Probably a buggish acpi. You may need a fixed DSDT table. Look in the gentoo wiki for a detailed (and not so easy) guide to verify if this is a guide. In the acpi website there is a repo of fixed DSDT tables for several laptops, which have not yet reached the vanilla kernel.


Mortuus in anima, curam gero cutis

Offline

Board footer

Powered by FluxBB