Systemd: slow reboot and shutdown fixed

I’m not so into systemd systems and ever avoided systemd whenever possible, but nowadays systems without systemd are very rare. So I’m learning my lessons slowly and with some memory protection (e.g. this article). Sorry, this article is not very well formatted…

I noticed long delays (more than 2 minutes) on reboots and poweroffs recently on my Manjaro laptop.

Fix the slow shutdown/reboot

View the last boot session log in reverse order

journalctl -rb -1

and inspect that for abnormalities. Also look at your console when rebooting or shutting down the system, as that may also present some good starting points.

To make things short, here’s my solution that I currently work with:

I edited /etc/systemd/system.conf and changed the following values:

# file: "/etc/systemd/system.conf"
[Manager]
[...]
RebootWatchdogSec=1min
ShutdownWatchdogSec=1min
[...]
DefaultTimeoutStopSec=5s
[...]

Have a quick look at the boot time

systemd-analyze

and if you are more interested into which module slows down your boot, list them with:

systemd-analyze blame

Just out of curiosity I also used:

sudo systemctl disable NetworkManager-wait-online.service

→ revert that with:

sudo systemctl enable NetworkManager-wait-online.service

Sources

The sources of my research and a more detailed explanation can be found with those links: