Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jan 2020 21:09:21 +0000
From:      Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= <trasz@freebsd.org>
To:        Lee Damon <nomad@castle.org>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: two questions about autofs on FBSD
Message-ID:  <20200108210921.GA40959@brick>
In-Reply-To: <578798e4-5e26-6116-9ffe-6dcc4f08ed59@castle.org>
References:  <578798e4-5e26-6116-9ffe-6dcc4f08ed59@castle.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 0103T1602, Lee Damon wrote:
> I am (reluctantly) replacing am-utils (amd) with autofs. To do this I
> need to replace a lot of functionality that I've had embedded for a very
> long time and which my users absolutely rely on. I have two (so far)
> questions that I need to solve before I can proceed with this process.
> 
> Question 1 - One of those features is the ability to use a symlink
> instead of a NFS mount. For a simplistic example:
> 
>  /homes/accountname -> /net/server/home/accountname
> 
> On Linux this is a : entry in /etc/auto.homes:
>  accountname  :/net/server/home/accountname
> 
> but when I test it on FBSD 11-3 I get:
>   automountd[1784]: "mount -t nfs -o automounted,retrycnt=1
> /net/[redacted]/vol/home/[redacted] /homes/[redacted]/", pid 1785,
> terminated with exit status 1
> 
> Which sure looks like it is trying to NFS mount the local filesystem,
> which clearly won't work.
> 
> I use this functionality all over the place including linking into AFS
> space and making smart decisions of which subdirectory to present, so I
> can't just turn all of the links into NFS mounts.
> 
> I found a bug report against the 10.1 version of autofs asking for the
> linking functionality but it was closed with no comment. I'm not finding
> any other documentation that references how to do a link.

I'm afraid linking isn't supported.  I've always considered it
an optimization that made sense back when NFS could have significant
overhead and nowadays just wasn't worth it.

One thing you could try is to use nullfs(5) instead of NFS for this
specific case.  I no longer remember all the details, but simply adding
'-t nullfs' to the map entry above should work.

> The media mount seems to be done via a special script instead of just a
> link. So, I have to ask, is this something that can be done? How do I do it?

Media mounts are handled by executable maps, aka special maps; there's
nothing media-specific in autofs itself, apart from the
/etc/autofs/special_media shell script.  Now that you mention it, there
is a /etc/autofs/include_nis_nullfs special map which does the nullfs
symlink, although it's to be used with NIS.  Might be useful if adding
"-t nullfs" in a static map file isn't enough.

> Question 2 - How do I get automount to reload a map if a filesystem is
> already mounted? It looks like issuing the "automount" command with no
> flags should get it to reload maps but it seems to be ignoring any
> changes to a map if that map has anything active.
> 
> 99% of my map updates are to add a new filesystem to an existing map and
> I need all of the hosts to pick up the changes the next time CM runs. On
> Linux "systemctl reload autofs" does it but "service automount reload"
> doesn't exist, and as I said, "automount" ignores map changes for active
> maps. I'm _certain_ I'm missing something simple and obvious here, I
> can't believe there's no way to reload an active map.
> 
> Any information related to either question is much appreciated.

Executing "automount" will refresh top-level mounts (ie all the filesystems
of type "autofs"); running "automount -c" will flush cached maps referenced
from /etc/auto_master.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200108210921.GA40959>