Bug 28917

Summary: autofs script skips non-duplicates too
Product: [Retired] Red Hat Linux Reporter: Matt Domsch <matt_domsch>
Component: autofsAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED NOTABUG QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-02-22 20:57:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Matt Domsch 2001-02-22 20:20:17 UTC
I've got an auto.master map on my NIS server:

/misc   /etc/auto.misc  --timeout 60
/home   yp:auto.home  --timeout 60
/home/ftp/pub/iso    /etc/auto.iso   --timeout 60

The idea being that /home gets automounted elsewhere, 
and /home/ftp/pub/iso does too.  1) Is this supported?  The autofs man 
page would seem to indicate not.

Assuming 1) is yes, then /etc/rc.d/init.d/autofs has a problem.  The check 
in getmounts() throws away my /home entry because the grep 
matches /home/ftp/pub/iso.

   # These checks screen out duplicates and skip over directories
   # where the map is '-'.
   if [ ! -z "$dir" -a ! -z "$map" \
	-a x`echo "$map" | cut -c1` != 'x-' \
	-a "`echo "$knownmaps" | grep $dir/`" = "" ]
   then


Assuming 1) is no, autofs still has a problem, in that I can't have two 
entries:
/mymnt2 /etc/auto.mymnt2
/mymnt  /etc/auto.mymnt

Even though they're two different directories, the grep will kill the 
second one.

Comment 1 Matt Domsch 2001-02-22 20:57:00 UTC
From: Nalin Dahyabhai [mailto:nalin@redhat.com]
Sent: Thursday, February 22, 2001 2:35 PM
To: testers-list@redhat.com
Subject: Re: autofs script skips non-duplicates too



Won't work.  An autofs filesystem (autofs 3, anyway) doesn't support
creation of subdirectories, so you can't start up an automounter on
/home and then immediately start one on /home/ftp/pub/iso.  If you try
reversing the order, the automounter in /home/ftp/pub/iso gets hidden
when you overlay something on top of it in /home.  More on that below.

The extra '/' at the end of the pattern prevents this, at least on my
test machine.

Going back to the original question, you can accomplish this using
submounts.  Add an entry to the auto.home map like this:

ftp		-fstype=autofs	file:/etc/auto.home.ftp

and one in /etc/auto.home.ftp that looks like this:

pub		-fstype=autofs	file:/etc/auto.home.ftp.pub

and one in /etc/auto.home.ftp.pub that looks like this:

iso		-fstype=autofs  file:/etc/auto.iso

That should approximate what you're looking for, messy though it looks.

Cheers,

Nalin