mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-10-04 07:48:36 +00:00
core: require mounts for the root and working directories
We know that launching a unit will fail if some required directories haven't been mounted yet. There's no point in starting it just to have it fail even before it gets a chance to run.
This commit is contained in:
@@ -671,6 +671,18 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) {
|
||||
assert(u);
|
||||
assert(c);
|
||||
|
||||
if (c->working_directory) {
|
||||
r = unit_require_mounts_for(u, c->working_directory);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (c->root_directory) {
|
||||
r = unit_require_mounts_for(u, c->root_directory);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (c->std_output != EXEC_OUTPUT_KMSG &&
|
||||
c->std_output != EXEC_OUTPUT_SYSLOG &&
|
||||
c->std_output != EXEC_OUTPUT_JOURNAL &&
|
||||
|
||||
Reference in New Issue
Block a user