mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 17:35:35 +03:00
core: add a reverse dep for OnFailure=
Let's add an implicit reverse dep OnFailureOf=. This is exposed via the bus to make things more debuggable: you can now ask systemd for which units a specific unit is the failure handler. OnFailure= was the only dependency type that had no inverse, this fixes that. Now that deps are a bit cheaper, it should be OK to add deps that only serve debug purposes.
This commit is contained in:
parent
39628fedac
commit
629b2a6f7b
@ -1630,6 +1630,8 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly as OnFailure = ['...', ...];
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly as OnFailureOf = ['...', ...];
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly as Triggers = ['...', ...];
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly as TriggeredBy = ['...', ...];
|
||||
@ -1773,6 +1775,8 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
|
||||
|
||||
<!--property ConsistsOf is not documented!-->
|
||||
|
||||
<!--property OnFailureOf is not documented!-->
|
||||
|
||||
<!--property ReloadPropagatedFrom is not documented!-->
|
||||
|
||||
<!--property JoinsNamespaceOf is not documented!-->
|
||||
@ -1905,6 +1909,8 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="OnFailure"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="OnFailureOf"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="Triggers"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="TriggeredBy"/>
|
||||
|
@ -275,6 +275,7 @@ static const char* const unit_dependency_table[_UNIT_DEPENDENCY_MAX] = {
|
||||
[UNIT_BEFORE] = "Before",
|
||||
[UNIT_AFTER] = "After",
|
||||
[UNIT_ON_FAILURE] = "OnFailure",
|
||||
[UNIT_ON_FAILURE_OF] = "OnFailureOf",
|
||||
[UNIT_TRIGGERS] = "Triggers",
|
||||
[UNIT_TRIGGERED_BY] = "TriggeredBy",
|
||||
[UNIT_PROPAGATES_RELOAD_TO] = "PropagatesReloadTo",
|
||||
|
@ -229,6 +229,7 @@ typedef enum UnitDependency {
|
||||
|
||||
/* On Failure */
|
||||
UNIT_ON_FAILURE,
|
||||
UNIT_ON_FAILURE_OF,
|
||||
|
||||
/* Triggers (i.e. a socket triggers a service) */
|
||||
UNIT_TRIGGERS,
|
||||
|
@ -865,6 +865,7 @@ const sd_bus_vtable bus_unit_vtable[] = {
|
||||
SD_BUS_PROPERTY("Before", "as", property_get_dependencies, 0, SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("After", "as", property_get_dependencies, 0, SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("OnFailure", "as", property_get_dependencies, 0, SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("OnFailureOf", "as", property_get_dependencies, 0, SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("Triggers", "as", property_get_dependencies, 0, SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("TriggeredBy", "as", property_get_dependencies, 0, SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("PropagatesReloadTo", "as", property_get_dependencies, 0, SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
|
@ -85,6 +85,7 @@ static const UnitDependencyAtom atom_map[_UNIT_DEPENDENCY_MAX] = {
|
||||
* things discoverable/debuggable as they are the inverse dependencies to some of the above. As they
|
||||
* have no effect of their own, they all map to no atoms at all, i.e. the value 0. */
|
||||
[UNIT_RELOAD_PROPAGATED_FROM] = 0,
|
||||
[UNIT_ON_FAILURE_OF] = 0,
|
||||
};
|
||||
|
||||
UnitDependencyAtom unit_dependency_to_atom(UnitDependency d) {
|
||||
|
@ -2871,7 +2871,8 @@ int unit_add_dependency(
|
||||
[UNIT_CONFLICTED_BY] = UNIT_CONFLICTS,
|
||||
[UNIT_BEFORE] = UNIT_AFTER,
|
||||
[UNIT_AFTER] = UNIT_BEFORE,
|
||||
[UNIT_ON_FAILURE] = _UNIT_DEPENDENCY_INVALID,
|
||||
[UNIT_ON_FAILURE] = UNIT_ON_FAILURE_OF,
|
||||
[UNIT_ON_FAILURE_OF] = UNIT_ON_FAILURE,
|
||||
[UNIT_REFERENCES] = UNIT_REFERENCED_BY,
|
||||
[UNIT_REFERENCED_BY] = UNIT_REFERENCES,
|
||||
[UNIT_TRIGGERS] = UNIT_TRIGGERED_BY,
|
||||
|
Loading…
Reference in New Issue
Block a user