Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Diagnosing Shutdown Problems
Just like with boot problems, when you encounter a hang during shutting down, make sure you wait at least 5 minutes to distinguish a permanent hang from a broken service that's just timing out. Then it's worth testing whether the system reacts to CTRL+ALT+DEL in any way.
If shutdown (whether it be to reboot or power-off) of your system gets stuck, first test if the kernel itself is able to reboot or power-off the machine forcedly using one of these commands:
sync && reboot -f
sync && poweroff -f
If either one of the commands does not work, it is a kernel bug, not systemd.
Shutdown Completes Eventually
If normal reboot or poweroff work, but take a suspiciously long time, then
boot with the debug options:
systemd.log_level=debug systemd.log_target=kmsg log_buf_len=1M enforcing=0
save the following script as /usr/lib/systemd/system-shutdown/ and make it executable:
mount -o remount,rw /
dmesg > /shutdown-log.txt
mount -o remount,ro /
Look for timeouts logged in the resulting file shutdown-log.txt and/or attach it to a bugreport.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.