Powering off is delayed on some machines

On some machines powering off from graphical system leasts very long. If I stop splash screen I see “waiting for xyz” and a countdown is running from 1:30 (e.g.) When I power off from console using shutdown -h now it is the same. But when I use poweroff -f it powers off with light speed (same at reboot: reboot -f is always very fast, all other possibilities sometimes are delayed for minutes). I have build a workaround for poweroff and reboot by creating bash scripts in /usr/local/bin like this:

#!/bin/bash
poweroff -f $1

(same for reboot) and it works like a charm. But I cannot find a solution for shutdown which does not know parameter -f

I think graphical poweroff/reboot uses shutdown - not reboot or poweroff…

Any ideas for removing the delay which is present for shutdown (not every time, not on every machine)?

This normally means systemd is waiting for a process to exit; after that time, it will time out and kill it.

Finding the hanging process might be tricky as it could be a driver rather than a user process. You could try starting with a clean boot and power off, then booting, logging in to a TTY then powering off, etc. Essentially, try different combinations until you find something that seems to affect shutdown.

It might be in the journal too, so it’s worth checking the journal for the affected/previous boot, journalctl -b-1 .

1 Like

Thanks for the hint. I have figured out that the delay is after systemd stops its logging. If I have “quiet boot” ativated at the point where the delay starts I cannot enter text screen by pressing ESC (no reaction) and the circle which normally turns stops turning which ends in powering off after the delay. The “countdown delays” are something quite different and do not have anything to do with the delay that bothers me… That is ths result of using log what you proposed. One step in the right direction.

1 Like