Here's the situation:

I start my main computer from another pc via wake on lan "wakeonlan ". All works fine. When I'm done doing what I did, I run "sudo shutdown -h now" (in the ssh terminal in which I was working) to shutdown the computer. But instead of shutting down, it reboots. I then have to reconnect to it via ssh and run the shutdown command again, and then it shuts down and stays off. I can then start it again via wake on lan...

does anyone know, why my computer actually reboots when I type "sudo shutdown -h now" when started via wake on lan?

Some information about the computer:

Ubuntu 13.04
Moterboard: Gigabyte GA-Z77X-UD3H
Ethernet Controller (as reported by "lspci"): Qualcomm Atheros AR8151 v2.0 Gigabit Ethernet (rev c0)

  • patsee, I'm facing the same issue. Any solutions? – Harshal Kshatriya May 24 '13 at 8:28
  • 1
    What (EFI?) BIOS version do you have? Others (including me) have reported the same issue with an Asus and GA-Z68X-UD3H-B3 board containing a Realtek card lists.debian.org/debian-user/2013/06/msg01280.html – Lekensteyn Jun 27 '13 at 12:27
  • I'm having the same problem with the Asus P8H61-M LE/CSM with a Realtek Ethernet card. Has anybody come up with some workaround for this? I read the debian email, but I also don't have Windows installed to test this behaviour. – Felipe Sep 24 '13 at 16:23

There's one dirty solution

a) create /etc/init.d/reshutdown with the contents

# force shutdown (due to bug in wakeonlan)

case "$1" in
  touch /home/shutdown.chk
  shutdown -r now

 if [ -f /home/shutdown.chk ];
    rm /home/shutdown.chk
    shutdown -h now

b) Execute: sudo chmod ugo+x /etc/init.d/reshutdown
b) Execute: sudo update-rc.d reshutdown start 1 1 2 3 4 5 6 .

c) Then to shutdown execute: sudo service reshutdown reshutdown

I had this issue too, using the Intel DQ77MK motherboard, which has 2 onboard Intel GB ethers. I fixed it by enabling the power bios entry "Native ACPI OS PCIe Support", which I guess allowed Ubuntu to reset the flag saying WOL has been triggered, probably with it disabled Ubuntu was not allowed by the BIOS to reset the flag.

  • Thanks for your answer, but unfortunately my bios does not have this option nor was I able to find a similar one. The problem still persists. – patsee Aug 10 '13 at 20:33

Try sudo poweroff.

It works better with WOL for me.

  • thanks for your suggestion. I just tried to shutdown via "sudo poweroff" but unfortunately it is the same behavior as written in my op. – patsee May 4 '13 at 7:31
  • 1
    This is the same as shutdown -h, seriously. – gertvdijk Jul 14 '13 at 13:55
  • 1
    @gertvdijk poweroff is not the same as shutdown -h, both because shutdown takes a time argument and because -h means "halt or power off" rather than "power off." Rather, poweroff is similar to (and, except in runlevel 0 or 6, invokes) shutdown -P now. – Eliah Kagan Oct 20 '14 at 16:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.