How do I prevent immediate wake up from suspend and/or hibernation?

For a few days, my Ubuntu 12.04 desktop computer has mysteriously been waking up immediately after going to suspend mode.

Since installation, my Ubuntu 12.10 laptop computer has also been resuming immediately after suspend and hibernation.

How to prevent those?


This problem was probably caused by strange USB signals. gedit /proc/acpi/wakeup showed me, that wakeup was enabled for USB0 and USB2.

sudo -s
echo USB0 > /proc/acpi/wakeup
echo USB2 > /proc/acpi/wakeup

switched them to disabled (checked by gedit /proc/acpi/wakeup again or refreshing the file-view), and after that, the computer stays in suspend like it should. :-)


I recently had the same symptom on Asus Zenbook Pro UX501 on Ubuntu 15.04. Bazon's exact fix did not work but Vladimir Rutsky's variation did. Specifically:

If running from the terminal cat /proc/acpi/wakeup shows the following lines

EHC1      S3    *enabled  pci:0000:00:xx.x
EHC2      S3    *enabled  pci:0000:00:xx.x
XHC       S3    *enabled  pci:0000:00:xx.x

(pci addresses may be different)

then toggle these three to disabled by issuing the following commands:

sudo -s
echo EHC1 > /proc/acpi/wakeup
echo EHC2 > /proc/acpi/wakeup
echo XHC > /proc/acpi/wakeup