From: Zbigniew Jędrzejewski-Szmek Date: Fri, 25 Oct 2019 14:57:37 +0000 (+0200) Subject: pid1: order .automount units after local-fs-pre.target X-Git-Tag: v244-rc1~149 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9432f882a53e7152a75007fd7f001f9a74f2a0d7;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/core/automount.c b/src/core/automount.c index 0ecacc12c8f..091b59fe78d 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;