summaryrefslogtreecommitdiff
path: root/src/core/execute.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-06-01 11:10:49 +0200
committerLennart Poettering <lennart@poettering.net>2018-06-12 16:12:10 +0200
commit228af36fff15430825dddb64d6dc6eeb47491aae (patch)
tree1cb41c3dd24c594c9f56df28ae107d37788343a6 /src/core/execute.h
parentf4ea7552c109942b49cc1a3c37e959716fb8c453 (diff)
downloadsystemd-228af36fff15430825dddb64d6dc6eeb47491aae.tar.gz
core: add new PrivateMounts= unit setting
This new setting is supposed to be useful in most cases where "MountFlags=slave" is currently used, i.e. as an explicit way to run a service in its own mount namespace and decouple propagation from all mounts of the new mount namespace towards the host. The effect of MountFlags=slave and PrivateMounts=yes is mostly the same, as both cause a CLONE_NEWNS namespace to be opened, and both will result in all mounts within it to be mounted MS_SLAVE. The difference is mostly on the conceptual/philosophical level: configuring the propagation mode is nothing people should have to think about, in particular as the matter is not precisely easyto grok. Moreover, MountFlags= allows configuration of "private" and "slave" modes which don't really make much sense to use in real-life and are quite confusing. In particular PrivateMounts=private means mounts made on the host stay pinned for good by the service which is particularly nasty for removable media mount. And PrivateMounts=shared is in most ways a NOP when used a alone... The main technical difference between setting only MountFlags=slave or only PrivateMounts=yes in a unit file is that the former remounts all mounts to MS_SLAVE and leaves them there, while that latter remounts them to MS_SHARED again right after. The latter is generally a nicer approach, since it disables propagation, while MS_SHARED is afterwards in effect, which is really nice as that means further namespacing down the tree will get MS_SHARED logic by default and we unify how applications see our mounts as we always pass them as MS_SHARED regardless whether any mount namespacing is used or not. The effect of PrivateMounts=yes was implied already by all the other mount namespacing options. With this new option we add an explicit knob for it, to request it without any other option used as well. See: #4393
Diffstat (limited to 'src/core/execute.h')
-rw-r--r--src/core/execute.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/execute.h b/src/core/execute.h
index ace94338e7..f434d10e7e 100644
--- a/src/core/execute.h
+++ b/src/core/execute.h
@@ -228,6 +228,7 @@ struct ExecContext {
bool private_network;
bool private_devices;
bool private_users;
+ bool private_mounts;
ProtectSystem protect_system;
ProtectHome protect_home;
bool protect_kernel_tunables;