Managing NFS and NIS, 2nd Edition - Mike Eisler [117]
automountd
A daemon that handles requests from the in-kernel autofs filesystem to mount and unmount filesystems.
Each program has several command-line options.
Automount command-line options
-t time
This is the time, in seconds, to wait before attempting to unmount a quiescent filesystem. The default is 600 seconds, but this value may need to be adjusted to accommodate various client usage patterns as described in Section 9.2.4.
-v
If set, this option prints out any new autofs mounts or unmounts. The automount command will perform a mount for each new direct and indirect map, and will perform an unmount for each map no longer listed in the master map or any of its submaps.
Automountd command-line options
-T
Turns on NFS call tracing, so the user sees the expansion of NFS calls handled by the automounter. If this option is used for debugging, then the standard output and standard error of the automounter daemon should be redirected to a file from its invocation in /etc/init/autofs:
/usr/lib/autofs/automountd -T > /tmp/auto_nfscalls
2&1
Excerpt from /tmp/auto_nfscalls
t8 LOOKUP REQUEST: Tue Sep 28 10:39:36 1999
t8 name=news[] map=auto.tools opts=intr,nosuid path=/tools direct=0
t8 LOOKUP REPLY : status=0
t1 MOUNT REQUEST: Tue Sep 28 10:39:36 1999
t1 name=news[] map=auto.tools opts=intr,nosuid path=/tools direct=0
t1 MOUNT REPLY : status=0, AUTOFS_DONE
In this example, the automounter daemon was asked by autofs to look up the directory news. It returned a status structure indicating that the daemon is requesting an NFS mount. The autofs filesystem then asked the daemon to perform the NFS mount, and the automounter returned a successful status. The prefixes t8 and t1 indicate the thread in the automounter daemon that did the operation.
-v
Turns on a verbose mode that logs status messages to the console.
-n
Turns off browsing of indirect maps.
-D var=value
Assigns the value to the variable var within the automounter's environment. Section 9.4.2 contains more information on variable substitutions within automounter maps.
The null map
The automounter also has a map "white-out" feature, via the -null special map. It is used after a directory to effectively delete any map entry affecting that directory from the automounter's set of maps. It must precede the map entry being deleted. For example:
/tools -null
This feature is used to override auto_master or direct map entries that may have been inherited from an NIS map. If you need to make per-machine changes to the automounter maps, or if you need local control over a mount point managed by the automounter, white-out the conflicting map entry with the -null map.
Tuning timeout values
When a filesystem has remained quiescent for some time, it is a candidate for unmounting. If the filesystem is busy, the attempts to unmount it will fail until the last open files and directories are closed. If an unmount attempt fails, the automounter tries it again later. However, it is difficult for the automounter to know if the filesystem is in fact in use. The simplest way to find out is to attempt to unmount it. So every ten minutes (or the period specified with the -t flag to automount) the automounter attempts to unmount every mounted filesystem.
There are two situations in which increasing the default unmount timeout period improves performance of the automounter:
When client processes keep files open for more than ten minutes
When one or more processes requiring automounted filesystems run regularly, with periods greater than the default timeout
When the automounter attempts to unmount a filesystem, it either succeeds, or the one or more open files from one or more processes cause the umount( ) call to return EBUSY. If there are several filesystems used by processes that behave in this fashion, then the automounter wastes numerous umount( ) system calls. The cost isn't just the overhead of checking to see if a filesystem is in use. There are several caches that hold references on the