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:
Lennart Poettering
2021-05-25 16:03:03 +02:00
parent 39628fedac
commit 629b2a6f7b
6 changed files with 12 additions and 1 deletions
+1
View File
@@ -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",