After upgrade to Kubuntu 18.04, System wakes up immediately after suspend. Bug?

Solution 1:

Got it!

My USB wifi dongle seemed to wake my system up.

Step 1: check what is allowed to wake up your system:

Open a terminal:

sudo nano /proc/acpi/wakeup

Step 2: understand the results:

Screenshot of /proc/acpi/wakeup content - step 1

The list shows what device can awake your computer.

Here: EHC1 - EHC2 - XHC

Step 3: Block the device that wake up your computer:

Disable EHC1 in your terminal with:

echo EHC1 | sudo tee /proc/acpi/wakeup

Suspend your computer. If it still awakes, try

echo EHC2 | sudo tee /proc/acpi/wakeup

Note: EHC2 instead of EHC1. You can also try with XHC)

Note: above command is a kind of toggle. If you use it 2 times in a row, it will turn off EHC1, then turn it back on

Step 4: Confirm it worked

Here, it was EHC2 that woke up my computer (my USB wifi dongle). Now, it's disabled, it cannot awake my computer, and it stays suspended.

Screenshot of /proc/acpi/wakeup content - step 2

Solution 2:

I had exactly the same symptom, but had nothing plugged in (USB). The notebook would wake up again immediately after closing the lid.

In my case I fixed it once by going to System Settings > Power Management and experimenting with every possible option. It worked for me to disable "Suspend session" on the "On battery" tab. This option sets up the automatic suspension of the computer after certain time, but disabling it somehow fixed the inability to suspend the computer.

I then started again experimenting with the options and the problem came back, this time it didn't work to disable automatic suspension after some time.

I then found an article (https://bibhasdn.com/blog/fixing-immediate-resume-of-system-after-suspend-on-linux-mint-ubuntu/) explaining how to do something similar to the answer provided by the OP here and, after disabling XHC1 (USB 3.0 chip), the only option able to resume the computer other than the open lid action, the bug was fixed.

The steps were:

  1. Type in the terminal sudo cat /proc/acpi/wakeup
  2. Identify the options that can wake up the computer (enabled)
  3. Disable one by one, starting with the low priority ones (careful, read the article to know which ones to leave alone)

I am running Kubuntu KDE Plasma (Ubuntu 18.04.2 LTS) on a 2017 Macbook Air.