Shutdown -h Doesn’t

Home » CentOS » Shutdown -h Doesn’t
CentOS 5 Comments

I’ve got a fresh CentOS 7 test machine, fully patched. The command:

shutdown -h now

surprisingly does not halt the machine. Instead it reboots it. WTF?

I found the following Debian discussion which seems to be the same issue:

However, removing kexec-tools in this case did not solve the problem. Nor does “systemctl poweroff” work.

Does anyone else see this? No, nothing is filed in bugzilla yet.

Devin

5 thoughts on - Shutdown -h Doesn’t

  • I’ve seen systems with broken ACPI BIOS support auto-restart on a shutdown. sometimes the behavior can be modified with a BIOS option.

  • same here, using a “ASUS All Series/H97M-PLUS, BIOS 2305 10/09/2014” (as per dmesg|grep ASUS).

    The workaround is a line

    for i in /sys/bus/usb/devices/*/power/control ; do echo on > $i ; done

    in /etc/rc.local . Unfortunately this prevents powersaving of all USB
    ports/hubs.

    What didn’t work: I created /usr/lib/systemd/system/stopusb.service with

    [Unit]
    Description=Power-on USB in prep for shutdown

    [Service]
    Type=oneshot ExecStart=/bin/sh -c “for i in /sys/bus/usb/devices/*/power/control ; do echo on > \$i ; done”
    ExecStop=/bin/sh -c “for i in /sys/bus/usb/devices/*/power/control ; do echo on > \$i ; done”
    RemainAfterExit=yes

    [Install]
    WantedBy=poweroff.target

    but this seems to have no effect. Maybe the “poweroff” target does not really exist. I think someone more experienced with systemd could fix this.

    HTH,

    Kay

  • Forgot to say: the problem does not exist when “Wake on LAN” is disabled in the BIOS (but I need wake-on-LAN).

  • Answering Devin Reade
    (Thu, 15 Jan 2015 21:05:12 -0700):

    Hi!

    Maybe it helps to poweroff explicitly?

    shutdown -hP now

    I had the same problem on SUSE machines.

    Cheers

    Dirk

  • –That did the trick. I was able to disable WOL and it no longer exhibits the problem, including being able to reinstall kexec-tools. A packet sniffer doesn’t actually show up any WOL packets, though. It makes one wonder.

    Thanks.

    For the record, the motherboard is a Gigabyte Z87X-D3H.

    Devin

LEAVE A COMMENT