Author Topic: Unwanted PC wakeup from shutdown only (Kubuntu 20.04 LTS)  (Read 959 times)

0 Members and 1 Guest are viewing this topic.

Online RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 6202
  • Country: ro
Unwanted PC wakeup from shutdown only (Kubuntu 20.04 LTS)
« on: May 13, 2021, 08:44:34 am »
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: [Select]
~$ 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 enabled

pnp0 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: [Select]
#    Path                                                                                      Mode UID  GID  Age Argument
...
...
w    /sys/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1.1/power/wakeup                          -    -    -    -   disabled

 

Why a device became wakeup active sometimes?
What keeps re-enabling manually disabled wake-up devices in Kubuntu 20.04 LTS?

Online RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 6202
  • Country: ro
Re: Unwanted PC wakeup from shutdown only (Kubuntu 20.04 LTS)
« Reply #1 on: May 13, 2021, 09:27:38 am »
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: [Select]
~$ find /sys/devices -name wakeup -type f -printf '%p ' -exec cat {} \; | grep enabled
/sys/devices/pnp0/00:06/power/wakeup enabled

 :-//

Online Marco

  • Super Contributor
  • ***
  • Posts: 6721
  • Country: nl
Re: Unwanted PC wakeup from shutdown only (Kubuntu 20.04 LTS)
« Reply #2 on: May 13, 2021, 05:37:25 pm »
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.html

It's probably trashing your settings.
 

Online RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 6202
  • Country: ro
Re: Unwanted PC wakeup from shutdown only (Kubuntu 20.04 LTS)
« Reply #3 on: May 13, 2021, 08:41:14 pm »
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 appeared
Code: [Select]
~$ 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 enabled
Added 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: [Select]
w    /sys/devices/pci0000:00/0000:00:1d.0/power/wakeup                                         -    -    -    -   disabled

Online Marco

  • Super Contributor
  • ***
  • Posts: 6721
  • Country: nl
Re: Unwanted PC wakeup from shutdown only (Kubuntu 20.04 LTS)
« Reply #4 on: May 13, 2021, 10:54:57 pm »
Try not putting the disables in /etc/tmpfiles.d, but put them in a 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.
« Last Edit: May 13, 2021, 10:57:45 pm by Marco »
 

Online RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 6202
  • Country: ro
Re: Unwanted PC wakeup from shutdown only (Kubuntu 20.04 LTS)
« Reply #5 on: May 14, 2021, 09:11:52 am »
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 wild  :bullshit: so 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 uninstall
Code: [Select]
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.
« Last Edit: May 14, 2021, 09:18:28 am by RoGeorge »
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8270
Re: Unwanted PC wakeup from shutdown only (Kubuntu 20.04 LTS)
« Reply #6 on: May 14, 2021, 01:39:42 pm »
Also check in BIOS settings for wake-on-LAN or similar.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf