Unwanted PC wakeup from shutdown only (Kubuntu 20.04 LTS) - Page 1
Forum section: electronics / general

author: RoGeorge
author_rank: Super Contributor
timestamp: May 13, 2021, 08:44:34 am
content: It's a desktop and it starts by itself during night, but only from shutdown. From standby it doesn't wakeup by itself overnight. Only from shutdown is doing that, and not each and every night, but often.There is a "/etc/tmpfiles.d/mine-disable-wake.conf" I added long ago to disable the wakeup from each wakeup-capable device, except for the PS/2 keyboard. Usually this script works as expected. However, sometimes I found the PC running next morning after a shutdown.This morning I found it running again, from the logs it woke up at about an hour after shutdown. Searching for wakup-enable devices I find this:Code:~$ find /sys/devices -name wakeup -type f -printf '%p ' -exec cat {} \; | grep enabled/sys/devices/pnp0/00:06/power/wakeup enabled/sys/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1.1/power/wakeup enabledpnp0 is the keyboard and expected to be enabled, but the next line for the USB3 shouldn't be there. That device was manually added long time ago in the "/etc/tmpfiles.d/mine-disable-wake.conf", in order to disable its wakeup events.I've checked in the .conf file, and the disable line is indeed there, last line in the file:Code:# Path Mode UID GID Age Argument......w /sys/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1.1/power/wakeup - - - - disabledWhy a device became wakeup active sometimes?What keeps re-enabling manually disabled wake-up devices in Kubuntu 20.04 LTS?

author: RoGeorge
author_rank: Super Contributor
timestamp: May 13, 2021, 09:27:38 am
content: Without changing anything, just shutdown and power up again, and now only the keyboard wakeup is enabled, the other USB3 wakeup device I've seen this morning is not there any more:Code:~$ find /sys/devices -name wakeup -type f -printf '%p ' -exec cat {} \; | grep enabled/sys/devices/pnp0/00:06/power/wakeup enabled

author: Marco
author_rank: Super Contributor
timestamp: May 13, 2021, 05:37:25 pm
content: Wild guess, when in doubt about something not quite working as expected, it's probably because systemd introduced a new way of doing it.https://www.freedesktop.org/software/systemd/man/systemd-suspend.service.htmlIt's probably trashing your settings.

author: RoGeorge
author_rank: Super Contributor
timestamp: May 13, 2021, 08:41:14 pm
content: Probably systemd, but I don't know how to stop it from adding wakeup devices.Meanwhile I've went to bios and disable USB 3. Guess what?! A new USB 2 wakeup device appearedCode:~$ find /sys/devices -name wakeup -type f -printf '%p ' -exec cat {} \; | grep enabled/sys/devices/pnp0/00:06/power/wakeup enabled/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.1/power/wakeup enabledAdded the new name to the manually disabled list. Will see how it goes.Before changing the bios settings it was named different (and disabled manually)Code:w /sys/devices/pci0000:00/0000:00:1d.0/power/wakeup - - - - disabled

author: Marco
author_rank: Super Contributor
timestamp: May 13, 2021, 10:54:57 pm
content: Try not putting the disables in /etc/tmpfiles.d, but put them ina script in /lib/systemd/system-sleep. This will cause the disable to be performed immediately before the suspend.PS. or in /usr/lib/systemd/system-sleep I guess, but it's a hack either way so who cares.

author: RoGeorge
author_rank: Super Contributor
timestamp: May 14, 2021, 09:11:52 am
content: By serendipity it happens that yesterday an update wanted to update "ubuntu-advantage-tools". A program with the word "advantage" in its name made my bullshit detector go wildso I googled what is ubuntu-advantage-tool, and it's a component for enterprise administration of many computers, payed subscription and assistance and other "advantages" never needed on a home computer administered from the local keyboard only."Ubuntu Advantages" seems like a good candidate for a program that will try to override manual settings in order to keep the computer reachable from outside. So I did an uninstallCode:sudo apt remove ubuntu-advantage-toolsand so far no new unwanted wakeup devices appeared out of nowhere, and the PC stayed off overnight.This is not yet a proof that the "Ubuntu Advantage" tools was indeed the culprit, but I highly suspect it was. Will see how it goes after a few more days.

author: amyk
author_rank: Super Contributor
timestamp: May 14, 2021, 01:39:42 pm
content: Also check in BIOS settings for wake-on-LAN or similar.