Computer Not Powering Down
For a long time I have been unable to power down my office computer with certainty. More than half the time the system restarted or self-awakened after only a few seconds.
I am running Slackware 14.2 64-bit. The motherboard is an ASUS Z170-K with AMI BIOS 3805 05/16/2018. A decent Quad core Intel Core i5-6400 with 16 GB DDR4 RAM.
I never saw the system self-awaken after a second power down.
For months I looked around the web to no avail.
Sometimes I would go a few days without the system powering on by itself and might go two days in a row where the system self-booted.
I fiddled in the BIOS with
ErP Ready. I tried
S5. I did not like
s5 because then I could not use the RTC to awaken the system at desired times.
A faulty power switch? No, but irrelevant. I always power down by script or command.
CMOS battery? Looked good at 3.16 volts, but I changed anyway.
Was there a WOL signal being transmitted somehow, somewhere? Removing the network cable before powering down indicated the problem was not WOL. Additionally, before powering down I removed the network controller driver with
rmmod r8169. No change in behavior.
I read that some people saw this same behavior with USB devices. I repeated my testing with all USB devices disconnected. I already use a PS/2 keyboard and for a while I added a PS/2 mouse.
No change in behavior.
After many months of enduring this irritating bug, by chance, I ran across an online discussion that loosely described a similar issue. The solution is to unload the
xhci_hcd kernel modules before powering down. These two kernel modules are needed to use USB 3.0.
/etc/rc.d/rc.local_shutdown I added an appropriate snippet to unload the modules.
After several weeks the computer always remained powered down.
I have yet to find an explanation for this behavior.
The Linux kernel developers are truly top of the class and they strive diligently to not break user space. Yet the behavior is fodder for the Year of the Linux Desktop.