.Dd March 9, 1998 .Dt AUTOMOUNT 8 .Sh NAME .Nm automount .Nd automatic server mount / unmount daemon .Sh SYNOPSIS .Nm .Op Fl V .Op Fl d .Op Fl D Ar type .Op Fl 1 .Op Fl tm Ar secs .Op Fl tl Ar secs .Op Fl s .Op Fl tcp .Op Fl m Ar directory map Fl mnt Ar directory .Ar ... .Sh DESCRIPTION .Nm is a daemon that automatically mounts network filesystems when they are first accessed and later unmounts them when they are idle. .Pp .Nm creates a virtual filesystem mounted at one or more places in the client's file and directory hierarchy. Potential server mount points within this virtual filesystem appear as symbolic links. Reading a symbolic link causes .Nm to mount the associated remote filesystem in a separate hierarchy and to return the path to the real mount point as the target of the symlink. .Pp To make the "trigger" symbolic links used by .Nm distinguishable from normal symbolic links, the sticky bit is set in the mode flags for the link. Programs which would normally traverse symbolic links can test for this bit and avoid triggering the mount. Various parts of the system, including .Xr ls 1 , have been modified in this way. .Pp Each virtual filesystem created by .Nm is governed by a corresponding map. One or more maps and the location in the hierarchy where they are to appear may be specified on the command line with .Fl m and .Fl mnt : .Bd -literal -offset indent .Fl m Ar directory map .Ed .Pp is followed by a specification of the private mount directory where the actual mounts are to be established: .Bd -literal -offset indent .Fl mnt Ar actual_root .Ed .Pp Each .Ar map Ns 's hierarchy is rooted at the .Ar directory specified. .I .Sh FILE MAPS A map may be file or a special map. A file map is a file containing a list of entries of the form: .Pp location mount_options server:path .Pp mount_options must be a comma-separated list of options drawn from the options known to .Xr mount 8 and .Xr mount_nfs 8 . .Nm will automatically make available at the map's mount point the directory specified by server:path (as a symlink). When the symlink is traversed, it will mount the server in the directory specified with .Fl mnt and return the real mount point as the result of the symlink resolution. .Sh SPECIAL MAPS In addition to reading files specifying mount maps, .Nm supports the .Dq -fstab , .Dq -static , and .Dq -nsl maps. The .Dq -fstab and .Dq -static maps are derived from .Xr fstab 5 data (as provided by .Xr getfsent 3 Ns ). .Pp All mounts in .Xr fstab 5 without the .Dq net .\" net is not yet documented in fstab(5) option will be made to appear at the .Xr fstab 5 Ns -specified location in the form of a symlink into the directory where the .Dq -static map is actually mounted (itself a directory of symlinks). For example, the entry: .Pp server:/Network/Applications /Network/Applications nfs nosuid 0 0 .Pp and automount invocation .Pp automount -m /automount/static -static -mnt /private/var/automount .Pp result in a non-trigger symlink /Network/Applications pointing to /automount/static/Network/Applications which, when traversed, causes server:/Network/Applications to be mounted on /private/var/automount/Network/Applications (which would then be returned from reading the link). .Pp All mounts with the .Dq net option will be mounted within the .Dq -fstab map's filesystem using a path of the form: .Pp server/path .Pp For such mounts, the path specified in the .Xr fstab 5 entry will be ignored. For example, if the .Xr fstab 5 database contained an entry for .Pp polaris:/Library/Fonts .Pp and .Nm was started as follows: .Pp automount -m /Useful -fstab -mnt /private/Useful .Pp then a symlink would appear in /Useful, /Useful/polaris/Library/Fonts, and link to /private/Useful/polaris/Library/Fonts where the filesystem is actually mounted when the symlink is traversed. .Pp The .Dq -nsl map generates its filesystem hierarchy from information generated by NSL. NSL "neighborhoods" are presented as directories, populated by server entries. .\" link to NSL documentation? .Pp Accessing servers in the NSL hierarchy may prompt the user for authentication. .I .Sh OPTIONS .Bl -tag -width Ds .It Fl V Print version and host information, then quit .It Fl m Ar directory map Associate the specified .Ar map with the given .Ar directory. The directory will be created if it doesn't exist. .Ar map may be the name of a file, or it may be the name of a special map. See the FILE MAPS and SPECIAL MAPS sections above. .It Fl d Run .Nm in debug mode. The program remains in the foreground and sends debugging information to standard output. .It Fl D Ar type Log debug messages for .Ar type . .Ar type may be "mount", "proc", "mount", "select", "options", "nsl", or "all". Multiple .Fl D options may be specified. .It Fl 1 (The numeric digit .Dq one . ) Modifies the .Dq -fstab and .Dq -static maps to do mounts "one at a time", when an actual mount point is traversed rather than mounting all mounts from a given server when the first of its mounts is referenced and mounted. .It Fl tm Ar secs Set the timeout for NFS mounts to .Ar secs seconds. The default value is 20 seconds. The "mnttimeo=n" mount option overrides this default. .Pp .It Fl tl Ar secs Set the time-to-live for NFS mounts to .Ar secs seconds. The default value is 3600 seconds. The "ttl=n" mount option overrides this default. .Pp .Nm periodically checks all its mounted filesystems. If it finds any filesystems that have been idle for their associated time-to-live value, it will attempt to unmount them. An unmount will only be successful if there are no processes with open files in that filesystem. Unless .Fl 1 is specified, if one or more mounts from a given server are found to be active, any mounts from that server that were successfully unmounted will be immeadiately remounted. .Pp Supplying a ttl value of 0 will disable this behavior and allow servers to remain mounted forever. .It Fl s Force all mounts at startup and never expire any mounts. .It Fl tcp Mount servers using TCP if possible, otherwise using UDP (the default is to try UDP first, then TCP). Per .Xr mount_nfs 8 , "-T", "TCP", or "tcp" mount options have the same effect as specifying .Fl tcp ; "-U", "UDP", or "udp" mount options force the default behavior of trying UDP first even if .Fl tcp is specified. .Pp .El .Sh SEE ALSO .Xr mount 8 , .Xr mount_nfs 8