2026年7月14日 星期二

My computer refused to SHUT DOWN

Recently, after working on my computer and clicking on the SHUT DOWN button, my computer refused to turn off while the monitor had already turned black. I needed to hard press the POWER BUTTON to turn it OFF. This frustrating phenomenon happened constantly for some time. In an attempt to solve the problem, I tried to ask Google Gemini for help and advice. This was its reply:

" This "black screen but still powered on" issue is a frustratingly common quirk in the Arch/EndeavourOS ecosystem — especially when paired with KDE Plasma. (That is what my computer is installed with.)

Usually, this happens because a specific system service, background application, or your display manager (SDDM) is refusing to close. By default, systemd is incredibly patient and will wait 90 seconds (a "stop job") for the stubborn app to close before forcibly killing it and shutting down. Sometimes, it gets stuck completely due to GPU driver states (especially NVIDIA) or ACPI power states.

Here is a step-by-step guide to diagnose and fix the issue.
 

1. The Quick Diagnostic: See What's Hanging

Before changing settings, we need to know what is holding up your system.

Hit Esc during shutdown: The moment you click shutdown and the screen starts to fade/go black, repeatedly tap the Esc key. This will hide the splash screen and show you the system console (TTY). Look for a message like: [ LIMIT ] A stop job is running for... (X s / 1min 30s) Note down the service name that is taking forever.


Read the logs from the previous boot: Since you had to force-shut down, reboot your computer, open a terminal, and run:

journalctl -b -1 -e


-b -1 tells systemd to show logs from the previous boot (the one you just forced off).


-e jumps straight to the end of the log (the shutdown sequence). Look at the last 20–30 lines. Often, you'll see a service like systemd-user-sessions, sd-pam, a specific Flatpak, or sddm refusing to terminate. 


2. The Best Workaround: Speed Up systemd's Patience

If an application is refusing to close and you just want your PC to turn off instead of waiting forever, you can tell systemd to stop being so polite. Instead of waiting 90 seconds, you can force it to kill stubborn processes after 5 seconds.

Open the systemd configuration file in your terminal:

sudo nano /etc/systemd/system.conf


Scroll down and find these lines (they will likely be commented out with #):

Plaintext #DefaultTimeoutStartSec=90s #DefaultTimeoutStopSec=90s

Remove the # at the beginning of the lines and change the value to 5s or 10s:

Plaintext DefaultTimeoutStartSec=10s DefaultTimeoutStopSec=5s

Press Ctrl + O then Enter to save, and Ctrl + X to exit.

Do the same for the user configuration:

sudo nano /etc/systemd/user.conf

Uncomment and edit:

Plaintext DefaultTimeoutStopSec=5s

Save and exit.
 

3. The KDE Plasma Specific Fix (Desktop Session)

KDE Plasma has a habit of trying to save your open windows and applications so they reopen when you boot back up. Sometimes, an application refuses to save its state, locking up the logout sequence.

Open System Settings in KDE Plasma.

Navigate to Startup and Shutdown > Desktop Session.

Under the On Login / On Next Session setting, select Start with an empty session.

Click Apply.
 

4. Fix GPU Driver / Hardware Lockups

If your monitor turns off but your PC fans and LEDs stay fully active indefinitely, this is often a failure of the kernel or GPU driver transitioning into the D3 (off) power state.
For NVIDIA Users:

Ensure NVIDIA's systemd services are enabled so they can save power states properly during shutdown:

Bash sudo systemctl enable nvidia-suspend.service nvidia-hibernate.service nvidia-resume.service

Try the LTS Kernel (Highly Recommended on Arch/EndeavourOS):

If a recent mainline kernel update introduced a power management bug with your motherboard or GPU, booting into the Long-Term Support (LTS) kernel often solves it.

Install the LTS kernel and its headers:

sudo pacman -S linux-lts linux-lts-headers

Reboot your computer, and at your bootloader menu (systemd-boot or GRUB), select the Linux-LTS option. If this fixes your shutdown issue, you can keep using it as your default kernel.
💡 Bonus Tip: Stop Hard-Pressing the Power Button! Hard-shutting down your system can eventually corrupt your storage drive. If your computer freezes on a black screen again, try the safer REISUB method to gracefully force a reboot:
Hold down Alt + SysRq (often the Print Screen key).

While holding them, slowly type the letters R E I S U O (waiting 1–2 seconds between each press). This sends low-level commands straight to the Linux kernel to safely close all processes, sync your hard drives, and power down (O for Off).  "

I followed through all the above steps but they did not help. 

While I was still wondering what to next, it suddenly came to my mind that would this be a problem of my motherboard which is Asus H610M-E D4. So I asked Gemini again. Its answer was:


" Yes, you hit the nail on the head. Your motherboard (Asus H610M-E D4) is highly likely the culprit behind this. Asus Prime series motherboards (specifically the H610 and B660 series) are notorious in the Linux community for having ACPI (Advanced Configuration and Power Interface) and power state translation bugs. When the operating system sends the ACPI signal to cut the hardware power (transitioning to the G3 mechanical off state), the motherboard firmware fails to interpret it. The OS shuts down and the screen goes black, but the motherboard physically keeps the power delivery lines to your fans, LEDs, and board logic active.

Fortunately, because this is a known motherboard firmware and ACPI behavior, you can usually resolve it using specific hardware and kernel workarounds.
 

Step 1: Fix ASUS Motherboard BIOS Power Settings

Several default ASUS power-saving and waking features block the motherboard from fully shutting down on Linux.

Turn on your computer and tap F2 or Del to enter the ASUS UEFI BIOS.

Press F7 to switch to Advanced Mode.

Go to Advanced --> APM Configuration (Advanced Power Management).

Find ErP Ready and change it to Enable (S4+S5) or Enable (S5). 

 (This forces the motherboard to cut power to USB ports and onboard components when shut down).


Find Power On By PCI-E and set it to Disabled (disables wake-on-LAN which often hangs the shutdown sequence).


Go to Advanced --> System Agent (SA) Configuration.

Find Graphics Configuration --> iGPU Multi-Monitor. If you are using a dedicated graphics card (like NVIDIA or AMD) and do not use your Intel motherboard HDMI port, set this to Disabled.
Press F10 to save and exit. "

This time, the Gemini advice finally worked. I needed only enable the ErP Ready to  S4+S5 and my computer could then shut down normally!

 

What is ErP?

ErP (Energy-Related Products) is a European Union directive designed to reduce energy consumption. In your BIOS, enabling ErP forces your computer to consume less than 1 watt of power when it is turned off or in standby.

To achieve this, the motherboard completely cuts power to USB ports, RGB lighting, network cards, and other onboard components when the system is inactive.

 

The Difference Between the Settings

The difference lies in which power states trigger this deep-sleep, ultra-low power mode.

SettingWhat it doesBest For
DisabledUSB ports and motherboard LEDs stay powered even when the PC is off. You can charge devices or boot via network (Wake-on-LAN).People who charge phones overnight using their PC, or use Wake-on-LAN.
Enabled (S5)ErP is active only when the PC is fully shut down (the S5 state). If the PC is in Hibernate (S4) or Sleep (S3), power to USBs and LEDs remains active.People who want power savings when finished for the day, but still want fast-charging/sleep features during short breaks.
Enabled (S4+S5)ErP is active when the PC is shut down (S5) OR hibernating (S4).Maximum energy savings and zero ghost power draw when the computer is not actively in use.