From: Martin Wilck Date: Wed, 24 Oct 2018 11:22:01 +0000 (+0200) Subject: core: don't create Requires for workdir if "missing ok" X-Git-Tag: v240~476 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1e74614aab41407e9199c65dd270516ac739015;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/core/unit.c b/src/core/unit.c index c8f4c7ce0c3..0df09d0d567 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;