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?


  • I don't have the reputation to add a proper answer, but I managed to fix this simply by charging my laptop. I think Ubuntu automatically wakes up when the battery is low (which seems counter-intuitive). Obviously this won't fix any issues with a desktop, but it might be worth trying for anyone with this issue on a laptop
    – JolonB
    Jun 19, 2021 at 6:16

6 Answers 6


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. :-)

  • 1
    This solution did not work for me. PS2K was enabled (keyboard wakeup) but changing it made no difference.
    – Bryce
    Oct 5, 2012 at 19:15
  • 5
    In my case there were no USB* devices, looks like they were internally connected through USB-hub: adding EHC1, EHC2 and XHC to /proc/acpi/wakeup helped me. Jun 8, 2014 at 18:43
  • 2
    In my case it was XHCI for USB 3
    – Andy
    Mar 17, 2016 at 16:52
  • @Bazon can you please have a look at http://askubuntu.com/questions/852600/ubuntu-16-04-wakes-up-immediately-from-suspend-after-installing-fprint-in-lenovo and help me to figure it out Nov 23, 2016 at 9:24
  • For me disabling IGBE worked Nov 24, 2016 at 4:16

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
  • 2
    Doing above didnot resolve my problem :( Nov 24, 2016 at 3:59
  • For me disabling IGBE worked, above three didn't Nov 24, 2016 at 4:15
  • @ilikerrobots This does not fix it permanently, how to fix it permanetly Nov 29, 2016 at 7:57
  • GLAN quickly switches back to enabled. Any idea why?
    – M. Toya
    Oct 17, 2017 at 14:25
  • To make it persist put it in a cron entry timed for @reboot. I found it useful to only run the echo if it was in fact enabled by putting a test in a shell script like so egrep -q '^XHC1\s+S[0-9]\s+\*enabled' /proc/acpi/wakeup && echo XHC1 > /proc/acpi/wakeup (my problem device was XHC1 - a USB chipset). Jun 18, 2018 at 11:30

If you know which device wake up your PC go to first step to follow the guide. If you don't, then open terminal and do:

cat /var/log/syslog

And find which device is waking your PC.

So now:

  1. hit in terminal:

    grep . /sys/bus/usb/devices/*/power/wakeup

To list all usb ports that wakeup our pc.

sudo su

we have now root privillages.

2.I have 8 USB ports and in this example let's say that I want to disable usb8 ,so:

echo disabled > /sys/bus/usb/devices/usb8/power/wakeup

Go ahead and test it. Now that specific device in USB port 8 won't wake up the PC.

Next step, to make the change permanent after each boot:


sudo nano /etc/rc.local

And we paste the command from step 2. In there (before the exit 0 of course).

That's it.

optional Only if after sleep/wakeup process the USB 8 device , in my example , revert back to enabled.

  1. Write a udev rule too to execute the command after every boot,sleep,wake up.

Open a terminal and do:


At your keyboard device id information the 4 first digits are the vendor id and the 4 next digits are the product id screenshot

Next do:

sudo nano /etc/udev/rules.d/10-wakeup.rules

Where "wakeup" enter your desired name of the script. Number 10 is the priority in case you have many other udev rules, the lower the number the 'rule' will be executed before the others.

Copy paste this and replace the vendor id and product id with your own wireless keyboard vendor id and product id.

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="062a", ATTRS{idProduct}=="4101" RUN+="/bin/sh -c 'echo disabled > /sys/bus/usb/devices/usb8/power/wakeup'"

*usb8 for me is my wireless keyboard (you can also see that in the screenshot (Bus 008)), replace it with your own.

Ctrl + O to save , Ctrl + X to exit and reboot.

  • thanks! this looks interesting. would you mind adding your guide here (changing it so it addresses the specific issue of this question)
    – geoffrey
    Jan 30, 2017 at 8:02
  • thanks. this is not quite what I wanted, but it got me to fix the issue - by modifying the rc.local file (my issue is not specific to the USB ports). I have posted my own solution, but you will get the bounty (I cannot award it before tomorrow though)
    – geoffrey
    Jan 30, 2017 at 20:17
  • Which are safe to disable? Will I run into problem if I disable all? The only enabled is for me is /sys/bus/usb/devices/1-2/power/wakeup:enabled
    – M. Toya
    Oct 17, 2017 at 14:20
  • 1
    syslog doesn't even mention what is waking up the computer
    – Ken Sharp
    Jul 4, 2019 at 10:17
  • I am running Ubuntu 22.04 on a ThinkPad P14s and this is the only solution that worked for me. Thanks!
    – mrpandey
    Nov 15, 2022 at 10:17

To make the fix permanent

(I am compiling the solutions provided by Bazon, Ilikerobots, and Pavlos Theodorou - together they address my specific issue)

To fix the issue permanently, whether it is a USB port waking up the system or something else:

  1. Find out what is allowed to wake up your system:

gedit /proc/acpi/wakeup

You might get these or similar 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

Then open:

sudo gedit /etc/rc.local

and add these lines (or similar, depending on the results above) before exit 0

echo EHC1 > /proc/acpi/wakeup

echo EHC2 > /proc/acpi/wakeup

echo XHC > /proc/acpi/wakeup

  • oh i didn't think about it. of course it could be another port besides a usb. i'm glad you solved it. Jan 30, 2017 at 23:53

This is what worked for me on my Mac Book Pro 2015

I added the following to /lib/systemd/system-sleep/wakeup_disable


# /lib/systemd/system-sleep/wakeup_disable
# Avoids that system wakes up immediately after suspend or hibernate
# Tested on MacBookPro 2015

case $1 in
    if grep -qE '^XHC1.*enabled' /proc/acpi/wakeup; then
        echo XHC1 > /proc/acpi/wakeup
    if grep -qE '^LID0.*enabled' /proc/acpi/wakeup; then
        echo LID0 > /proc/acpi/wakeup

Note this will prevent waking up via the lid opening and via keyboard/mouse/USB device you have to push the power button.


  1. https://wiki.debian.org/InstallingDebianOn/Apple/MacBookPro/Early-2015-13-inch#Immediate_wakeup_after_sleep

  2. https://wiki.archlinux.org/index.php/MacBookPro11,x

  • Can't resist mentioning the UUoC :-). But had you written if grep -qE '^XHC1.*enabled' /proc/acpi/wakeup; then instead, I would have missed an apportunity to comment...
    – mivk
    Aug 12, 2020 at 20:21
  • I cannot believe I did that! Fixed it ;)
    – Rwky
    Aug 13, 2020 at 21:04
  • This answer makes way more sense than other "permanent fixes" I've seen, most of which don't check whether the problematic wakeup is enabled before trying to fix it.
    – naught101
    Sep 27, 2020 at 22:31
  • In Linux Mint and my Thinkpad T480s, the cause is XHC, so I disable it and so far, my Thinkpad no longer wakeup by itself when lid closed Jan 24, 2022 at 5:57

I solved this problem in a simple way, writing the following lines in /etc/rc.local to enable only wakeup by PS2 keyboard:

for d in `cat /proc/acpi/wakeup |grep enabled|grep -v PS2K|cut -b -4`; do
    echo $d >/proc/acpi/wakeup ; 

When Linux boots, it executes the /etc/rc.local file disabling wakeup by USB or other devices.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .