diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2017-07-18 14:34:52 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-07-18 14:34:52 +0200 |
commit | 3536f49e8fa281539798a7bc5004d73302f39673 (patch) | |
tree | 8cb49fc448d6b88ccf8d01e9a094dd64aa7b6dbb /src/core/execute.h | |
parent | Merge pull request #6349 from poettering/mkosi-builddir (diff) | |
download | systemd-3536f49e8fa281539798a7bc5004d73302f39673.tar.xz systemd-3536f49e8fa281539798a7bc5004d73302f39673.zip |
core: add {State,Cache,Log,Configuration}Directory= (#6384)
This introduces {State,Cache,Log,Configuration}Directory= those are
similar to RuntimeDirectory=. They create the directories under
/var/lib, /var/cache/, /var/log, or /etc, respectively, with the mode
specified in {State,Cache,Log,Configuration}DirectoryMode=.
This also fixes #6391.
Diffstat (limited to 'src/core/execute.h')
-rw-r--r-- | src/core/execute.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/core/execute.h b/src/core/execute.h index 93713e48cc..f7fa3176b1 100644 --- a/src/core/execute.h +++ b/src/core/execute.h @@ -108,6 +108,21 @@ struct ExecRuntime { int netns_storage_socket[2]; }; +typedef enum ExecDirectoryType { + EXEC_DIRECTORY_RUNTIME = 0, + EXEC_DIRECTORY_STATE, + EXEC_DIRECTORY_CACHE, + EXEC_DIRECTORY_LOGS, + EXEC_DIRECTORY_CONFIGURATION, + _EXEC_DIRECTORY_MAX, + _EXEC_DIRECTORY_INVALID = -1, +} ExecDirectoryType; + +typedef struct ExecDirectory { + char **paths; + mode_t mode; +} ExecDirectory; + struct ExecContext { char **environment; char **environment_files; @@ -217,9 +232,8 @@ struct ExecContext { Set *address_families; bool address_families_whitelist:1; - char **runtime_directory; - mode_t runtime_directory_mode; ExecPreserveMode runtime_directory_preserve_mode; + ExecDirectory directories[_EXEC_DIRECTORY_MAX]; bool memory_deny_write_execute; bool restrict_realtime; @@ -265,7 +279,7 @@ struct ExecParameters { CGroupMask cgroup_supported; const char *cgroup_path; - const char *runtime_prefix; + char **prefix; const char *confirm_spawn; @@ -342,3 +356,6 @@ ExecUtmpMode exec_utmp_mode_from_string(const char *s) _pure_; const char* exec_preserve_mode_to_string(ExecPreserveMode i) _const_; ExecPreserveMode exec_preserve_mode_from_string(const char *s) _pure_; + +const char* exec_directory_type_to_string(ExecDirectoryType i) _const_; +ExecDirectoryType exec_directory_type_from_string(const char *s) _pure_; |