[systemd-devel] ExecStop required in service file?
Lennart Poettering
lennart at poettering.net
Wed Dec 14 05:13:08 PST 2011
On Tue, 13.12.11 17:33, Michael D. Berger (m.d.berger at ieee.org) wrote:
> > Note that systemd sends TERM to all processes of a service anyway. An
> > ExecStop= line like this is hence fully redundant.
> >
> > Lennart
> >
>
> So if instead, I did:
>
> ExecStop=/bin/kill -9 $MAINPID
>
> would I get both TERM and KILL signals, or would I just get KILL?
Well, normally the SIGKILL would already terminate the process
unconditionally, which means the SIGTERM would not get delivered
anymore. But let's say for some reason your process manages to survive
SIGKILL, then yes, you'd first get SIGKILL, then SIGTERM, and then
SIGKILL again if the process still survives after a timeout. (i.e. if a
process doesn't react to SIGTERM we follow-up with a SIGKILL)
Lennart
--
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel
mailing list