Bug 65388

Summary: ExecStop should honour RemainAfterExit and KillMode
Product: systemd Reporter: Tim Desjardins <timd>
Component: generalAssignee: systemd-bugs
Status: RESOLVED WORKSFORME QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Tim Desjardins 2013-06-05 04:20:22 UTC
I have a situation where I want to start a new process on exit, unfortunately ExecStop doesn't honour RemainAfterExit or KillMode. ExecStart and ExecStop are not symmetrical in operation.

We have a fastCgi service, when we stop the service for maintenance we automatically start second fastCgi service which is essentially a (we're under maintenance, which is use by mobile applications to display a service is not available right now, which is different from a 500 error in our case)

All processes spawned by ExecStop are killed on exit, which is frustrating.
Comment 1 Fireball 2015-03-16 09:34:46 UTC
I think they were never intended to be symmetrical.

Do you want a unit to be considered "active" after it is "stopped" if RemainAfterExit=yes? This makes no sense.

For your situation, use 2 separate services.
Comment 2 Lennart Poettering 2016-06-07 10:46:29 UTC
Closing, due to lack of response.
Comment 3 Tim Desjardins 2016-06-07 11:52:48 UTC
Honestly what comment could I make that would get the systemd maintainers to take this seriously? Admittedly this is a corner case and I imagine most people will just manually stop and start their services, but there was a better way once, no longer. 

Asymmetry (or un-orthogonality) is a code (design) smell.
It's also means that things that could be done before systemd can no longer be performed, which is a loss of functionality.
Comment 4 Lennart Poettering 2016-06-07 13:28:34 UTC
Well, one option would be to use ExecStop=/usr/bin/systemctl --no-block someotherservice.service or so...

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.