There’s a considerable number of reasons why this might be happening.
Examples: a new kernel was installed and it’s not perfectly compatible with the kernel module (device driver) responsible for power control; you have SNAP installed and its daemon snapd
is taking too long to stop and terminate itself (and systemd isn’t terminating it as it should); a shutdown task is repeatedly executed at shutdown but always fails to succeed and therefore is started again at every new shutdown attempt. And so on.
You need to power off your computer, then start it again and run dmesg
and sudo cat /var/log/kern.log
in order to check what’s causing this.
If you want to decrease the systemd timeout, you can edit the system.conf
file:
sudo nano /etc/systemd/system.conf
…and then uncomment and edit the entries DefaultTimeoutStartSec
, DefaultTimeoutStopSec
e DefaultTimeoutAbortSec
so they look like this:
#DefaultStandardError=inherit
DefaultTimeoutStartSec=10s
DefaultTimeoutStopSec=10s
DefaultTimeoutAbortSec=10
#DefaultRestartSec=100ms
Then save (Ctrl O), exit (Ctrl X) and restart to test it:
reboot