how to make systemd wait for a process to die?

Lennart Poettering mzerqung at 0pointer.de
Mon Sep 19 20:08:53 UTC 2011


On Mon, 19.09.11 21:26, Juan Orti Alcaine (j.orti.alcaine at gmail.com) wrote:

> Yes, it's a poor choice for the daemon to use SIGHUP, I have found a lot of
> oddities with this program.
> 
> A collateral effect of this is that the router advertisement daemon (radvd)
> is run as a child and meanwhile gogoc is closing the tunnel, radvd is
> reloading its configuration, and then dying with SIGKILL, because it never
> receives a SIGTERM, doesn't it?

This sounds to me as if you need to set KillMode=process. The default
KillMode is "control-group" which means all processes in the cgroup get
a SIGHUP if you use this in conjunction with KillSignal=SIGHUP. However,
if you want to make sure that only the parent PID gets the SIGHUP (which
is then responsible to kill the child, too), then use KillMode=process.

> Thank you and good work with systemd, it's fantastic!

Thanks!

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the devel mailing list