Bug 28917 - autofs script skips non-duplicates too
Summary: autofs script skips non-duplicates too
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: autofs
Version: 7.1
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact: Brock Organ
Depends On:
TreeView+ depends on / blocked
Reported: 2001-02-22 20:20 UTC by Matt Domsch
Modified: 2007-04-18 16:31 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2001-02-22 20:57:03 UTC

Attachments (Terms of Use)

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/`" = "" ]

Assuming 1) is no, autofs still has a problem, in that I can't have two 
/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.



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