LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   acpi event triggered sleep shuts down twice with USB mouse connected (https://www.linuxquestions.org/questions/linux-newbie-8/acpi-event-triggered-sleep-shuts-down-twice-with-usb-mouse-connected-743254/)

neonsignal 07-27-2009 09:17 PM

acpi event triggered sleep shuts down twice with USB mouse connected
 
I'm running Debian Lenny on a Toshiba Portege 3500.

I have set up an ACPI event in /etc/acpi/events/powerbtn:
Code:

event=button[ /]power
action=/etc/acpi/powerbtn.sh

This runs the following script, which sleeps the computer when I press the power button (rather than shutting down).
acpitool -s

Normally this works fine, ie:
1 press button
2 system goes to sleep
3 press button
4 system wakes up

However, when I have a USB mouse plugged in, the following happens:
1 press button
2 system goes to sleep mode
3 press button
4 system starts to wake up, USB restarts, system goes back to sleep mode
5 press button
6 system wakes up

Note that if I invoke 'acpitool -s' directly from the command line, it works properly (whether or not the usb mouse is present), and wakes up the first time.

Why is this happening? Possibly it has something to do with the autowake on USB (which incidentally, I can't figure out how to turn off in order to test this hypothesis, it doesn't have an obvious bios setting). I appear to be getting a reentry into the acpi powerbtn event.

I have a hack of a workaround, but it is ugly; my script now has the following:
Code:

test -f /var/lock/acpisleep1 && exit 0
touch /var/lock/acpisleep1
acpitool -s
(sleep 2; rm /var/lock/acpisleep1) &


neonsignal 04-29-2011 07:09 PM

Additional information; this particular wake-from-sleep quirk has been fixed in Debian Squeeze.


All times are GMT -5. The time now is 09:23 AM.