automounter peculiarity, and a nice automount example

Bob Cunningham bob at kahala.hig.hawaii.edu
Thu Dec 22 04:51:31 AEST 1988


If you accidentally specify non-existent map for an invocation of
automount (or, a map which say isn't correctly published by your yp
server(s)), then you can get some strange effects.  The most obvious is
console messages on the system on which automount is running that it
"cannot read mountopts.bysitepair map".

This is the name of some sort of default map, hard-coded in automount at
least in SunOS4.0, for a feature which was never--and will never--be
implemented.  The fix is to make sure you didn't make a typo in specifying
the map name, and the map is properly published.

Also, ome of the examples of how to use the automounter that have appeared
in Sun-Spots aren't too clear.  Here is a (hopefully clear) way in which I
use it to manage bits and pieces of /usr/local spread around various
servers here.  The "server1" and "server2" machines have identical copies
of /usr/local/bin, etc., while "server3" just has /usr/local/src.

At the tail end of /etc/rc.local on all the diskless machines, I put
something like this:

# Automounter
if [ -f /usr/etc/automount ]; then
 /usr/etc/automount /usr/local auto.local; (echo "auto local") >/dev/console
fi

The yellow pages master has a file called /etc/auto.local, which I publish
in the yellow pages (via some minor additions to /var/yp/Makefile which
should be obvious, so I'm not outlining them here), which contains:

bin	-ro,soft	server1:/usr/local/bin	server2:/usr/local/bin
lib	-ro,soft	server1:/usr/local/lib	server2:/usr/local/lib
src	-ro,soft	server3:/usr/local/src

The effect on each diskless client is to create an invocation of automount
that "lives" in /usr/local.  When it sees references to /usr/local/bin or
/usr/local/lib (or any of their sub-directories) it mounts them from
either server1 or server2 (doesn't matter which).  When it sees a
reference to the /usr/local/src (or a sub-directory), it mounts that from
server3.



More information about the Comp.sys.sun mailing list