From e1e74614aab41407e9199c65dd270516ac739015 Mon Sep 17 00:00:00 2001 From: Martin Wilck Date: Wed, 24 Oct 2018 13:22:01 +0200 Subject: [PATCH] core: don't create Requires for workdir if "missing ok" Don't add an implicit RequiresMountsFor depenency for the WorkingDirectory of a unit if the "-" character was used to indicate that "a missing working directory is not considered fatal" (see systemd.exec(5)). Otherwise systemd might fail the unit because of missing dependencies. --- src/core/unit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/unit.c b/src/core/unit.c index c8f4c7ce0c..0df09d0d56 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -964,7 +964,7 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) { assert(u); assert(c); - if (c->working_directory) { + if (c->working_directory && !c->working_directory_missing_ok) { r = unit_require_mounts_for(u, c->working_directory, UNIT_DEPENDENCY_FILE); if (r < 0) return r;