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.
This commit is contained in:
parent
4e412d2684
commit
e1e74614aa
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue