From: Lennart Poettering Date: Wed, 7 Apr 2021 09:12:39 +0000 (+0200) Subject: fstab-generator: properly order generated mount units before "post" target units X-Git-Tag: v249-rc1~379^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fa138f5e26742f83a762b2809a1891978c6aa04a;p=thirdparty%2Fsystemd.git fstab-generator: properly order generated mount units before "post" target units Let's make sure, that our mount unit are properly ordered before the "post" target unit even if DefaultDependencies= is used on the target unit. --- diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c index 8f5cd0af3ef..110a9bd1baf 100644 --- a/src/fstab-generator/fstab-generator.c +++ b/src/fstab-generator/fstab-generator.c @@ -433,6 +433,11 @@ static int add_mount( if (r < 0) return r; + /* Order the mount unit we generate relative to the post unit, so that DefaultDependencies= on the + * target unit won't affect us. */ + if (post && !FLAGS_SET(flags, AUTOMOUNT) && !FLAGS_SET(flags, NOAUTO)) + fprintf(f, "Before=%s\n", post); + if (passno != 0) { r = generator_write_fsck_deps(f, dest, what, where, fstype); if (r < 0)