[systemd-devel] not running ExecStop= when stopping "activating" services?
arvidjaar at gmail.com
Thu Mar 19 20:40:39 PDT 2015
В Thu, 19 Mar 2015 15:08:39 -0400
"Nekrasov, Alexander" <alexander.nekrasov at emc.com> пишет:
> Hi All,
> With these settings
> ExecStart=/cli run
> ExecStop=/cli stop
> The service is active once "cli run" exits. A call to systemctl stop then produces a call to "cli stop". This is as expected.
> However if I call "systemctl stop" on this service before "cli run" exited, i.e., when the service is still activating, the service is stopped, all threads are killed off, but "cli stop" is never run.
> Is that as intended? Why? Is there a way to change this behavior?
This is intentional (see commit 3f6c78dc); I do not think intention was
as much "do not run ExecStopPost" as "do not spend time if starting
failed anyway"). There is currently no way to change it, it is
hardcoded. I guess you will need to present use case and explain what
is broken with current behavior.
Although there is obvious corner case - timeout expires exactly when
service starts and before systemd has chance to notice it. Then we have
fully started service that gets killed.
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
More information about the systemd-devel