[Top] [Contents] [Index] [ ? ]

Am-utils (4.4BSD Automounter Utilities)

Am-utils (4.4BSD Automounter Utilities) User Manual
For version 6.2a3, 27 November 2006

Erez Zadok
(Originally by Jan-Simon Pendry and Nick Williams)

Copyright © 1997-2006 Erez Zadok
Copyright © 1989 Jan-Simon Pendry
Copyright © 1989 Imperial College of Science, Technology & Medicine
Copyright © 1989 The Regents of the University of California.
All Rights Reserved.

Permission to copy this document, or any portion of it, as necessary for use of this software is granted provided this copyright notice and statement of permission are included.

Am-utils is the 4.4BSD Automounter Tool Suite, which includes the Amd automounter, the Amq query and control program, the Hlfsd daemon, and other tools. This Info file describes how to use and understand the tools within Am-utils.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

License

Am-utils is not in the public domain; it is copyrighted and there are restrictions on its distribution.

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.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgment:

    "This product includes software developed by the University of California, Berkeley and its contributors, as well as the Trustees of Columbia University."

  4. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Source Distribution

The Am-utils home page is located in

 
http://www.am-utils.org/

You can get the latest distribution version of Am-utils from

 
ftp://ftp.am-utils.org/pub/am-utils/am-utils.tar.gz

Additional alpha, beta, and release distributions are available in

 
ftp://ftp.am-utils.org/pub/am-utils/.

Revision 5.2 was part of the 4.3BSD Reno distribution.

Revision 5.3bsdnet, a late alpha version of 5.3, was part of the BSD network version 2 distribution

Revision 6.0 was made independently by Erez Zadok at the Computer Science Department of Columbia University, as part of his PhD thesis work. Am-utils (especially version 6.1) continues to be developed and maintained at the Computer Science Department of Stony Brook University, as a service to the user community.

See section History, for more details.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Getting Additional Information


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Bug Reports

Before reporting a bug, see if it is a known one in the bugs file.

If you find a problem and hopefully you can reproduce it, please describe it in detail and submit a bug report via Bugzilla. Alternatively, you can send your bug report to the "am-utils" list (see http://www.am-utils.org/ under "Mailing Lists") quoting the details of the release and your configuration. These details can be obtained by running the command `amd -v'. It would greatly help if you could provide a reproducible procedure for detecting the bug you are reporting.

Providing working patches is highly encouraged. Every patch incorporated, however small, will get its author an honorable mention in the authors file.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Mailing Lists

There are several mailing lists for people interested in keeping up-to-date with developments.

  1. The users mailing list, `am-utils' is for

    To subscribe, visit http://www.am-utils.org/ under "Mailing Lists." After subscribing, you can post a message to this list. To avoid as much spam as possible, only subscribers to this list may post to it.

    Subscribers of `am-utils' are most helpful if they have the time and resources to test new and development versions of amd, on as many different platforms as possible. They should also be prepared to learn and use the GNU Autoconf, Automake, and Libtool packages, as needed; and of course, become familiar with the complex code in the am-utils package. In other words, subscribers on this list should hopefully be able to contribute meaningfully to the development of amd.

    Note that this `am-utils' list used to be called `amd-dev' before January 1st, 2004. Please use the new name, `am-utils'.

  2. The announcements mailing list, `am-utils-announce' is for announcements only (mostly new releases). To subscribe, visit http://www.am-utils.org/ under "Mailing Lists." This list is read-only: only am-utils developers may post to it.
  3. We distribute nightly CVS snapshots in ftp://ftp.am-utils.org/pub/am-utils/snapshots/daily/. If you like to get email notices of commits to the am-utils CVS repository, subscribe to the CVS logs mailing list, `am-utils-cvs' at http://www.am-utils.org/ under "Mailing Lists."
  4. The older list which was used to user discussions, `amd-workers', is defunct as of January 2004. (Its last address was amd-workers AT majordomo.glue.umd.edu.) Don't use `amd-workers': use the newer, more active `am-utils' list.
  5. For completeness, there's a developers-only closed list called `am-utils-developers' (see http://www.am-utils.org/ under "Mailing Lists").

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Am-utils Book

Erez Zadok wrote a book, titled Linux NFS and Automounter Administration, ISBN 0-7821-2739-8, (Sybex, 2001). The book is full of details and examples that go beyond what this manual has. The book also covers NFS in great detail. Although the book is geared toward Linux users, it is general enough for any Unix administrator and contains specific sections for non-Linux systems.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Introduction

An automounter maintains a cache of mounted filesystems. Filesystems are mounted on demand when they are first referenced, and unmounted after a period of inactivity.

Amd may be used as a replacement for Sun's automounter. The choice of which filesystem to mount can be controlled dynamically with selectors. Selectors allow decisions of the form "hostname is this," or "architecture is not that." Selectors may be combined arbitrarily. Amd also supports a variety of filesystem types, including NFS, UFS and the novel program filesystem. The combination of selectors and multiple filesystem types allows identical configuration files to be used on all machines thus reducing the administrative overhead.

Amd ensures that it will not hang if a remote server goes down. Moreover, Amd can determine when a remote server has become inaccessible and then mount replacement filesystems as and when they become available.

Amd contains no proprietary source code and has been ported to numerous flavors of Unix.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

History

The Amd package has been without an official maintainer since 1992. Several people have stepped in to maintain it unofficially. Most notable were the `upl' (Unofficial Patch Level) releases of Amd, created by me (Erez Zadok), and available from ftp://ftp.am-utils.org/pub/amd/. The last such unofficial release was `upl102'.

Through the process of patching and aging, it was becoming more and more apparent that Amd was in much need of revitalizing. Maintaining Amd had become a difficult task. I took it upon myself to cleanup the code, so that it would be easier to port to new platforms, add new features, keep up with the many new feature requests, and deal with the never ending stream of bug reports.

I have been working on such a release of Amd on and off since January of 1996. The new suite of tools is currently named "am-utils" (AutoMounter Utilities), in line with GNU naming conventions, befitting the contents of the package. In October of 1996 I had received enough offers to help me with this task that I decided to make a mailing list for this group of people. Around the same time, Amd had become a necessary part of my PhD thesis work, resulting in more work performed on am-utils.

Am-utils version 6.0 was numbered with a major new release number to distinguish it from the last official release of Amd (5.x). Many new features have been added such as a GNU configure system, NFS Version 3, a run-time configuration file (`amd.conf'), many new ports, more scripts and programs, as well as numerous bug fixes. Another reason for the new major release number was to alert users of am-utils that user-visible interfaces may have changed. In order to make Amd work well for the next 10 years, and be easier to maintain, it was necessary to remove old or unused features, change various syntax files, etc. However, great care was taken to ensure the maximum possible backwards compatibility.

Am-utils version 6.1 has autofs support for Linux and Solaris 2.5+ as the major new feature, in addition to several other minor new features. The autofs support is completely transparent to the end-user, aside from the fact that /bin/pwd now always returns the correct amd-ified path. The administrator can easily switch between NFS and autofs mounts by changing one parameter in amd.conf. Autofs support and maintenance was developed in conjunction with Ion Badulescu.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1. Overview

Amd maintains a cache of mounted filesystems. Filesystems are demand-mounted when they are first referenced, and unmounted after a period of inactivity. Amd may be used as a replacement for Sun's automount(8) program. It contains no proprietary source code and has been ported to numerous flavors of Unix. See section Supported Platforms.

Amd was designed as the basis for experimenting with filesystem layout and management. Although Amd has many direct applications it is loaded with additional features which have little practical use. At some point the infrequently used components may be removed to streamline the production system.

Amd supports the notion of replicated filesystems by evaluating each member of a list of possible filesystem locations one by one. Amd checks that each cached mapping remains valid. Should a mapping be lost - such as happens when a fileserver goes down - Amd automatically selects a replacement should one be available.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.1 Fundamentals

The fundamental concept behind Amd is the ability to separate the name used to refer to a file from the name used to refer to its physical storage location. This allows the same files to be accessed with the same name regardless of where in the network the name is used. This is very different from placing `/n/hostname' in front of the pathname since that includes location dependent information which may change if files are moved to another machine.

By placing the required mappings in a centrally administered database, filesystems can be re-organized without requiring changes to configuration files, shell scripts and so on.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.2 Filesystems and Volumes

Amd views the world as a set of fileservers, each containing one or more filesystems where each filesystem contains one or more volumes. Here the term volume is used to refer to a coherent set of files such as a user's home directory or a TeX distribution.

In order to access the contents of a volume, Amd must be told in which filesystem the volume resides and which host owns the filesystem. By default the host is assumed to be local and the volume is assumed to be the entire filesystem. If a filesystem contains more than one volume, then a sublink is used to refer to the sub-directory within the filesystem where the volume can be found.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.3 Volume Naming

Volume names are defined to be unique across the entire network. A volume name is the pathname to the volume's root as known by the users of that volume. Since this name uniquely identifies the volume contents, all volumes can be named and accessed from each host, subject to administrative controls.

Volumes may be replicated or duplicated. Replicated volumes contain identical copies of the same data and reside at two or more locations in the network. Each of the replicated volumes can be used interchangeably. Duplicated volumes each have the same name but contain different, though functionally identical, data. For example, `/vol/tex' might be the name of a TeX distribution which varied for each machine architecture.

Amd provides facilities to take advantage of both replicated and duplicated volumes. Configuration options allow a single set of configuration data to be shared across an entire network by taking advantage of replicated and duplicated volumes.

Amd can take advantage of replacement volumes by mounting them as required should an active fileserver become unavailable.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.4 Volume Binding

Unix implements a namespace of hierarchically mounted filesystems. Two forms of binding between names and files are provided. A hard link completes the binding when the name is added to the filesystem. A soft link delays the binding until the name is accessed. An automounter adds a further form in which the binding of name to filesystem is delayed until the name is accessed.

The target volume, in its general form, is a tuple (host, filesystem, sublink) which can be used to name the physical location of any volume in the network.

When a target is referenced, Amd ignores the sublink element and determines whether the required filesystem is already mounted. This is done by computing the local mount point for the filesystem and checking for an existing filesystem mounted at the same place. If such a filesystem already exists then it is assumed to be functionally identical to the target filesystem. By default there is a one-to-one mapping between the pair (host, filesystem) and the local mount point so this assumption is valid.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.5 Operational Principles

Amd operates by introducing new mount points into the namespace. These are called automount points. The kernel sees these automount points as NFS filesystems being served by Amd. Having attached itself to the namespace, Amd is now able to control the view the rest of the system has of those mount points. RPC calls are received from the kernel one at a time.

When a lookup call is received Amd checks whether the name is already known. If it is not, the required volume is mounted. A symbolic link pointing to the volume root is then returned. Once the symbolic link is returned, the kernel will send all other requests direct to the mounted filesystem.

If a volume is not yet mounted, Amd consults a configuration mount-map corresponding to the automount point. Amd then makes a runtime decision on what and where to mount a filesystem based on the information obtained from the map.

Amd does not implement all the NFS requests; only those relevant to name binding such as lookup, readlink and readdir. Some other calls are also implemented but most simply return an error code; for example mkdir always returns "read-only filesystem".


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.6 Mounting a Volume

Each automount point has a corresponding mount map. The mount map contains a list of key-value pairs. The key is the name of the volume to be mounted. The value is a list of locations describing where the filesystem is stored in the network. In the source for the map the value would look like

 
location1  location2  …  locationN

Amd examines each location in turn. Each location may contain selectors which control whether Amd can use that location. For example, the location may be restricted to use by certain hosts. Those locations which cannot be used are ignored.

Amd attempts to mount the filesystem described by each remaining location until a mount succeeds or Amd can no longer proceed. The latter can occur in three ways:

Once a volume has been mounted, Amd establishes a volume mapping which is used to satisfy subsequent requests.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.7 Automatic Unmounting

To avoid an ever increasing number of filesystem mounts, Amd removes volume mappings which have not been used recently. A time-to-live interval is associated with each mapping and when that expires the mapping is removed. When the last reference to a filesystem is removed, that filesystem is unmounted. If the unmount fails, for example the filesystem is still busy, the mapping is re-instated and its time-to-live interval is extended. The global default for this grace period is controlled by the -w command-line option (see section -w) or the amd.conf parameter `dismount_interval' (see section dismount_interval Parameter). It is also possible to set this value on a per-mount basis (see section opts).

Filesystems can be forcefully timed out using the Amq command. See section Run-time Administration. Note that on new enough systems that support forced unmounts, such as Linux, Amd can try to use the umount2(2) system call to force the unmount, if the regular umount(2) system call failed in a way that indicates that the mount point is hung or stale. See section forced_unmounts Parameter.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.8 Keep-alives

Use of some filesystem types requires the presence of a server on another machine. If a machine crashes then it is of no concern to processes on that machine that the filesystem is unavailable. However, to processes on a remote host using that machine as a fileserver this event is important. This situation is most widely recognized when an NFS server crashes and the behavior observed on client machines is that more and more processes hang. In order to provide the possibility of recovery, Amd implements a keep-alive interval timer for some filesystem types. Currently only NFS makes use of this service.

The basis of the NFS keep-alive implementation is the observation that most sites maintain replicated copies of common system data such as manual pages, most or all programs, system source code and so on. If one of those servers goes down it would be reasonable to mount one of the others as a replacement.

The first part of the process is to keep track of which fileservers are up and which are down. Amd does this by sending RPC requests to the servers' NFS NullProc and checking whether a reply is returned. While the server state is uncertain the requests are re-transmitted at three second intervals and if no reply is received after four attempts the server is marked down. If a reply is received the fileserver is marked up and stays in that state for 30 seconds at which time another NFS ping is sent. This interval is configurable and can even be turned off using the ping option. See section opts Option.

Once a fileserver is marked down, requests continue to be sent every 30 seconds in order to determine when the fileserver comes back up. During this time any reference through Amd to the filesystems on that server fail with the error "Operation would block". If a replacement volume is available then it will be mounted, otherwise the error is returned to the user.

Although this action does not protect user files, which are unique on the network, or processes which do not access files via Amd or already have open files on the hung filesystem, it can prevent most new processes from hanging.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.9 Non-blocking Operation

Since there is only one instance of Amd for each automount point, and usually only one instance on each machine, it is important that it is always available to service kernel calls. Amd goes to great lengths to ensure that it does not block in a system call. As a last resort Amd will fork before it attempts a system call that may block indefinitely, such as mounting an NFS filesystem. Other tasks such as obtaining filehandle information for an NFS filesystem, are done using a purpose built non-blocking RPC library which is integrated with Amd's task scheduler. This library is also used to implement NFS keep-alives (see section Keep-alives).

Whenever a mount is deferred or backgrounded, Amd must wait for it to complete before replying to the kernel. However, this would cause Amd to block waiting for a reply to be constructed. Rather than do this, Amd simply drops the call under the assumption that the kernel RPC mechanism will automatically retry the request.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2. Supported Platforms

Am-utils has been ported to a wide variety of machines and operating systems. Am-utils's code works for little-endian and big-endian machines, as well as 32 bit and 64 bit architectures. Furthermore, when Am-utils ports to an Operating System on one architecture, it is generally readily portable to the same Operating System on all platforms on which it is available.

See the `INSTALL' in the distribution for more specific details on building and/or configuring for some systems.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3. Mount Maps

Amd has no built-in knowledge of machines or filesystems. External mount-maps are used to provide the required information. Specifically, Amd needs to know when and under what conditions it should mount filesystems.

The map entry corresponding to the requested name contains a list of possible locations from which to resolve the request. Each location specifies filesystem type, information required by that filesystem (for example the block special device in the case of UFS), and some information describing where to mount the filesystem (see section fs Option). A location may also contain selectors (see section Selectors).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1 Map Types

A mount-map provides the run-time configuration information to Amd. Maps can be implemented in many ways. Some of the forms supported by Amd are regular files, ndbm databases, NIS maps, the Hesiod name server, and even the password file.

A mount-map name is a sequence of characters. When an automount point is created a handle on the mount-map is obtained. For each map type configured, Amd attempts to reference the map of the appropriate type. If a map is found, Amd notes the type for future use and deletes the reference, for example closing any open file descriptors. The available maps are configured when Amd is built and can be displayed by running the command `amd -v'.

When using an Amd configuration file (see section Amd Configuration File) and the keyword `map_type' (see section map_type Parameter), you may force the map used to any type.

By default, Amd caches data in a mode dependent on the type of map. This is the same as specifying `cache:=mapdefault' and selects a suitable default cache mode depending on the map type. The individual defaults are described below. The cache option can be specified on automount points to alter the caching behavior (see section Automount Filesystem (`auto')).

The following map types have been implemented, though some are not available on all machines. Run the command `amd -v' to obtain a list of map types configured on your machine.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.1 File maps

When Amd searches a file for a map entry it does a simple scan of the file and supports both comments and continuation lines.

Continuation lines are indicated by a backslash character (`\') as the last character of a line in the file. The backslash, newline character and any leading white space on the following line are discarded. A maximum line length of 2047 characters is enforced after continuation lines are read but before comments are stripped. Each line must end with a newline character; that is newlines are terminators, not separators. The following examples illustrate this:

 
key     valA   valB;   \
          valC

specifies three locations, and is identical to

 
key     valA   valB;   valC

However,

 
key     valA   valB;\
          valC

specifies only two locations, and is identical to

 
key     valA   valB;valC

After a complete line has been read from the file, including continuations, Amd determines whether there is a comment on the line. A comment begins with a hash ("`#'") character and continues to the end of the line. There is no way to escape or change the comment lead-in character.

Note that continuation lines and comment support only apply to file maps, or ndbm maps built with the mk-amd-map program.

When caching is enabled, file maps have a default cache mode of all (see section Automount Filesystem (`auto')).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.2 ndbm maps

An ndbm map may be used as a fast access form of a file map. The program, mk-amd-map, converts a normal map file into an ndbm database. This program supports the same continuation and comment conventions that are provided for file maps. Note that ndbm format files may not be sharable across machine architectures. The notion of speed generally only applies to large maps; a small map, less than a single disk block, is almost certainly better implemented as a file map.

ndbm maps have a default cache mode of `all' (see section Automount Filesystem (`auto')).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.3 NIS maps

When using NIS (formerly YP), an Amd map is implemented directly by the underlying NIS map. Comments and continuation lines are not supported in the automounter and must be stripped when constructing the NIS server's database.

NIS maps have a default cache mode of all (see section Automount Filesystem (`auto')).

The following rule illustrates what could be added to your NIS `Makefile', in this case causing the `amd.home' map to be rebuilt:

 
$(YPTSDIR)/amd.home.time: $(ETCDIR)/amd.home
    -@sed -e "s/#.*$$//" -e "/^$$/d" $(ETCDIR)/amd.home | \
      awk '{  \
         for (i = 1; i <= NF; i++) \
             if (i == NF) { \
             if (substr($$i, length($$i), 1) == "\\") \
                 printf("%s", substr($$i, 1, length($$i) - 1)); \
             else \
                 printf("%s\n", $$i); \
             } \
             else \
             printf("%s ", $$i); \
         }' | \
    $(MAKEDBM) - $(YPDBDIR)/amd.home; \
    touch $(YPTSDIR)/amd.home.time; \
    echo "updated amd.home"; \
    if [ ! $(NOPUSH) ]; then \
        $(YPPUSH) amd.home; \
        echo "pushed amd.home"; \
    else \
        : ; \
    fi

Here $(YPTSDIR) contains the time stamp files, and $(YPDBDIR) contains the dbm format NIS files.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.4 NIS+ maps

NIS+ maps do not support cache mode `all' and, when caching is enabled, have a default cache mode of `inc'.

XXX: FILL IN WITH AN EXAMPLE.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.5 Hesiod maps

When the map name begins with the string `hesiod.' lookups are made using the Hesiod name server. The string following the dot is used as a name qualifier and is prepended with the key being located. The entire string is then resolved in the automount context, or the amd.conf parameter `hesiod_base' (see section hesiod_base Parameter). For example, if the key is `jsp' and map name is `hesiod.homes' then Hesiod is asked to resolve `jsp.homes.automount'.

Hesiod maps do not support cache mode `all' and, when caching is enabled, have a default cache mode of `inc' (see section Automount Filesystem (`auto')).

The following is an example of a Hesiod map entry:

 
jsp.homes.automount HS TXT "rfs:=/home/charm;rhost:=charm;sublink:=jsp"
njw.homes.automount HS TXT "rfs:=/home/dylan/dk2;rhost:=dylan;sublink:=njw"

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.6 Password maps

The password map support is unlike the four previous map types. When the map name is the string `/etc/passwd' Amd can lookup a user name in the password file and re-arrange the home directory field to produce a usable map entry.

Amd assumes the home directory has the format `/anydir/dom1/../domN/login'. It breaks this string into a map entry where ${rfs} has the value `/anydir/domN', ${rhost} has the value `domN.....dom1', and ${sublink} has the value login.

Thus if the password file entry was

 
/home/achilles/jsp

the map entry used by Amd would be

 
rfs:=/home/achilles;rhost:=achilles;sublink:=jsp

Similarly, if the password file entry was

 
/home/cc/sugar/mjh

the map entry used by Amd would be

 
rfs:=/home/sugar;rhost:=sugar.cc;sublink:=mhj

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.7 Union maps

The union map support is provided specifically for use with the union filesystem, see section Union Filesystem (`union').

It is identified by the string `union:' which is followed by a colon separated list of directories. The directories are read in order, and the names of all entries are recorded in the map cache. Later directories take precedence over earlier ones. The union filesystem type then uses the map cache to determine the union of the names in all the directories.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.8 LDAP maps

LDAP (Lightweight Directory Access Protocol) maps do not support cache mode `all' and, when caching is enabled, have a default cache mode of `inc'.

For example, an Amd map `amd.home' that looks as follows:

 
/defaults    opts:=rw,intr;type:=link

zing         -rhost:=shekel \
             host==shekel \
             host!=shekel;type:=nfs

when converted to LDAP (see section amd2ldif), will result in the following LDAP database:

 
$ amd2ldif amd.home CUCS < amd.home
dn: cn=amdmap timestamp, CUCS
cn             : amdmap timestamp
objectClass    : amdmapTimestamp
amdmapTimestamp: 873071363

dn: cn=amdmap amd.home[/defaults], CUCS
cn          : amdmap amd.home[/defaults]
objectClass : amdmap
amdmapName  : amd.home
amdmapKey   : /defaults
amdmapValue : opts:=rw,intr;type:=link

dn: cn=amdmap amd.home[], CUCS
cn          : amdmap amd.home[]
objectClass : amdmap
amdmapName  : amd.home
amdmapKey   :
amdmapValue :

dn: cn=amdmap amd.home[zing], CUCS
cn          : amdmap amd.home[zing]
objectClass : amdmap
amdmapName  : amd.home
amdmapKey   : zing
amdmapValue : -rhost:=shekel host==shekel host!=shekel;type:=nfs

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.9 Executable maps

An executable map is a dynamic map in which the keys and values for the maps are generated on the fly by a program or script. The program is expected to take a single parameter argument which is the key to lookup. If the key is found, the program should print on stdout the key-value pair that were found; if the key was not found, nothing should be printed out. Below is an sample of such a map script:

 
#!/bin/sh
# executable map example
case "$1" in
    "/defaults" )
	echo "/defaults   type:=nfs;rfs:=filer"
	;;
    "a" )
	echo "a   type:=nfs;fs:=/tmp"
	;;
    "b" )
	echo "b   type:=link;fs:=/usr/local"
	;;
    * )  # no match, echo nothing
	;;
esac

See section exec_map_timeout Parameter.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.2 How keys are looked up

The key is located in the map whose type was determined when the automount point was first created. In general the key is a pathname component. In some circumstances this may be modified by variable expansion (see section Variable Expansion) and prefixing. If the automount point has a prefix, specified by the pref option, then that is prepended to the search key before the map is searched.

If the map cache is a `regexp' cache then the key is treated as an egrep-style regular expression, otherwise a normal string comparison is made.

If the key cannot be found then a wildcard match is attempted. Amd repeatedly strips the basename from the key, appends `/*' and attempts a lookup. Finally, Amd attempts to locate the special key `*'.

For example, the following sequence would be checked if `home/dylan/dk2' was being located:

 
   home/dylan/dk2
   home/dylan/*
   home/*
   *

At any point when a wildcard is found, Amd proceeds as if an exact match had been found and the value field is then used to resolve the mount request, otherwise an error code is propagated back to the kernel. (see section Filesystem Types).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3 Location Format

The value field from the lookup provides the information required to mount a filesystem. The information is parsed according to the syntax shown below.

 
location-list:
                  location-selection
                  location-list white-space || white-space location-selection
location-selection:
                  location
                  location-selection white-space location
location:
                  location-info
                  -location-info
                  -
location-info:
                  sel-or-opt
                  location-info;sel-or-opt
                  ;
sel-or-opt:
                  selection
                  opt-ass
selection:
                  selector==value
                  selector!=value
opt-ass:
                  option:=value
white-space:
                  space
                  tab

Note that unquoted whitespace is not allowed in a location description. White space is only allowed, and is mandatory, where shown with non-terminal white-space.

A location-selection is a list of possible volumes with which to satisfy the request. Each location-selection is tried sequentially, until either one succeeds or all fail. This, by the way, is different from the historically documented behavior, which claimed (falsely, at least for last 3 years) that Amd would attempt to mount all location-selections in parallel and the first one to succeed would be used.

location-selections are optionally separated by the `||' operator. The effect of this operator is to prevent use of location-selections to its right if any of the location-selections on its left were selected, whether or not any of them were successfully mounted (see section Selectors).

The location-selection, and singleton location-list, `type:=ufs;dev:=/dev/xd1g' would inform Amd to mount a UFS filesystem from the block special device `/dev/xd1g'.

The sel-or-opt component is either the name of an option required by a specific filesystem, or it is the name of a built-in, predefined selector such as the architecture type. The value may be quoted with double quotes `"', for example `type:="ufs";dev:="/dev/xd1g"'. These quotes are stripped when the value is parsed and there is no way to get a double quote into a value field. Double quotes are used to get white space into a value field, which is needed for the program filesystem (see section Program Filesystem (`program')).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.1 Map Defaults

A location beginning with a dash `-' is used to specify default values for subsequent locations. Any previously specified defaults in the location-list are discarded. The default string can be empty in which case no defaults apply.

The location `-fs:=/mnt;opts:=ro' would set the local mount point to `/mnt' and cause mounts to be read-only by default. Defaults specified this way are appended to, and so override, any global map defaults given with `/defaults').


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.2 Variable Expansion

To allow generic location specifications Amd does variable expansion on each location and also on some of the option strings. Any option or selector appearing in the form $var is replaced by the current value of that option or selector. For example, if the value of ${key} was `bin', ${autodir} was `/a' and ${fs} was `${autodir}/local/${key}' then after expansion ${fs} would have the value `/a/local/bin'. Any environment variable can be accessed in a similar way.

Two pathname operators are available when expanding a variable. If the variable name begins with `/' then only the last component of the pathname is substituted. For example, if ${path} was `/foo/bar' then ${/path} would be expanded to `bar'. Similarly, if the variable name ends with `/' then all but the last component of the pathname is substituted. In the previous example, ${path/} would be expanded to `/foo'.

Two domain name operators are also provided. If the variable name begins with `.' then only the domain part of the name is substituted. For example, if ${rhost} was `swan.doc.ic.ac.uk' then ${.rhost} would be expanded to `doc.ic.ac.uk'. Similarly, if the variable name ends with `.' then only the host component is substituted. In the previous example, ${rhost.} would be expanded to `swan'.

Variable expansion is a two phase process. Before a location is parsed, all references to selectors, eg ${path}, are expanded. The location is then parsed, selections are evaluated and option assignments recorded. If there were no selections or they all succeeded the location is used and the values of the following options are expanded in the order given: sublink, rfs, fs, opts, remopts, mount and unmount.

Note that expansion of option values is done after all assignments have been completed and not in a purely left to right order as is done by the shell. This generally has the desired effect but care must be taken if one of the options references another, in which case the ordering can become significant.

There are two special cases concerning variable expansion:

  1. before a map is consulted, any selectors in the name received from the kernel are expanded. For example, if the request from the kernel was for `${arch}.bin' and the machine architecture was `vax', the value given to ${key} would be `vax.bin'.
  2. the value of ${rhost} is expanded and normalized before the other options are expanded. The normalization process strips any local sub-domain components. For example, if ${domain} was `Berkeley.EDU' and ${rhost} was initially `snow.Berkeley.EDU', after the normalization it would simply be `snow'. Hostname normalization is currently done in a case-dependent manner.

@c======================================================================


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3 Selectors

Selectors are used to control the use of a location. It is possible to share a mount map between many machines in such a way that filesystem location, architecture and operating system differences are hidden from the users. A selector of the form `arch==sun3;os==sunos4' would only apply on Sun-3s running SunOS 4.x.

Selectors can be negated by using `!=' instead of `=='. For example to select a location on all non-Vax machines the selector `arch!=vax' would be used.

Selectors are evaluated left to right. If a selector fails then that location is ignored. Thus the selectors form a conjunction and the locations form a disjunction. If all the locations are ignored or otherwise fail then Amd uses the error filesystem (see section Error Filesystem (`error')). This is equivalent to having a location `type:=error' at the end of each mount-map entry.

The default value of many of the selectors listed here can be overridden by an Amd command line switch or in an Amd configuration file. See section Amd Configuration File.

The following selectors are currently implemented.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.1 arch Selector Variable

The machine architecture which was automatically determined at compile time. The architecture type can be displayed by running the command `amd -v'. You can override this value also using the -A command line option. See section Supported Platforms.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.2 autodir Selector Variable

The default directory under which to mount filesystems. This may be changed by the -a command line option. See section fs Option.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.3 byte Selector Variable

The machine's byte ordering. This is either `little', indicating little-endian, or `big', indicating big-endian. One possible use is to share `rwho' databases (see section `rwho' servers). Another is to share ndbm databases, however this use can be considered a courageous juggling act.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.4 cluster Selector Variable

This is provided as a hook for the name of the local cluster. This can be used to decide which servers to use for copies of replicated filesystems. ${cluster} defaults to the value of ${domain} unless a different value is set with the -C command line option.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.5 domain Selector Variable

The local domain name as specified by the -d command line option. See section host Selector Variable.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.6 dollar Selector Variable

This is a special variable, whose sole purpose is to produce a literal dollar sign in the value of another variable. For example, if you have a remote file system whose name is `/disk$s', you can mount it by setting the remote file system variable as follows:

 
rfs:=/disk${dollar}s

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.7 host Selector Variable

The local hostname as determined by gethostname(2). If no domain name was specified on the command line and the hostname contains a period `.' then the string before the period is used as the host name, and the string after the period is assigned to ${domain}. For example, if the hostname is `styx.doc.ic.ac.uk' then host would be `styx' and domain would be `doc.ic.ac.uk'. hostd would be `styx.doc.ic.ac.uk'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.8 hostd Selector Variable

This resolves to the ${host} and ${domain} concatenated with a `.' inserted between them if required. If ${domain} is an empty string then ${host} and ${hostd} will be identical.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.9 karch Selector Variable

This is provided as a hook for the kernel architecture. This is used on SunOS 4 and SunOS 5, for example, to distinguish between different `/usr/kvm' volumes. ${karch} defaults to the "machine" value gotten from uname(2). If the uname(2) system call is not available, the value of ${karch} defaults to that of ${arch}. Finally, a different value can be set with the -k command line option.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.10 os Selector Variable

The operating system. Like the machine architecture, this is automatically determined at compile time. The operating system name can be displayed by running the command `amd -v'. See section Supported Platforms.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.11 osver Selector Variable

The operating system version. Like the machine architecture, this is automatically determined at compile time. The operating system name can be displayed by running the command `amd -v'. See section Supported Platforms.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.12 full_os Selector Variable

The full name of the operating system, including its version. This value is automatically determined at compile time. The full operating system name and version can be displayed by running the command `amd -v'. See section Supported Platforms.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.13 vendor Selector Variable

The name of the vendor of the operating system. This value is automatically determined at compile time. The name of the vendor can be displayed by running the command `amd -v'. See section Supported Platforms.

<HR>


The following selectors are also provided. Unlike the other selectors, they vary for each lookup. Note that when the name from the kernel is expanded prior to a map lookup, these selectors are all defined as empty strings.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.14 key Selector Variable

The name being resolved. For example, if `/home' is an automount point, then accessing `/home/foo' would set ${key} to the string `foo'. The key is prefixed by the pref option set in the parent mount point. The default prefix is an empty string. If the prefix was `blah/' then ${key} would be set to `blah/foo'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.15 map Selector Variable

The name of the mount map being used.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.16 netnumber Selector Variable

This selector is identical to the `in_network' selector function, see in_network Selector Function. It will match either the name or number of any network interface on which this host is connected to. The names and numbers of all attached interfaces are available from the output of `amd -v'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.17 network Selector Variable

This selector is identical to the `in_network' selector function, see in_network Selector Function. It will match either the name or number of any network interface on which this host is connected to. The names and numbers of all attached interfaces are available from the output of `amd -v'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.18 path Selector Variable

The full pathname of the name being resolved. For example `/home/foo' in the example above.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.19 wire Selector Variable

This selector is identical to the `in_network' selector function, see in_network Selector Function. It will match either the name or number of any network interface on which this host is connected to. The names and numbers of all attached interfaces are available from the output of `amd -v'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.20 uid Selector Variable

This selector provides the numeric effective user ID (UID) of the user which last accessed an automounted path name. This simple example shows how floppy mounting can be assigned only to machine owners:

 
floppy  -type:=pcfs \
        uid==2301;host==shekel;dev:=/dev/floppy \
        uid==6712;host==titan;dev=/dev/fd0 \
        uid==0;dev:=/dev/fd0c \
        type:=error

The example allows two machine owners to mount floppies on their designated workstations, allows the root user to mount on any host, and otherwise forces an error.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.21 gid Selector Variable

This selector provides the numeric effective group ID (GID) of the user which last accessed an automounted path name.

<HR>

The following boolean functions are selectors which take an argument ARG. They return a value of true or false, and thus do not need to be compared with a value. Each of these may be negated by prepending `!' to their name.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.22 exists Selector Function

If the file listed by ARG exists (via lstat(2)), this function evaluates to true. Otherwise it evaluates to false.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.23 false Selector Function

Always evaluates to false. ARG is ignored.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.24 netgrp Selector Function

The argument ARG of this selector is a netgroup name followed optionally by a comma and a host name. If the host name is not specified, it defaults to ${host}. If the host name (short name) is a member of the netgroup, this selector evaluates to true. Otherwise it evaluates to false.

For example, suppose you have a netgroup `ppp-hosts', and for reasons of performance, these have a local `/home' partition, while all other clients on the faster network can access a shared home directory. A common map to use for both might look like the following:

 
home/*  netgrp(ppp-hosts);type:=link;fs:=/local/${key} \
        !netgrp(ppp-hosts);type:=nfs;rhost:=serv1;rfs:=/remote/${key}

A more complex example that takes advantage of the two argument netgrp mount selector is given in the following scenario. Suppose one wants to mount the local scratch space from a each host under `scratch/<hostname>' and some hosts have their scratch space in a different path than others. Hosts in the netgroup `apple-hosts' have their scratch space in the `/apple' path, where hosts in the netgroup `cherry-hosts' have their scratch space in the `/cherry' path. For hosts that are neither in the `apple-hosts' or `cherry-hosts' netgroups we want to make a symlink pointing to nowhere but provide a descriptive error message in the link destination:

 
scratch/*	netgrp(apple-hosts,${/key});type:=nfs;rhost:=${/key};\
		    rfs:="/apple" \
		netgrp(cherry-hosts,${/key});type:=nfs;rhost:=${/key};\
		    rfs:="/cherry" \
		type:=link;rfs:="no local partition for ${/key}"

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.25 netgrpd Selector Function

The argument ARG of this selector is a netgroup name followed optionally by a comma and a host name. If the host name is not specified, it defaults to ${hostd}. If the host name (fully-qualified name) is a member of the netgroup, this selector evaluates to true. Otherwise it evaluates to false.

The `netgrpd' function uses fully-qualified host names to match netgroup names, while the `netgrp' function (see section netgrp Selector Function) uses short host names.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.26 in_network Selector Function

This selector matches against any network name or number with an optional netmask. First, if the current host has any network interface that is locally attached to the network specified in ARG (either via name or number), this selector evaluates to true.

Second, `in_network' supports a network/netmask syntax such as `128.59.16.0/255.255.255.0', `128.59.16.0/24', `128.59.16.0/0xffffff00', or `128.59.16.0/'. Using the last form, Amd will match the specified network number against the default netmasks of each of the locally attached interfaces.

If the selector does not match, it evaluates to false.

For example, suppose you have two servers that have an exportable `/opt' that smaller clients can NFS mount. The two servers are say, `serv1' on network `foo-net.site.com' and `serv2' on network `123.4.5.0'. You can write a map to be used by all clients that will attempt to mount the closest one as follows:

 
opt in_network(foo-net.site.com);rhost:=serv1;rfs:=/opt \
    in_network(123.4.5.0);rhost:=serv2;rfs:=/opt \
    rhost:=fallback-server

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.27 true Selector Function

Always evaluates to true. ARG is ignored.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3.28 xhost Selector Function

This function compares ARG against the current hostname, similarly to the host Selector Variable. However, this function will also match if ARG is a CNAME (DNS Canonical Name, or alias) for the current host's name.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.4 Map Options

Options are parsed concurrently with selectors. The difference is that when an option is seen the string following the `:=' is recorded for later use. As a minimum the type option must be specified. Each filesystem type has other options which must also be specified. See section Filesystem Types, for details on the filesystem specific options.

Superfluous option specifications are ignored and are not reported as errors.

The following options apply to more than one filesystem type.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.4.1 addopts Option

This option adds additional options to default options normally specified in the `/defaults' entry or the defaults of the key entry being processed (see section opts Option). Normally when you specify `opts' in both the `/defaults' and the map entry, the latter overrides the former completely. But with `addopts' it will append the options and override any conflicting ones.

`addopts' also overrides the value of the `remopts' option (see section remopts Option), which unless specified defaults to the value of `opts'.

Options which start with `no' will override those with the same name that do not start with `no' and vice verse. Special handling is given to inverted options such as `soft' and `hard', `bg' and `fg', `ro' and `rw', etc.

For example, if the default options specified were

 
opts:=rw,nosuid,intr,rsize=1024,wsize=1024,quota,posix

and the ones specified in a map entry were

 
addopts:=grpid,suid,ro,rsize=2048,quota,nointr

then the actual options used would be

 
wsize=1024,posix,grpid,suid,ro,rsize=2048,quota,nointr

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.4.2 delay Option

The delay, in seconds, before an attempt will be made to mount from the current location. Auxiliary data, such as network address, file handles and so on are computed regardless of this value.

A delay can be used to implement the notion of primary and secondary file servers. The secondary servers would have a delay of a few seconds, thus giving the primary servers a chance to respond first.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.4.3 fs Option

The local mount point. The semantics of this option vary between filesystems.

For NFS and UFS filesystems the value of ${fs} is used as the local mount point. For other filesystem types it has other meanings which are described in the section describing the respective filesystem type. It is important that this string uniquely identifies the filesystem being mounted. To satisfy this requirement, it should contain the name of the host on which the filesystem is resident and the pathname of the filesystem on the local or remote host.

The reason for requiring the hostname is clear if replicated filesystems are considered. If a fileserver goes down and a replacement filesystem is mounted then the local mount point must be different from that of the filesystem which is hung. Some encoding of the filesystem name is required if more than one filesystem is to be mounted from any given host.

If the hostname is first in the path then all mounts from a particular host will be gathered below a single directory. If that server goes down then the hung mount points are less likely to be accidentally referenced, for example when getcwd(3) traverses the namespace to find the pathname of the current directory.

The `fs' option defaults to ${autodir}/${rhost}${rfs}. In addition, `rhost' defaults to the local host name (${host}) and `rfs' defaults to the value of ${path}, which is the full path of the requested file; `/home/foo' in the example above (see section Selectors). ${autodir} defaults to `/a' but may be changed with the -a command line option. Sun's automounter defaults to `/tmp_mnt'. Note that there is no `/' between the ${rhost} and ${rfs} since ${rfs} begins with a `/'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.4.4 opts Option

The options to pass to the mount system call. A leading `-' is silently ignored. The mount options supported generally correspond to those used by mount(8) and are listed below. Some additional pseudo-options are interpreted by Amd and are also listed.

Unless specifically overridden, each of the system default mount options applies. Any options not recognized are ignored. If no options list is supplied the string `rw,defaults' is used and all the system default mount options apply. Options which are not applicable for a particular operating system are silently ignored. For example, only 4.4BSD is known to implement the compress and spongy options.

acdirmax=n

Set the maximum directory attribute cache timeout to n.

acdirmin=n

Set the minimum directory attribute cache timeout to n.

acregmax=n

Set the maximum file attribute cache timeout to n.

acregmin=n

Set the minimum file attribute cache timeout to n.

actimeo=n

Set the overall attribute cache timeout to n.

auto
ignore

Ignore this mount by df(1).

cache

Allow data to be cached from a remote server for this mount.

compress

Use NFS compression protocol.

defperm

Ignore the permission mode bits, and default file permissions to 0555, UID 0, and GID 0. Useful for CD-ROMs formatted as ISO-9660.

dev

Allow local special devices on this filesystem.

dirmask=n

For PCFS mounts, specify the maximum file permissions for directories in the file system. See the `mask' option's description for more details. The mask value of n can be specified in decimal, octal, or hexadecimal.

dumbtimr

Turn off the dynamic retransmit timeout estimator. This may be useful for UDP mounts that exhibit high retry rates, since it is possible that the dynamically estimated timeout interval is too short.

extatt

Enable extended attributes in ISO-9660 file systems.

fsid

Set ID of filesystem.

gens

Enable generations in ISO-9660 file systems. Generations allow you to see all versions of a given file.

group=n

For PCFS mounts, set the group of the files in the file system to n (which can either be a group name or a GID number). The default group is the group of the directory on which the file system is being mounted.

grpid

Use BSD directory group-id semantics.

int
intr

Allow keyboard interrupts on hard mounts.

lock

Use the NFS locking protocol (default)

longname

For PCFS mounts, force Win95 long names.

mask=n

For PCFS mounts, specify the maximum file permissions for files in the file system. For example, a mask of 755 specifies that, by default, the owner should have read, write, and execute permissions for files, but others should only have read and execute permissions. Only the nine low-order bits of mask are used. The default mask is taken from the directory on which the file system is being mounted. The mask value of n can be specified in decimal, octal, or hexadecimal.

multi

Perform multi-component lookup on files.

maxgroups

Set the maximum number of groups to allow for this mount.

nfsv3

Use NFS Version 3 for this mount.

noac

Turn off the attribute cache.

noauto

This option is used by the mount command in `/etc/fstab' or `/etc/vfstab' and means not to mount this file system when mount -a is used.

nocache

Do not allow data to be cached from a remote server for this mount.

noconn

Don't make a connection on datagram transports.

nocto

No close-to-open consistency.

nodefperm

Do not ignore the permission mode bits. Useful for CD-ROMS formatted as ISO-9660.

nodev
nodevs

Don't allow local special devices on this filesystem.

noexec

Don't allow program execution.

noint

Do not allow keyboard interrupts for this mount

nolock

Do not use the NFS locking protocol

nomnttab

This option is used internally to tell Amd that a Solaris 8 system using mntfs is in use.

norrip

Turn off using of the Rock Ridge Interchange Protocol (RRIP) extensions to ISO-9660.

nosub

Disallow mounts beneath this mount.

nosuid

Don't allow set-uid or set-gid executables on this filesystem.

noversion

Strip the extension `;#' from the version string of files recorded on an ISO-9660 CD-ROM.

nowin95

For PCFS mounts, completely ignore Win95 entries.

optionstr

Under Solaris 8, provide the kernel a string of options to parse and show as part of the special in-kernel mount file system.

overlay

Overlay this mount on top of an existing mount, if any.

pgthresh=n

Set the paging threshold to n kilobytes.

port=n

Set the NFS port to n.

posix

Turn on POSIX static pathconf for mounts.

private

Use local locking instead of the NLM protocol, useful for IRIX 6 only.

proplist

Support property lists (ACLs) for this mount, useful primarily for Tru64 UNIX.

proto=s

Use transport protocol s for NFS (can be "tcp" or "udp").

quota

Enable quota checking on this mount.

rdonly
ro

Mount this filesystem readonly.

resvport

Use a reserved port (smaller than 1024) for remote NFS mounts. Most systems assume that, but some allow for mounts to occur on non-reserved ports. This causes problems when such a system tries to NFS mount one that requires reserved ports. It is recommended that this option always be on.

retrans=n

The number of NFS retransmits made before a user error is generated by a `soft' mounted filesystem, and before a `hard' mounted filesystem reports `NFS server yoyo not responding still trying'.

retry

Set the NFS retry counter.

rrip

Uses the Rock Ridge Interchange Protocol (RRIP) extensions to ISO-9660.

rsize=n

The NFS read packet size. You may need to set this if you are using NFS/UDP through a gateway or a slow link.

rw

Allow reads and writes on this filesystem.

shortname

For PCFS mounts, force old DOS short names only.

soft

Give up after retrans retransmissions.

spongy

Like `soft' for status requests, and `hard' for data transfers.

suid

Allow set-uid programs on this mount.

symttl

Turn off the symbolic link cache time-to-live.

sync

Perform synchronous filesystem operations on this mount.

tcp

Use TCP/IP instead of UDP/IP, ignored if the NFS implementation does not support TCP/IP mounts.

timeo=n

The NFS timeout, in tenth-seconds, before a request is retransmitted.

user=n

For PCFS mounts, set the owner of the files in the file system to n (which can either be a user name or a UID number). The default owner is the owner of the directory on which the file system is being mounted.

vers=n

Use NFS protocol version number n (can be 2 or 3).

wsize=n

The NFS write packet size. You may need to set this if you are using NFS/UDP through a gateway or a slow link.

The following options are implemented by Amd, rather than being passed to the kernel.

nounmount

Configures the mount so that its time-to-live will never expire. This is the default for non-network based filesystem types (such as mounting local disks, floppies, and CD-ROMs). See also the related unmount option.

ping=n

The interval, in seconds, between keep-alive pings. When four consecutive pings have failed the mount point is marked as hung. This interval defaults to 30 seconds; if the ping interval is set to zero, Amd will use the default 30-second interval. If the interval is set to -1 (or any other negative value), no pings are sent and the host is assumed to be always up, which can cause unmounts to hang See the softlookup option for a better alternative. Turning pings off can be useful in NFS-HA (High-Availability) sites where the NFS service rarely goes down. Setting the ping value to a large value can reduce the amount of NFS_NULL chatter on your network considerably, especially in large sites.

Note that if you have multiple Amd entries using the same file server, and each entry sets a different value of N, then each time Amd mounts a new entry, the ping value will be re-evaluated (and updated, turned off, or turned back on as needed). Finally, note that NFS_NULL pings are sent for both UDP and TCP mounts, because even a hung TCP mount can cause user processes to hang.

public

Use WebNFS multi-component lookup on the public file handle instead of the mount protocol to obtain NFS file handles, as documented in the WebNFS Client Specification, RFC 2054. This means that Amd will not attempt to contact the remote portmapper or remote mountd daemon, and will only connect to the well-known NFS port 2049 or the port specified with the port mount option, thus making it easier to use NFS through a firewall.

retry=n

The number of times to retry the mount system call.

softlookup

Configures Amd's behavior with respect to already-mounted shares from NFS fileservers that are unreachable. If softlookup is specified, trying to access such a share will result in an error (EIO, which is changed from the ENOENT 6.0 used to return). If it is not specified, a regular symlink is provided and the access will probably hang in the NFS filesystem.

The default behavior depends on whether the mount is 'soft' or 'hard'; softlookup can be used to change this default. This is changed from 6.0 which always behaved as if softlookup was specified.

unmount

Configures the mount so that its time-to-live will indeed expire (and thus may be automatically unmounted). This is also the default for network-based filesystem types (e.g., NFS). This option is useful for removable local media such as CD-ROMs, USB drives, etc. so they can expire when not in use, and get unmounted (such drives can get work out when they keep spinning). See also the related nounmount option.

utimeout=n

The interval, in seconds, that looked up and mounted map entries are cached. After that period of time, Amd will attempt to unmount the entries. If, however, the unmount fails (with EBUSY), then Amd will extend the mount's time-to-live by the utimeout value before the next unmount attempt is made. In fact the interval is extended before the unmount is attempted, to avoid thrashing. The default value is 120 seconds (two minutes) or as set by the -w command line option.

xlatecookie

Translate directory cookies between 32-long and 64-long lengths.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.4.5 remopts Option

This option has the same use as ${opts} but applies only when the remote host is on a non-local network. For example, when using NFS across a gateway it is often necessary to use smaller values for the data read and write sizes. This can simply be done by specifying the small values in remopts. When a non-local host is accessed, the smaller sizes will automatically be used.

Amd determines whether a host is local by examining the network interface configuration at startup. Any interface changes made after Amd has been started will not be noticed. The likely effect will be that a host may incorrectly be declared non-local.

Unless otherwise set, the value of ${remopts} is the same as the value of ${opts}.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.4.6 sublink Option

The subdirectory within the mounted filesystem to which the reference should point. This can be used to prevent duplicate mounts in cases where multiple directories in the same mounted filesystem are used.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.4.7 type Option

The filesystem type to be used. See section Filesystem Types, for a full description of each type.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4. Amd Command Line Options

Many of Amd's parameters can be set from the command line. The command line is also used to specify automount points and maps.

The general format of a command line is

 
amd [options] [{ directory map-name [-map-options] } ...]

For each directory and map-name given or specified in the `amd.conf' file, Amd establishes an automount point. The map-options may be any sequence of options or selectors--see section Location Format. The map-options apply only to Amd's mount point.

`type:=toplvl;cache:=mapdefault;fs:=${map}' is the default value for the map options. Default options for a map are read from a special entry in the map whose key is the string `/defaults'. When default options are given they are prepended to any options specified in the mount-map locations as explained in Map Defaults.

The options are any combination of those listed below.

Once the command line has been parsed, the automount points are mounted. The mount points are created if they do not already exist, in which case they will be removed when Amd exits. Finally, Amd disassociates itself from its controlling terminal and forks into the background.

Note: Even if Amd has been built with `-DDEBUG' (via configure --enable-debug), it will still background itself and disassociate itself from the controlling terminal. To use a debugger it is necessary to specify `-D daemon' on the command line. However, even with all of this, mounts and unmounts are performed in the background, and Amd will always fork before doing them. Therefore, debugging what happens closely during un/mounts is more challenging.

All of Amd's command options (save -F and -T) can be specified in the `amd.conf' file. See section Amd Configuration File. If Amd is invoked without any command line options, it will default to using the configuration file `/etc/amd.conf', if one exists.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.1 -a directory

Specifies the default mount directory. This option changes the variable ${autodir} which otherwise defaults to `/a'. For example, some sites prefer `/amd' or `/n'.

 
amd -a /amd ...

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.2 -c cache-interval

Selects the period, in seconds, for which a name is cached by Amd. If no reference is made to the volume in this period, Amd discards the volume name to filesystem mapping.

Once the last reference to a filesystem has been removed, Amd attempts to unmount the filesystem. If the unmount fails the interval is extended by a further period as specified by the `-w' command line option or by the `utimeout' mount option.

The default cache-interval is 300 seconds (five minutes).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3 -d domain

Specifies the host's domain. This sets the internal variable ${domain} and affects the ${hostd} variable.

If this option is not specified and the hostname already contains the local domain then that is used, otherwise the default value of ${domain} is `unknown.domain'.

For example, if the local domain was `doc.ic.ac.uk', Amd could be started as follows:

 
amd -d doc.ic.ac.uk ...

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4 -k kernel-architecture

Specifies the kernel architecture of the system. This is usually the output of `uname -m' (the "machine" value gotten from uname(2)). If the uname(2) system call is not available, the value of ${karch} defaults to that of ${arch}.

The only effect of this option is to set the variable ${karch}.

This option would be used as follows:

 
amd -k `arch -k` ...

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.5 -l log-option

Selects the form of logging to be made. Several special log-options are recognized.

  1. If log-option is the string `syslog', Amd will use the syslog(3) mechanism. If your system supports syslog facilities, then the default facility used is `LOG_DAEMON'.
  2. When using syslog, if you wish to change the facility, append its name to the log option name, delimited by a single colon. For example, if log-options is the string `syslog:local7' then Amd will log messages via syslog(3) using the `LOG_LOCAL7' facility. If the facility name specified is not recognized, Amd will default to `LOG_DAEMON'. Note: while you can use any syslog facility available on your system, it is generally a bad idea to use those reserved for other services such as `kern', `lpr', `cron', etc.
  3. If log-option is the string `/dev/stderr', Amd will use standard error, which is also the default target for log messages. To implement this, Amd simulates the effect of the `/dev/fd' driver.

Any other string is taken as a filename to use for logging. Log messages are appended to the file if it already exists, otherwise a new file is created. The file is opened once and then held open, rather than being re-opened for each message.

Normally, when long-running daemons hold an open file descriptor on a log file, it is impossible to "rotate" the log file and compress older logs on a daily basis. The daemon needs to be told to discard (via close(2)) its file handle, and re-open the log file. This is done using amq -l log-option. See section Amq -l option.

If the `syslog' option is specified but the system does not support syslog or if the named file cannot be opened or created, Amd will use standard error. Error messages generated before Amd has finished parsing the command line are printed on standard error.

Since Amd tends to generate a lot of logging information (especially if debugging was turned on), and due to it being an important program running on the system, it is usually best to log to a separate disk file. In that case Amd would be started as follows:

 
amd -l /var/log/amd ...

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.6 -n

Normalizes the remote hostname before using it. Normalization is done by replacing the value of ${rhost} with the (generally fully qualified) primary name returned by a hostname lookup.

This option should be used if several names are used to refer to a single host in a mount map.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.7 -o op-sys-ver

Overrides the compiled-in version number of the operating system, with op-sys-ver. Useful when the built-in version is not desired for backward compatibility reasons. For example, if the built-in version is `2.5.1', you can override it to `5.5.1', and use older maps that were written with the latter in mind.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.8 -p

Causes Amd's process id to be printed on standard output. This can be redirected to a suitable file for use with kill:

 
amd -p > /var/run/amd.pid ...

This option only has an affect if Amd is running in daemon mode. If Amd is started with the -D daemon debug flag, this option is ignored.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9 -r

Tells Amd to restart existing mounts (see section Inheritance Filesystem (`inherit')).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10 -t timeout.retransmit

Specifies the RPC timeout interval and the retransmit counter used by the kernel to communicate to Amd. These are used to set the `timeo' and `retrans' mount options, respectively. The default timeout is 0.8 seconds, and the default number of retransmissions is 11.

Amd relies on the kernel RPC retransmit mechanism to trigger mount retries. The values of these parameters change the overall retry interval. Too long an interval gives poor interactive response; too short an interval causes excessive retries.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.11 -v

Print version information on standard error and then exit. The output is of the form:

 
Copyright (c) 1997-1999 Erez Zadok
Copyright (c) 1990 Jan-Simon Pendry
Copyright (c) 1990 Imperial College of Science, Technology & Medicine
Copyright (c) 1990 The Regents of the University of California.
am-utils version 6.0a15 (build 61).
Built by ezk@example.com on date Wed Oct 22 15:21:03 EDT 1997.
cpu=sparc (big-endian), arch=sun4, karch=sun4u.
full_os=solaris2.5.1, os=sos5, osver=5.5.1, vendor=sun.
Map support for: root, passwd, union, nisplus, nis, ndbm, file, error.
AMFS: nfs, link, nfsx, nfsl, host, linkx, program, union, inherit,
      ufs, lofs, hsfs, pcfs, auto, direct, toplvl, error.
FS: autofs, cachefs, cdfs, lofs, nfs, nfs3, pcfs, tfs, tmpfs, ufs.
Network 1: wire="mcl-lab-net.cs.columbia.edu" (netnumber=128.59.13).
Network 2: wire="14-net.cs.columbia.edu" (netnumber=128.59.14).
Network 3: wire="old-net.cs.columbia.edu" (netnumber=128.59.16).

The information includes the version number, number of times Amd was compiled on the local system, release date and name of the release. Following come the cpu type, byte ordering, and the architecture and kernel architecture as ${arch} and ${karch}, respectively. The next line lists the operating system full name, short name, version, and vendor. These four values correspond to the variables ${full_os}, ${os}, ${osver}, and ${vendor}, respectively. See section Supported Platforms.

Then come a list of map types supported, filesystems internally supported by Amd (AMFS), and generic filesystems available (FS). Finally all known networks (if any) of this host are listed by name and number. They are available via the variables ${wire} or ${network}, and ${netnumber} (see section Selectors) or the `in_network' selector function (see section in_network Selector Function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.12 -w wait-timeout

Selects the interval in seconds between unmount attempts after the initial time-to-live has expired.

This defaults to 120 seconds (two minutes).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.13 -x opts

Specifies the type and verbosity of log messages. opts is a comma separated list selected from the following options:

fatal

Fatal errors (cannot be turned off)

error

Non-fatal errors (cannot be turned off)

user

Non-fatal user errors

warn

Recoverable errors

warning

Alias for warn

info

Information messages

map

Mount map usage

stats

Additional statistics

all

All of the above

defaults

An alias for "fatal,error,user,warning,info".

Initially a set of default logging flags is enabled. This is as if `-x defaults' or `-x fatal,error,user,warning,info' had been selected. The command line is parsed and logging is controlled by the -x option. The very first set of logging flags is saved and can not be subsequently disabled using Amq. This default set of options is useful for general production use.

The `info' messages include details of what is mounted and unmounted and when filesystems have timed out. If you want to have the default set of messages without the `info' messages then you simply need `-x noinfo'. The messages given by `user' relate to errors in the mount maps, so these are useful when new maps are installed. The following table lists the syslog priorities used for each of the message types.

fatal

`LOG_CRIT'

error

`LOG_ERR'

user

`LOG_WARNING'

warning

`LOG_WARNING'

info

`LOG_INFO'

debug

`LOG_DEBUG'

map

`LOG_DEBUG'

stats

`LOG_INFO'

The options can be prefixed by the string `no' to indicate that this option should be turned off. For example, to obtain all but `info' messages the option `-x all,noinfo' would be used.

If Amd was built with debugging enabled the debug option is automatically enabled regardless of the command line options.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.14 -y NIS-domain

Selects an alternate NIS domain. This is useful for debugging and cross-domain shared mounting. If this flag is specified, Amd immediately attempts to bind to a server for this domain.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.15 -A architecture

Specifies the OS architecture of the system. The only effect of this option is to set the variable ${arch}.

This option would be used as follows:

 
amd -A i386 ...

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.16 -C cluster-name

Specifies the name of the cluster of which the local machine is a member. The only effect is to set the variable ${cluster}. The cluster-name is will usually obtained by running another command which uses a database to map the local hostname into a cluster name. ${cluster} can then be used as a selector to restrict mounting of replicated data. If this option is not given, ${cluster} has the same value as ${domain}. This would be used as follows:

 
amd -C `clustername` ...

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.17 -D opts

Controls the verbosity and coverage of the debugging trace; opts is a comma separated list of debugging options. The -D option is only available if Amd was compiled with `-DDEBUG', or configured with configure --enable-debug. The memory debugging facilities (`mem') are only available if Amd was compiled with `-DDEBUG_MEM' (in addition to `-DDEBUG'), or configured with configure --enable-debug=mem.

The most common options to use are `-D trace' and `-D test' (which turns on all the useful debug options). As usual, every option can be prefixed with `no' to turn it off.

all

all options (excluding hrtime and mtab)

defaults

"sensible" default options (all-excluding hrtime, mtab, and xdrtrace)

test

full debug options plus mtab,nodaemon,nofork,noamq

amq

register Amd with the RPC portmapper, for Amq

daemon

enter daemon mode

fork

fork child worker (hlfsd only)

full

program trace

hrtime

print high resolution time stamps (only if syslog(3) is not used)

info

info service specific debugging (hesiod, nis, etc.) In the case of hesiod maps, turns on the hesiod RES_DEBUG internal debugging option.

mem

trace memory allocations. Needs to be explicitly enabled at compile time with -enable-debug=mem.

mtab

use local mount-table file (defaults to `/tmp/mtab', see section debug_mtab_file Parameter)

readdir

show readdir progress

str

debug string munging

trace

trace RPC protocol and NFS mount arguments

xdrtrace

trace XDR routines

You may also refer to the program source for a more detailed explanation of the available options.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.18 -F conf-file

Specify an Amd configuration file conf-file to use. For a description of the format and syntax, see section Amd Configuration File. This configuration file is used to specify any options in lieu of typing many of them on the command line. The `amd.conf' file includes directives for every command line option Amd has, and many more that are only available via the configuration file facility. The configuration file specified by this option is processed after all other options had been processed, regardless of the actual location of this option on the command line.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.19 -H

Print a brief help and usage string.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.20 -O op-sys-name

Overrides the compiled-in name of the operating system, with op-sys-name. Useful when the built-in name is not desired for backward compatibility reasons. For example, if the build in name is `sunos5', you can override it to the old name `sos5', and use older maps which were written with the latter in mind.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.21 -S

Do not lock the running executable pages of Amd into memory. To improve Amd's performance, systems that support the plock(3) or mlockall(2) call lock the Amd process into memory. This way there is less chance the operating system will schedule, page out, and swap the Amd process as needed. This tends to improve Amd's performance, at the cost of reserving the memory used by the Amd process (making it unavailable for other processes). If this behavior is not desired, use the -S option.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.22 -T tag

Specify a tag to use with `amd.conf'. All map entries tagged with tag will be processed. Map entries that are not tagged are always processed. Map entries that are tagged with a tag other than tag will not be processed.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5. Filesystem Types

To mount a volume, Amd must be told the type of filesystem to be used. Each filesystem type typically requires additional information such as the fileserver name for NFS.

From the point of view of Amd, a filesystem is anything that can resolve an incoming name lookup. An important feature is support for multiple filesystem types. Some of these filesystems are implemented in the local kernel and some on remote fileservers, whilst the others are implemented internally by Amd.

The two common filesystem types are UFS and NFS. Four other user accessible filesystems (`link', `program', `auto' and `direct') are also implemented internally by Amd and these are described below. There are two additional filesystem types internal to Amd which are not directly accessible to the user (`inherit' and `error'). Their use is described since they may still have an effect visible to the user.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.1 Network Filesystem (`nfs')

The nfs (`type:=nfs') filesystem type provides access to Sun's NFS.

The following options must be specified:

rhost

the remote fileserver. This must be an entry in the hosts database. IP addresses are not accepted. The default value is taken from the local host name (${host}) if no other value is specified.

rfs

the remote filesystem. If no value is specified for this option, an internal default of ${path} is used.

NFS mounts require a two stage process. First, the file handle of the remote file system must be obtained from the server. Then a mount system call must be done on the local system. Amd keeps a cache of file handles for remote file systems. The cache entries have a lifetime of a few minutes.

If a required file handle is not in the cache, Amd sends a request to the remote server to obtain it.

Historically, this documentation has maintained that Amd will try all the locations in parallel and use the first one which responds with a valid file handle. This has not been the case for quite some time, however. Instead, Amd will go through each location, one by one, and will only skip to the next one if the previous one either fails or times out.

An NFS entry might be:

 
jsp  host!=charm;type:=nfs;rhost:=charm;rfs:=/home/charm;sublink:=jsp

The mount system call and any unmount attempts are always done in a new task to avoid the possibility of blocking Amd.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.2 Network Host Filesystem (`host')

The host (`type:=host') filesystem allows access to the entire export tree of an NFS server. The implementation is layered above the `nfs' implementation so keep-alives work in the same way. The only option which needs to be specified is `rhost' which is the name of the fileserver to mount.

The `host' filesystem type works by querying the mount daemon on the given fileserver to obtain its export list. Amd then obtains filehandles for each of the exported filesystems. Any errors at this stage cause that particular filesystem to be ignored. Finally each filesystem is mounted. Again, errors are logged but ignored. One common reason for mounts to fail is that the mount point does not exist. Although Amd attempts to automatically create the mount point, it may be on a remote filesystem to which Amd does not have write permission.

When an attempt to unmount a `host' filesystem mount fails, Amd remounts any filesystems which had successfully been unmounted. To do this Amd queries the mount daemon again and obtains a fresh copy of the export list. Amd then tries to mount any exported filesystems which are not currently mounted.

Sun's automounter provides a special `-hosts' map. To achieve the same effect with Amd requires two steps. First a mount map must be created as follows:

 
*       type:=host;rhost:=${key};fs:=${autodir}/${rhost}/root

and then start Amd with the following command

 
amd /net net.map

where `net.map' is the name of map described above. Note that the value of ${fs} is overridden in the map. This is done to avoid a clash between the mount tree and any other filesystem already mounted from the same fileserver.

If different mount options are needed for different hosts then additional entries can be added to the map, for example

 
host2       opts:=ro,nosuid,soft

would soft mount `host2' read-only.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.3 Network Filesystem Group (`nfsx')

The nfsx (`type:=nfsx') filesystem allows a group of filesystems to be mounted from a single NFS server. The implementation is layered above the `nfs' implementation so keep-alives work in the same way.

WARNING: `nfsx' is meant to be a "last resort" kind of solution. It is racy and poorly supported. The authors highly recommend that other solutions be considered before relying on it.

The options are the same as for the `nfs' filesystem with one difference for `rfs', as explained below.

The following options should be specified:

rhost

the remote fileserver. The default value is taken from the local host name (${host}) if no other value is specified.

rfs

is a list of filesystems to mount, and must be specified. The list is in the form of a comma separated strings.

For example:

 
pub  type:=nfsx;rhost:=gould;\
     rfs:=/public,/,graphics,usenet;fs:=${autodir}/${rhost}/root

The first string defines the root of the tree, and is applied as a prefix to the remaining members of the list which define the individual filesystems. The first string is not used as a filesystem name. A serial operation is used to determine the local mount points to ensure a consistent layout of a tree of mounts.

Here, the three filesystems, `/public', `/public/graphics' and `/public/usenet', would be mounted.

A local mount point, ${fs}, must be specified. The default local mount point will not work correctly in the general case. A suggestion is to use `fs:=${autodir}/${rhost}/root'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.4 Unix Filesystem (`ufs', `xfs', or `efs')

The ufs (`type:=ufs') filesystem type provides access to the system's standard disk filesystem--usually a derivative of the Berkeley Fast Filesystem.

The following option must be specified:

dev

the block special device to be mounted.

A UFS entry might be:

 
jsp   host==charm;type:=ufs;dev:=/dev/sd0d;sublink:=jsp

UFS is the default Unix disk-based file system, which Am-utils picks up during the autoconfiguration phase. Some systems have more than one type, such as IRIX, that comes with EFS (Extent File System) and XFS (Extended File System). In those cases, you may explicitly set the file system type, by using entries such:

 
ez1   type:=efs;dev:=/dev/xd0a
ez2   type:=xfs;dev:=/dev/sd3c

The UFS/XFS/EFS filesystems are never timed out by default, i.e. they will never be unmounted by Amd. If automatic unmounting is desired, the "unmount" option should be added to the mount options for the entry.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.5 Caching Filesystem (`cachefs')

The cachefs (`type:=cachefs') filesystem caches files from one location onto another, presumably providing faster access. It is particularly useful to cache from a larger and remote (slower) NFS partition to a smaller and local (faster) UFS directory.

The following options must be specified:

cachedir

the directory where the cache is stored.

rfs

the path name to the "back file system" to be cached from.

fs

the "front file system" mount point to the cached files, where Amd will set a symbolic link pointing to.

A CacheFS entry for, say, the `/import' Amd mount point, might be:

 
copt  type:=cachefs;cachedir:=/cache;rfs:=/import/opt;fs:=/n/import/copt

Access to the pathname `/import/copt' will follow a symbolic link to `/n/import/copt'. The latter is the mount point for a caching file system, that caches from `/import/opt' to `/cache'.

The cachefs filesystem is never timed out by default, i.e. it will never be unmounted by Amd. If automatic unmounting is desired, the "unmount" option should be added to the mount options for the entry.

Caveats:

  1. This file system is currently only implemented for Solaris 2.x!
  2. Before being used for the first time, the cache directory must be initialized with `cfsadmin -c cachedir'. See the manual page for cfsadmin(1M) for more information.
  3. The "back file system" mounted must be a complete file system, not a subdirectory thereof; otherwise you will get an error "Invalid Argument".
  4. If Amd aborts abnormally, the state of the cache may be inconsistent, requiring running the command `fsck -F cachefs cachedir'. Otherwise you will get the error "No Space Left on Device".

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.6 CD-ROM Filesystem (`cdfs')

The cdfs (`type:=cdfs') filesystem mounts a CD-ROM with an ISO9660 format filesystem on it.

The following option must be specified:

dev

the block special device to be mounted.

Some operating systems will fail to mount read-only CDs unless the `ro' option is specified. A cdfs entry might be:

 
cdfs      os==sunos4;type:=cdfs;dev:=/dev/sr0 \
          os==sunos5;addopts:=ro;type:=cdfs;dev:=/dev/dsk/c0t6d0s2

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.7 Loopback Filesystem (`lofs')

The lofs (`type:=lofs') filesystem is also called the loopback filesystem. It mounts a local directory on another, thus providing mount-time binding to another location (unlike symbolic links).

The loopback filesystem is particularly useful within the context of a chroot-ed directory (via chroot(2)), to provide access to directories otherwise inaccessible.

The following option must be specified:

rfs

the pathname to be mounted on top of ${fs}.

Usually, the FTP server runs in a chroot-ed environment, for security reasons. In this example, lofs is used to provide a subdirectory within a user's home directory, also available for public ftp.

 
lofs      type:=lofs;rfs:=/home/ezk/myftpdir;fs:=/usr/ftp/pub/ezk

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.8 Memory/RAM Filesystem (`mfs')

The mfs (`type:=mfs') filesystem is available in 4.4BSD, Linux, and other systems. It creates a filesystem in a portion of the system's memory, thus providing very fast file (volatile) access.

XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.9 Null Filesystem (`nullfs')

The nullfs (`type:=nullfs') filesystem is available from 4.4BSD, and is very similar to the loopback filesystem, lofs.

XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.10 Floppy Filesystem (`pcfs')

The pcfs (`type:=pcfs') filesystem mounts a floppy previously formatted for the MS-DOS format.

The following option must be specified:

dev

the block special device to be mounted.

A pcfs entry might be:

 
pcfs      os==sunos4;type:=pcfs;dev:=/dev/fd0 \
          os==sunos5;type:=pcfs;dev:=/dev/diskette

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.11 Translucent Filesystem (`tfs')

The tfs (`type:=tfs') filesystem is an older version of the 4.4BSD unionfs.

XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.12 Shared Memory+Swap Filesystem (`tmpfs')

The tmpfs (`type:=tmpfs') filesystem shares memory between a the swap device and the rest of the system. It is generally used to provide a fast access `/tmp' directory, one that uses memory that is otherwise unused. This filesystem is available in SunOS 4.x and 5.x.

XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.13 User ID Mapping Filesystem (`umapfs')

The umapfs (`type:=umapfs') filesystem maps User IDs of file ownership, and is available from 4.4BSD.

XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.14 Program Filesystem (`program')

The program (`type:=program') filesystem type allows a program to be run whenever a mount or unmount is required. This allows easy addition of support for other filesystem types, such as MIT's Remote Virtual Disk (RVD) which has a programmatic interface via the commands `rvdmount' and `rvdunmount'.

Both of the following options must be specified:

mount

the program which will perform the mount.

unmount
umount

the program which will perform the unmount. For convenience, you may use either `unmount' or `umount' but not both. If neither is defined, Amd will default to `umount ${fs}' (the actual unmount program pathname will be automatically determined at the time GNU configure runs.)

The exit code from these two programs is interpreted as a Unix error code. As usual, exit code zero indicates success. To execute the program, Amd splits the string on whitespace to create an array of substrings. Single quotes `'' can be used to quote whitespace if that is required in an argument. There is no way to escape or change the single quote character.

To run e.g. the program `rvdmount' with a host name and filesystem as arguments, it would be specified by `fs:=${autodir}${path};type:=program;mount:="/etc/rvdmount rvdmount fserver ${fs}";unmount:="/etc/rdvumount rvdumount ${fs}"'.

The first element in the array is taken as the pathname of the program to execute. The other members of the array form the argument vector to be passed to the program, including argument zero. The array is exactly the same as the array passed to the execv() system call (man execv for details). The split string must have at least two elements. The programs are directly executed by Amd, not via a shell. Therefore, if a script is to be used as a mount/umount program, it must begin with a #! interpreter specification.

Often, this program mount type is used for Samba mounts, where you need a double slash in pathnames. However, Amd normalizes sequences of slashes into one slash. Therefore, you must use an escaped slash, preceded by an escaped backslash. So to get a double slash in the mount command, you need the eight character sequence `\\\/\\\/' in your map. For example:

`mount="/sbin/mount mount -r -t smbfs -o-N,-Ihostname \\\/\\\/guest@venus/mp3"'

If a filesystem type is to be heavily used, it may be worthwhile adding a new filesystem type into Amd, but for most uses the program filesystem should suffice.

When the program is run, standard input and standard error are inherited from the current values used by Amd. Standard output is a duplicate of standard error. The value specified with the -l command line option has no effect on standard error.

Amd guarantees that the mountpoint will be created before calling the mount program, and that it will be removed after the umount program returns success.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.15 Symbolic Link Filesystem (`link')

Each filesystem type creates a symbolic link to point from the volume name to the physical mount point. The `link' filesystem does the same without any other side effects. This allows any part of the machines name space to be accessed via Amd.

One common use for the symlink filesystem is `/homes' which can be made to contain an entry for each user which points to their (auto-mounted) home directory. Although this may seem rather expensive, it provides a great deal of administrative flexibility.

The following option must be defined:

fs

The value of fs option specifies the destination of the link, as modified by the sublink option. If sublink is non-null, it is appended to ${fs}/ and the resulting string is used as the target.

The `link' filesystem can be thought of as identical to the `ufs' filesystem but without actually mounting anything.

An example entry might be:

 
jsp   host==charm;type:=link;fs:=/home/charm;sublink:=jsp

which would return a symbolic link pointing to `/home/charm/jsp'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.16 Symbolic Link Filesystem II (`linkx')

The linkx (`type:=linkx') filesystem type is identical to `link' with the exception that the target of the link must exist. Existence is checked with the lstat(2) system call.

The `linkx' filesystem type is particularly useful for wildcard map entries. In this case, a list of possible targets can be given and Amd will choose the first one which exists on the local machine.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.17 NFS-Link Filesystem (`nfsl')

The nfsl (`type:=nfsl') filesystem type is a combination of two others: `link' and `nfs'. If the local host name is equal to the value of ${rhost} and the target pathname listed in ${fs} exists, `nfsl' will behave exactly as `type:=link', and refer to the target as a symbolic link. If the local host name is not equal to the value of ${rhost}, or if the target of the link does not exist, Amd will treat it as `type:=nfs', and will mount a remote pathname for it.

The `nfsl' filesystem type is particularly useful as a shorthand for the more cumbersome and yet one of the most popular Amd entries. For example, you can simplify all map entries that look like:

 
zing    -fs:=/n/shekel/u/zing \
        host!=shekel;type:=nfs;rhost:=shekel;rfs:=${fs} \
        host==shekel;type:=link

or

 
zing    -fs:=/n/shekel/u/zing \
        exists(${fs});type:=link \
        !exists(${fs});type:=nfs;rhost:=shekel;rfs:=${fs}

into a shorter form

 
zing    type:=nfsl;fs:=/n/shekel/u/zing;rhost:=shekel;rfs:=${fs}

Not just does it make the maps smaller and simpler, but it avoids possible mistakes that often happen when forgetting to set up the two entries (one for `type:=nfs' and the other for `type:=link') necessary to perform transparent mounts of existing or remote mounts.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.18 Automount Filesystem (`auto')

The auto (`type:=auto') filesystem type creates a new automount point below an existing automount point. Top-level automount points appear as system mount points. An automount mount point can also appear as a sub-directory of an existing automount point. This allows some additional structure to be added, for example to mimic the mount tree of another machine.

The following options may be specified:

cache

specifies whether the data in this mount-map should be cached. The default value is `none', in which case no caching is done in order to conserve memory.

However, better performance and reliability can be obtained by caching some or all of a mount-map.

If the cache option specifies `all', the entire map is enumerated when the mount point is created.

If the cache option specifies `inc', caching is done incrementally as and when data is required. Some map types do not support cache mode `all', in which case `inc' is used whenever `all' is requested.

Caching can be entirely disabled by using cache mode `none'.

If the cache option specifies `regexp' then the entire map will be enumerated and each key will be treated as an egrep-style regular expression. The order in which a cached map is searched does not correspond to the ordering in the source map so the regular expressions should be mutually exclusive to avoid confusion.

Each mount map type has a default cache type, usually `inc', which can be selected by specifying `mapdefault'.

The cache mode for a mount map can only be selected on the command line. Starting Amd with the command:

 
amd /homes hesiod.homes -cache:=inc

will cause `/homes' to be automounted using the Hesiod name server with local incremental caching of all successfully resolved names.

All cached data is forgotten whenever Amd receives a `SIGHUP' signal and, if cache `all' mode was selected, the cache will be reloaded. This can be used to inform Amd that a map has been updated. In addition, whenever a cache lookup fails and Amd needs to examine a map, the map's modify time is examined. If the cache is out of date with respect to the map then it is flushed as if a `SIGHUP' had been received.

An additional option (`sync') may be specified to force Amd to check the map's modify time whenever a cached entry is being used. For example, an incremental, synchronized cache would be created by the following command:

 
amd /homes hesiod.homes -cache:=inc,sync
fs

specifies the name of the mount map to use for the new mount point.

Arguably this should have been specified with the ${rfs} option but we are now stuck with it due to historical accident.

pref

alters the name that is looked up in the mount map. If ${pref}, the prefix, is non-null then it is prepended to the name requested by the kernel before the map is searched. The default prefix is the prefix of the parent map (if any) with name of the auto node appended to it. That means if you want no prefix you must say so in the map: `pref:=null'.

opts

Normally, `auto' style maps are not browsable even if you turn on directory browsability (see section browsable_dirs Parameter). To enable browsing entries in `auto' maps, specify `opts:=browsable' or `opts:=fullybrowsable' in the description of this map.

The server `dylan.doc.ic.ac.uk' has two user disks: `/dev/dsk/2s0' and `/dev/dsk/5s0'. These are accessed as `/home/dylan/dk2' and `/home/dylan/dk5' respectively. Since `/home' is already an automount point, this naming is achieved with the following map entries:

 
dylan        type:=auto;fs:=${map};pref:=${key}/
dylan/dk2    type:=ufs;dev:=/dev/dsk/2s0
dylan/dk5    type:=ufs;dev:=/dev/dsk/5s0

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.19 Direct Automount Filesystem (`direct')

The direct (`type:=direct') filesystem is almost identical to the automount filesystem. Instead of appearing to be a directory of mount points, it appears as a symbolic link to a mounted filesystem. The mount is done at the time the link is accessed. See section Automount Filesystem (`auto'), for a list of required options.

Direct automount points are created by specifying the `direct' filesystem type on the command line:

 
amd ... /usr/man auto.direct -type:=direct

where `auto.direct' would contain an entry such as:

 
usr/man    -type:=nfs;rfs:=/usr/man \
           rhost:=man-server1  rhost:=man-server2

In this example, `man-server1' and `man-server2' are file servers which export copies of the manual pages. Note that the key which is looked up is the name of the automount point without the leading `/'.

Note that the implementation of the traditional direct filesystem is essentially a hack (pretending that the root of an NFS filesystem is a symlink) and many modern operating systems get very unhappy about it. For example, Linux kernel 2.4+ completely disallows it, and Solaris 2.8 fails to unmount it when Amd shuts down. Therefore, the use of the traditional direct filesystem is strongly discouraged; it is only semi-supported, at best.

The autofs implementations that permit direct mounts are fully supported, however. That currently includes all versions of Solaris. Linux autofs does NOT support direct mounts at all.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.20 Union Filesystem (`union')

The union (`type:=union') filesystem type allows the contents of several directories to be merged and made visible in a single directory. This can be used to overcome one of the major limitations of the Unix mount mechanism which only allows complete directories to be mounted.

For example, supposing `/tmp' and `/var/tmp' were to be merged into a new directory called `/mtmp', with files in `/var/tmp' taking precedence. The following command could be used to achieve this effect:

 
amd ... /mtmp union:/tmp:/var/tmp -type:=union

Currently, the unioned directories must not be automounted. That would cause a deadlock. This seriously limits the current usefulness of this filesystem type and the problem will be addressed in a future release of Amd.

Files created in the union directory are actually created in the last named directory. This is done by creating a wildcard entry which points to the correct directory. The wildcard entry is visible if the union directory is listed, so allowing you to see which directory has priority.

The files visible in the union directory are computed at the time Amd is started, and are not kept up-to-date with respect to the underlying directories. Similarly, if a link is removed, for example with the `rm' command, it will be lost forever.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.21 Error Filesystem (`error')

The error (`type:=error') filesystem type is used internally as a catch-all in the case where none of the other filesystems was selected, or some other error occurred. Lookups and mounts always fail with "No such file or directory". All other operations trivially succeed.

The error filesystem is not directly accessible.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.22 Top-level Filesystem (`toplvl')

The toplvl (`type:=toplvl') filesystems is derived from the `auto' filesystem and is used to mount the top-level automount nodes. Requests of this type are automatically generated from the command line arguments.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.23 Root Filesystem (`root')

The root (`type:=root') filesystem type acts as an internal placeholder onto which Amd can pin `toplvl' mounts. Only one node of this type need ever exist and one is created automatically during startup. The effect of having more than one root node is undefined.

The root filesystem is not directly accessible.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.24 Inheritance Filesystem (`inherit')

The inheritance (`type:=inherit') filesystem is not directly accessible. Instead, internal mount nodes of this type are automatically generated when Amd is started with the -r option. At this time the system mount table is scanned to locate any filesystems which are already mounted. If any reference to these filesystems is made through Amd then instead of attempting to mount it, Amd simulates the mount and inherits the filesystem. This allows a new version of Amd to be installed on a live system simply by killing the old daemon with `SIGTERM' and starting the new one.

This filesystem type is not generally visible externally, but it is possible that the output from `amq -m' may list `inherit' as the filesystem type. This happens when an inherit operation cannot be completed for some reason, usually because a fileserver is down.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6. Amd Configuration File

The `amd.conf' file is the configuration file for Amd, as part of the am-utils suite. This file contains runtime configuration information for the Amd automounter program.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.1 File Format

The `amd.conf' file consists of sections and parameters. A section begins with the name of the section in square brackets `[]' and continues until the next section begins or the end of the file is reached. Sections contain parameters of the form `name = value'.

The file is line-based -- that is, each newline-terminated line represents either a comment, a section name or a parameter. No line-continuation syntax is available.

Section names, parameter names and their values are case sensitive.

Only the first equals sign in a parameter is significant. Whitespace before or after the first equals sign is discarded. Leading, trailing and internal whitespace in section and parameter names is irrelevant. Leading and trailing whitespace in a parameter value is discarded. Internal whitespace within a parameter value is not allowed, unless the whole parameter value is quoted with double quotes as in `name = "some value"'.

Any line beginning with a pound sign `#' is ignored, as are lines containing only whitespace.

The values following the equals sign in parameters are all either a string (no quotes needed if string does not include spaces) or a boolean, which may be given as `yes'/`no'. Case is significant in all values. Some items such as cache timeouts are numeric.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2 The Global Section

The global section must be specified as `[global]'. Parameters in this section either apply to Amd as a whole, or to all other regular map sections which follow. There should be only one global section defined in one configuration file.

It is highly recommended that this section be specified first in the configuration file. If it is not, then regular map sections which precede it will not use global values defined later.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.3 Regular Map Sections

Parameters in regular (non-global) sections apply to a single map entry. For example, if the map section `[/homes]' is defined, then all parameters following it will be applied to the `/homes' Amd-managed mount point.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.4 Common Parameters

These parameters can be specified either in the global or a map-specific section. Entries specified in a map-specific section override the default value or one defined in the global section. If such a common parameter is specified only in the global section, it is applicable to all regular map sections that follow.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.4.1 autofs_use_lofs Parameter

(type=string, default=`yes'). When set to `yes', Amd's autofs code will use lofs-type (loopback) mounts for type:=link mounts, as well as several other cases that require local references. This has the advantage that Amd does not use a secondary mount point and users do not see external pathnames (the infamous /bin/pwd problem, where it reports a different path than the user chdir'ed into). One of the disadvantages of using this option is that the autofs code is relatively new and the in-place mounts have not been throughly tested.

If this option is set to `no', then Amd's autofs code will use symlinks instead of lofs-type mounts for local references. This has the advantage of using simpler (more stable) code, but at the expense of negating one of autofs's big advantages: the hiding of Amd's internal paths. Note that symlinks are not supported in all autofs implementations, especially those derived from Solaris Autofs v1. Also, on Solaris 2.6 and newer, autofs symlinks are not cached, resulting in repeated up-call requests to Amd.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.4.2 browsable_dirs Parameter

(type=string, default=`no'). If `yes', then Amd's top-level mount points will be browsable to readdir(3) calls. This means you could run for example ls(1) and see what keys are available to mount in that directory. Not all entries are made visible to readdir(3): the `/defaults' entry, wildcard entries, and those with a `/' in them are not included. If you specify `full' to this option, all but the `/defaults' entry will be visible. Note that if you run a command which will attempt to stat(2) the entries, such as often done by `ls -l' or `ls -F', Amd will attempt to mount every entry in that map. This is often called a "mount storm".

Note that mount storms are mostly avoided by using autofs mounts (`mount_type = autofs').


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.4.3 map_defaults Parameter

(type=string, default to empty). This option sets a string to be used as the map's /defaults entry, overriding any /defaults specified in the map. This allows local users to override a given map's defaults without modifying maps globally (which is impossible in sites where the maps are managed by a different administrative group).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.4.4 map_options Parameter

(type=string, default no options). This option is the same as specifying map options on the command line to Amd, such as `cache:=all'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.4.5 map_type Parameter

(type=string, default search all map types). If specified, Amd will initialize the map only for the type given. This is useful to avoid the default map search type used by Amd which takes longer and can have undesired side-effects such as initializing NIS even if not used. Possible values are

`file'

plain files

`hesiod'

Hesiod name service from MIT

`ldap'

Lightweight Directory Access Protocol

`ndbm'

(New) dbm style hash files

`nis'

Network Information Services (version 2)

`nisplus'

Network Information Services Plus (version 3)

`passwd'

local password files

`union'

union maps


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.4.6 mount_type Parameter

(type=string, default=`nfs'). All Amd mount types default to NFS. That is, Amd is an NFS server on the map mount points, for the local host it is running on. If `autofs' is specified, Amd will be an autofs server for those mount points.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.4.7 search_path Parameter

(type=string, default no search path). This provides a (colon-delimited) search path for file maps. Using a search path, sites can allow for local map customizations and overrides, and can distributed maps in several locations as needed.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.4.8 selectors_in_defaults Parameter

(type=boolean, default=`no'). If `yes', then the `/defaults' entry of maps will search for and process any selectors before setting defaults for all other keys in that map. Useful when you want to set different options for a complete map based on some parameters. For example, you may want to better the NFS performance over slow slip-based networks as follows:

 
/defaults \
    wire==slip-net;opts:=intr,rsize=1024,wsize=1024 \
    wire!=slip-net;opts:=intr,rsize=8192,wsize=8192

Deprecated form: selectors_on_default.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.4.9 sun_map_syntax Parameter

(type=boolean, default=`no'). If `yes', then Amd will parse the map according to the Sun Automount syntax.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5 Global Parameters

The following parameters are applicable to the `[global]' section only.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.1 arch Parameter

(type=string, default to compiled in value). Same as the -A option to Amd. Allows you to override the value of the arch Amd variable.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.2 auto_attrcache Parameter

(type=numeric, default=0). Specify in seconds (or units of 0.1 seconds, depending on the OS), what is the (kernel-side) NFS attribute cache timeout for Amd's own automount points. A value of 0 is supposed to turn off attribute caching, meaning that Amd will be consulted via a kernel-RPC each time someone stat()'s the mount point (which could be abused as a denial-of-service attack).

WARNING: Amd depends on being able to turn off the NFS attribute cache of the client OS. If it cannot be turned off, then users may get ESTALE errors or symlinks that point to the wrong places. This is more likely under heavy use of Amd, for example if your system is experiencing frequent map changes or frequent mounts/unmounts. Therefore, under normal circumstances, this parameter should remain set to 0, to ensure that the attribute cache is indeed off.

Unfortunately, some kernels (e.g., certain BSDs) don't have a way to turn off the NFS attribute cache. Setting this parameter to 0 is supposed to turn off attribute caching entirely, but unfortunately it does not; instead, the attribute cache is set to some internal hard-coded default (usually anywhere from 5-30 seconds). If you suspect that your OS doesn't have a reliable way of turning off the attribute cache, then it is better to set this parameter to the smallest possible non-zero value (set `auto_attrcache=1' in your amd.conf). This will not eliminate the problem, but reduce the risk window somewhat. The best solutions are (1) to use Amd in Autofs mode, if it's supported in your OS, and (2) talk to your OS vendor to support a true `noac' flag. See the README.attrcache document for more details.

If you are able to turn off the attribute cache on your OS, alas, Amd's performance may degrade (when not using Autofs) because every traversal of an automounter-controlled pathname will result in a lookup request from the kernel to Amd. Under heavy loads, for example when using recursive tools like `find', `rdist', or `rsync', this performance degradation can be noticeable. There are two possible solutions that some administrators have chosen to improve performance:

  1. First, you can turn off unmounting using the `nounmount' mount option. This will ensure that no Amd symlink could ever change, thereby the kernel's attribute cache and Amd will always be in sync. However, this method will cause the number of mounts to keep growing, even if some are no longer in use; this has the disadvantage that your system could be more susceptible to hangs if even one of those accumulating mounts hangs due to a downed server.
  2. Second, you can turn on attribute caching carefully by setting a small automounter attribute cache value (say, one second), and a relatively large dismount interval (say, one hour). (See section dismount_interval Parameter.) For example, you can set this in your amd.conf:
     
    [global]
    auto_attrcache = 1
    dismount_interval = 3600
    

    This has the benefit of using the kernel's attribute cache and thus improving performance. The disadvantage with this option is that the window of vulnerability is not eliminated entirely: it is only made smaller.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.3 auto_dir Parameter

(type=string, default=`/a'). Same as the -a option to Amd. This sets the private directory where Amd will create sub-directories for its real mount points.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.4 cache_duration Parameter

(type=numeric, default=300). Same as the -c option to Amd. Sets the duration in seconds that looked-up or mounted map entries remain in the cache.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.5 cluster Parameter

(type=string, default no cluster). Same as the -C option to Amd. Specifies the alternate HP-UX cluster to use.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.6 debug_mtab_file Parameter

(type=string, default="/tmp/mtab"). Path to mtab file that is used by Amd to store a list of mounted file systems during debug-mtab mode. This option only applies to systems that store mtab information on disk.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.7 debug_options Parameter

(type=string, default no debug options). Same as the -D option to Amd. Specify any debugging options for Amd. Works only if am-utils was configured for debugging using the --enable-debug option. The additional `mem' option can be turned on via --enable-debug=mem. Otherwise debugging options are ignored. Options are comma delimited, and can be preceded by the string `no' to negate their meaning. You can get the list of supported debugging and logging options by running amd -H. Possible values those listed for the -D option. See section -D opts.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.8 dismount_interval Parameter

(type=numeric, default=120). Same as the -w option to Amd. Specify in seconds, the time between attempts to dismount file systems that have exceeded their cached times.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.9 domain_strip Parameter

(type=boolean, default=`yes'). If `yes', then the domain name part referred to by ${rhost} is stripped off. This is useful to keep logs and smaller. If `no', then the domain name part is left changed. This is useful when using multiple domains with the same maps (as you may have hosts whose domain-stripped name is identical).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.10 exec_map_timeout Parameter

(type=numeric, default=10). The timeout in seconds that Amd will wait for an executable map program before an answer is returned from that program (or script). This value should be set to as small as possible while still allowing normal replies to be returned before the timer expires, because during the time that the executable map program is queried, Amd is essentially waiting and is thus not responding to any other queries. See section Executable maps.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.11 forced_unmounts Parameter

(type=boolean, default=`no'). Sometimes, mount points are hung due to unrecoverable conditions, such as when NFS servers migrate, change their IP address, are down permanently, or due to hardware failures, and more. In this case, attempting to unmount an existing mount point, or even just to stat(2) it, results in one of three fatal errors: EIO, ESTALE, or EBUSY. At that point, Amd can do little to recover that hung point (in fact, the OS cannot automatically recover either). For that reason, some OSs support special kinds of forced unmounts, which must be used very carefully: they will force an unmount immediately (or lazily on Linux), which could result in application data loss. However, that may be the only way to recover the entire host (without rebooting). Once a hung mount point is forced out, Amd can then re-mount a replacement one (if available), bringing a mostly-hung system back to operation and avoiding a potentially costly reboot.

If the `forced_unmounts' option is set to `yes', and the client OS supports forced or lazy unmounts, then Amd will attempt to use them if it gets any of the three serious error conditions listed above. Note that Amd will force the unmount of mount points that returned EBUSY only for `type:=toplvl' mounts (see section Top-level Filesystem (`toplvl')): that is, Amd's own mount points. This is useful to recover from a previously hung Amd, and to ensure that an existing Amd can shutdown cleanly even if some processes are keeping its mount points busy (i.e., when a user's shell process uses cd to set its CWD to Amd's own mount point).

If this option is set to `no' (the default), then Amd will not attempt this special recovery procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.12 full_os Parameter

(type=string, default to compiled in value). The full name of the operating system, along with its version. Allows you to override the compiled-in full name and version of the operating system. Useful when the compiled-in name is not desired. For example, the full operating system name on linux comes up as `linux', but you can override it to `linux-2.2.5'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.13 fully_qualified_hosts Parameter

(type=string, default=`no'). If `yes', Amd will perform RPC authentication using fully-qualified host names. This is necessary for some systems, and especially when performing cross-domain mounting. For this function to work, the Amd variable `${hostd}' is used, requiring that `${domain}' not be null.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.14 hesiod_base Parameter

(type=string, default=`automount'). Specify the base name for hesiod maps.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.15 karch Parameter

(type=string, default to karch of the system). Same as the -k option to Amd. Allows you to override the kernel-architecture of your system. Useful for example on Sun (Sparc) machines, where you can build one Amd binary, and run it on multiple machines, yet you want each one to get the correct karch variable set (for example, sun4c, sun4m, sun4u, etc.) Note that if not specified, Amd will use uname(2) to figure out the kernel architecture of the machine.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.16 ldap_base Parameter

(type=string, default not set). Specify the base name for LDAP. This often includes LDAP-specific values such as country and organization.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.17 ldap_cache_maxmem Parameter

(type=numeric, default=131072). Specify the maximum memory Amd should use to cache LDAP entries.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.18 ldap_cache_seconds Parameter

(type=numeric, default=0). Specify the number of seconds to keep entries in the cache.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.19 ldap_hostports Parameter

(type=string, default not set). Specify the LDAP host and port values.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.20 ldap_proto_version Parameter

(type=numeric, default=2). Specify the LDAP protocol version to use. With a value of 3 will use LDAPv3 protocol.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.21 local_domain Parameter

(type=string, default no sub-domain). Same as the -d option to Amd. Specify the local domain name. If this option is not given the domain name is determined from the hostname, by removing the first component of the fully-qualified host name.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.22 localhost_address Parameter

(type=string, default to localhost or 127.0.0.1). Specify the name or IP address for Amd to use when connecting the sockets for the local NFS server and the RPC server. This defaults to 127.0.0.1 or whatever the host reports as its local address. This parameter is useful on hosts with multiple addresses where you want to force Amd to connect to a specific address.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.23 log_file Parameter

(type=string, default=`stderr'). Same as the -l option to Amd. Specify a file name to log Amd events to. If the string `/dev/stderr' is specified, Amd will send its events to the standard error file descriptor.

If the string `syslog' is given, Amd will record its events with the system logger syslogd(8). If your system supports syslog facilities, then the default facility used is `LOG_DAEMON'.

When using syslog, if you wish to change the facility, append its name to the option name, delimited by a single colon. For example, if it is the string `syslog:local7' then Amd will log messages via syslog(3) using the `LOG_LOCAL7' facility. If the facility name specified is not recognized, Amd will default to `LOG_DAEMON'. Note: while you can use any syslog facility available on your system, it is generally a bad idea to use those reserved for other services such as `kern', `lpr', `cron', etc.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.24 log_options Parameter

(type=string, default="defaults"). Same as the -x option to Amd. Specify any logging options for Amd. Options are comma delimited, and can be preceded by the string `no' to negate their meaning. The `debug' logging option is only available if am-utils was configured with --enable-debug. You can get the list of supported debugging options by running amd -H. Possible values are:

`all'

all messages

`defaults'

an alias for "fatal,error,user,warning,info"

`debug'

debug messages

`error'

non-fatal system errors (cannot be turned off)

`fatal'

fatal errors (cannot be turned off)

`info'

information

`map'

map errors

`stats'

additional statistical information

`user'

non-fatal user errors

`warn'

warnings

`warning'

warnings


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.25 map_reload_interval Parameter

(type=numeric, default=3600). The number of seconds that Amd will wait before it checks to see if any maps have changed at their source (NIS servers, LDAP servers, files, etc.). Amd will reload only those maps that have changed.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.26 nfs_allow_any_interface Parameter

(type=string, default=`no'). Normally Amd accepts local NFS packets only from 127.0.0.1. If this parameter is set to `yes', then amd will accept local NFS packets from any local interface; this is useful on hosts that may have multiple interfaces where the system is forced to send all outgoing packets (even those bound to the same host) via an address other than 127.0.0.1.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.27 nfs_allow_insecure_port Parameter

(type=string, default=`no'). Normally Amd will refuse requests coming from unprivileged ports (i.e., ports >= 1024 on Unix systems), so that only privileged users and the kernel can send NFS requests to it. However, some kernels (certain versions of Darwin, MacOS X, and Linux) have bugs that cause them to use unprivileged ports in certain situations, which causes Amd to stop dead in its tracks. This parameter allows Amd to operate normally even on such systems, at the expense of a slight decrease in the security of its operations. If you see messages like "ignoring request from foo:1234, port not reserved" in your Amd log, try enabling this parameter and give it another go.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.28 nfs_proto Parameter

(type=string, default to trying version tcp then udp). By default, Amd tries tcp and then udp. This option forces the overall NFS protocol used to TCP or UDP. It overrides what is in the Amd maps, and is useful when Amd is compiled with TCP support in NFSv2/NFSv3 that may not be stable. With this option you can turn off the complete usage of TCP for NFS dynamically (without having to recompile Amd), and use UDP only, until such time as TCP support is desired again.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.29 nfs_retransmit_counter Parameter

(type=numeric, default=11). Same as the retransmit part of the -t timeout.retransmit option to Amd. Specifies the number of NFS retransmissions that the kernel will use to communicate with Amd using either UDP or TCP mounts. See section -t timeout.retransmit.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.30 nfs_retransmit_counter_udp Parameter

(type=numeric, default=11). Same as the nfs_retransmit_counter parameter, but applied globally only to UDP mounts. See section nfs_retransmit_counter Parameter.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.31 nfs_retransmit_counter_tcp Parameter

(type=numeric, default=11). Same as the nfs_retransmit_counter parameter, but applied globally only to TCP mounts. See section nfs_retransmit_counter Parameter.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.32 nfs_retransmit_counter_toplvl Parameter

(type=numeric, default=11). Same as the nfs_retransmit_counter parameter, applied only for Amd's top-level UDP mounts. On some systems it is useful to set this differently than the OS default, so as to better tune Amd's responsiveness under heavy scheduler loads. See section nfs_retransmit_counter Parameter.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.33 nfs_retry_interval Parameter

(type=numeric, default=8). Same as the timeout part of the -t timeout.retransmit option to Amd. Specifies the NFS timeout interval, in tenths of seconds, between NFS/RPC retries (for UDP or TCP). This is the value that the kernel will use to communicate with Amd. See section -t timeout.retransmit.

Amd relies on the kernel RPC retransmit mechanism to trigger mount retries. The values of the nfs_retransmit_counter and the nfs_retry_interval parameters change the overall retry interval. Too long an interval gives poor interactive response; too short an interval causes excessive retries.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.34 nfs_retry_interval_udp Parameter

(type=numeric, default=8). Same as the nfs_retry_interval parameter, but applied globally only to UDP mounts. See section nfs_retry_interval Parameter.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.35 nfs_retry_interval_tcp Parameter

(type=numeric, default=8). Same as the nfs_retry_interval parameter, but applied globally only to TCP mounts. See section nfs_retry_interval Parameter.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.36 nfs_retry_interval_toplvl Parameter

(type=numeric, default=8). Same as the nfs_retry_interval parameter, applied only for Amd's top-level UDP mounts. On some systems it is useful to set this differently than the OS default, so as to better tune Amd's responsiveness under heavy scheduler loads. See section nfs_retry_interval Parameter.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.37 nfs_vers Parameter

(type=numeric, default to trying version 3 then 2). By default, Amd tries version 3 and then version 2. This option forces the overall NFS protocol used to version 3 or 2. It overrides what is in the Amd maps, and is useful when Amd is compiled with NFSv3 support that may not be stable. With this option you can turn off the complete usage of NFSv3 dynamically (without having to recompile Amd), and use NFSv2 only, until such time as NFSv3 support is desired again.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.38 nis_domain Parameter

(type=string, default to local NIS domain name). Same as the -y option to Amd. Specify an alternative NIS domain from which to fetch the NIS maps. The default is the system domain name. This option is ignored if NIS support is not available.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.39 normalize_hostnames Parameter

(type=boolean, default=`no'). Same as the -n option to Amd. If `yes', then the name referred to by ${rhost} is normalized relative to the host database before being used. The effect is to translate aliases into "official" names.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.40 normalize_slashes Parameter

(type=boolean, default=`yes'). If `yes' then amd will condense all multiple / (slash) characters into one and remove all trailing slashes. If `no', then amd will not touch strings that may contain repeated or trailing slashes. The latter is sometimes useful with SMB mounts, which often require multiple slash characters in pathnames.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.41 os Parameter

(type=string, default to compiled in value). Same as the -O option to Amd. Allows you to override the compiled-in name of the operating system. Useful when the built-in name is not desired for backward compatibility reasons. For example, if the built-in name is `sunos5', you can override it to `sos5', and use older maps which were written with the latter in mind.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.42 osver Parameter

(type=string, default to compiled in value). Same as the -o option to Amd. Allows you to override the compiled-in version number of the operating system. Useful when the built-in version is not desired for backward compatibility reasons. For example, if the build in version is `2.5.1', you can override it to `5.5.1', and use older maps that were written with the latter in mind.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.43 pid_file Parameter

(type=string, default=`/dev/stdout'). Specify a file to store the process ID of the running daemon into. If not specified, Amd will print its process id onto the standard output. Useful for killing Amd after it had run. Note that the PID of a running Amd can also be retrieved via Amq (see section Amq -p option).

This file is used only if the `print_pid' option is on (see section print_pid Parameter).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.44 plock Parameter

(type=boolean, default=`yes'). Same as the -S option to Amd. If `yes', lock the running executable pages of Amd into memory. To improve Amd's performance, systems that support the plock(3) or mlockall(2) call can lock the Amd process into memory. This way there is less chance the operating system will schedule, page out, and swap the Amd process as needed. This improves Amd's performance, at the cost of reserving the memory used by the Amd process (making it unavailable for other processes).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.45 portmap_program Parameter

(type=numeric, default=300019). Specify an alternate Port-mapper RPC program number, other than the official number. This is useful when running multiple Amd processes. For example, you can run another Amd in "test" mode, without affecting the primary Amd process in any way. For safety reasons, the alternate program numbers that can be specified must be in the range 300019-300029, inclusive. Amq has an option -P which can be used to specify an alternate program number of an Amd to contact. In this way, amq can fully control any number of Amd processes running on the same host.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.46 preferred_amq_port Parameter

(type=numeric, default=0). Specify an alternate Port-mapper RPC port number for Amd's Amq service. This is used for both UDP and TCP. Setting this value to 0 (or not defining it) will cause Amd to select an arbitrary port number. Setting the Amq RPC service port to a specific number is useful in firewalled or NAT'ed environments, where you need to know which port Amd will listen on.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.47 print_pid Parameter

(type=boolean, default=`no'). Same as the -p option to Amd. If `yes', Amd will print its process ID upon starting.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.48 print_version Parameter

(type=boolean, default=`no'). Same as the -v option to Amd, but the version prints and Amd continues to run. If `yes', Amd will print its version information string, which includes some configuration and compilation values.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.49 restart_mounts Parameter

(type=boolean, default=`no'). Same as the -r option to Amd. If `yes' Amd will scan the mount table to determine which file systems are currently mounted. Whenever one of these would have been auto-mounted, Amd inherits it.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.50 show_statfs_entries Parameter

(type=boolean), default=`no'). If `yes', then all maps which are browsable will also show the number of entries (keys) they have when df(1) runs. (This is accomplished by returning non-zero values to the statfs(2) system call).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.51 truncate_log Parameter

(type=boolean), default=`no'). If `yes', then Amd will truncate the log file (if it's a regular file) on startup. This could be useful when conducting extensive testing on Amd maps (or Amd itself) and you don't want to see log data from a previous run in the same file.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.52 unmount_on_exit Parameter

(type=boolean, default=`no'). If `yes', then Amd will attempt to unmount all file systems which it knows about. Normally it leaves all (esp. NFS) mounted file systems intact. Note that Amd does not know about file systems mounted before it starts up, unless the `restart_mounts' option is used (see section restart_mounts Parameter).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.53 use_tcpwrappers Parameter

(type=boolean), default=`yes'). If `yes', then amd will use the tcpwrappers (tcpd/librwap) library (if available) to control access to Amd via the /etc/hosts.allow and /etc/hosts.deny files. Amd will verify that the host running Amq is authorized to connect. The amd service name must used in the /etc/hosts.allow and /etc/hosts.deny files. For example, to allow only localhost to connect to Amd, add this line to /etc/hosts.allow:

 
amd: localhost

and this line to /etc/hosts.deny:

 
amd: ALL

Consult the man pages for hosts_access(5) for more information on using the tcpwrappers access-control library.

Note that in particular, you should not configure your hosts.allow file to spawn a command for Amd: that will cause Amd to not be able to waitpid on the child process ID of any background un/mount that Amd issued, resulting in a confused Amd that does not know what happened to those background un/mount requests.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.54 vendor Parameter

(type=string, default to compiled in value). The name of the vendor of the operating system. Overrides the compiled-in vendor name. Useful when the compiled-in name is not desired. For example, most Intel based systems set the vendor name to `unknown', but you can set it to `redhat'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.6 Regular Map Parameters

The following parameters are applicable only to regular map sections.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.6.1 map_name Parameter

(type=string, must be specified). Name of the map where the keys are located.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.6.2 tag Parameter

(type=string, default no tag). Each map entry in the configuration file can be tagged. If no tag is specified, that map section will always be processed by Amd. If it is specified, then Amd will process the map if the -T option was given to Amd, and the value given to that command-line option matches that in the map section.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.7 amd.conf Examples

The following is the actual amd.conf file I used at the Computer Science Department of Columbia University.

 
# GLOBAL OPTIONS SECTION
[ global ]
normalize_hostnames =    no
print_pid =              no
#pid_file =              /var/run/amd.pid
restart_mounts =         yes
#unmount_on_exit =       yes
auto_dir =               /n
log_file =               /var/log/amd
log_options =            all
#debug_options =         defaults
plock =                  no
selectors_in_defaults =  yes
# config.guess picks up "sunos5" and I don't want to edit my maps yet
os =                     sos5
# if you print_version after setting up "os", it will show it.
print_version =          no
map_type =               file
search_path =            /etc/amdmaps:/usr/lib/amd:/usr/local/AMD/lib
browsable_dirs =         yes
fully_qualified_hosts =  no

# DEFINE AN AMD MOUNT POINT
[ /u ]
map_name =               amd.u

[ /proj ]
map_name =               amd.proj

[ /src ]
map_name =               amd.src

[ /misc ]
map_name =               amd.misc

[ /import ]
map_name =               amd.import

[ /tftpboot/.amd ]
tag =                    tftpboot
map_name =               amd.tftpboot

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7. Run-time Administration


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.1 Starting Amd

Amd is best started from `/etc/rc.local' on BSD systems, or from the appropriate start-level script in `/etc/init.d' on System V systems.

 
if [ -f /usr/local/sbin/ctl-amd ]; then
    /usr/local/sbin/ctl-amd start; (echo -n ' amd') > /dev/console
fi

The shell script, `ctl-amd' is used to start, stop, or restart Amd. It is a relatively generic script. All options you want to set should not be made in this script, but rather updated in the `amd.conf' file. See section Amd Configuration File.

If you do not wish to use an Amd configuration file, you may start Amd manually. For example, getting the map entries via NIS:

 
amd -r -l /var/log/amd `ypcat -k auto.master`

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.2 Stopping Amd

Amd stops in response to two signals.

`SIGTERM'

causes the top-level automount points to be unmounted and then Amd to exit. Any automounted filesystems are left mounted. They can be recovered by restarting Amd with the -r command line option.

`SIGINT'

causes Amd to attempt to unmount any filesystems which it has automounted, in addition to the actions of `SIGTERM'. This signal is primarily used for debugging.

Actions taken for other signals are undefined.

The easiest and safest way to stop Amd, without having to find its process ID by hand, is to use the `ctl-amd' script, as with:

 
ctl-amd stop

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.3 Restarting Amd

Before Amd can be started, it is vital to ensure that no other Amd processes are managing any of the mount points, and that the previous process(es) have terminated cleanly. When a terminating signal is set to Amd, the automounter does not terminate right then. Rather, it starts by unmounting all of its managed mount mounts in the background, and then terminates. It usually takes a few seconds for this process to happen, but it can take an arbitrarily longer time. If two or more Amd processes attempt to manage the same mount point, it usually will result in a system lockup.

The easiest and safest way to restart Amd, without having to find its process ID by hand, sending it the `SIGTERM' signal, waiting for Amd to die cleanly, and verifying so, is to use the `ctl-amd' script, as with:

 
ctl-amd restart

The script will locate the process ID of Amd, kill it, and wait for it to die cleanly before starting a new instance of the automounter. `ctl-amd' will wait for a total of 30 seconds for Amd to die, and will check once every 5 seconds if it had.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4 Controlling Amd

It is sometimes desirable or necessary to exercise external control over some of Amd's internal state. To support this requirement, Amd implements an RPC interface which is used by the Amq program. A variety of information is available.

Amq generally applies an operation, specified by a single letter option, to a list of mount points. The default operation is to obtain statistics about each mount point. This is similar to the output shown above but includes information about the number and type of accesses to each mount point.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4.1 Amq default information

With no arguments, Amq obtains a brief list of all existing mounts created by Amd. This is different from the list displayed by df(1) since the latter only includes system mount points.

The output from this option includes the following information:

For example:

 
/            root   "root"                    sky:(pid75)
/homes       toplvl /usr/local/etc/amd.homes  /homes
/home        toplvl /usr/local/etc/amd.home   /home
/homes/jsp   nfs    charm:/home/charm         /a/charm/home/charm/jsp
/homes/phjk  nfs    toytown:/home/toytown     /a/toytown/home/toytown/ai/phjk

If an argument is given then statistics for that volume name will be output. For example:

 
What         Uid   Getattr Lookup RdDir   RdLnk   Statfs Mounted@
/homes       0     1196    512    22      0       30     90/09/14 12:32:55
/homes/jsp   0     0       0      0       1180    0      90/10/13 12:56:58
What

the volume name.

Uid

ignored.

Getattr

the count of NFS getattr requests on this node. This should only be non-zero for directory nodes.

Lookup

the count of NFS lookup requests on this node. This should only be non-zero for directory nodes.

RdDir

the count of NFS readdir requests on this node. This should only be non-zero for directory nodes.

RdLnk

the count of NFS readlink requests on this node. This should be zero for directory nodes.

Statfs

the count of NFS statfs requests on this node. This should only be non-zero for top-level automount points.

Mounted@

the date and time the volume name was first referenced.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4.2 Amq -f option

The -f option causes Amd to flush the internal mount map cache. This is useful for example in Hesiod maps since Amd will not automatically notice when they have been updated. The map cache can also be synchronized with the map source by using the `sync' option (see section Automount Filesystem (`auto')).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4.3 Amq -h option

By default the local host is used. In an HP-UX cluster the root server is used since that is the only place in the cluster where Amd will be running. To query Amd on another host the -h option should be used.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4.4 Amq -H option

Print a brief help and usage string.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4.5 Amq -l option

Tell Amd to use log_file as the log file name. For security reasons, this must be the same log file which Amd used when started. This option is therefore only useful to refresh Amd's open file handle on the log file, so that it can be rotated and compressed via daily cron jobs.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4.6 Amq -m option

The -m option displays similar information about mounted filesystems, rather than automount points. The output includes the following information:

For example:

 
"root"           truth:(pid602)     root   1 localhost is up
hesiod.home      /home              toplvl 1 localhost is up
hesiod.vol       /vol               toplvl 1 localhost is up
hesiod.homes     /homes             toplvl 1 localhost is up
amy:/home/amy    /a/amy/home/amy    nfs    5 amy is up
swan:/home/swan  /a/swan/home/swan  nfs    0 swan is up (Permission denied)
ex:/home/ex      /a/ex/home/ex      nfs    0 ex is down

When the reference count is zero the filesystem is not mounted but the mount point and server information is still being maintained by Amd.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4.7 Amq -p option

Return the process ID of the remote or locally running Amd. Useful when you need to send a signal to the local Amd process, and would rather not have to search through the process table. This option is used in the `ctl-amd' script.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4.8 Amq -P option

Contact an alternate running Amd that had registered itself on a different RPC program_number and apply all other operations to that instance of the automounter. This is useful when you run multiple copies of Amd, and need to manage each one separately. If not specified, Amq will use the default program number for Amd, 300019. For security reasons, the only alternate program numbers Amd can use range from 300019 to 300029, inclusive.

For example, to kill an alternate running Amd:

 
kill `amq -p -P 300020`

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4.9 Amq -s option

The -s option displays global statistics. If any other options are specified or any filesystems named then this option is ignored. For example:

 
requests  stale     mount     mount     unmount
deferred  fhandles  ok        failed    failed
1054      1         487       290       7017
`Deferred requests'

are those for which an immediate reply could not be constructed. For example, this would happen if a background mount was required.

`Stale filehandles'

counts the number of times the kernel passes a stale filehandle to Amd. Large numbers indicate problems.

`Mount ok'

counts the number of automounts which were successful.

`Mount failed'

counts the number of automounts which failed.

`Unmount failed'

counts the number of times a filesystem could not be unmounted. Very large numbers here indicate that the time between unmount attempts should be increased.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4.10 Amq -T option

The -T option causes the Amq to contact Amd using the TCP transport only (connection oriented). Normally, Amq will use TCP first, and if that failed, will try UDP.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4.11 Amq -U option

The -U option causes the Amq to contact Amd using the UDP transport only (connectionless). Normally, Amq will use TCP first, and if that failed, will try UDP.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4.12 Amq -u option

The -u option causes the time-to-live interval of the named mount points to be expired, thus causing an unmount attempt. This is the only safe way to unmount an automounted filesystem. It is not possible to unmount a filesystem which has been mounted with the `nounmount' flag.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4.13 Amq -v option

The -v option displays the version of Amd in a similar way to Amd's -v option.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4.14 Amq -w option

The -w option translates a full pathname as returned by getpwd(3) into a short Amd pathname that goes through its mount points. This option requires that Amd is running.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4.15 Other Amq options

Two other operations are implemented. These modify the state of Amd as a whole, rather than any particular filesystem. The -x and -D options have exactly the same effect as Amd's corresponding command line options.

When Amd receives the -x flag, it disallows turning off the `fatal' or `error' flags. Both are on by default. They are mandatory so that Amd could report important errors, including errors relating to turning flags on/off.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8. FSinfo

XXX: this chapter should be reviewed by someone knowledgeable with fsinfo.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.1 FSinfo overview

FSinfo is a filesystem management tool. It has been designed to work with Amd to help system administrators keep track of the ever increasing filesystem namespace under their control.

The purpose of FSinfo is to generate all the important standard filesystem data files from a single set of input data. Starting with a single data source guarantees that all the generated files are self-consistent. One of the possible output data formats is a set of Amd maps which can be used among the set of hosts described in the input data.

FSinfo implements a declarative language. This language is specifically designed for describing filesystem namespace and physical layouts. The basic declaration defines a mounted filesystem including its device name, mount point, and all the volumes and access permissions. FSinfo reads this information and builds an internal map of the entire network of hosts. Using this map, many different data formats can be produced including `/etc/fstab', `/etc/exports', Amd mount maps and `/etc/bootparams'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.2 Using FSinfo

The basic strategy when using FSinfo is to gather all the information about all disks on all machines into one set of declarations. For each machine being managed, the following data is required:

The following information can also be entered into the same configuration files so that all data can be kept in one place.

To generate Amd mount maps, the automount tree must also be defined (see section Defining an Amd Mount Map in FSinfo). This will have been designed at the time the volume names were allocated. Some volume names will not be automounted, so FSinfo needs an explicit list of which volumes should be automounted.

Hostnames are required at several places in the FSinfo language. It is important to stick to either fully qualified names or unqualified names. Using a mixture of the two will inevitably result in confusion.

Sometimes volumes need to be referenced which are not defined in the set of hosts being managed with FSinfo. The required action is to add a dummy set of definitions for the host and volume names required. Since the files generated for those particular hosts will not be used on them, the exact values used is not critical.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.3 FSinfo grammar

FSinfo has a relatively simple grammar. Distinct syntactic constructs exist for each of the different types of data, though they share a common flavor. Several conventions are used in the grammar fragments below.

The notation, list(xxx), indicates a list of zero or more xxx's. The notation, opt(xxx), indicates zero or one xxx. Items in double quotes, eg "host", represent input tokens. Items in angle brackets, eg <hostname>, represent strings in the input. Strings need not be in double quotes, except to differentiate them from reserved words. Quoted strings may include the usual set of C "\" escape sequences with one exception: a backslash-newline-whitespace sequence is squashed into a single space character. To defeat this feature, put a further backslash at the start of the second line.

At the outermost level of the grammar, the input consists of a sequence of host and automount declarations. These declarations are all parsed before they are analyzed. This means they can appear in any order and cyclic host references are possible.

 
fsinfo      : list(fsinfo_attr) ;

fsinfo_attr : host | automount ;

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.4 FSinfo host definitions

A host declaration consists of three parts: a set of machine attribute data, a list of filesystems physically attached to the machine, and a list of additional statically mounted filesystems.

 
host        : "host" host_data list(filesystem) list(mount) ;

Each host must be declared in this way exactly once. Such things as the hardware address, the architecture and operating system types and the cluster name are all specified within the host data.

All the disks the machine has should then be described in the list of filesystems. When describing disks, you can specify what volname the disk/partition should have and all such entries are built up into a dictionary which can then be used for building the automounter maps.

The list of mounts specifies all the filesystems that should be statically mounted on the machine.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.5 FSinfo host attributes

The host data, host_data, always includes the hostname. In addition, several other host attributes can be given.

 
host_data   : <hostname>
            | "{" list(host_attrs) "}" <hostname>
            ;

host_attrs  : host_attr "=" <string>
            | netif
            ;

host_attr   : "config"
            | "arch"
            | "os"
            | "cluster"
            ;

The hostname is, typically, the fully qualified hostname of the machine.

Examples:

 
host dylan.doc.ic.ac.uk

host {
    os = hpux
    arch = hp300
} dougal.doc.ic.ac.uk

The options that can be given as host attributes are shown below.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.5.1 netif Option

This defines the set of network interfaces configured on the machine. The interface attributes collected by FSinfo are the IP address, subnet mask and hardware address. Multiple interfaces may be defined for hosts with several interfaces by an entry for each interface. The values given are sanity checked, but are currently unused for anything else.

 
netif       : "netif" <string> "{" list(netif_attrs) "}" ;

netif_attrs : netif_attr "=" <string> ;

netif_attr  : "inaddr" | "netmask" | "hwaddr" ;

Examples:

 
netif ie0 {
    inaddr  = 129.31.81.37
    netmask = 0xfffffe00
    hwaddr  = "08:00:20:01:a6:a5"
}

netif ec0 { }

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.5.2 config Option

This option allows you to specify configuration variables for the startup scripts (`rc' scripts). A simple string should immediately follow the keyword.

Example:

 
config "NFS_SERVER=true"
config "ZEPHYR=true"

This option is currently unsupported.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.5.3 arch Option

This defines the architecture of the machine. For example:

 
arch = hp300

This is intended to be of use when building architecture specific mountmaps, however, the option is currently unsupported.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.5.4 os Option

This defines the operating system type of the host. For example:

 
os = hpux

This information is used when creating the `fstab' files, for example in choosing which format to use for the `fstab' entries within the file.