[comp.sys.sgi] Using symbolic links to simulate direct mounts

fsfacca@ZOSO.LERC.NASA.GOV (Tony Facca) (04/17/91)

I would like to use an indirect automount to access release notes which I 
have moved to a file server.

The indirect mount point is called /r/relnotes and it is mapped to 
fileserver:/data/adm/sgi/3.3.2/relnotes

If I use the mount command as follows:

	/etc/mount -o soft,rw fileserver:/data/.../relnotes /usr/relnotes

and issue the "relnotes" command, all is well.

What I want to do is create a symlink between /r/relnotes and /usr/relnotes.
When I do that, and issue the "relnotes" command, the automounter fails to
mount the /usr/relnotes directory properly and the command returns:

	Sorry, but no products have release notes installed

If I cd into /usr/relnotes directory, the mount occurs.  But "relnotes" still
says, "Sorry,.."

Does this mean that something is not linked properly.  We've had success using
symlinks to simulate direct mounts for other applications.  Does anyone have
any idea what might be going on?  I tried links from /tmp_mnt/r/relnotes and
that didn't work either.  The /etc/auto.indirect file has these relevant lines
in them:

adm             -rw,soft        louvre:/data/adm
relnotes        -rw,soft        louvre:/data/adm/sgi/irix_3.3.2/relnotes

Is this allowable syntax?  Or am I confusing the automount program by having
a subdirectory after the first /data/adm?  


-----------------------------------------------------------------------------
Tony Facca   |   fsfacca@avelon.lerc.nasa.gov      |     phone: 216-433-8318
-----------------------------------------------------------------------------
      You are at Witt's end.  Passages lead off in *all* directions.

brendan@illyria.wpd.sgi.com (Brendan Eich) (04/18/91)

In article <9104171516.AA14281@ZoSo.lerc.nasa.gov>, fsfacca@ZOSO.LERC.NASA.GOV (Tony Facca) writes:
> I would like to use an indirect automount to access release notes which I 
> have moved to a file server.
> [. . .]
> What I want to do is create a symlink between /r/relnotes and /usr/relnotes.
> When I do that, and issue the "relnotes" command, the automounter fails to
> mount the /usr/relnotes directory properly and the command returns:
> 
> 	Sorry, but no products have release notes installed
> 
> If I cd into /usr/relnotes directory, the mount occurs.  But "relnotes" still
> says, "Sorry,.."
> 
> Does this mean that something is not linked properly.  We've had success using
> symlinks to simulate direct mounts for other applications.  Does anyone have
> any idea what might be going on?

The problem is that /usr/sbin/relnotes, a shell script, uses find(1) to
search for regular files matching 'ch*.z' under /usr/relnotes, resulting
in readdir NFS operations, while automount mounts remote filesystems only
in response to lookup (and readlink for direct maps) NFS operations.

This limitation is discussed in automount(1M)'s NOTES section, in the
paragraph beginning "An ls(1) listing ....", and applies only to indirect
maps in the case at hand (if /usr/relnotes were direct-mapped to a remote
filesystem, find would stat it and follow the automount-emulated symlink,
causing the remote filesystem to be mounted).

Direct maps are supported in IRIX 4.0.

/be

fsfacca@zoso.lerc.nasa.gov (Tony Facca) (04/18/91)

brendan@illyria.wpd.sgi.com (Brendan Eich) writes:
>
>The problem is that /usr/sbin/relnotes, a shell script, uses find(1) to
>search for regular files matching 'ch*.z' under /usr/relnotes, resulting
>in readdir NFS operations, while automount mounts remote filesystems only
>in response to lookup (and readlink for direct maps) NFS operations.
>
>This limitation is discussed in automount(1M)'s NOTES section, in the
>paragraph beginning "An ls(1) listing ....", and applies only to indirect
>maps in the case at hand (if /usr/relnotes were direct-mapped to a remote
>filesystem, find would stat it and follow the automount-emulated symlink,
>causing the remote filesystem to be mounted).
>
>Direct maps are supported in IRIX 4.0.
>
>/be

Brendan--

You are absolutely correct.  I didn't realize that relnotes was a script, 
or I might have figured it out myself.  Anyway, as a quick fix to the 
problem, I simply changed the script to do a chdir and then a find on
the current directory.  This worked just fine. 

If anyone else really cares, here's the diff:

28,29c28,29
< find /usr/relnotes/ -type f -name "ch*.z" -print |  \
<     sed -e 's%/usr/relnotes/%%' -e 's%/ch.\.z%%' | sort -u > $list_relnotes
---
> cd /usr/relnotes; find . -name "ch*.z" -print |  \
>     sed -e 's%./%%' -e 's%/ch.\.z%%' | sort -u > $list_relnotes

Thanks for such a quick response.


-- 
-----------------------------------------------------------------------------
Tony Facca   |   fsfacca@avelon.lerc.nasa.gov      |     phone: 216-433-8318
-----------------------------------------------------------------------------
      You are at Witt's end.  Passages lead off in *all* directions.