Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
NFS Services Administrator's Guide: HP-UX 11i version 3 > Chapter 3 Configuring and Administering AutoFS

Using Environment Variables as Shortcuts in AutoFS Maps

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

This section describes how to use environment variables as shortcuts in AutoFS maps.

To use environment variables as shortcuts in direct and indirect maps, follow these steps:

  1. Use an environment variable anywhere in a direct or an indirect AutoFS map except the first field, which specifies the local mount point. An environment variable must be preceded by a dollar ($) sign or must be 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'”

Notes on Using Environment Variables as Shortcuts in Maps

IMPORTANT: You cannot use environment variables in the AutoFS master map.

The previous example assumes that the NFS server, sage, has 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 the 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 the server, sage.

You can use any environment variable that is set to a value in an AutoFS 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.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2007 Hewlett-Packard Development Company, L.P.