summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-04-12 17:16:07 +0200
committerGitHub <noreply@github.com>2020-04-12 17:16:07 +0200
commita1a11d56108f091cfa475bb44ad565e787f3b274 (patch)
tree23c25aea1f50ebd9169818facfa6bf492a1adf24 /src
parentMerge pull request #15405 from DaanDeMeyer/sd-bus-can-send-docs (diff)
parentunits: make sure systemd-pstore stops at shutdown (diff)
downloadsystemd-a1a11d56108f091cfa475bb44ad565e787f3b274.tar.xz
systemd-a1a11d56108f091cfa475bb44ad565e787f3b274.zip
Merge pull request #15365 from poettering/remount-fs-pstore-fix
pid1: automatically generate systemd-remount-fs.service deps, plus enable systemd-pstore from sysinit.target
Diffstat (limited to 'src')
-rw-r--r--src/core/unit.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index ce0b197e6b..7964863470 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -1055,6 +1055,16 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) {
if (!MANAGER_IS_SYSTEM(u->manager))
return 0;
+ /* For the following three directory types we need write access, and /var/ is possibly on the root
+ * fs. Hence order after systemd-remount-fs.service, to ensure things are writable. */
+ if (!strv_isempty(c->directories[EXEC_DIRECTORY_STATE].paths) ||
+ !strv_isempty(c->directories[EXEC_DIRECTORY_CACHE].paths) ||
+ !strv_isempty(c->directories[EXEC_DIRECTORY_LOGS].paths)) {
+ r = unit_add_dependency_by_name(u, UNIT_AFTER, SPECIAL_REMOUNT_FS_SERVICE, true, UNIT_DEPENDENCY_FILE);
+ if (r < 0)
+ return r;
+ }
+
if (c->private_tmp) {
const char *p;