Bug 28917 - autofs script skips non-duplicates too
Summary: autofs script skips non-duplicates too
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: autofs
Version: 7.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
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:
Environment:
Last Closed: 2001-02-22 20:57:03 UTC
Embargoed:


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/`" = "" ]
   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 [nalin]
Sent: Thursday, February 22, 2001 2:35 PM
To: testers-list
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



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