Bug 121959 - Autofs squashes directories when submounts are in NIS
Summary: Autofs squashes directories when submounts are in NIS
Keywords:
Status: CLOSED DUPLICATE of bug 145533
Alias: None
Product: Fedora
Classification: Fedora
Component: autofs
Version: rawhide
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Moyer
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-04-29 11:03 UTC by Ken VanDine
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2005-04-11 20:16:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ken VanDine 2004-04-29 11:03:32 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1)
Gecko/20031114

Description of problem:
Our NIS maps include automounts in /usr/public (I know it is not a
good idea).  When autofs starts in loads those maps and they work, but
it mounts over the existing /usr rendering the box useless.  It should
mount over /usr/public not /usr.  This is new behavior, it works fine
on FC1, RH9 and older, and Solaris. 

I notice the automounter is passing the --submount option for that
particular mount, if that helps.

Version-Release number of selected component (if applicable):
autofs-4.1.2-2

How reproducible:
Always

Steps to Reproduce:
1. Specify /usr/public as an automount in NIS
2. Start autofs
3. ls /usr
    

Actual Results:  You see there is nothing in /usr (It has been mounted
over)

Expected Results:  display the contents of the /usr directory 

Additional info:

Comment 1 Tom Duffy 2004-05-04 18:47:22 UTC
I notice this as well at our setup.  We have an NIS map that mounts
/usr/dist.  I have had to sed out this map from /etc/init.d/autofs to
make the machine happy again.  The map looks like this:

$ ypcat -k auto_direct
/usr/dist -ro,bg,noquota,intr
sd-umpk12-01.sfbay,sd-umpk12-02.sfbay,sd-umpk18-01.sfbay,sd-umpk18-02.sfbay,mi-umpk14-01.sfbay,mi-umpk14-02.sfbay,sd-umpk15-01.sfbay,sd-umpk15-02.sfbay,mi-umpk17-01.sfbay,mi-umpk17-02.sfbay,mf-umpk10-01.sfbay,mf-umpk10-02.sfbay,mf-umpk16-01.sfbay,mf-umpk16-02.sfbay:/usr/dist

As a workaround for my setup, I have patched the initscript:

--- /etc/init.d/autofs.4.19.04  2004-04-19 15:25:51.000000000 -0700
+++ /etc/init.d/autofs  2004-04-19 15:27:12.000000000 -0700
@@ -203,7 +203,8 @@
                        if [ "$UNDERSCORETODOT" = "0" ] ; then
                            map=`basename $map | sed 's^//^/^g'`
                        else
-                           map=`basename $map | sed -e
s/^auto_home/auto.home/ -e s/^auto_mnt/auto.mnt/`
+#                          map=`basename $map | sed -e
s/^auto_home/auto.home/ -e s/^auto_mnt/auto.mnt/`
+                           map=`basename $map | sed -e s/^auto_direct//`
                        fi
                    fi
                fi

Comment 2 Jeff Moyer 2004-05-06 13:02:21 UTC
Direct mounts take over from the second from top level directory.  So,
if you have a direct mount specified for /usr/local/mounts, then
autofs will take ownership and mount over /usr.  This is how it was
designed, and there should be a note about this in the README.direct file.

For the initial bug reporter, if you are not using direct maps, please
attach a copy of your auto.master and the map file which causes you
problems.

Thanks!

Comment 3 Tom Duffy 2004-05-07 16:22:25 UTC
But this works fine in Solaris.

Comment 4 Jeff Moyer 2004-05-07 16:33:46 UTC
From: Ian Kent
To: Jeff Moyer
Subject: Re: autofs and 2.6 
Date: Fri, 26 Mar 2004 10:37:56 +0800 (WST) 
 
On Thu, 25 Mar 2004, Jeff Moyer wrote: 
 
>  
> One unrelated issue, how are direct mounts designed to work?  I thought 
> they would not take over a directory.  So, if you had a /var/spool 
> directory, and you wanted /var/spool/mail to be a direct mount, that
should 
> still allow visibility into /var/spool/cron for example. 
>  
> At any rate, it seems the current autofs is not designed that way. 
And, in 
> fact, if you configure /var/spool/mail as a direct map, autofs takes
over 
> /var!  Here is a Red Hat bugzilla on said subject: 
 
Yes. That's right on both points. A sore point with me and something I  
have needed at work for a long time and still have not done it. 
 
There are a couple of reasons it's that way. 
 
It minimises the number of anonymous mounts needed. Was previously a  
problem with 2.4 even with the mone-unamed patch as sites with
reasonable  
sized direct maps would quickly use the 1200 available mounts. For  
example we have between 550 and 600 entries in our direct mount map. 
 
It retains compatibility with previous autofs versions. Lame one this. 
 
And the big one. 
It's hard to do within the current design! 
 
The current design uses a filesystem and works on the base of the tree
for  
detecting mounts and so obsures the underlying fs. So to do this a  
redirection layer is needed on top of autofs. I have loopback filesystem  
(aka striped down wrapfs, www.filesystems.org) I can use but haven't  
started work on it yet. I don't want to start on this until the current  
work makes it into the kernel because it will be hard to maintain
multiple  
branches as well as being to much to swallow in one go for the kernel  
maintainers. 
 
Mike Waychison and Tim Hocking have made a proposal that will cover all  
these issues but I expect they will not have a procuct for some time(2.7  
or 2.8 time frame). In the meantime I have decided to persevere with the  
current design and take it as far as I can. 
 
Sorry, I can't be much help on this yet. 
 
Ian 


Comment 5 Jeff Moyer 2005-04-11 20:16:11 UTC

*** This bug has been marked as a duplicate of 145533 ***


Note You need to log in before you can comment on or make changes to this bug.