[CentOS] shutdown -h doesn't

Fri Jan 16 08:54:01 UTC 2015
Kay Diederichs <kay.diederichs at uni-konstanz.de>

On 01/16/2015 09:51 AM, Kay Diederichs wrote:
> On 01/16/2015 05:05 AM, Devin Reade wrote:
>> 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: <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=766338>
>>
>> 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
>>
> 
> 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).