NFS Services Administrator's Guide (B.11.31.05) September 2009

Turning Off an AutoFS Map Using the -null Map
To turn off a map using the -null map, follow these steps:
1. Add a line with the following syntax in the AutoFS master map:
local_directory -null
2. If AutoFS is running, enter the following command on each client that uses the map, to force
AutoFS to reread its maps:
/usr/sbin/automount
This enables AutoFS to ignore the map entry that does not apply to your host.
Notes on the -null Map
The -null map is used to ignore mapping entries that do not apply to your host, but which
would otherwise be inherited from the NIS or LDAP maps.
The -null option causes AutoFS to ignore AutoFS map entries that affect the specified directory.
For example, an NIS (or LDAP) auto_master map is configured such that AutoFS mounts the
auto_home map on /home, as follows:
/home auto_home
You can include the following line in the /etc/auto_master file, before the +auto_master
entry, so that the NIS auto_home map is not used for the system:
/home -null
+auto_master
NOTE: The -null entry must precede the included map entry to be effective.
Using Executable Maps
An executable map is a map whose entries are 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, ensure that its execute bit is not set. An
executable map is an indirect map.
When the AutoFS daemon locates a map whose execute bit is set, then instead of opening the
file and searching for an entry, the daemon executes the file as a program and passes the key to
be located within the map as an argument. Executable AutoFS maps return a map entry on the
standard output. If they cannot supply a map entry for the key, they do not return anything.
You can list executable AutoFS maps in the master map or include them in the local AutoFS map
files. However, executable maps cannot be used with NIS and LDAP.
For example, an 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 is
the key argument). It then formats the path names into a multiple-mount map entry and sorts
the list to order the mounts correctly into a top-down hierarchy, as follows:
!/bin/sh
Server=$1
showmount -e $1 | awk NR > 1 {print $1 \t'$Server: $1 \\ } | sort
Advanced AutoFS Administration
This section presents advanced AutoFS concepts that enable you to improve mounting efficiency
and also help make map building easier. This section addresses:
Automounting Multiple Directories (Hierarchical Mounts)” (page 72)
“Configuring Replicated Servers for an AutoFS Directory” (page 72)
Advanced AutoFS Administration 71