summaryrefslogtreecommitdiff
path: root/src/basic/unit-def.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-03-29 22:07:22 +0200
committerLennart Poettering <lennart@poettering.net>2023-04-13 06:44:27 +0200
commitb9c1883a9cd9b5126fe648f3e198143dc19a222d (patch)
treef31bf560425d33c0d6933b20fe724e11942d6206 /src/basic/unit-def.h
parentc25fac9a17b95271bb6f8d967d33c5a9aa9e4bc9 (diff)
downloadsystemd-b9c1883a9cd9b5126fe648f3e198143dc19a222d.tar.gz
service: add ability to pin fd store
Oftentimes it is useful to allow the per-service fd store to survive longer than for a restart. This is useful in various scenarios: 1. An fd to some security relevant object needs to be stashed somewhere, that should not be cleaned automatically, because the security enforcement would be dropped then. 2. A user namespace fd should be allocated on first invocation and be kept around until the user logs out (i.e. systemd --user ends), รก la #16328 (This does not implement what #16318 asks for, but should solve the use-case discussed there.) 3. There's interest in allow a concept of "userspace reboots" where the kernel stays running, and userspace is swapped out (i.e. all services exit, and the rootfs transitioned into a new version of it) while keeping some select resources pinned, very similar to how we implement a switch root. Thus it is useful to allow services to exit, while leaving their fds around till the very end. This is exposed through a new FileDescriptorStorePreserve= setting that is closely modelled after RuntimeDirectoryPreserve= (in fact it reused the same internal type), since we want similar behaviour in the end, and quite often they probably want to be used together.
Diffstat (limited to 'src/basic/unit-def.h')
-rw-r--r--src/basic/unit-def.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/unit-def.h b/src/basic/unit-def.h
index 2fab42e9c7..169e1f719e 100644
--- a/src/basic/unit-def.h
+++ b/src/basic/unit-def.h
@@ -146,6 +146,7 @@ typedef enum ServiceState {
SERVICE_FAILED,
SERVICE_DEAD_BEFORE_AUTO_RESTART,
SERVICE_FAILED_BEFORE_AUTO_RESTART,
+ SERVICE_DEAD_RESOURCES_PINNED, /* Like SERVICE_DEAD, but with pinned resources */
SERVICE_AUTO_RESTART,
SERVICE_CLEANING,
_SERVICE_STATE_MAX,