core: add new PropagateStopTo= dependency (and inverse)
This takes inspiration from PropagatesReloadTo=, but propagates stop jobs instead of restart jobs. This is defined based on exactly two atoms: UNIT_ATOM_PROPAGATE_STOP + UNIT_ATOM_RETROACTIVE_STOP_ON_STOP. The former ensures that when the unit the dependency is originating from is stopped based on user request, we'll propagate the stop job to the target unit, too. In addition, when the originating unit suddenly stops from external causes the stopping is propagated too. Note that this does *not* include the UNIT_ATOM_CANNOT_BE_ACTIVE_WITHOUT atom (which is used by BoundBy=), i.e. this dependency is purely about propagating "edges" and not "levels", i.e. it's about propagating specific events, instead of continious states. This is supposed to be useful for dependencies between .mount units and their backing .device units. So far we either placed a BindsTo= or Requires= dependency between them. The former gave a very clear binding of the to units together, however was problematic if users establish mounnts manually with different block device sources than our configuration defines, as we there might come to the conclusion that the backing device was absent and thus we need to umount again what the user mounted. By combining Requires= with the new StopPropagatedFrom= (i.e. the inverse PropagateStopTo=) we can get behaviour that matches BindsTo= in every single atom but one: UNIT_ATOM_CANNOT_BE_ACTIVE_WITHOUT is absent, and hence the level-triggered logic doesn't apply. Replaces: #11340
This commit is contained in:
+14
-7
@@ -787,13 +787,20 @@
|
||||
<term><varname>PropagatesReloadTo=</varname></term>
|
||||
<term><varname>ReloadPropagatedFrom=</varname></term>
|
||||
|
||||
<listitem><para>A space-separated list of one or more units
|
||||
where reload requests on this unit will be propagated to, or
|
||||
reload requests on the other unit will be propagated to this
|
||||
unit, respectively. Issuing a reload request on a unit will
|
||||
automatically also enqueue a reload request on all units that
|
||||
the reload request shall be propagated to via these two
|
||||
settings.</para></listitem>
|
||||
<listitem><para>A space-separated list of one or more units to which reload requests from this unit
|
||||
shall be propagated to, or units from which reload requests shall be propagated to this unit,
|
||||
respectively. Issuing a reload request on a unit will automatically also enqueue reload requests on
|
||||
all units that are linked to it using these two settings.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>PropagatesStopTo=</varname></term>
|
||||
<term><varname>StopPropagatedFrom=</varname></term>
|
||||
|
||||
<listitem><para>A space-separated list of one or more units to which stop requests from this unit
|
||||
shall be propagated to, or units from which stop requests shall be propagated to this unit,
|
||||
respectively. Issuing a stop request on a unit will automatically also enqueue stop requests on all
|
||||
units that are linked to it using these two settings.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
|
||||
Reference in New Issue
Block a user