summaryrefslogtreecommitdiffstats
path: root/src/basic/unit-def.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-06-25 11:31:28 +0200
committerLennart Poettering <lennart@poettering.net>2019-07-11 12:18:51 +0200
commit380dc8b0a25f544269fdff7d9fd0e488fb374031 (patch)
tree8272684786fb0df16e30f2ad07b57b972ddddfb1 /src/basic/unit-def.c
parentrm-rf: introduce new flag REMOVE_MISSING_OK (diff)
downloadsystemd-380dc8b0a25f544269fdff7d9fd0e488fb374031.tar.xz
systemd-380dc8b0a25f544269fdff7d9fd0e488fb374031.zip
core: add generic "clean" operation to units
This adds basic infrastructure to implement a "clean" operation for unit types. This "clean" operation is supposed to remove on-disk resources of units, and is supposed to be used in a later commit to clean our RuntimeDirectory=, StateDirectory= and so on of service units. Later commits will open this up to the bus, and hook up service units with this. This also adds a new generic ActiveState called UNIT_MAINTENANCE. It's supposed to cover all kinds of "maintainance" state of units. Specifically, this is supposed to cover the "cleaning" operations later added for service units which might take a bit of time. This high-level, generic, abstract state is called UNIT_MAINTENANCE instead of the more specific "UNIT_CLEANING", since I think this should be kept open for different operations possibly later on that could be nicely subsumed under this (for example, maybe a recursive chown()ing operation could be covered by this, and similar).
Diffstat (limited to 'src/basic/unit-def.c')
-rw-r--r--src/basic/unit-def.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/basic/unit-def.c b/src/basic/unit-def.c
index 245daabcf8..3c0482366e 100644
--- a/src/basic/unit-def.c
+++ b/src/basic/unit-def.c
@@ -102,7 +102,8 @@ static const char* const unit_active_state_table[_UNIT_ACTIVE_STATE_MAX] = {
[UNIT_INACTIVE] = "inactive",
[UNIT_FAILED] = "failed",
[UNIT_ACTIVATING] = "activating",
- [UNIT_DEACTIVATING] = "deactivating"
+ [UNIT_DEACTIVATING] = "deactivating",
+ [UNIT_MAINTENANCE] = "maintenance",
};
DEFINE_STRING_TABLE_LOOKUP(unit_active_state, UnitActiveState);