For 5+ years I’ve banged my head against the wall trying to figure this out across two different gaming PC builds, and this problem never happened to me with Windows 7, 8, 8.1, and 10, yet always did in Linux Mint from versions 14 onward and Ubuntu ( regardless of desktop environment) 14 onward as well as Vanilla Arch and Manjaro.
Problem , was, my PC ( after doing a complete power off/shut down using terminal command " shutdown -P now" or something like that varient depending on the individual distro. That command is what I’m currently still using for LM Cinnamon 20 ) would, within 6 seconds or less of the system trying to shut off long enough for the fans to stop spinning…, auto power itself right back on.
It was infuriating as I had already turned off/disabled all “wake” or " auto wake" settings in uefi/bios on both my old Phenom IIx6 supported amd mobo and my current z97m pro4 micro atx asrock mobo.
So I stumbled upon this link with a script that FINALLY resolves the problem.
If your goal is to ensure …NOTHING automatically wakes up/turns on your PC except you pressing the power button, then this is for you.
Before I did this solution the results of my cat /proc/acpi/wakeup showed at least 5 items that were set to “enable” involving waking my PC up which included two usb devices/items, one pci item/device, and my physical ethernet labeled as " GLAN"
- Navigate in your file manager to, if applicable, etc/systemd/system and open that folder as root. Then right click and create a “new document” /empty document and name it “acpi-wake.service” without the quotes.
** you’ll notice on the link Kernemelk put a colon at the end of that document name. that isn’t needed and I don’t know if it will make it not work or not. **
- Paste the following into that file
[Unit]
Description=ACPI Wake Service
[Service]
Type=oneshot
ExecStart=/bin/sh -c “for i in $(cat /proc/acpi/wakeup|grep enabled|awk ‘{print $1}’|xargs); do [ $i != PBTN ] && echo $i|tee /proc/acpi/wakeup;done”
[Install]
WantedBy=multi-user.target
-
Save it. Then using terminal window, navigate to that folder /etc/systemd/system using the command “cd /etc/systemd/system” without quotes.
-
Now to enable and start the script/service.
Type each of the following command lines and hit enter on each one:
systemctl start acpi-wake.service
systemctl enable acpi-wake.service
NOW nothing about my cat /proc/acpi/wakeup results show enabled. Everything in there is disabled
And nothing else has changed. Everything just works just as before.
For those needing to adjust only individual items in that cat /proc/acpi/wakeup results list… I found this info by Freedomtruth on linuxmintforum site I need to disable all possible wake-from-standby events (except the power button). - Linux Mint Forums do a ctrl f and type “Freedomtruth” without quotes and you’ll see what i mean as an example. Remember to sub out whatever 4 character thing/item you need to disable from auto waking your PC with the correct one you see listed in your cat /proc/acpi/wakeup ( which is a terminal command btw)
Hope this helped someone. It was the absolute last draw/thing that would previous make it want to return to Winblows ( although I just chose to tolerate it since July 2020 when I made my 100% journey to Linux completely once and for all)
I don’t think the desktop environment matters as I proved via 20 shut downs and 20 manual power ups that this works in my LM Cinnamon 20 installation, but someone please update me if I’m wrong there.
Cheers–