Suspend: Disable wakeup on mouse-move (Linux)

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

Suspend: Disable wakeup on mouse-move (Linux)

Post by ^rooker »

[PROBLEM]
Since upgrading to from Xubuntu 11.10 oneiric to LTS 12.04 precise, my PC would resume from suspend when the mouse moved. That might sound fun, but it's pretty annoying, considering that you touch the table to pick up something and the PC resumes again... hmpf. :?

[SOLUTION]
The following is closely based on a blog entry by "shadyabhi" on abhijeetr.com, but adapted to my setup (which had different wakeup-devices enabled).

In order to see what is enable to wake up your system from suspend, take a look at "/proc/acpi/wakeup", like this:

Code: Select all

$ cat /proc/acpi/wakeup
In my case the output was as follows:

Code: Select all

Device	S-state	  Status   Sysfs node
P0P1	  S4	*disabled  pci:0000:00:01.0
P0P2	  S4	*disabled  
P0P3	  S4	*disabled  
P0P4	  S4	*disabled  
GBE	  S4	*enabled   pci:0000:00:19.0
BR20	  S3	*disabled  
EUSB	  S3	*enabled   pci:0000:00:1d.0
USBE	  S3	*enabled   pci:0000:00:1a.0
PEX0	  S4	*disabled  pci:0000:00:1c.0
BR21	  S4	*disabled  pci:0000:02:00.0
PEX1	  S4	*disabled  
PEX2	  S4	*disabled  
PEX3	  S4	*disabled  pci:0000:00:1c.3
PEX4	  S4	*disabled  
PEX5	  S4	*disabled  
PEX6	  S4	*disabled  
PEX7	  S4	*disabled  
PWRB	  S3	*enabled
I'm pretty sure that "PWRB" means "power button", and "GBE" means "GigaBit Ethernet", and it's obvious that "EUSB" and "USBE" relate to my mouse (because it's connected by USB) - Although I'm not so sure what exactly the difference "EUSB" vs "USBE" is.
However, I wanted only the power button and my network (WOL) to allow resume from suspend.

If you echo one of those "Device" abbreviation strings to /proc/acpi/wakeup, it toggles the state between enable/disabled.

So in my case I did (as root):

Code: Select all

$ printf "EUSB\nUSBE\n" > /proc/acpi/wakeup
This toggled the enabled state of EUSB and USBE to disabled, leaving only "GBE" and "PWRB":

Code: Select all

Device	S-state	  Status   Sysfs node
P0P1	  S4	*disabled  pci:0000:00:01.0
P0P2	  S4	*disabled  
P0P3	  S4	*disabled  
P0P4	  S4	*disabled  
GBE	  S4	*enabled   pci:0000:00:19.0
BR20	  S3	*disabled  
EUSB	  S3	*disabled  pci:0000:00:1d.0
USBE	  S3	*disabled  pci:0000:00:1a.0
PEX0	  S4	*disabled  pci:0000:00:1c.0
BR21	  S4	*disabled  pci:0000:02:00.0
PEX1	  S4	*disabled  
PEX2	  S4	*disabled  
PEX3	  S4	*disabled  pci:0000:00:1c.3
PEX4	  S4	*disabled  
PEX5	  S4	*disabled  
PEX6	  S4	*disabled  
PEX7	  S4	*disabled  
PWRB	  S3	*enabled
That change however is not permanent.
You could write a small script though, call it "acpi_wakeup" and put it in "/etc/init.d":

Code: Select all

#!/bin/sh
printf "EUSB\nUSBE\n" > /proc/acpi/wakeup
Make it executable:

Code: Select all

$ chmod 755 /etc/init.d/acpi_wakeup
Then use 'update-rc.d' to make the required symbolic links automatically in other directories:

Code: Select all

$ update-rc.d acpi_wakeup defaults
Thanks shadyabhi, for your help!
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

acpi/wakeup: Enable / disable permanently

Post by ^rooker »

Here's an option for disabling USB devices permanently from waking up (resuming) from suspend:
(Xubuntu 16.04.3)

Add the following lines to "/etc/rc.local":

Code: Select all

echo "USBE" > /proc/acpi/wakeup
echo "EUSB" > /proc/acpi/wakeup
Thanks to a blog article by Thomas Monaco for this tip.
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply