[systemd-devel] How do I remove dead process managed by Systemd?

Lennart Poettering lennart at poettering.net
Mon Dec 4 18:14:51 UTC 2017


On Mo, 04.12.17 23:15, Yun-Chih Chen (yunchih.cat at gmail.com) wrote:

> Hi, fellows:
> 
> How do I remove a dead process (D-state process) wrapped as a Systemd
> service unit?  The process's parent is systemd (pid=1) and I still did not
> find a way to remove such process without rebooting.  I have tried the
> following:
> 
> $ systemctl restart <my_service>  # timeout
> $ systemctl daemon-reexec
> $ kill -9 <pid of my process> # won't work of course
> 
> Or anyone knows of hacks that do the trick?

You cannot kill "D" state processes on Linux. That's what "D" state
means ultimately: *uninterruptible* sleep. The kill command can't kill
such processes, and neither can systemd. If you see processes like
this, then either you have very slow I/O, or this points to some form
of kernel/driver problem, as sleeping in this state should usually be
for short periods only.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list