summaryrefslogtreecommitdiff
path: root/src/core/unit-dependency-atom.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-04-14 15:24:08 +0200
committerLennart Poettering <lennart@poettering.net>2021-05-25 16:03:03 +0200
commit0bc488c99ab2ed3464237607e381f4d72cd321d5 (patch)
tree5dfbbe4572ec4a3d945b3b4b50369e78a3c62a64 /src/core/unit-dependency-atom.h
parent294446dcb98eaa1ced5839da674c2065b1367a3a (diff)
downloadsystemd-0bc488c99ab2ed3464237607e381f4d72cd321d5.tar.gz
core: implement Uphold= dependency type
This is like a really strong version of Wants=, that keeps starting the specified unit if it is ever found inactive. This is an alternative to Restart= inside a unit, acknowledging the fact that whether to keep restarting the unit is sometimes not a property of the unit itself but the state of the system. This implements a part of what #4263 requests. i.e. there's no distinction between "always" and "opportunistic". We just dumbly implement "always" and become active whenever we see no job queued for an inactive unit that is supposed to be upheld.
Diffstat (limited to 'src/core/unit-dependency-atom.h')
-rw-r--r--src/core/unit-dependency-atom.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/unit-dependency-atom.h b/src/core/unit-dependency-atom.h
index daa296f601..3e684f01c4 100644
--- a/src/core/unit-dependency-atom.h
+++ b/src/core/unit-dependency-atom.h
@@ -32,6 +32,11 @@ typedef enum UnitDependencyAtom {
/* Stop our unit if the other unit happens to inactive */
UNIT_ATOM_CANNOT_BE_ACTIVE_WITHOUT = UINT64_C(1) << 7,
+ /* Start this unit whenever we find it inactive and the other unit active */
+ UNIT_ATOM_START_STEADILY = UINT64_C(1) << 9,
+ /* Whenever our unit becomes active, add other unit to start_when_upheld_queue */
+ UNIT_ATOM_ADD_START_WHEN_UPHELD_QUEUE = UINT64_C(1) << 10,
+
/* If our unit unexpectedly becomes active, retroactively start the other unit too, in "replace" job
* mode */
UNIT_ATOM_RETROACTIVE_START_REPLACE = UINT64_C(1) << 11,