Kubuntu 18.04 waking from sleep (AND Shutdown)

Hello, new Linux user here. I’ve recently installed Kubuntu 18.04 as a secondary (but preferred) OS next to Windows. I’ve ironed out almost all the kinks, but one thing just perplexes me and I don’t know what to be looking for.

Sometimes I prefer to put my computer to sleep instead of shutting down which works great. But for some reason Linux decides to wake itself from sleep at 4am. It has never successfully stayed asleep for the entire night and will always wake at 4am (used to be 3am but daylight savings changed that).

I’m fairly confident that it is not my mouse/keyboard doing this, they are connected to the PC through USB pass-through on one of my monitors, which I turn off when shutting down/sleeping. And since there is such a consistent time that it happens it seems extremely unlikely that a USB device is causing it, but I could be wrong.

Here is a pastebin of my journalctl output from yesterday when I booted at ~3:30pm yesterday until this morning. It should also be noted that I only started using the PC this morning ~8:20am which is where a lot of the kscreen logs start happening.

Any help here would be appreciated or any suggestions on where to go from here or what to look into?

Update: This issue seems to have booted my computer after a shutdown as well! It has occurred the last 2 nights I believe, but the first I assumed was an accident. Yesterday morning I shutdown my computer using the shutdown menu in the Application Launcher and after a full day out of the house the computer remained off (as is intended). However I got up this morning to find my computer was awake! It managed to turn itself on and boot into Kubuntu.

This has never happened in Windows (10) and I’m fairly adamant that I don’t have a wake-time set in my bios as I have never set this up and have never had this issue for the 2+ years that I’ve owned this hardware.

I’m going to attempt a shutdown from the terminal today and see if this fixes the issue somehow. I’m happy to live with an Application Launcher issue rather than something far more difficult.

I can confirm that this issue remains even when shutting down through terminal. I’ve attached my journalctl output from the moment I entered the shutdown command, through to this morning when I sat down to my (automatically booted) PC.

It could be the settings for allowing unattended upgrades? But all of the settings I have for unattended upgrades are from stock Kubuntu, and I find that bizarre that it would be default and intended functionality.
journalctl_output.txt (216.0 KB)

Did you verify that you’re bios does not have wake on lan or power on after power surge settings enabled?

I’m not aware of anything in software that could power the computer from a shutdown state.

If the computer is starting after you actually shut down then it’s your power setting in bios rather than the OS. It can’t start itself up without something like an addin card or ipmi doing it.
We used to have a rule to do that to perform updates if a user shut down their box.

@TheIdiotYouYellat Yes I have confirmed this. There are no wake timers setup, I have set the power surge boot to “Disabled”. I also have keyboard, mouse, and LAN disabled for boot.

@blackfire That would make sense, but there are no power settings that are set that would cause this (as far as I know). And like I say, this has never been and continues to not be an issue with Windows. If I shutdown from my Windows OS the PC stays off as normal.

When you are in the OS open the terminal and run shutdown - h
This will do a full shut down so there won’t be any possible sleep. If it still wakes up then it’s not the OS.

Ok cool. I will give this out try tonight and post back with the results.

1 Like

Ugh noooo! Even with shutdown -h still booted at 4am…
I’m gunna have to tackle this in a couple days, but god damn this confuses me.

Well, here is my latest journalctl output with the persisting issue. journalctl.txt (107.2 KB)

Could this be a bootloader / efi / grub thing? If so, where would I check logs settings for these?

@blackfire found out some interesting tidbits over night! I decided to unplug my ethernet cable overnight to see if that had an effect. And it did! After shutting down my PC (through Application Launcher) and unplugging my ethernet cable everything remained off.
What’s more strange to me is that after plugging my ethernet cable in this morning, my PC booted by itself with <1 second of me doing so. So it seems that my booting is linked to the NetworkManager, but I’m not sure how it’s able to wait for a connection (because Linux is powered down).

Using ethtool I can see that my ethernet adapter does not have wake-on-lane enabled, or even supported:

Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Full 
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Full 
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: 100Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x000060e4 (24804)
                               link ifup rx_err tx_err hw wol
        Link detected: yes

Is there other things that would cause a boot? Like an update timer or anything like that?

something is sending a wakeonlan packet (aka magic packet) to your system. using this feature is often (but not always) a two step process having to enable it in the bios and enabling a call in the os to set the system to listen for one after shutdown.

https://wiki.archlinux.org/index.php/Wake-on-LAN

read through that and basically do the opposite :stuck_out_tongue:

actually go ahead and paste the output of
ethtool interface | grep Wake-on
so we can see it too.
edit never mind I see you last post actually shows it’s off this is truely bizarre. only thing left I can think is something is enableing it during shutdown maybe???

edit 2. it might seem counterproductive but I propose that you enable wakeonlan (set wake-on to g) and see if that doesn’t stop it from happening.

I had the same issue during dual boot of xubuntu 14.04 and windows 8.1. It too would infuriate me where it can and will stay shut off in windows during shut down but not in xubuntu. I was not able to replicate it’s origin as you were with Ethernet cable (I was using a USB wifi device). I also had a gigabyte motherboard (amd CPU, but I recognize the bios) and from your screenshot the only setting I can distinctly remember being different than my own setup is the boot load selection was set to UEFI only. So keep messing around in the BIOS, and I wanted to say you are not crazy :slight_smile:

What else is in your network? Something is triggering. Im not against calling networks haunted.
In your windows partition can you just check there are no scheduled jobs like windows update.
In the linux side can you also check cron

Also have a look at this

You may want to specify in interfaces not to allow wake on lan as I can see

Oct 10 04:00:23 NVLinux kernel: snd_hda_codec_hdmi hdaudioC1D0: HDMI: invalid ELD data byte 10
Oct 10 04:00:23 NVLinux kernel: alx 0000:03:00.0 eth0: wol: ctrl=3, speed=A
Oct 10 04:00:23 NVLinux kernel: ACPI: Preparing to enter system sleep state
S3

There’s only some pretty mundane stuff tbh: Macbook, Ubuntu Server, 3-4 Cellphones, windows PC, 2 Chromecasts, Skybox (I think? Not actually sure how these are setup but it seems to be connected to the router), and my Linux/Windows PC.
Also in my Windows power setting I have Allow wake timers set to false. Not sure if there’s anything else that I should be looking for within scheduled jobs, there’s quite a number that windows has in there by default. Is there a filter that I can use?

I assume by interfaces you mean /etc/network/interfaces? What should I be adding exactly? In the second link you posted it suggests:

auto eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.254
        post-up /sbin/ethtool -s eth0 wol g
        post-down /sbin/ethtool -s eth0 wol g

I’m guessing replace the last 2 lines with

post-up /sbin/ethtool -s eth0 wol d
post-down /sbin/ethtool -s eth0 wol d

Yes disable in the interfaces.
This is really weird.
Any idea’s @devadmin?

Putting it into interfaces didn’t seem to help much either. My current interace file looks like this:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

post-up /sbin/ethtool -s eth0 wol d
post-down /sbin/ethtool -s eth0 wol d

I reverted it back to using lo instead of eth0 inet static because it failed to initialize my ethernet and tried to revert to my WiFi adapter.

Sorry I’m all out of ideas. @Eden @AnotherDev @wendell
Any of you got anything?