summaryrefslogtreecommitdiff
path: root/man/systemd.mount.xml
diff options
context:
space:
mode:
authorNeilBrown <neil@brown.name>2017-07-04 17:47:40 +1000
committerLennart Poettering <lennart@poettering.net>2017-07-04 09:47:40 +0200
commit65e1dee7dcf1668c25c32f0238c935708dbffbcf (patch)
tree68fe0bf25615de37b83147d3b181b7178ed791ac /man/systemd.mount.xml
parent45d1ffd51d963604d9f4f501fad46c83c647af1c (diff)
downloadsystemd-65e1dee7dcf1668c25c32f0238c935708dbffbcf.tar.gz
fstab-generator: handle NFS "bg" mounts correctly. (#6103)
When "bg" is specified for NFS mounts, and if the server is not accessible, two behaviors are possible depending on networking details. If a definitive error is received, such a EHOSTUNREACH or ECONNREFUSED, mount.nfs will fork and continue in the background, while /bin/mount will report success. If no definitive error is reported but the connection times out instead, then the mount.nfs timeout will normally be longer than the systemd.mount timeout, so mount.nfs will be killed by systemd. In the first case the mount has appeared to succeed even though it hasn't. This can be confusing. Also the background mount.nfs will never get cleaned up, even if the mount unit is stopped. In the second case, mount.nfs is killed early and so the mount will not complete when the server comes back. Neither of these are ideal. This patch modifies the options when an NFS bg mount is detected to force an "fg" mount, but retain the default "retry" time of 10000 minutes that applies to "bg" mounts. It also imposes "nofail" behaviour and sets the TimeoutSec for the mount to "infinity" so the retry= time is allowed to complete. This provides near-identical behaviour to an NFS bg mount started directly by "mount -a". The only difference is that systemd will not wait for the first mount attempt, while "mount -a" will. Fixes #6046
Diffstat (limited to 'man/systemd.mount.xml')
-rw-r--r--man/systemd.mount.xml11
1 files changed, 9 insertions, 2 deletions
diff --git a/man/systemd.mount.xml b/man/systemd.mount.xml
index b4e2c79bde..98f71d2e7e 100644
--- a/man/systemd.mount.xml
+++ b/man/systemd.mount.xml
@@ -161,8 +161,15 @@
<para>The NFS mount option <option>bg</option> for NFS background mounts
as documented in <citerefentry project='man-pages'><refentrytitle>nfs</refentrytitle><manvolnum>5</manvolnum></citerefentry>
- is not supported in <filename>/etc/fstab</filename> entries. The systemd mount option <option>nofail</option>
- provides similar functionality and should be used instead.</para>
+ is detected by <command>systemd-fstab-generator</command> and the options
+ are transformed so that systemd fulfills the job-control implications of
+ that option. Specifically <command>systemd-fstab-generator</command> acts
+ as though <literal>x-systemd.mount-timout=infinity,retry=10000</literal> was
+ prepended to the option list, and <literal>fg,nofail</literal> was appended.
+ Depending on specific requirements, it may be appropriate to provide some of
+ these options explicitly, or to make use of the
+ <literal>x-systemd.automount</literal> option described below instead
+ of using <literal>bg</literal>.</para>
<para>When reading <filename>/etc/fstab</filename> a few special
mount options are understood by systemd which influence how