diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-10-25 16:57:37 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-10-28 22:44:32 +0900 |
commit | 9432f882a53e7152a75007fd7f001f9a74f2a0d7 (patch) | |
tree | d1db49c58c3a55e63f146ced31fa539786aeeab7 /src | |
parent | e9cfc71222c8e6dac02c85f9c05ba1aba09a3b1c (diff) | |
download | systemd-9432f882a53e7152a75007fd7f001f9a74f2a0d7.tar.gz |
pid1: order .automount units after local-fs-pre.target
From the bug:
> According to the documentation of systemd.automount if the automoint point is
> automagically created if it doesn't exist yet. This ofcourse means the
> filesystem underneath has to be writable, which for / means not only does
> -.mount need to be started but also systemd-remount-fs.service has to be run,
> which isn't guaranteed by the default automount dependencies.
>
> For .mount units there is an automatic default After= dependency on
> local-fs-pre.target, would probably make sense to do the same for automount
> units to avoid it failing on the corner-case where it has to create directory.
Fixes #13306.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/automount.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/automount.c b/src/core/automount.c index 0ecacc12c8..091b59fe78 100644 --- a/src/core/automount.c +++ b/src/core/automount.c @@ -152,6 +152,10 @@ static int automount_add_default_dependencies(Automount *a) { if (!MANAGER_IS_SYSTEM(UNIT(a)->manager)) return 0; + r = unit_add_dependency_by_name(UNIT(a), UNIT_AFTER, SPECIAL_LOCAL_FS_PRE_TARGET, true, UNIT_DEPENDENCY_DEFAULT); + if (r < 0) + return r; + r = unit_add_two_dependencies_by_name(UNIT(a), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, true, UNIT_DEPENDENCY_DEFAULT); if (r < 0) return r; |