diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2016-12-29 11:18:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-29 11:18:38 +0100 |
commit | 56a9366d7d80a8bbb0d3c1c7009c86ce3af0b18a (patch) | |
tree | e4b99894acdf171165251591d90656151135414d /src/core | |
parent | 323de07d449f46e3a5c8d145c341f8eb5e3424a0 (diff) | |
parent | dc7621a571b79d7fead93790c01c82c7c5789c8f (diff) |
Merge pull request #4994 from poettering/private-tmp-tmpfiles
automatically clean up PrivateTmp= left-overs in /var/tmp on next boot
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; } |