diff --git a/usr.sbin/autofs/auto_master.5 b/usr.sbin/autofs/auto_master.5 index 30c78cc26766..4f960161859b 100644 --- a/usr.sbin/autofs/auto_master.5 +++ b/usr.sbin/autofs/auto_master.5 @@ -1,373 +1,376 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2014 The FreeBSD Foundation .\" .\" This software was developed by Edward Tomasz Napierala under sponsorship .\" from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .Dd December 27, 2023 .Dt AUTO_MASTER 5 .Os .Sh NAME .Nm auto_master .Nd autofs automounter configuration and map file format .Sh DESCRIPTION The automounter configuration consists of the .Nm configuration file, which assigns filesystem paths to map names, and maps, which contain actual mount information. The .Nm configuration file is used by the .Xr automount 8 command. Map files are read by the .Xr automountd 8 daemon. .Sh AUTO_MASTER SYNTAX The .Nm file consists of lines with two or three entries separated by whitespace and terminated by newline character: .Bd -literal -offset indent .Pa mountpoint Pa map_name Op Ar -options .Ed .Pp .Pa mountpoint is either a fully specified path, or .Li /- . When .Pa mountpoint is a full path, .Pa map_name must reference an indirect map. Otherwise, .Pa map_name must reference a direct map. See .Sx "MAP SYNTAX" below. .Pp .Pa map_name specifies map to use. If .Pa map_name begins with .Li - , it specifies a special map. See .Sx "MAP SYNTAX" below. If .Pa map_name is not a fully specified path .Pq it does not start with Li / , .Xr automountd 8 will search for that name in .Li /etc . Otherwise it will use the path as given. If the file indicated by .Pa map_name is executable, .Xr automountd 8 will assume it is an executable map. See .Sx "MAP SYNTAX" below. Otherwise, the file is opened and the contents parsed. .Pp .Pa -options is an optional field that starts with .Li - and can contain generic filesystem mount options. .Pp The following example specifies that the /etc/auto_example indirect map will be mounted on /example. .Bd -literal -offset indent /example auto_example .Ed .Sh MAP SYNTAX Map files consist of lines with a number of entries separated by whitespace and terminated by newline character: .Bd -literal -offset indent .Pa key Oo Ar -options Oc Oo Ar mountpoint Oo -options Oc Oc Ar location Op ... .Ed .Pp In most cases, it can be simplified to: .Bd -literal -offset indent .Pa key Oo Ar -options Oc Ar location .Ed .Pp .Pa key is the path component used by .Xr automountd 8 to find the right map entry to use. It is also used to form the final mountpoint. A wildcard .Pq Ql * can be used for the key. It matches every directory that does not match other keys. Those directories will not be visible to the user until accessed. .Pp The .Ar options field, if present, must begin with .Li - . When mounting the filesystem, options supplied to .Nm and options specified in the map entry are concatenated together. The special option .Li fstype is used to specify filesystem type. It is not passed to the mount program as an option. Instead, it is passed as an argument to .Cm "mount -t". The default .Li fstype is .Ql nfs . The special option .Li nobrowse is used to disable creation of top-level directories for special and executable maps. .Pp The optional .Pa mountpoint field is used to specify multiple mount points for a single key. .Pp The .Ar location field specifies the filesystem to be mounted. Ampersands .Pq Ql & in the .Ar location field are replaced with the value of .Ar key . This is typically used with wildcards, like: .Bd -literal -offset indent .Li * 192.168.1.1:/share/& .Ed .Pp The .Ar location field may contain references to variables, like: .Bd -literal -offset indent .Li sys 192.168.1.1:/sys/${OSNAME} .Ed .Pp Defined variables are: .Pp .Bl -tag -width "-OSNAME" -compact .It Li ARCH Expands to the output of .Li "uname -p" . .It Li CPU Same as ARCH. .It Li DOLLAR A literal $ sign. .It Li HOST Expands to the output of .Li "uname -n" . .It Li OSNAME Expands to the output of .Li "uname -s" . .It Li OSREL Expands to the output of .Li "uname -r" . .It Li OSVERS Expands to the output of .Li "uname -v" . .El .Pp Additional variables can be defined with the .Fl D option of .Xr automount 8 and .Xr automountd 8 . .Pp To pass a location that begins with .Li / , prefix it with a colon. For example, .Li :/dev/cd0 . .Pp This example, when put into .Pa /etc/auto_example , and with .Nm referring to the map as described above, specifies that the NFS share .Li 192.168.1.1:/share/example/x will be mounted on .Pa /example/x/ when any process attempts to access that mountpoint, with .Li intr and .Li nfsv4 mount options, described in .Xr mount_nfs 8 : .Bd -literal -offset indent .Li x -intr,nfsv4 192.168.1.1:/share/example/x .Ed .Pp Automatically mount an SMB share on access, as a guest user, without prompting for a password: .Bd -literal -offset indent .Li share -fstype=smbfs,-N ://@server/share .Ed .Pp Automatically mount the CD drive on access: .Bd -literal -offset indent .Li cd -fstype=cd9660 :/dev/cd0 .Ed .Sh SPECIAL MAPS Special maps have names beginning with .Li - . Supported special maps are: .Pp -.Bl -tag -width "-hosts" -compact +.Bl -tag -width "-noauto" -compact .It Li -hosts Query the remote NFS server and map exported shares. This map is traditionally mounted on .Pa /net . Access to files on a remote NFS server is provided through the .Pf /net/ Ar nfs-server-ip Ns / Ns Ar 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. .It Li -media Query devices that are not yet mounted, but contain valid filesystems. Generally used to access files on removable media. .It Li -noauto Mount filesystems configured in .Xr fstab 5 as "noauto". This needs to be set up as a direct map. .It Li -null Prevent .Xr automountd 8 from mounting anything on the mountpoint. .El .Pp It is possible to add custom special maps by adding them, as executable maps named .Pa special_foo , to the .Pa /etc/autofs/ directory. .Sh EXECUTABLE MAPS If the map file specified in .Nm has the execute bit set, .Xr 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. .Sh INDIRECT VERSUS DIRECT MAPS Indirect maps are referred to in .Nm 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 .Nm by entries with .Li /- as the mountpoint, and must contain only fully qualified paths as keys. For indirect maps, the final mount point is determined by concatenating the .Nm 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. .Pp The example above could be rewritten using direct map, by placing this in .Nm : .Bd -literal -offset indent .Li /- auto_example .Ed .Pp and this in .Li /etc/auto_example map file: .Bd -literal -offset indent .Li /example/x -intr,nfsv4 192.168.1.1:/share/example/x .Li /example/share -fstype=smbfs,-N ://@server/share .Li /example/cd -fstype=cd9660 :/dev/cd0 .Ed .Sh DIRECTORY SERVICES Both .Nm and maps may contain entries consisting of a plus sign and map name: .Bd -literal -offset indent .Li +auto_master .Ed .Pp Those entries cause .Xr automountd 8 daemon to retrieve the named map from directory services (like LDAP) and include it where the entry was. .Pp If the file containing the map referenced in .Nm is not found, the map will be retrieved from directory services instead. .Pp To retrieve entries from directory services, .Xr automountd 8 daemon runs .Pa /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 .Nm or automounter map syntax to standard output. An example script to use LDAP is included in .Pa /etc/autofs/include_ldap . It can be symlinked to .Pa /etc/autofs/include . .Sh FILES .Bl -tag -width ".Pa /etc/auto_master" -compact .It Pa /etc/auto_master The default location of the .Pa auto_master file. .It Pa /etc/autofs/ Directory containing shell scripts to implement special maps and directory services. .El .Sh SEE ALSO .Xr autofs 4 , .Xr automount 8 , .Xr automountd 8 , .Xr autounmountd 8 .Sh AUTHORS The .Nm configuration file functionality was developed by .An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org under sponsorship from the FreeBSD Foundation. diff --git a/usr.sbin/autofs/automount.8 b/usr.sbin/autofs/automount.8 index 953b3c265178..83ff1cd61709 100644 --- a/usr.sbin/autofs/automount.8 +++ b/usr.sbin/autofs/automount.8 @@ -1,108 +1,111 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2014 The FreeBSD Foundation .\" .\" This software was developed by Edward Tomasz Napierala under sponsorship .\" from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .Dd November 22, 2014 .Dt AUTOMOUNT 8 .Os .Sh NAME .Nm automount .Nd update autofs mounts .Sh SYNOPSIS .Nm .Op Fl D Ar name=value .Op Fl L .Op Fl c .Op Fl f .Op Fl o Ar options .Op Fl v .Op Fl u .Sh DESCRIPTION When called without options, the .Nm command parses the .Xr auto_master 5 configuration file and any direct maps that it references, and mounts or unmounts .Xr autofs 4 filesystems to match. These options are available: -.Bl -tag -width ".Fl v" +.Bl -tag -width "-D" .It Fl D Define a variable. It is only useful with .Fl L . .It Fl L Do not mount or unmount anything. Instead parse .Xr auto_master 5 and any direct maps, then print them to standard output. When specified more than once, all the maps, including indirect ones, will be parsed and shown. This is useful when debugging configuration problems. .It Fl c Flush caches, discarding possibly stale information obtained from maps and directory services. .It Fl f Force unmount, to be used with .Fl u . .It Fl o Specify mount options to be used along with the ones specified in the maps. It is only useful with .Fl L . .It Fl u Try to unmount filesystems mounted by .Xr automountd 8 . .Xr autofs 4 mounts are not unmounted. To unmount all .Xr autofs 4 mounts, use .Cm "umount -At autofs". .It Fl v Increase verbosity. .El .Sh EXIT STATUS .Ex -std .Sh EXAMPLES Unmount all filesystems mounted by .Xr automountd 8 : .Dl Nm Fl u .Sh SEE ALSO .Xr autofs 4 , .Xr auto_master 5 , .Xr automountd 8 , .Xr autounmountd 8 .Sh HISTORY The .Nm command appeared in .Fx 10.1 . .Sh AUTHORS The .Nm was developed by .An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org under sponsorship from the FreeBSD Foundation. diff --git a/usr.sbin/autofs/automountd.8 b/usr.sbin/autofs/automountd.8 index 0384fe2e7ed2..1a790fa52414 100644 --- a/usr.sbin/autofs/automountd.8 +++ b/usr.sbin/autofs/automountd.8 @@ -1,100 +1,103 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2014 The FreeBSD Foundation .\" .\" This software was developed by Edward Tomasz Napierala under sponsorship .\" from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .Dd March 10, 2015 .Dt AUTOMOUNTD 8 .Os .Sh NAME .Nm automountd .Nd daemon handling autofs mount requests .Sh SYNOPSIS .Nm .Op Fl D Ar name=value .Op Fl i .Op Fl m Ar maxproc .Op Fl o Ar options .Op Fl d .Op Fl v .Sh DESCRIPTION The .Nm daemon is responsible for handling .Xr autofs 4 mount requests, parsing maps, and mounting filesystems they specify. On startup, .Nm forks into background and waits for kernel requests. When a request is received, .Nm forks a child process. The child process parses the appropriate map and mounts filesystems accordingly. Then it signals the kernel to release blocked processes that were waiting for the mount. -.Bl -tag -width ".Fl v" +.Bl -tag -width "-m maxproc" .It Fl D Define a variable. .It Fl i For indirect mounts, only create subdirectories if there are no wildcard entries. Without .Fl i , .Nm creates all the subdirectories it can. Users may not realize that the wildcard map entry makes it possible to access directories that have not yet been created. .It Fl m Ar maxproc Limit the number of forked .Nm processes, and thus the number of mount requests being handled in parallel. The default is 30. .It Fl d Debug mode: increase verbosity and do not daemonize. .It Fl o Ar options Specify mount options. Options specified here will be overridden by options entered in maps or .Xr auto_master 5 . .It Fl v Increase verbosity. .El .Sh EXIT STATUS .Ex -std .Sh SEE ALSO .Xr autofs 4 , .Xr auto_master 5 , .Xr automount 8 , .Xr autounmountd 8 .Sh HISTORY The .Nm daemon appeared in .Fx 10.1 . .Sh AUTHORS The .Nm was developed by .An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org under sponsorship from the FreeBSD Foundation. diff --git a/usr.sbin/autofs/autounmountd.8 b/usr.sbin/autofs/autounmountd.8 index 69b4565703e6..582e0d36b214 100644 --- a/usr.sbin/autofs/autounmountd.8 +++ b/usr.sbin/autofs/autounmountd.8 @@ -1,85 +1,88 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2014 The FreeBSD Foundation .\" .\" This software was developed by Edward Tomasz Napierala under sponsorship .\" from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .Dd December 13, 2014 .Dt AUTOUNMOUNTD 8 .Os .Sh NAME .Nm autounmountd .Nd daemon unmounting automounted filesystems .Sh SYNOPSIS .Nm .Op Fl d .Op Fl r Ar time .Op Fl t Ar time .Op Fl v .Sh DESCRIPTION The .Nm daemon is responsible for unmounting filesystems mounted by .Xr automountd 8 . On startup, .Nm retrieves a list of filesystems that have the .Li automounted mount option set. The list is updated every time a filesystem is mounted or unmounted. After a specified time passes, .Nm attempts to unmount a filesystem, retrying after some time if necessary. .Pp These options are available: -.Bl -tag -width ".Fl v" +.Bl -tag -width "-d" .It Fl d Debug mode: increase verbosity and do not daemonize. .It Fl r Number of seconds to wait before trying to unmount an expired filesystem after a previous attempt failed, possibly due to filesystem being busy. The default value is 600, or ten minutes. .It Fl t Number of seconds to wait before trying to unmount a filesystem. The default value is 600, or ten minutes. .It Fl v Increase verbosity. .El .Sh EXIT STATUS .Ex -std .Sh SEE ALSO .Xr auto_master 5 , .Xr autofs 5 , .Xr automount 8 , .Xr automountd 8 .Sh HISTORY The .Nm daemon appeared in .Fx 10.1 . .Sh AUTHORS The .Nm was developed by .An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org under sponsorship from the FreeBSD Foundation.