Wake on LAN: On shutdown PC reboots when started via WOL

I have an Ausus VivoPC VC60 with an i5-3320M CPU, OS is OpenSuse 13.2 (fresh install), kernel 3.16.7-21-desktop.

Wake on Lan is enabled from BIOS (UEFI). If the PC is started via wol, when I shut it down it powers off for a couple of seconds and then it reboots. A second shutdown works as expected.

Network card:
RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)

Ethtool output:


ethtool enp2s0
Settings for enp2s0:
        Supported ports:  TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
                                             1000baseT/Full
        Link partner advertised pause frame use: Symmetric
        Link partner advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: pumbg
        Wake-on: g
        Current message level: 0x00000033 (51)
                               drv probe ifdown ifup
        Link detected: yes

I need to get wol working properly, because I must be able to power on the PC from remote.

Can anyone point me to the right direction in order to debug the problem?

Thanks.

I remembered having seen similar here, thus I did a search on the forums. Maybe you want to check these:
https://forums.opensuse.org/showthread.php/498351-After-WOL-system-reboots-at-shutdown-command?highlight=wol

https://forums.opensuse.org/showthread.php/498123-Wake-on-Lan-problem/page2?highlight=wol

I am not sure there is a solution in there :frowning:

The first is related, but no solution is provided.

The second is a different problem, i.e. WOL not working.

:frowning:

I left the detailed studying to you :wink:

The stupid thing is that somewhere in my mind I have the idea that I had something similar. But I now think that the problem was that I set the system for WOL and that it then rebooted after a normal shutdown. This irrespective if it was originaly started through a WOL action. Hm, sounds a bit like your case. And there was something I could do somewhere about it. I will try to search a bit further.

I have tried everything; resetting the network card before shutdown, unloading the kernel module, invoking Chtulhu, but no joy.

So…

  1. from another PC i send the magic packet to the Asus VC60.
  2. the Asus VC60 boots up
  3. I disable WOL via ethtool then I type “shutdown -h now”
  4. The Asus VC60 powers off and, after a couple of seconds, reboots (sigh)
  5. I type “shutdown -h now” and this time the Asus VC60 stays powered off

Even disabling WOL won’t reset whatever needs to be reset, the Asus VC60 will still reboot after shutdown.

On Fri 19 Jun 2015 02:26:01 PM CDT, lorenzodes wrote:

hcvv;2715912 Wrote:
> I left the detailed studying to you :wink:
>
> The stupid thing is that somewhere in my mind I have the idea that I
> had something similar. But I now think that the problem was that I
> set the system for WOL and that it then rebooted after a normal
> shutdown. This irrespective if it was originaly started through a WOL
> action. Hm, sounds a bit like your case. And there was something I
> could do somewhere about it. I will try to search a bit further.

I have tried everything; resetting the network card before shutdown,
unloading the kernel module, invoking Chtulhu, but no joy.

Hi
What about the BIOS S and P settings, it may also be acpi related, you
have not set anything here in the grub command line?

You could try acpi=force in the kernel boot options (see YaST
bootloader), but may be some other combination of the acpi options that
may help.


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel
3.12.43-52.6-default If you find this post helpful and are logged into
the web interface, please show your appreciation and click on the star
below… Thanks!

Does your syslog contain any entries around the problem shutdown or boot?

TSU

No, there’s nothing different from a normal reboot.

Wild guess that this may be a Grub not writing to BTRFS problem. Using ext4 instead may fix things. Or a separate non BTRFS boot partition. I admit that this is wild speculation.

I don’t think that grub is involved. The PC powers off, then on again. When that happens, grub is not even running. It might be a driver issue, or an ACPI one, or even a BIOS bug (I can’t check if WOL works properly in Windows, that PC came with no OS), but what puzzles me is that the second “shutdown -h now” works fine. So, at some point, during the second shutdown, something happens that doesn’t happen during the first shutdown (or vice versa).

Here is the thing and I speculate. Some boot modes require a file to be written to by grub at boot but grub does not speak BTRFS it only reads it. (yea go figure) In any case it has been seen many times that under some conditions a resume from sleep never leaves that state and grub skips past the menu until a file is erased. The WOL problem seems to be somewhat related since something is not set right on the boot. As I say pure speculation but BTRFS has bitten more then once. This is an edge case. Probably not many using WOL so a reasonable place to look is the new somewhat still beta BTRFS file system. And Grub does have problem with BTRFS in some situation. This may be one

This is a problem of spurious wakeups. It’s not grub that reboots the system after a shutdown.

Hi
Did you try the acpi=force option?

Unfortunately acpi=force has no effect.

Sure it is a grub that wake it up it just skips the menu and goes straight to the memory recovery.

I think you are mixing with wake up after sleep/hibernate. Wakup On Lan is waking up from a shutdown state and the reaction on a WOL has to be a normal boot. It could be that it wakes up from sleep/hibernate, when that is what the system is left in, on WOL also, bu that is not what the OP is trying IIAC.

Grub doesn’t wake up the PC and there’s no menu skipping. It’s all ACPI magic that happens when Grub is not even loaded in memory.

Yes, same thing (unwanted wakeup) happens with hibernate if power-on was previously triggered via a magic packet (WOL)

Yes, that is correct. Repeating: WOL does the same as pushing the Power button on a “powered down” system (I say “powered down”, because there is still some power, the NIC must be able to see the WOL package).

This is before POC and way before Grub and thus way before the descision if it is a “real” boot or a recovery from sleep/hibernate.