fstab-generator: add 'nofail' when NFS 'bg' option is used
authorFranck Bui <fbui@suse.com>
Tue, 15 Sep 2020 09:49:09 +0000 (11:49 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 20 Sep 2020 10:43:17 +0000 (12:43 +0200)
Otherwise a 'Before=remote-fs.target' dependency is added to the mount unit
which defeats the purpose of 'bg' option.

(cherry picked from commit e66d2eeeeb4332ca94aeb62e95ec76f1f17ee9b7)
(cherry picked from commit ad77a988f2ef7f8adb2b4d54b9fc37a48f6a52df)
(cherry picked from commit a4bf35c2012e59aabb21e9866bb154badbb452b3)

src/fstab-generator/fstab-generator.c

index 6fd6fbdf1ccdf542b8cf6ae6b7ac3a16d36ff723..75f804c60912fa24979587337a48154eabff555c 100644 (file)
@@ -368,7 +368,7 @@ static int add_mount(
                  * the systemd mount-timeout doesn't interfere.
                  * By placing these options first, they can be over-ridden by
                  * settings in /etc/fstab. */
-                opts = strjoina("x-systemd.mount-timeout=infinity,retry=10000,", opts, ",fg");
+                opts = strjoina("x-systemd.mount-timeout=infinity,retry=10000,nofail,", opts, ",fg");
                 SET_FLAG(flags, NOFAIL, true);
         }