Bug 65388 - ExecStop should honour RemainAfterExit and KillMode
Summary: ExecStop should honour RemainAfterExit and KillMode
Status: RESOLVED WORKSFORME
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-05 04:20 UTC by Tim Desjardins
Modified: 2016-06-07 13:28 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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.