All of lore.kernel.org
 help / color / mirror / Atom feed
* autofs5: multiple entries with wildcards
@ 2007-03-14 21:20 Sascha Frey
  2007-03-14 21:42 ` jmoyer
  2007-03-15 16:39 ` Jim Carter
  0 siblings, 2 replies; 7+ messages in thread
From: Sascha Frey @ 2007-03-14 21:20 UTC (permalink / raw)
  To: autofs

Hi,

I'm trying to set up autofs5, but I've got a problem:

auto.master:
/homes		/etc/auto.homes

auto.homes:
* -fstype=nfs,rw        homeserver1:/home/&
* -fstype=nfs,rw        homeserver2:/home/&

The directories on the first server are mounted. 
But if I try to access a home which is on the second one I get a 'No
such file or directory' error.


Thanks for any help.

- Sascha

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: autofs5: multiple entries with wildcards
  2007-03-14 21:20 autofs5: multiple entries with wildcards Sascha Frey
@ 2007-03-14 21:42 ` jmoyer
  2007-03-15  0:46   ` Sascha Frey
  2007-03-15 16:39 ` Jim Carter
  1 sibling, 1 reply; 7+ messages in thread
From: jmoyer @ 2007-03-14 21:42 UTC (permalink / raw)
  To: Sascha Frey; +Cc: autofs

==> Regarding [autofs] autofs5: multiple entries with wildcards; Sascha Frey <sfrey@acs-software.de> adds:

sfrey> Hi,
sfrey> I'm trying to set up autofs5, but I've got a problem:

sfrey> auto.master:
sfrey> /homes		/etc/auto.homes

sfrey> auto.homes:
sfrey> * -fstype=nfs,rw        homeserver1:/home/&
sfrey> * -fstype=nfs,rw        homeserver2:/home/&

sfrey> The directories on the first server are mounted. 
sfrey> But if I try to access a home which is on the second one I get a 'No
sfrey> such file or directory' error.

Your configuration is not valid.  You can use a replicated server entry,
but this is not the purpose for which it was intended.  Even so, it should
work:

* -fstype=nfs,rw        homeserver1,homeserver2:/home/&

-Jeff

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: autofs5: multiple entries with wildcards
  2007-03-14 21:42 ` jmoyer
@ 2007-03-15  0:46   ` Sascha Frey
  2007-03-15  3:15     ` Ian Kent
                       ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sascha Frey @ 2007-03-15  0:46 UTC (permalink / raw)
  To: autofs

On Wed, 2007-03-14 at 17:42 -0400, jmoyer@redhat.com wrote:
> ==> Regarding [autofs] autofs5: multiple entries with wildcards; Sascha Frey <sfrey@acs-software.de> adds:
> 
> sfrey> Hi,
> sfrey> I'm trying to set up autofs5, but I've got a problem:
> 
> sfrey> auto.master:
> sfrey> /homes		/etc/auto.homes
> 
> sfrey> auto.homes:
> sfrey> * -fstype=nfs,rw        homeserver1:/home/&
> sfrey> * -fstype=nfs,rw        homeserver2:/home/&
> 
> sfrey> The directories on the first server are mounted. 
> sfrey> But if I try to access a home which is on the second one I get a 'No
> sfrey> such file or directory' error.
> 
> Your configuration is not valid.  You can use a replicated server entry,
> but this is not the purpose for which it was intended.  Even so, it should
> work:
> 
> * -fstype=nfs,rw        homeserver1,homeserver2:/home/&
This doesn't solve my problem, because the NFS export directories are
different on both servers (sorry, my auto.homes was just a sample).

I've seen an autofs4 setup with the maps on NIS.
The map entries looked like this:
#ypcat auto.home
NFSServer:/mnt/sda1/&
NFSServer:/mnt/sdc3/&
NFSServer2:/mnt/users/&
...


This is what I want, but without NIS.
I'm testing now with local map files, but I want to store the maps in my
LDAP directory.


> 
> -Jeff

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: autofs5: multiple entries with wildcards
  2007-03-15  0:46   ` Sascha Frey
@ 2007-03-15  3:15     ` Ian Kent
  2007-03-15  3:20     ` Ian Kent
  2007-03-15  6:27     ` Matthew Costello
  2 siblings, 0 replies; 7+ messages in thread
From: Ian Kent @ 2007-03-15  3:15 UTC (permalink / raw)
  To: Sascha Frey; +Cc: autofs

On Thu, 2007-03-15 at 01:46 +0100, Sascha Frey wrote:
> On Wed, 2007-03-14 at 17:42 -0400, jmoyer@redhat.com wrote:
> > ==> Regarding [autofs] autofs5: multiple entries with wildcards; Sascha Frey <sfrey@acs-software.de> adds:
> > 
> > sfrey> Hi,
> > sfrey> I'm trying to set up autofs5, but I've got a problem:
> > 
> > sfrey> auto.master:
> > sfrey> /homes		/etc/auto.homes
> > 
> > sfrey> auto.homes:
> > sfrey> * -fstype=nfs,rw        homeserver1:/home/&
> > sfrey> * -fstype=nfs,rw        homeserver2:/home/&
> > 
> > sfrey> The directories on the first server are mounted. 
> > sfrey> But if I try to access a home which is on the second one I get a 'No
> > sfrey> such file or directory' error.
> > 
> > Your configuration is not valid.  You can use a replicated server entry,
> > but this is not the purpose for which it was intended.  Even so, it should
> > work:
> > 
> > * -fstype=nfs,rw        homeserver1,homeserver2:/home/&
> This doesn't solve my problem, because the NFS export directories are
> different on both servers (sorry, my auto.homes was just a sample).
> 
> I've seen an autofs4 setup with the maps on NIS.
> The map entries looked like this:
> #ypcat auto.home
> NFSServer:/mnt/sda1/&
> NFSServer:/mnt/sdc3/&
> NFSServer2:/mnt/users/&
> ...

But you haven't confirmed that the above NIS map is the same as what you
are using in your map.

Try using "ypcat -k auto.home" and see what the keys are.

I don't believe that and automounter will allow you to have multiple
wildcard entries.

Ian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: autofs5: multiple entries with wildcards
  2007-03-15  0:46   ` Sascha Frey
  2007-03-15  3:15     ` Ian Kent
@ 2007-03-15  3:20     ` Ian Kent
  2007-03-15  6:27     ` Matthew Costello
  2 siblings, 0 replies; 7+ messages in thread
From: Ian Kent @ 2007-03-15  3:20 UTC (permalink / raw)
  To: Sascha Frey; +Cc: autofs

On Thu, 2007-03-15 at 01:46 +0100, Sascha Frey wrote:
> On Wed, 2007-03-14 at 17:42 -0400, jmoyer@redhat.com wrote:
> > ==> Regarding [autofs] autofs5: multiple entries with wildcards; Sascha Frey <sfrey@acs-software.de> adds:
> > 
> > sfrey> Hi,
> > sfrey> I'm trying to set up autofs5, but I've got a problem:
> > 
> > sfrey> auto.master:
> > sfrey> /homes		/etc/auto.homes
> > 
> > sfrey> auto.homes:
> > sfrey> * -fstype=nfs,rw        homeserver1:/home/&
> > sfrey> * -fstype=nfs,rw        homeserver2:/home/&
> > 
> > sfrey> The directories on the first server are mounted. 
> > sfrey> But if I try to access a home which is on the second one I get a 'No
> > sfrey> such file or directory' error.
> > 
> > Your configuration is not valid.  You can use a replicated server entry,
> > but this is not the purpose for which it was intended.  Even so, it should
> > work:
> > 
> > * -fstype=nfs,rw        homeserver1,homeserver2:/home/&
> This doesn't solve my problem, because the NFS export directories are
> different on both servers (sorry, my auto.homes was just a sample).

Why not?
Did you actually try the expanded rather than shorthand version of the
above:

* -fstype=nfs,rw server1:/path1/& server2:/path2/&

Ian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: autofs5: multiple entries with wildcards
  2007-03-15  0:46   ` Sascha Frey
  2007-03-15  3:15     ` Ian Kent
  2007-03-15  3:20     ` Ian Kent
@ 2007-03-15  6:27     ` Matthew Costello
  2 siblings, 0 replies; 7+ messages in thread
From: Matthew Costello @ 2007-03-15  6:27 UTC (permalink / raw)
  To: Sascha Frey; +Cc: autofs

On Thu, 2007-03-15 at 01:46 +0100, Sascha Frey wrote:
> ...
> This is what I want, but without NIS.
> I'm testing now with local map files, but I want to store the maps in my
> LDAP directory.

I don't know if this is what you want, but this is the meat of the shell
script I used to create the /etc/auto.home map from LDAP.  Home
directories in my environment don't change all that often so creating a
static map from the LDAP information gives slightly more speed and
higher reliability.

ldapsearch -x -s sub -S cn nisMapName=auto.home cn nisMapEntry | \
sed -e "s/`uname -n`:/:/" | \
awk '$1 == "cn:" { cn=$2 }
$1 == "nisMapEntry:" { printf "%-10s %s,rsize=8192,wsize=8192 %s\n", cn,
$2,$3 }' >> $tmpfile

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: autofs5: multiple entries with wildcards
  2007-03-14 21:20 autofs5: multiple entries with wildcards Sascha Frey
  2007-03-14 21:42 ` jmoyer
@ 2007-03-15 16:39 ` Jim Carter
  1 sibling, 0 replies; 7+ messages in thread
From: Jim Carter @ 2007-03-15 16:39 UTC (permalink / raw)
  To: Sascha Frey; +Cc: autofs

On Wed, 14 Mar 2007, Sascha Frey wrote:

> auto.master:
> /homes		/etc/auto.homes
> 
> auto.homes:
> * -fstype=nfs,rw        homeserver1:/home/&
> * -fstype=nfs,rw        homeserver2:/home/&
> 
> The directories on the first server are mounted. 
> But if I try to access a home which is on the second one I get a 'No
> such file or directory' error.

That's not a bug, that's a feature :-)  If you were to access /homes/jimc 
then autofs would go through /etc/auto.homes until it found a match to the 
wildcard (in the first line), mount homeserver1:/home/jimc, and its job is 
done; it has no reason to look at subsequent lines.  

Several people have suggested using hot failover syntax, so if the mount 
fails it could try additional servers (on the same line).  But that's a 
kludge, not what hot failover is for -- it's intended for when several 
servers have identical data, so (e.g.) the department's favorite software 
package remains available even if its primary residence site goes down.

Here at UCLA-Mathnet we handle the issue actually in two parallel ways: 
first, a user's official homedir would be /net/$hostname/$filesys/$loginID, 
e.g. /net/julia/h1/jimc, and a generic map causes julia:/h1 to be mounted 
on /net/julia/h1.  This has the advantage of requiring one mount per 
filesystem, not one mount per user, so we've never hit the limit on the 
number of mounted filesystems.

On the other hand, the "home" NIS map would have a key of the loginID and a 
value of for example julia:/h1/jimc, and the automounter would mount the 
correct subdirectory of the correct host on /home/jimc (at a cost of one 
mount per user).  We provide this for autonomous scripts where $HOME may 
not have a useable value and where it may be hard to resolve ~$USER, e.g. 
/bin/sh scripts on Solaris.

Conclusion: one way or another, you need to list the server and the 
filesystem explicitly in the NIS or LDAP map that defines the user's home 
directory.

FYI, here are our /etc/auto.* files:

auto.master:
/net            /etc/auto.net.new
/home           yp:auto.home

auto.net.new (all on 1 line):
*       -rsize=8192,wsize=8192,retry=1,soft,fstype=autofs,-DSERVER=& \
    file:/etc/auto.net.generic

auto.net.generic:
*       ${SERVER}:/&


James F. Carter          Voice 310 825 2897    FAX 310 206 6673
UCLA-Mathnet;  6115 MSA; 405 Hilgard Ave.; Los Angeles, CA, USA  90095-1555
Email: jimc@math.ucla.edu    http://www.math.ucla.edu/~jimc (q.v. for PGP key)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-03-15 16:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-14 21:20 autofs5: multiple entries with wildcards Sascha Frey
2007-03-14 21:42 ` jmoyer
2007-03-15  0:46   ` Sascha Frey
2007-03-15  3:15     ` Ian Kent
2007-03-15  3:20     ` Ian Kent
2007-03-15  6:27     ` Matthew Costello
2007-03-15 16:39 ` Jim Carter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.