NFS Sharing

/usr/local for multiple architectures

We are going to export our /usr/local (which will really be living on /share/local) to our systems; another machine will export /usr/people (really on /share/people) the same way. For the former, we need to accommodate multiple client architectures (CPU/OS types) which want different /usr/local/bin directories. We've used the ideas in the O'Reilly book by Hal Stern, Managing NFS and NIS. My /etc/exports file on wirehead looks like:
/share/local   wirehead.hq.nasa.gov apollo.hq.nasa.gov zeus.hq.nasa.gov \
	       -root=wirehead.hq.nasa.gov:apollo.hq.nasa.gov:zeus.hq.nasa.gov
and the relevant part of /etc/fstab on all the machines (including wirehead) is:
wirehead:/share/local           /usr/local      nfs     bg,intr 0 0
wirehead:/share/local/bin.irix5 /usr/local/bin  nfs     bg,intr 0 0
So we're mounting the whole /share/local, then on each kind of platform, mounting on top of that the appropriate hardware-specific binary directory.

As Stern indicates, to avoid duplicating architecture-neutral executables like scripts in the different/usr/local/bin, you should install these in a separate, exported directory. He suggests /usr/local/share, but here that might be confusing; I propose /usr/local/generic. We haven't done this here yet, since we don't have multiple architectures, but we probably will soon.

Exporting /var/mail and MXing

Another machine here exports the mail spool directory, and we've added MX records to the DNS so the mail for all our machines goes to the host with the spool. The relevant part of that system's /etc/exports looks like:
/var/mail      wirehead.hq.nasa.gov apollo.hq.nasa.gov zeus.hq.nasa.gov \
               -root=wirehead.hq.nasa.gov:apollo.hq.nasa.gov:zeus.hq.nasa.gov
We had the DNS folks add MX records to the name server like the following:
apollo		IN	A	131.182.121.87
		IN	MX 10	apollo.hq.nasa.gov.
wirehead	IN	A	131.182.121.88
		IN	MX 10	apollo.hq.nasa.gov.
zeus		IN	A	131.182.121.86
		IN	MX 10	apollo.hq.nasa.gov.

Full contents of /etc/exports and /etc/fstab

Before, I've only shown the relevant lines of the various filesystem configuration files. Here I'll show them for two machines, each a server and client for the other.

Wirehead exports /usr/local, and imports /usr/people and /var/mail from apollo.

Apollo exports /usr/people and /var/mail and imports /usr/local from wirehead.
Chris Shenton