Bug 54659 - RFE: Extend logic for stopping units (As for OnFailure) [ w/ patch ]
Summary: RFE: Extend logic for stopping units (As for OnFailure) [ w/ patch ]
Status: RESOLVED WONTFIX
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium enhancement
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-08 05:13 UTC by Oleksii Shevchuk
Modified: 2016-06-07 10:35 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Add OnStop to [Unit] (6.75 KB, patch)
2012-11-02 19:50 UTC, Oleksii Shevchuk
Details | Splinter Review
Add OnStopRestoreConflicts (11.14 KB, patch)
2012-11-03 17:19 UTC, Oleksii Shevchuk
Details | Splinter Review

Description Oleksii Shevchuk 2012-09-08 05:13:14 UTC
In some cases, starting or stopping of some service requires starting/restarting other. One example - you have some service A that replaces service B with Conflicts= rule, and then B stopped
Comment 1 Oleksii Shevchuk 2012-11-02 19:50:17 UTC
Created attachment 69457 [details] [review]
Add OnStop to [Unit]

+ Add OnStop event // at job stop/done
Comment 2 Oleksii Shevchuk 2012-11-03 17:19:45 UTC
Created attachment 69493 [details] [review]
Add OnStopRestoreConflicts

Extends previous patch. Add optional support for restoring stopped by conflict  resolution deps, on successful stop conflicing unit. (Oh.) 


i.e.

user > cat dep1.target
[Unit]
Description=dep1
OnStopRestoreConflicts=yes

user > cat dep2.target
[Unit]
Description=dep2
Conflicts=dep1.target

start dep2.target
// dep2 started
start dep1.target
// dep1 started
// dep2 stopped
// dep2 added to dep1 OnStopRestoreConflicts deps
stop dep1.target
// dep1 stopped
// dep2 started
// dep2 removed from dep1 OnStopRestoreConflicts deps
Comment 3 Lennart Poettering 2016-06-07 10:35:27 UTC
I am not convinced adding this would be a good idea, as this would make systemd Turing complete, and I am pretty sure we really shouldn't be.

I hope that makes sense?

Closing hence. Sorry.


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.