Adam’s comment on my previous post on autofs in Leopard reminded me of some other improvements over the legacy automount program I hadn’t mentioned:
The legacy automount doesn’t support these at all. autofs supports these, so you can have map entries like this:
* -rw,hard,intr host:/export/apps/&
If this entry was in the map associated with the /apps mountpoint, then a `cd /apps/foo` would attempt to mount host:/export/apps/foo on /apps/foo.
A special /net map is defined in /etc/auto_master that automatically mounts all exports from a given host:
/net -hosts -nobrowse,nosuid
This option existed under Tiger on PowerPC, but was broken on Intel. To use it, you’d cd to /net/hostname. An `ls` then shows all the available exports from hostname.
aquaman:~ root# cd /net/french
aquaman:french root# ls
rel sw vol
autofs supports variables in automount maps. ARCH, CPU, HOST, OSNAME, OSREL, OSVERS, and NATISA are directly supported. Most are defined by uname:
ARCH = `uname -m`
CPU = `uname -p`
HOST = `uname -n`
OSNAME = `uname -s`
OSREL = `uname -r`
OSVERS = `uname -v`
(If you look at the output of `uname -v` on OS X, you’ll see this isn’t terribly useful in an automount map… )
NATISA (NATive Instruction Set Architecture) = currently the same as CPU. No distinction between ppc and ppc64 or i386 and x86-64.
You can define additional variables in /etc/autofs.conf – see `man autofs.conf` for details.
These variables can then appear in automount maps, and their values will be substituted. To get similar functionality with the legacy automount program, you needed to use a script that did text substitutions – substituting the correct values for variable references.
You can find more info in the man pages for autofsd, automount, automountd, autofs.conf, and auto_master.
Most of the info here for Linux autofs.5 is also relevant.