NFS Services Administrator's Guide HP-UX 11i version 3

Following are sample lines from an AutoFS indirect map on the NFS client, sage. The hash (#)
symbol indicates a commented line.
# /etc/auto_desktop file
# local mount-point mount options remote server:directory
draw -nosuid thyme:/export/apps/draw
write -nosuid basil:/export/write
Figure 3-6 illustrates how AutoFS sets up indirect mounts.
Figure 3-6 How AutoFS Sets Up NFS Indirect Mounts
Using Environment Variables as Shortcuts in AutoFS Maps
This section describes how to use environment variables as shortcuts in AutoFS maps using an
example. You can create an environment variable by prefixing a dollar ($) to its name, or enclosing
it in braces ({}). You can use an environment variable in a direct or an indirect AutoFS map
anywhere except the first field, which specifies the local mount-point.
IMPORTANT: You cannot use environment variables in the AutoFS master map.
In this example, the NFS server basil, contains subdirectories in its /export/private_files
directory, which are named after the hosts in its network. Every host in the network can use the
same AutoFS map and the same AUTOMOUNTD_OPTIONS definition to mount its private files
from basil.
When AutoFS starts up on the host sage, it assigns the value sage to the HOST variable. When
you request access to the local /private_files directory on sage, AutoFS mounts
/export/private_files/sage from basil.
To use environment variables as shortcuts in direct and indirect maps, follow these steps:
1. To enable the automount command to expand the environment variable to its current value
of the client's hostname, modify the direct map entry on the server, basil, as follows:
/private_files basil:/export/private_files/$HOST
In the direct map entry, HOST, is the environment variable.
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 follows:
AUTOMOUNTD_OPTIONS=-D HOST='hostname'
66 Configuring and Administering AutoFS