diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-12-27 23:25:24 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-12-27 23:25:24 +0100 |
commit | d71f050599dfd63a53ef3e91a8ef1835a8985b92 (patch) | |
tree | 48b95331dd0bf4e3bf94adcbcd9b090c287a02f5 /src/core | |
parent | 27e2e3231fc1edbbaa9f73be363900701ab4598d (diff) |
core: implicitly order units with PrivateTmp= after systemd-tmpfiles-setup.service
Preparation for fixing #4401.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/unit.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/unit.c b/src/core/unit.c index 5d0b17425b..409668f6d2 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -866,11 +866,15 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) { return 0; if (c->private_tmp) { - r = unit_require_mounts_for(u, "/tmp"); - if (r < 0) - return r; + const char *p; + + FOREACH_STRING(p, "/tmp", "/var/tmp") { + r = unit_require_mounts_for(u, p); + if (r < 0) + return r; + } - r = unit_require_mounts_for(u, "/var/tmp"); + r = unit_add_dependency_by_name(u, UNIT_AFTER, SPECIAL_TMPFILES_SETUP_SERVICE, NULL, true); if (r < 0) return r; } |