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:
~$ 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:
# 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?