формат карт автомонтирования (Format of the automounter maps)
AMD FORMAT
This is a description of the text file format. Other methods of
specifying mount map entries may be required for different map
sources. All empty lines or lines beginning with # are ignored.
The basic format of one line in such maps is:
key location-list
key
A key is a path (or a single path component alone) that
may end in the wildcard key, "*", or the wildcard key
alone and must not begin with the "/" character.
location-list
Following the key is a mount location-list.
A location-list list has the following syntax:
location[ location[ ... ]] [|| location[ location[ ... ]]
A mount location-list can use the cut operator, ||, to specify
locations that should be tried if none of the locations to the
left of it where selected for a mount attempt.
A mount location consists of an optional colon separated list of
selectors, followed by a colon separated list of option:=value
pairs.
The selectors that may be used return a value or boolean result.
Those that return a value may be to used with the comparison
operators == and != and those that return a boolean result may be
negated with the !.
For a location to be selected for a mount attempt all of its
selectors must evaluate to true. If a location is selected for a
mount attempt and succeeds the lookup is completed and returns
success. If the mount attempt fails the procedure continues with
the next location until they have all been tried.
In addition, some selectors take no arguments, some one argument
and others optionally take two arguments.
The selectors that take no arguments are:
arch
The machine architecture which, if not set in the
configuration, is obtained using uname(2).
karch
The machine kernel architecture which, if not set
in the configuration, is obtained using uname(2).
os
The operating system name, if not set in the
configuration, is obtained using uname(2).
osver
The operating system version, if not set in the
configuration, is obtained using uname(2).
full_os
The full operating system name, if not set in the
configuration this selector has no value.
vendor
The operating system vendor name, if not set in the
configuration this selector has the value
"unknown".
byte
The endianness of the hardware.
cluster
The name of the local cluster. It has a value only
if it is set in the configuration.
autodir
The base path under which external mounts are done
if they are needed. Most mounts are done in place
but some can't be and this is the base path under
which those mounts will be done.
domain
The local domain name. It is set to the value of
the configuration option sub_domain. If sub_domain
is not given in the configuration it is set to the
domain part of the local host name, as given by
gethostname(2).
host
The local host name, without the domain part, as
given by gethostname(2).
hostd
The full host name. If sub_domain is given in the
configuration this is set to the contatenation of
host and sub_domain deperated by a .. If sub_domain
is not set in the configuration the value of domain
is used instead of sub_domain.
uid
The numeric value of the uid of the user that first
requested the mount. Note this is usual the same as
that used by amd but can be different within
autofs.
gid
The numeric value of the gid of the user that first
requested the mount. Note this is usual the same as
that used by amd but can be different within
autofs.
key
The string value of the key being looked up.
map
The string value of the map name used to lookup
keys.
path
The string value of the full path to the mount
being requested.
dollar
Evaluates to the string "$".
The selectors that take one argument are:
in_network(network) , network(network) ,
netnumber(network) , wire(network)
These selectors are all the same. in_network() is
the preferred usage. The network argument is an
address (which may include a subnet mask) or
network name. The function compares network against
each interface and returns true if network belongs
to the network the interface is connected to.
xhost(hostname)
The xhost() selector compares hostname to the
${host} and if it doesn't match it attempts to
lookup the cannonical name of hostname and compares
it to {host} as well.
exists(filename)
Returns true if filename exits as determined by
lstat(2).
true()
Evaluates to true, the argument is ignored and may
be empty.
false()
Evaluates to false, the argument is ignored and may
be empty.
The selectors that take up to two arguments are:
netgrp(netgroup[,hostname])
The netgrp() selector returns true if hostname is a
member of the netgroup netgroup. If hostname is not
given ${host} is used for the comparison.
netgrpd(netgroup[,hostname])
The netgrpd()i selector behaves the same as
netgrp() except that if hostname is not given
${hostd}, the fully qualified hostname, is used
instead of ${host}.
The options that may be used are:
type
This is the mount filesystem type. It can have a
value of auto, link, linkx, host, lofs, ext2-4,
xfs, nfs, nfsl or cdfs. Other types that are not
yet implemented or are not available in autofs are
nfsx, lustre, jfs, program, cachefs and direct.
maptype
The maptype option specifies the type of the map
source and can have a value of file, nis, nisplus,
exec, ldap or hesiod. Map sources either not yet
implemented or not available in autofs are sss,
ndbm, passwd and union.
fs
The option fs is used to specify the local
filesystem. The meaning of this option (and whether
or not it is used) is dependent on the mount
filesystem type.
rhost
The remote host name for network mount requests.
rfs
The remote host filesystem path for network mount
requests.
dev
Must resolve to the device file for local device
mount requests.
sublink
The sublink option is used to specify a
subdirectory within the mount location to which
this entry will point.
pref
The pref option is used to specify a prefix that is
prepended to the lookup key before looking up the
map entry key.
opts
The opts option is used to specify mount options to
be used for the mount. If a "-" is given it is
ignored. Options that may be used are dependend on
the mount filesystem.
addopts
The addopts option is used to specify additional
mount options used in addition to the default mount
options for the mount location.
remopts
The addopts option is used to specify mount options
used instead the options given in opts when the
mount location is on a remote retwork.
A number of options aren't available or aren't yet implemented
within autofs, these are:
cache
The cache option isn't used by autofs. The map
entry cache is continually updated and stale
entries cleaned on re-load when map changes are
detected so these configuration entries are not
used. The regex map key matching is not
implemented and may not be due to the potential
overhead of the full map scans needed on every key
lookup.
cachedir
The cachefs filesystem is not available on Linux, a
different implementation is used for caching
network mounted file systems.
mount , unmount , umount
These options are used by the amd program mount
type which is not yet implemented.
delay
This option is not used by the autofs
implementation and is ignored.