|ARCH||Expands to the output of uname -p.|
|CPU||Same as ARCH.|
|HOST||Expands to the output of uname -n.|
|OSNAME||Expands to the output of uname -s.|
|OSREL||Expands to the output of uname -r.|
|OSVERS||Expands to the output of uname -v.|
To pass a location that begins with /, prefix it with a colon. For example, :/dev/cd0.
This example, when put into /etc/auto_example, and with auto_master referring to the map as described above, specifies that the NFS share 192.168.1.1:/share/example/x will be mounted on /example/x/ when any process attempts to access that mountpoint, with intr and nfsv4 mount options, described in mount_nfs(8):
x -intr,nfsv4 192.168.1.1:/share/example/x
Automatically mount an SMB share on access, as a guest user, without prompting for a password:
share -fstype=smbfs,-N ://@server/share
Automatically mount the CD drive on access:
cd -fstype=cd9660 :/dev/cd0
Special maps have names beginning with -. Supported special maps are:
-hosts Query the remote NFS server and map exported shares. This map is traditionally mounted on /net. Access to files on a remote NFS server is provided through the /net/ nfs-server-ip / share-name Ns/ directory without any additional configuration. Directories for individual NFS servers are not present until the first access, when they are automatically created. -media Query devices that are not yet mounted, but contain valid filesystems. Generally used to access files on removable media. -noauto Mount filesystems configured in fstab(5) as "noauto". This needs to be set up as a direct map. -null Prevent automountd(8) from mounting anything on the mountpoint.
It is possible to add custom special maps by adding them, as executable maps named special_foo, to the /etc/autofs/ directory.
If the map file specified in auto_master has the execute bit set, automountd(8) will execute it and parse the standard output instead of parsing the file contents. When called without command line arguments, the executable is expected to output a list of available map keys separated by newline characters. Otherwise, the executable will be called with a key name as a command line argument. Output from the executable is expected to be the entry for that key, not including the key itself.
Indirect maps are referred to in auto_master by entries with a fully qualified path as a mount point, and must contain only relative paths as keys. Direct maps are referred to in auto_master by entries with /- as the mountpoint, and must contain only fully qualified paths as keys. For indirect maps, the final mount point is determined by concatenating the auto_master mountpoint with the map entry key and optional map entry mountpoint. For direct maps, the final mount point is determined by concatenating the map entry key with the optional map entry mountpoint.
The example above could be rewritten using direct map, by placing this in auto_master:/- auto_example
and this in /etc/auto_example map file:/example/x -intr,nfsv4 192.168.1.1:/share/example/x /example/share -fstype=smbfs,-N ://@server/share /example/cd -fstype=cd9660 :/dev/cd0
Both auto_master and maps may contain entries consisting of a plus sign and map name:+auto_master
Those entries cause automountd(8) daemon to retrieve the named map from directory services (like LDAP) and include it where the entry was.
If the file containing the map referenced in auto_master is not found, the map will be retrieved from directory services instead.
To retrieve entries from directory services, automountd(8) daemon runs /etc/autofs/include, which is usually a shell script, with map name as the only command line parameter. The script should output entries formatted according to auto_master or automounter map syntax to standard output. An example script to use LDAP is included in /etc/autofs/include_ldap. It can be symlinked to /etc/autofs/include.
/etc/auto_master The default location of the auto_master file. /etc/autofs/ Directory containing shell scripts to implement special maps and directory services.
autofs(5), automount(8), automountd(8), autounmountd(8)
The auto_master configuration file functionality was developed by
.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org under sponsorship from the FreeBSD Foundation.