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
Enhanced AutoFS Administrator's Guide: HP-UX 11i v1 > Chapter 3 Configuring and Administering AutoFS

Executable Maps

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

An executable map has its entries generated dynamically by a program or a script. AutoFS determines whether a map is executable by checking whether the execute bit is set in its permissions string. If a map is not executable, make sure its execute bit is not set.

When the AutoFS daemon locates a map and detects that its execute bit is set, then instead of opening the file and searching for an entry, the AutoFS daemon executes the file as a program and passes the key to be located within the map as an argument. The executable AutoFS map returns a map entry on the standard output. If they cannot supply a map entry for the key, they should return nothing. You can list executable AutoFS maps in the master map or include them in local AutoFS map files.

For example, the following executable map, implemented as a shell script, emulates the AutoFS built-in -hosts map for /net. It obtains a list of exported file systems from an NFS server (its name given as the key argument), formats the path names into a multiple-mount map entry, and sorts the list to order the mounts correctly into a top-down hierarchy:

# ! /bin/sh
Server=$1 
showmount -e $1 | awk ‘{print $1 “\t’$Server’: $1 “\\”} | sort
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2004 Hewlett-Packard Development Company, L.P.