From: Zbigniew Jędrzejewski-Szmek Date: Fri, 22 Mar 2019 12:23:02 +0000 (+0100) Subject: man: clarify that ExecStop= is always called X-Git-Tag: v242-rc1~79^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3aaae27a75dd2f3795dadce9a6566326751e0d0c;p=thirdparty%2Fsystemd.git man: clarify that ExecStop= is always called Fixes #11744. --- diff --git a/man/systemd.service.xml b/man/systemd.service.xml index c61e0f02961..b9a3266dfd7 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -473,14 +473,18 @@ start-up failed, for example because any of the commands specified in ExecStart=, ExecStartPre= or ExecStartPost= failed (and weren't prefixed with -, see above) or timed out. Use ExecStopPost= to invoke commands when a - service failed to start up correctly and is shut down again. Also note that, service restart requests are - implemented as stop operations followed by start operations. This means that ExecStop= and - ExecStopPost= are executed during a service restart operation. - - It is recommended to use this setting for commands that communicate with the service requesting clean - termination. When the commands specified with this option are executed it should be assumed that the service is - still fully up and is able to react correctly to all commands. For post-mortem clean-up steps use - ExecStopPost= instead. + service failed to start up correctly and is shut down again. Also note that the stop operation is always + performed if the service started successfully, even if the processes in the service terminated on their + own or were killed. The stop commands must be prepared to deal with that case. $MAINPID + will be unset if systemd knows that the main process exited by the time the stop commands are called. + + Service restart requests are implemented as stop operations followed by start operations. This + means that ExecStop= and ExecStopPost= are executed during a + service restart operation. + + It is recommended to use this setting for commands that communicate with the service requesting + clean termination. For post-mortem clean-up steps use ExecStopPost= instead. +