NFS Services Administrator's Guide
Configuring and Administering NFS
Configuring and Administering AutoFS
Chapter 2 113
If you configure multiple servers on both sides of a gateway, a server on
the same side of the gateway as the NFS client will always be used,
because it will always respond to the client’s poll before the servers on
the other side of the gateway.
To Use Environment Variables as Shortcuts in
Automounter Maps
1. Use an environment variable anywhere in a direct or indirect
automounter map except the first field, which specifies the local
mount point. An environment variable must be preceded by a dollar
sign ($) or enclosed in curly braces {}. The following direct map uses
a variable called HOST:
/private_files sage:/export/private_files/$HOST
2. Add the -D option to the AUTOMOUNTD_OPTIONS variable in the
/etc/rc.config.d/nfsconf file to assign a value to the variable, as
in the following example:
AUTOMOUNTD_OPTIONS=”-D HOST='hostname'”
The example shown above assumes that NFS server sage has
subdirectories in its /export/private_files directory that are named
after the hosts in its network. Every host in the network can use the
same automounter map and the same AUTOMOUNTD_OPTIONS definition to
mount its private files from server sage.
For example, when AutoFS starts up on host basil, it assigns the value
basil to the HOST variable. Then, when someone requests access to the
local /private_files directory on basil, AutoFS mounts
/export/private_files/basil from server sage.
Any environment variable that is set to a value may be used in an
automounter map. If you do not set the variable with the -D option in
/etc/rc.config.d/nfsconf, AutoFS uses the current value of the
environment variable on the local host.
You cannot use environment variables in the automounter master map.