[systemd-devel] How to find out the processes systemd-shutdown is waiting for?

Lennart Poettering lennart at poettering.net
Wed Mar 2 16:50:04 UTC 2022


On Mi, 02.03.22 12:29, Manuel Wagesreither (ManWag at FastMail.FM) wrote:

> Hi all,
>
> My embedded system is shutting down rather slow, and I'd like to find out the responsible processes.
>
> [ 7668.571133] systemd-shutdown[1]: Waiting for process: dockerd, python3
> [ 7674.670684] systemd-shutdown[1]: Sending SIGKILL to remaining processes...
>
> Is there a way for systemd-shutdown to give me the PID of the
> processes it waits for?

The messages above are from the second phase of shutdown, the "killing
spree phase": it kills processes/unmounts file systems/detaches
storage/… that is left over from the first phase of shutdown. If stuff
is terminated here, and in particular processes are killed this almost
certainly indicates something is seriously broken in the first phase
of shutdown. Or in other words: don#t try to debug the second phase
too much, the first phase is where the brokeness is.

Since this is dockerized stuff: look at docker, they are pretty bad at
cooperating with systemd in the cgroup hierarchy, and they really need
to clean up their own stuff properly when going down. If they don't do
that, you need to fix that in Docker. Or in other words: talk to the
docker people aout all this.

That said, we could certainly show both the comm field and the PID of
the offending processes. I am prepping a patch for that.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list