This is am-utils.info, produced by makeinfo version 4.1 from
am-utils.texi.

START-INFO-DIR-ENTRY
* Am-utils: (am-utils).          The Amd automounter suite of utilities
END-INFO-DIR-ENTRY


File: am-utils.info,  Node: Top,  Next: License,  Up: (DIR)

   Am-utils - The 4.4BSD Automounter Tool Suite
*********************************************

   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.

* Menu:

* License::                  Explains the terms and conditions for using
                             and distributing Am-utils.
* Distrib::                  How to get the latest Am-utils distribution.
* Intro::                    An introduction to Automounting concepts.
* History::                  History of am-utils' development.
* Overview::                 An overview of Amd.
* Supported Platforms::      Machines and Systems supported by Amd.
* Mount Maps::               Details of mount maps
* Amd Command Line Options:: All the Amd command line options explained.
* Filesystem Types::         The different mount types supported by Amd.
* Amd Configuration File::   The amd.conf file syntax and meaning.
* Run-time Administration::  How to start, stop and control Amd.
* FSinfo::                   The FSinfo filesystem management tool.
* Hlfsd::                    The Home-Link Filesystem server.
* Assorted Tools::           Other tools which come with am-utils.
* Examples::                 Some examples showing how Amd might be used.
* Internals::                Implementation details.
* Acknowledgments & Trademarks:: Legal Notes

Indexes
* Index::                    An item for each concept.


File: am-utils.info,  Node: License,  Next: Distrib,  Prev: Top,  Up: Top

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.


File: am-utils.info,  Node: Distrib,  Next: Intro,  Prev: License,  Up: Top

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
<ezk@cs.columbia.edu> at the Computer Science Department
(http://www.cs.columbia.edu/) of Columbia University
(http://www.columbia.edu/), as part of his PhD thesis work
(http://www.cs.columbia.edu/~ezk/research/tp/thesis_proposal.html).
*Note History::, for more details.

Bug Reports
===========

   Before reporting a bug, see if it is a known one in the bugs
(http://www.am-utils.org/BUGS.txt) file.  Send all bug reports to
<amd-dev@majordomo.cs.columbia.edu> quoting the details of the release
and your configuration.  These 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 (http://www.am-utils.org/AUTHORS.txt).

Mailing List
============

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

  1. The older list, `amd-workers' is for general "how to" questions and
     announcements.  To subscribe, send a note to
     <amd-workers-request@majordomo.glue.umd.edu>.(1)  To post a
     message to this list, send mail to
     <amd-workers@majordomo.glue.umd.edu>.

  2. The developers only list, `amd-dev' is for

        - announcements of alpha and beta releases of am-utils

        - reporting of bugs and patches

        - discussions of new features for am-utils

        - implementation and porting issues

     To subscribe, send a note to <majordomo@majordomo.cs.columbia.edu>
     with the single body text line `subscribe amd-dev'.  To post a
     message to this list, send mail to
     <amd-dev@majordomo.cs.columbia.edu>.  To avoid as much spam as
     possible, only subscribers to this list may post to it.

     Subscribers of `amd-dev' are most suitable if they have the time
     and resources to test new and buggy 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,
     and of course, be very familiar with the complex code in the
     am-utils package.  In other words, subscribers on this list should
     be able to contribute meaningfully to the development of amd.


   ---------- Footnotes ----------

   (1) Note that the older address, <amd-workers-request@acl.lanl.gov>,
is defunct.


File: am-utils.info,  Node: Intro,  Next: History,  Prev: Distrib,  Up: Top

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.


File: am-utils.info,  Node: History,  Next: Overview,  Prev: Intro,  Up: Top

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 <ezk@cs.columbia.edu>), and available from
<ftp://ftp.cs.columbia.edu/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.


File: am-utils.info,  Node: Overview,  Next: Supported Platforms,  Prev: History,  Up: Top

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.  *Note 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.

* Menu:

* Fundamentals::
* Filesystems and Volumes::
* Volume Naming::
* Volume Binding::
* Operational Principles::
* Mounting a Volume::
* Automatic Unmounting::
* Keep-alives::
* Non-blocking Operation::


File: am-utils.info,  Node: Fundamentals,  Next: Filesystems and Volumes,  Prev: Overview,  Up: Overview

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.


File: am-utils.info,  Node: Filesystems and Volumes,  Next: Volume Naming,  Prev: Fundamentals,  Up: Overview

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.


File: am-utils.info,  Node: Volume Naming,  Next: Volume Binding,  Prev: Filesystems and Volumes,  Up: Overview

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.


File: am-utils.info,  Node: Volume Binding,  Next: Operational Principles,  Prev: Volume Naming,  Up: Overview

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.


File: am-utils.info,  Node: Operational Principles,  Next: Mounting a Volume,  Prev: Volume Binding,  Up: Overview

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".


File: am-utils.info,  Node: Mounting a Volume,  Next: Automatic Unmounting,  Prev: Operational Principles,  Up: Overview

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:

   * If none of the locations could be used, or if all of the locations
     caused an error, then the last error is returned.

   * If a location could be used but was being mounted in the
     background then Amd marks that mount as being "in progress" and
     continues with the next request; no reply is sent to the kernel.

   * Lastly, one or more of the mounts may have been "deferred".  A
     mount is deferred if extra information is required before the
     mount can proceed.  When the information becomes available the
     mount will take place, but in the mean time no reply is sent to
     the kernel.  If the mount is deferred, Amd continues to try any
     remaining locations.

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


File: am-utils.info,  Node: Automatic Unmounting,  Next: Keep-alives,  Prev: Mounting a Volume,  Up: Overview

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 (*note -w: -w
Option.) or the amd.conf parameter `dismount_interval' (*note
dismount_interval Parameter::).  It is also possible to set this value
on a per-mount basis (*note opts: opts Option.).

   Filesystems can be forcefully timed out using the Amq command.
*Note Run-time Administration::.


File: am-utils.info,  Node: Keep-alives,  Next: Non-blocking Operation,  Prev: Automatic Unmounting,  Up: Overview

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.

   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.


File: am-utils.info,  Node: Non-blocking Operation,  Prev: Keep-alives,  Up: Overview

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
(*note 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.


File: am-utils.info,  Node: Supported Platforms,  Next: Mount Maps,  Prev: Overview,  Up: Top

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.

   The table below lists those platforms supported by the latest
release.  The listing is based on the standard output from GNU's
`config.guess' script.  Since significant changes have been made to
am-utils, not all systems listed here have been verified working for all
features.

Auto-Configured System Name   Config   Compile   Amd   NFS3   Shlib   Hlfsd
alpha-dec-osf2.1              yes      yes       yes   ?      no      ?
alpha-dec-osf4.0              yes      yes       yes   yes    yes     ?
alpha-dec-osf4.0f             yes      yes       yes   yes    yes     ?
alpha-dec-osf5.1              yes      yes       yes   yes    yes     ?
alphaev5-unknown-linux-gnu    yes      yes       yes   n/a    yes     ?
alphaev5-unknown-linux-gnu-rh5.2yes      yes       yes   n/a    yes     ?
alphaev6-dec-osf5.0           yes      yes       yes   yes    yes     ?
hppa1.0-hp-hpux11.00          yes      yes       yes   no     yes     yes
hppa1.1-hp-hpux10.10          yes      yes       yes   n/a    no      ?
hppa1.1-hp-hpux10.20          yes      yes       yes   no     no      ?
hppa1.1-hp-hpux11.00          yes      yes       yes   UDP    yes     yes
hppa1.1-hp-hpux9.01           yes      yes       yes   n/a    yes     ?
hppa1.1-hp-hpux9.05           yes      yes       yes   n/a    yes     ?
hppa1.1-hp-hpux9.07           yes      yes       yes   n/a    yes     ?
hppa2.0w-hp-hpux11.00         yes      yes       yes   n/a    yes     ?
i386-pc-bsdi2.1               yes      yes       yes   n/a    no      ?
i386-pc-bsdi3.0               yes      yes       yes   yes    no      ?
i386-pc-bsdi3.1               yes      yes       yes   yes    no      ?
i386-pc-bsdi4.0               yes      yes       yes   yes    yes     ?
i386-pc-bsdi4.0.1             yes      yes       yes   yes    yes     ?
i386-pc-bsdi4.1               yes      yes       yes   yes    yes     ?
i386-pc-linux-rh7.2           yes      yes       yes   yes    yes     yes
i386-pc-solaris2.5.1          yes      yes       yes   yes    yes     yes
i386-pc-solaris2.6            yes      yes       yes   yes    yes     yes
i386-pc-solaris2.7            yes      yes       yes   yes    yes     yes
i386-unknown-freebsd2.1.0     yes      yes       yes   n/a    ?       ?
i386-unknown-freebsd2.2.1     yes      yes       yes   n/a    yes     ?
i386-unknown-freebsd2.2.6     yes      yes       yes   n/a    yes     ?
i386-unknown-freebsd2.2.7     yes      yes       yes   n/a    yes     ?
i386-unknown-freebsd2.2.8     yes      yes       yes   n/a    yes     ?
i386-unknown-freebsd3.0       yes      yes       yes   yes    yes     ?
i386-unknown-freebsd4.2       yes      yes       yes   yes    yes     ?
i386-unknown-freebsd4.4       yes      yes       yes   yes    yes     ?
i386-unknown-freebsd5.0       yes      yes       yes   yes    yes     ?
i386-unknown-freebsdelf3.0    yes      yes       yes   yes    yes     ?
i386-unknown-freebsdelf3.1    yes      yes       yes   yes    yes     ?
i386-unknown-freebsdelf3.2    yes      yes       yes   yes    yes     ?
i386-unknown-freebsdelf3.3    yes      yes       yes   yes    yes     ?
i386-unknown-freebsdelf3.4    yes      yes       yes   yes    yes     ?
i386-unknown-freebsdelf4.0    yes      yes       yes   yes    yes     ?
i386-unknown-netbsd1.2.1      yes      yes       yes   yes    yes     ?
i386-unknown-netbsd1.3        yes      yes       yes   yes    yes     ?
i386-unknown-netbsd1.3.1      yes      yes       yes   yes    yes     ?
i386-unknown-netbsd1.3.2      yes      yes       yes   yes    yes     ?
i386-unknown-netbsd1.3.3      yes      yes       yes   yes    yes     ?
i386-unknown-netbsd1.4        yes      yes       yes   yes    yes     ?
i386-unknown-netbsd1.4.1      yes      yes       yes   yes    yes     ?
i386-unknown-openbsd2.1       yes      yes       yes   yes    yes     ?
i386-unknown-openbsd2.2       yes      yes       yes   yes    yes     ?
i386-unknown-openbsd2.3       yes      yes       yes   yes    yes     ?
i386-unknown-openbsd2.4       yes      yes       yes   yes    yes     ?
i386-unknown-openbsd2.5       yes      yes       yes   yes    yes     ?
i486-ncr-sysv4.3.03           yes      yes       ?     yes    yes     ?
i486-pc-linux-gnu-rh6.0       yes      yes       yes   n/a    yes     ?
i486-pc-linux-gnulibc1        yes      yes       yes   n/a    yes     ?
i486-pc-linux-gnulibc1-rh4.2  yes      yes       yes   n/a    yes     ?
i486-pc-linux-gnuoldld        yes      yes       yes   n/a    yes     ?
i586-pc-linux-gnu             yes      yes       yes   n/a    yes     ?
i586-pc-linux-gnu-rh5.2       yes      yes       yes   n/a    yes     ?
i586-pc-linux-gnu-rh6.0       yes      yes       yes   n/a    yes     ?
i586-pc-linux-gnu-rh6.1       yes      yes       yes   n/a    yes     ?
i586-pc-linux-gnu-rh6.2       yes      yes       yes   n/a    yes     ?
i586-pc-linux-gnulibc1        yes      yes       yes   n/a    yes     ?
i586-pc-linux-gnulibc1-rh4.2  yes      yes       yes   n/a    yes     ?
i686-pc-linux-gnu             yes      yes       yes   n/a    yes     ?
i686-pc-linux-gnu-rh5.2       yes      yes       yes   n/a    yes     ?
i686-pc-linux-gnu-rh6.0       yes      yes       yes   n/a    yes     ?
i686-pc-linux-gnu-rh6.2       yes      yes       yes   n/a    yes     yes
i686-pc-linux-gnulibc         yes      yes       yes   n/a    yes     ?
i686-pc-linux-gnulibc1        yes      yes       yes   n/a    yes     ?
ia64-hp-hpux11.20             yes      yes       yes   yes    yes     ?
ia64-unknown-linux-rh7.1      yes      yes       yes   yes    yes     yes
m68k-hp-hpux9.00              yes      yes       yes   n/a    ?       ?
m68k-sun-sunos4.1.1           yes      yes       yes   n/a    no      ?
m68k-next-nextstep3           yes      yes       yes   n/a    no      ?
mips-dec-ultrix4.3            yes      yes       yes   n/a    ?       ?
mips-sgi-irix5.2              ?        ?         ?     ?      ?       ?
mips-sgi-irix5.3              yes      yes       yes   yes    yes     ?
mips-sgi-irix6.2              yes      yes       yes   yes    yes     ?
mips-sgi-irix6.4              yes      yes       yes   yes    yes     ?
mips-sgi-irix6.5              yes      yes       yes   yes    yes     ?
powerpc-ibm-aix4.1.5.0        yes      yes       yes   n/a    no/broken?
powerpc-ibm-aix4.2.1.0        yes      yes       yes   yes    no/broken?
powerpc-ibm-aix4.3.1.0        yes      yes       ?     yes    ?       ?
powerpc-unknown-linux-gnu     yes      yes       yes   n/a    yes     ?
rs6000-ibm-aix3.2             yes      yes       yes   n/a    ?       ?
rs6000-ibm-aix3.2.5           yes      yes       yes   n/a    ?       ?
rs6000-ibm-aix4.1.4.0         yes      yes       yes   n/a    no/broken?
rs6000-ibm-aix4.1.5.0         yes      yes       yes   n/a    no/broken?
sparc-sun-solaris2.3          yes      yes       yes   n/a    yes     ?
sparc-sun-solaris2.4          yes      yes       yes   n/a    yes     ?
sparc-sun-solaris2.5          yes      yes       yes   yes    yes     ?
sparc-sun-solaris2.5.1        yes      yes       yes   yes    yes     yes
sparc-sun-solaris2.6          yes      yes       yes   yes    yes     yes
sparc-sun-solaris2.7          yes      yes       yes   yes    yes     yes
sparc-sun-solaris2.8          yes      yes       yes   yes    yes     yes
sparc-sun-sunos4.1.1          yes      yes       yes   n/a    yes     ?
sparc-sun-sunos4.1.3          yes      yes       yes   n/a    yes     ?
sparc-sun-sunos4.1.3C         yes      yes       yes   n/a    yes     ?
sparc-sun-sunos4.1.3_U1       yes      yes       yes   n/a    yes     ?
sparc-sun-sunos4.1.4          yes      yes       yes   n/a    yes     ?
sparc-unknown-linux-gnulibc1  yes      yes       yes   n/a    yes     ?
sparc-unknown-netbsd1.2E      yes      yes       yes   ?      ?       ?
sparc-unknown-netbsd1.2G      yes      yes       yes   ?      ?       ?
sparc64-unknown-linux-gnu     yes      yes       yes   n/a    yes     ?

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


File: am-utils.info,  Node: Mount Maps,  Next: Amd Command Line Options,  Prev: Supported Platforms,  Up: Top

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 (*note fs
Option::).  A location may also contain "selectors" (*note Selectors::).

* Menu:

* Map Types::
* Key Lookup::
* Location Format::


File: am-utils.info,  Node: Map Types,  Next: Key Lookup,  Prev: Mount Maps,  Up: Mount Maps

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 (*note Amd Configuration File::)
and the keyword `map_type' (*note 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 (*note Automount
Filesystem::).

   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.

* Menu:

* File maps::
* ndbm maps::
* NIS maps::
* NIS+ maps::
* Hesiod maps::
* Password maps::
* Union maps::
* LDAP maps::


File: am-utils.info,  Node: File maps,  Next: ndbm maps,  Prev: Map Types,  Up: Map Types

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' (*note Automount Filesystem::).


File: am-utils.info,  Node: ndbm maps,  Next: NIS maps,  Prev: File maps,  Up: Map Types

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' (*note Automount
Filesystem::).


File: am-utils.info,  Node: NIS maps,  Next: NIS+ maps,  Prev: ndbm maps,  Up: Map Types

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' (*note Automount
Filesystem::).

   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.


File: am-utils.info,  Node: NIS+ maps,  Next: Hesiod maps,  Prev: NIS maps,  Up: Map Types

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.


File: am-utils.info,  Node: Hesiod maps,  Next: Password maps,  Prev: NIS+ maps,  Up: Map Types

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' (*note 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' (*note Automount
Filesystem::).

   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"


File: am-utils.info,  Node: Password maps,  Next: Union maps,  Prev: Hesiod maps,  Up: Map Types

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:=jsp


File: am-utils.info,  Node: Union maps,  Next: LDAP maps,  Prev: Password maps,  Up: Map Types

Union maps
----------

   The union map support is provided specifically for use with the union
filesystem, *note Union Filesystem::.

   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.


File: am-utils.info,  Node: LDAP maps,  Prev: Union maps,  Up: Map Types

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 (*note 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


File: am-utils.info,  Node: Key Lookup,  Next: Location Format,  Prev: Map Types,  Up: Mount Maps

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 (*note 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.
(*note Filesystem Types::).


File: am-utils.info,  Node: Location Format,  Prev: Key Lookup,  Up: Mount Maps

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.  "location-selection"s are 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 (*note 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
(*note Program Filesystem::).

* Menu:

* Map Defaults::
* Variable Expansion::
* Selectors::
* Map Options::


File: am-utils.info,  Node: Map Defaults,  Next: Variable Expansion,  Prev: Location Format,  Up: Location Format

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').


File: am-utils.info,  Node: Variable Expansion,  Next: Selectors,  Prev: Map Defaults,  Up: Location Format

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.

