Re: [CFT] Autofs.

From: Edward Tomasz Napierała <trasz_at_FreeBSD.org>
Date: Thu, 4 Sep 2014 14:43:30 +0200
On 0904T0759, Hans Ottevanger wrote:
> On 08/17/14 16:50, Edward Tomasz Napierała wrote:
> >On 0817T1244, Hans Ottevanger wrote:
> >>
> [...]
> >>Hi!
> >>
> >>Great to see a real autofs finally coming to FreeBSD.
> >>
> >>I already did some very cursory testing on a recent 11-CURRENT system
> >>that I still happened to have and things with at least the /net map
> >>look quite OK.
> >>
> >>I could do some more extensive testing if I could use some of my
> >>10-STABLE systems. I already checked that the patch applies cleanly
> >>to a recent 10-STABLE (modulo a few offsets) and that both buildworld
> >>and buildkernel succeed. Should I expect difficulties actually
> >>running your autofs on 10-STABLE?
> >
> >No, it should be fine.  Plan is to MFC this to 10 soon, btw.
> >
> 
> Good to see that autofa has been MFC'd during my vacation 8-)
> 
> But I found a little problem...
> 
> When I try to access the NFS exported file-systems on an older test
> machine (running 7.x, but that is not so relevant, it also happens
> with other servers), with the following exports:
> 
> $ showmount -e soekris
> Exports list on soekris:
> /var                               192.168.0.0
> /usr                               192.168.0.0
> /home                              192.168.0.0
> /                                  192.168.0.0
> 
> I get:
> 
> $ ls /net/soekris
> COPYRIGHT       dist            libexec         proc            tmp
> bin             entropy         lost+found      rescue          usr
> boot            etc             media           root            var
> compat          home            mnt             sbin
> dev             lib
> 
> which is correct, but the next level fails:
> 
> $ ls -l  /net/soekris/usr
> total 0
> 
> since /usr on soekris is definitely not empty.
> Relevant output of mount :
> 
> ...
> map -hosts on /net (autofs)
> soekris:/ on /net/soekris (nfs, nosuid, automounted)
> 
> This is on 10.1-PRERELEASE r270922. The kernel config is GENERIC
> minus devices I do not have and AUTOFS added. Config files
> (/etc/auto_master, et al) are default. Mounting manually does succeed
> (in two steps, of course).
> 
> When trying this from Mac OS X (I am still on Snow Leopard)
> automounting works as expected. I did not have the opportunity yet to
> try a Linux box (also do not know whether autofs there has been eaten
> by systemd already 8-)).
> 
> Do I miss something, or is this a bug?

It's a bug.  Or rather, a missing feature.  The problem here is that
the "/" export "shadows" the rest.  To handle this correctly, automountd(8)
would need to mount the "/" share, then mount autofs on "/usr" etc, and
then call it done.  This part is easy.  The problem is: how to expire
(automatically unmount) it?  Because of autofs mounts, the "/" share
will always be busy, and thus won't ever get automatically unmounted.
So, for now, we don't even try to handle this situation.

I'm not sure what would the best way to solve it.
Received on Thu Sep 04 2014 - 10:43:37 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:51 UTC