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
Created attachment 69457 [details] [review] Add OnStop to [Unit] + Add OnStop event // at job stop/done
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
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.