Manual Pages for UNIX Darwin command on man auto_master
MyWebUniversity

Manual Pages for UNIX Darwin command on man auto_master

AUTOMASTER(5) BSD File Formats Manual AUTOMASTER(5)

NAME

aauuttoommaasstteerr - automounter master map

DESCRIPTION

The aauuttoommaasstteerr file contains a list of the directories that are to be automounted. Associated with each directory is the name of a map that lists the locations of the filesystems to be automounted there. The default map looks like this:

#

# Automounter master map

#

+automaster # Use directory service

/net -hosts -nobrowse,nosuid

/home autohome -nobrowse

/Network/Servers -fstab

/- -static

A ``#'' is the comment character. All characters from it to the end of

line are ignored. A line beginning with ``+'' and followed by a name, indicates the name of a file or map accessible from a Directory Service source such as NIS or LDAP; the master map entries in that file or map are included at this point in the master map. A line that specifies a map to be mounted has the format:

mountpoint map -options

where mountpoint is the directory on which the map is to be mounted, map

is the name of the map to be mounted, and options is an optional, comma-

separated list of default mount options to be used by any entries in the map that do not have their own mount options. The nnoobbrroowwssee option is used on maps that have the potential to produce entries too numerous for

browsing to be practical. This option as used in the master map is dis-

tinct from nobrowse used as a Mac OS X mount option, which affects the visibility of the mount to the Finder. A map name beginning with / is the pathname of a file containing the map, otherwise the name represents a map to be found as a file in /etc or to be read from Directory Service (and thus from whatever sources Directory Service uses, such as NIS or LDAP servers). Note that, in order to get automounter maps from NIS, the "BSD Flat File and NIS" plugin must, in the Directory Utility application, be enabled and configured to "Use NIS domain for authentication". If more than one entry in the master map has the same mountpoint then all but the first are ignored. For instance, in the following master map: /shared myautoshared +automaster The /shared entry overrides any /shared specification imported from the network aauuttoommaasstteerr. AAUUTTOOMMOOUUNNTTEERR MMAAPPSS Automounter maps associate directories with the locations of filesystems that are to be mounted when the directory is accessed. Map entries have the general form: key location These map entries may be represented by lines in a file, NIS or LDAP tables indexed by the key, or from output of an executable map. Most commonly, the location is simply the name of an NFS server and the path to an exported file system, e.g. local mynfs:/export/local A location can also represent multiple mounts, where each is associated with a relative path, for example: pkg \ /data mynfs:/export/pkg/data \ /bin mynfs:/export/pkg/bin \ /man mynfs:/export/pkg/man Reference to this entry will provide access to any of three exported file systems from the server, each via its own subdirectory. Each of these

sub-mounts will be done only when referenced. Note the use of a back-

slash to escape the newline so that the automounter will read these lines as a single map entry.

The location can be preceded by a comma-separated list of mount options

with a prepended ``-''. For example:

bin -ro,nosuid mynfs:/export/bin

DDiirreecctt MMaapp A direct map associates filesystem locations directly with directories. The entry key is the full path name of a directory. For example: /usr/local eng4:/export/local /src eng4:/export/src Since the direct map as a whole isn't associated with a single directory,

it is specified in the master map with a dummy directory name of /-.

IInnddiirreecctt MMaapp

An indirect map is used where a large number of entries are to be associ-

ated with a single directory. Each map entry key is the simple name of a directory entry. A good example of this is the autohome map which determines the entries under the /home directory. For example: bill argon:/export/home/bill brent depot:/export/home/brent guy depot:/export/home/guy EExxeeccuuttaabbllee MMaapp An executable map is an indirect map represented by a file that has its execute bit set. Instead of reading entries from the file directly, the automounter executes the program or script passing the key as an argument and receiving the location string on stdout. If the automounter needs to enumerate map keys for a directory listing, it invokes the map with no

arguments and expects a newline-separated list of keys on stdout.

If an error occurs, the executable map must return a non-zero exit status

and no output. For example, a map that, when bound to an Open Directory server, has one entry for every user, with the key being the user's login name and the entry being the URL of the user's home directory, could be implemented as

#!/bin/sh

if [ $# = 0 ]; then # List keys

dscl /Search -list Users

exit fi

# Return location

homedirloc=`dscl /Search -read Users/$1 HomeDirectory`

case "$homedirloc" in

"No such key: HomeDirectory"*)

homedirloc=`dscl /Search -read Users/$1 NFSHomeDirectory`

case "$homedirloc" in

"NFSHomeDirectory: /Network/Servers/"*)

#

# NFS home directory

#

echo "$homedirloc" | sed 's;NFSHomeDirectory: /Network/Servers//]*/;1:/2;'

;; *)

#

# Unknown

#

exit 1 ;; esac ;; "HomeDirectory: smb://"*)

#

# SMB home directory

#

echo "$homedirloc" | sed -e 's;HomeDirectory: ;;' -e 's;;/;' -e 's;;;'

;; *)

#

# Unknown

#

exit 1 ;; esac (this is a simplified example; it does not handle users who do not have a network home directory, but includes them in the directory listing). SSppeecciiaall MMaappss The special maps have reserved names and are built into the automounter.

-fstab This map would normally be mounted on /Network/Servers.

The key is the host name of a server; the contents of the map entry are generated from corresponding entries in fstab(5) data (as provided by getfsent(3)) that have the net option and that specify mounts from that server. An entry of the form server:/path mountpoint fstype options 0 0 will be mounted in server/path under the mount point of the

-fstab map, using the specified fstype file system type and

the specified options. The mountpoint is ignored.

-hosts This map would normally be mounted on /net. The key is the

host name of an NFS server; the contents of the map are generated from the list of file systems exported by that server. For example, a server that exports three NFS filesystems might have an equivalent map entry of: myserv \ /export/home myserv:/export/home \ /export/local myserv:/export/local \ /export/pkg myserv:/export/pkg To access the first mount, the path would be /net/myserv/export/home if the map was associated with /net.

-null This map has no entries. It is used to disable entries

that occur later in the aauuttoommaasstteerr file. For example:

/shared -null

+automaster

The -null entry disables any /shared entry in +automaster.

-static This map is a direct map, so the mount point must be speci-

fied as /-. The contents are generated from all entries in

fstab(5) data (as provided by getfsent(3)) that do not have the net option. An fstab(5) entry of the form server:/path mountpoint fstype options rw 0 0 will generate a direct map entry of the form mountpoint options server:/path FILES /etc/automaster The master map file.

SEE ALSO

automount(8), automountd(8), autofsd(8), autofs.conf(5), fstab(5), getfsent(3), DirectoryService(8) Darwin April 20, 2007 Darwin




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™