If you’re not yet sick of learning about Leopard’s new autofs implementation, Rajeev Karamchedu has written several excellent articles, which I just stumbled across today:
Archive for December 2007
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.
One of the features I’d been looking forward to in Leopard was autofs. We’re a heavily Linux shop here, and also have Sun boxes around. They all run autofs to implement their NFS automounts. I’d been frustrated and annoyed to have OS X be the odd man out – since Tiger and earlier releases of OS X used Apple’s proprietary automount program, which did not work like autofs. The two big deficiencies of Apple’s automount are that its automount maps are in a different format than autofs, and it does not do “mount-in-place”.
As I’m sure you’re all aware, NetInfo is gone in Leopard, replaced by plist files living in /var/db/dslocal. This might present issues if you are migrating users from Tiger machines to Leopard. Two scenarios for us:
1) If we use radmind to update a machine in-place from Tiger to Leopard, we’ll need a way to convert any local user accounts from the NetInfo database to the new dslocal store.
2) If you migrate user data and accounts from a Tiger machine to a Leopard machine (and you don’t want to use Apple’s Migration Assistant, or can’t), again, you might need to convert NetInfo user account info to dslocal.