Skip to content

Commit

Permalink
autofs.conf: Set mount_nfs_default_protocol = 4
Browse files Browse the repository at this point in the history
From autofs.conf(5):

mount_nfs_default_protocol

   Specify  the default protocol used by mount.nfs(8) (program default 3).
   Since we can't identify this default automatically we need to set it in
   the autofs configuration.

Our mount.fs defaults to nfs4, so configure this correctly.

Background:

autmount tries to avoid to call mount.nfs for a host, when the host or
the nfs service on the host is not available to avoid long timeouts (and
possibly use a alternative ip-address or server).

So it uses rpc calls to the null procedure of the relevant nfs version.
If a map entries specifies a version option for nfs, then it is clear,
what this relevant version is. But if no version is specified in the map
entry, automounts wants to poll the version(s) mount.nfs would use, if
no version is specified. Per default, it is assumed, that mount.nfs
tries nfs3 and 2, so this is what gets polled. As we only offer nfs4, we
get the error `mount(nfs): no hosts available`. We need to tell
automount, that our mount.nfs defaults to nfs4 so that nfs4 is polled.

The above error doesn't occur with our current version of nfs-utils
(which is 2.4.1). In this version, `mount.nfs` is so old, that it
doesn't show its version number when called as `mount.nfs -V`.  In that
case, autofs skips the probing of nfs-versions alltogether.

However, when nfs-utils is upgraded to 2.5.4, autofs will detect that
and we get the error. So the change here is a prerequisite for an update
of nfs-utils.

This new setting is valid for autofs version 5.1.3 and for autofs
version 5.1.7, so there is no issue with the concurrently ongoing update
of autofs.
  • Loading branch information
donald committed Mar 4, 2021
1 parent 064657c commit f6fa3ce
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions misc_etc_files/autofs.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
timeout = 300
negative_timeout = 1
browse_mode = no
mount_nfs_default_protocol = 4

[ amd ]

Expand Down

0 comments on commit f6fa3ce

Please sign in to comment.