147501Spendry\input texinfo		@c -*-texinfo-*-
247501Spendry@c
347501Spendry@c Copyright (c) 1989 Jan-Simon Pendry
447501Spendry@c Copyright (c) 1989 Imperial College of Science, Technology & Medicine
547501Spendry@c Copyright (c) 1989 The Regents of the University of California.
647501Spendry@c All rights reserved.
747501Spendry@c
847501Spendry@c This code is derived from software contributed to Berkeley by
947501Spendry@c Jan-Simon Pendry at Imperial College, London.
1047501Spendry@c
1149684Spendry@c Redistribution and use in source and binary forms, with or without
1249684Spendry@c modification, are permitted provided that the following conditions
1349684Spendry@c are met:
1449684Spendry@c 1. Redistributions of source code must retain the above copyright
1549684Spendry@c    notice, this list of conditions and the following disclaimer.
1649684Spendry@c 2. Redistributions in binary form must reproduce the above copyright
1749684Spendry@c    notice, this list of conditions and the following disclaimer in the
1849684Spendry@c    documentation and/or other materials provided with the distribution.
1949684Spendry@c 3. All advertising materials mentioning features or use of this software
2049684Spendry@c    must display the following acknowledgement:
2149684Spendry@c      This product includes software developed by the University of
2249684Spendry@c      California, Berkeley and its contributors.
2349684Spendry@c 4. Neither the name of the University nor the names of its contributors
2449684Spendry@c    may be used to endorse or promote products derived from this software
2549684Spendry@c    without specific prior written permission.
2647501Spendry@c
2749684Spendry@c THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2849684Spendry@c ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2949684Spendry@c IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
3049684Spendry@c ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
3149684Spendry@c FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3249684Spendry@c DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3349684Spendry@c OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3449684Spendry@c HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3549684Spendry@c LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3649684Spendry@c OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3747501Spendry@c
38*61791Sbostic@c	@(#)amdref.texinfo	8.1 (Berkeley) 06/06/93
3949684Spendry@c
4052454Spendry@c $Id: amdref.texinfo,v 5.2.2.1 1992/02/09 15:11:50 jsp beta $
4149684Spendry@c
4252454Spendry@setfilename amdref.info
4352454Spendry@c @setfilename /usr/local/emacs/info/amd
4447501Spendry@tex
4547501Spendry\overfullrule=0pt
4647501Spendry@end tex
4747501Spendry
4847501Spendry@settitle 4.4 BSD Automounter Reference Manual
4947501Spendry@titlepage
5047501Spendry@sp 6
5147501Spendry@center @titlefont{Amd}
5247501Spendry@sp 2
5347501Spendry@center @titlefont{The 4.4 BSD Automounter}
5447501Spendry@sp 2
5547501Spendry@center @titlefont{Reference Manual}
5647501Spendry@sp 2
5747501Spendry@center @authorfont{Jan-Simon Pendry}
5847501Spendry@sp
5947501Spendry@center @i{and}
6047501Spendry@sp
6147501Spendry@center @authorfont{Nick Williams}
6247501Spendry@sp 4
6347501Spendry@center Last updated March 1991
6447501Spendry@center Documentation for software revision 5.3 Alpha
6547501Spendry@page
6647501SpendryCopyright @copyright{} 1989 Jan-Simon Pendry
6747501Spendry@sp -1
6847501SpendryCopyright @copyright{} 1989 Imperial College of Science, Technology & Medicine
6947501Spendry@sp -1
7047501SpendryCopyright @copyright{} 1989 The Regents of the University of California.
7147501Spendry@sp 0
7247501SpendryAll Rights Reserved.
7347501Spendry@vskip 1ex
7447501SpendryPermission to copy this document, or any portion of it, as
7547501Spendrynecessary for use of this software is granted provided this
7647501Spendrycopyright notice and statement of permission are included.
7747501Spendry@end titlepage
7847501Spendry@page
7947501Spendry@ifinfo
8047501Spendry@node Top, License, , (DIR)
8147501Spendry
8247501SpendryAmd - The 4.4 BSD Automounter
8347501Spendry*****************************
8447501Spendry
8547501SpendryAmd is the 4.4 BSD Automounter.  This Info file describes how
8647501Spendryto use and understand Amd.
8747501Spendry@end ifinfo
8847501Spendry
8947501Spendry@menu
9047501Spendry* License::                  Explains the terms and conditions for using
9147501Spendry                             and distributing Amd.
9247501Spendry* Distrib::                  How to get the latest Amd distribution.
9352454Spendry* Intro::                    An introduction to Automounting concepts.
9452454Spendry* Overview::                 An overview of Amd.
9547501Spendry* Supported Platforms::      Machines and Systems supported by Amd.
9647501Spendry* Mount Maps::               Details of mount maps
9747501Spendry* Amd Command Line Options:: All the Amd command line options explained.
9847501Spendry* Filesystem Types::         The different mount types supported by Amd.
9947501Spendry* Run-time Administration::  How to start, stop and control Amd.
10047501Spendry* FSinfo::                   The FSinfo filesystem management tool.
10152454Spendry* Internals::                Internals.
10252454Spendry* Acknowledgements & Trademarks:: Legal notes.
10347501Spendry* Examples::                 Some examples showing how Amd might be used.
10452454Spendry* Internals::                Implementation details.
10552454Spendry* Acknowledgements & Trademarks::
10647501Spendry
10747501SpendryIndexes
10847501Spendry* Index::                    An item for each concept.
10947501Spendry@end menu
11047501Spendry
11147501Spendry@iftex
11247501Spendry@unnumbered Preface
11347501Spendry
11447501SpendryThis manual documents the use of the 4.4 BSD automounter---@i{Amd}.
11547501SpendryThis is primarily a reference manual.  Unfortunately, no tutorial
11647501Spendryexists.
11747501Spendry
11847501SpendryThis manual comes in two forms: the published form and the Info form.
11947501SpendryThe Info form is for on-line perusal with the INFO program which is
12047501Spendrydistributed along with GNU Emacs.  Both forms contain substantially the
12147501Spendrysame text and are generated from a common source file, which is
12247501Spendrydistributed with the @i{Amd} source.
12347501Spendry@end iftex
12447501Spendry
12547501Spendry@node License, Distrib, Top, Top
12647501Spendry@unnumbered License
12747501Spendry@cindex License Information
12847501Spendry
12947501Spendry@i{Amd} is not in the public domain; it is copyrighted and there are
13047501Spendryrestrictions on its distribution.
13147501Spendry
13247501SpendryRedistribution and use in source and binary forms are permitted provided
13347501Spendrythat: (1) source distributions  retain this entire  copyright notice and
13447501Spendrycomment, and (2) distributions including  binaries display the following
13547501Spendryacknowledgement: ``This product  includes  software  developed  by   The
13647501SpendryUniversity  of California,   Berkeley  and its  Contributors''  in   the
13747501Spendrydocumentation  or other materials provided with  the distribution and in
13847501Spendryall advertising materials mentioning  features  or use of this software.
13947501Spendryneither the name of the University nor the names of its Contributors may
14047501Spendrybe  used   to endorse or promote   products  derived from  this software
14147501Spendrywithout specific prior written permission.
14247501Spendry
14347501SpendryTHIS SOFTWARE IS  PROVIDED ``AS IS''  AND WITHOUT ANY EXPRESS OR IMPLIED
14447501SpendryWARRANTIES, INCLUDING,  WITHOUT  LIMITATION,  THE IMPLIED  WARRANTIES OF
14547501SpendryMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14647501Spendry
14752454Spendry@node Distrib, Intro, License, Top
14847501Spendry@unnumbered Source Distribution
14947501Spendry@cindex Source code distribution
15047501Spendry@cindex Obtaining the source code
15147501Spendry
15247501SpendryIf you have access to the Internet, you can get the latest distribution
15347501Spendryversion of @i{Amd} from host @file{usc.edu} using anonymous FTP.  Move to
15447501Spendrythe directory @file{/pub/amd} on that host and fetch the file @file{amd.tar.Z}.
15547501Spendry
15647501SpendryIf you are in the UK, you can get the latest distribution version of
15747501Spendry@i{Amd} from the UKnet info-server.  Start by sending email to
15847501Spendry@file{info-server@@doc.ic.ac.uk}.
15947501Spendry
16047501SpendrySites on the UK JANET network can get the latest distribution by using
16147501Spendryanonymous NIFTP to fetch the file @samp{<AMD>amd.tar.Z} from host
16247501Spendry@samp{uk.ac.imperial.doc.src}.
16347501Spendry
16447501SpendryRevision 5.2 was part of the 4.3 BSD Reno distribution.
16547501Spendry
16652454SpendryRevision 5.3bsdnet, a late alpha version of 5.3, was part
16752454Spendryof the BSD network version 2 distribution
16852454Spendry
16947501Spendry@unnumberedsec Bug Reports
17047501Spendry@cindex Bug reports
17147501Spendry
17247501SpendrySend all bug reports to @file{jsp@@doc.ic.ac.uk} quoting the details of
17347501Spendrythe release and your configuration.  These can be obtained by running
17447501Spendrythe command @samp{amd -v}.
17547501Spendry
17647501Spendry@unnumberedsec Mailing List
17747501Spendry@cindex Mailing list
17847501Spendry
17947501SpendryThere is a mailing list for people interested in keeping uptodate with
18047501Spendrydevelopments.  To subscribe, send a note to @file{amd-workers-request@@acl.lanl.gov}.
18147501Spendry
18252454Spendry@node Intro, Overview, Distrib, Top
18347501Spendry@unnumbered Introduction
18447501Spendry@cindex Introduction
18547501Spendry
18647501SpendryAn @dfn{automounter} maintains a cache of mounted filesystems.
18747501SpendryFilesystems are mounted on demand when they are first referenced,
18847501Spendryand unmounted after a period of inactivity.
18947501Spendry
19047501Spendry@i{Amd} may be used as a replacement for Sun's automounter.  The choice
19147501Spendryof which filesystem to mount can be controlled dynamically with
19247501Spendry@dfn{selectors}.  Selectors allow decisions of the form ``hostname is
19347501Spendry@var{this},'' or ``architecture is not @var{that}.''  Selectors may be
19447501Spendrycombined arbitrarily.  @i{Amd} also supports a variety of filesystem
19547501Spendrytypes, including NFS, UFS and the novel @dfn{program} filesystem.  The
19647501Spendrycombination of selectors and multiple filesystem types allows identical
19747501Spendryconfiguration files to be used on all machines so reducing the
19847501Spendryadministrative overhead.
19947501Spendry
20047501Spendry@i{Amd} ensures that it will not hang if a remote server goes down.
20147501SpendryMoreover, @i{Amd} can determine when a remote server has become
20247501Spendryinaccessible and then mount replacement filesystems as and when they
20347501Spendrybecome available.
20447501Spendry
20547501Spendry@i{Amd} contains no proprietary source code and has been ported to
20647501Spendrynumerous flavours of Unix.
20747501Spendry
20852454Spendry@node Overview, Supported Platforms, Intro, Top
20947501Spendry@chapter Overview
21047501Spendry
21147501Spendry@i{Amd} maintains a cache of mounted filesystems.  Filesystems are
21247501Spendry@dfn{demand-mounted} when they are first referenced, and unmounted after
21347501Spendrya period of inactivity.  @i{Amd} may be used as a replacement for Sun's
21447501Spendry@b{automount}(8) program.  It contains no proprietary source code and
21547501Spendryhas been ported to numerous flavours of Unix.  @xref{Supported Operating
21647501SpendrySystems}.@refill
21747501Spendry
21847501Spendry@i{Amd} was designed as the basis for experimenting with filesystem
21947501Spendrylayout and management.  Although @i{Amd} has many direct applications it
22047501Spendryis loaded with additional features which have little practical use.  At
22147501Spendrysome point the infrequently used components may be removed to streamline
22247501Spendrythe production system.
22347501Spendry
22447501Spendry@c @i{Amd} supports the notion of @dfn{replicated} filesystems by evaluating
22547501Spendry@c each member of a list of possible filesystem locations in parallel.
22647501Spendry@c @i{Amd} checks that each cached mapping remains valid.  Should a mapping be
22747501Spendry@c lost -- such as happens when a fileserver goes down -- @i{Amd} automatically
22847501Spendry@c selects a replacement should one be available.
22947501Spendry@c
23047501Spendry@menu
23147501Spendry* Fundamentals::
23247501Spendry* Filesystems and Volumes::
23347501Spendry* Volume Naming::
23447501Spendry* Volume Binding::
23547501Spendry* Operational Principles::
23647501Spendry* Mounting a Volume::
23747501Spendry* Automatic Unmounting::
23847501Spendry* Keep-alives::
23947501Spendry* Non-blocking Operation::
24047501Spendry@end menu
24147501Spendry
24247501Spendry@node     Fundamentals, Filesystems and Volumes, Overview, Overview
24347501Spendry@comment  node-name,  next,  previous,  up
24447501Spendry@section Fundamentals
24547501Spendry@cindex Automounter fundamentals
24647501Spendry
24747501SpendryThe fundamental concept behind @i{Amd} is the ability to separate the
24847501Spendryname used to refer to a file from the name used to refer to its physical
24947501Spendrystorage location.  This allows the same files to be accessed with the
25047501Spendrysame name regardless of where in the network the name is used.  This is
25147501Spendryvery different from placing @file{/n/hostname} in front of the pathname
25247501Spendrysince that includes location dependent information which may change if
25347501Spendryfiles are moved to another machine.
25447501Spendry
25547501SpendryBy placing the required mappings in a centrally administered database,
25647501Spendryfilesystems can be re-organised without requiring changes to
25747501Spendryconfiguration files, shell scripts and so on.
25847501Spendry
25947501Spendry@node     Filesystems and Volumes, Volume Naming, Fundamentals, Overview
26047501Spendry@comment  node-name,  next,  previous,  up
26147501Spendry@section Filesystems and Volumes
26247501Spendry@cindex Filesystem
26347501Spendry@cindex Volume
26447501Spendry@cindex Fileserver
26547501Spendry@cindex sublink
26647501Spendry
26747501Spendry@i{Amd} views the world as a set of fileservers, each containg one or
26847501Spendrymore filesystems where each filesystem contains one or more
26947501Spendry@dfn{volumes}.  Here the term @dfn{volume} is used to refer to a
27047501Spendrycoherent set of files such as a user's home directory or a @TeX{}
27147501Spendrydistribution.@refill
27247501Spendry
27347501SpendryIn order to access the contents of a volume, @i{Amd} must be told in
27447501Spendrywhich filesystem the volume resides and which host owns the filesystem.
27547501SpendryBy default the host is assumed to be local and the volume is assumed to
27647501Spendrybe the entire filesystem.  If a filesystem contains more than one
27747501Spendryvolume, then a @dfn{sublink} is used to refer to the sub-directory
27847501Spendrywithin the filesystem where the volume can be found.
27947501Spendry
28047501Spendry@node     Volume Naming, Volume Binding, Filesystems and Volumes, Overview
28147501Spendry@comment  node-name,  next,  previous,  up
28247501Spendry@section Volume Naming
28347501Spendry@cindex Volume names
28447501Spendry@cindex Network-wide naming
28547501Spendry@cindex Replicated volumes
28647501Spendry@cindex Duplicated volumes
28747501Spendry@cindex Replacement volumes
28847501Spendry
28947501SpendryVolume names are defined to be unique across the entire network.  A
29047501Spendryvolume name is the pathname to the volume's root as known by the users
29147501Spendryof that volume.  Since this name uniquely identifies the volume
29247501Spendrycontents, all volumes can be named and accessed from each host, subject
29347501Spendryto administrative controls.
29447501Spendry
29547501SpendryVolumes may be replicated or duplicated.  Replicated volumes contain
29647501Spendryidentical copies of the same data and reside at two or more locations in
29747501Spendrythe network.  Each of the replicated volumes can be used
29847501Spendryinterchangeably.  Duplicated volumes each have the same name but contain
29947501Spendrydifferent, though functionally identical, data.  For example,
30047501Spendry@samp{/vol/tex} might be the name of a @TeX{} distribution which varied
30147501Spendryfor each machine architecture.@refill
30247501Spendry
30347501Spendry@i{Amd} provides facilities to take advantage of both replicated and
30447501Spendryduplicated volumes.  Configuration options allow a single set of
30547501Spendryconfiguration data to be shared across an entire network by taking
30647501Spendryadvantage of replicated and duplicated volumes.
30747501Spendry
30847501Spendry@i{Amd} can take advantage of replacement volumes by mounting them as
30947501Spendryrequired should an active fileserver become unavailable.
31047501Spendry
31147501Spendry@node     Volume Binding, Operational Principles, Volume Naming, Overview
31247501Spendry@comment  node-name,  next,  previous,  up
31347501Spendry@section Volume Binding
31447501Spendry@cindex Volume binding
31547501Spendry@cindex Unix namespace
31647501Spendry@cindex Namespace
31747501Spendry@cindex Binding names to filesystems
31847501Spendry
31947501SpendryUnix implements a namespace of hierarchically mounted filesystems.  Two
32047501Spendryforms of binding between names and files are provided.  A @dfn{hard
32147501Spendrylink} completes the binding when the name is added to the filesystem.  A
32247501Spendry@dfn{soft link} delays the binding until the name is accessed.  An
32347501Spendry@dfn{automounter} adds a further form in which the binding of name to
32447501Spendryfilesystem is delayed until the name is accessed.@refill
32547501Spendry
32647501SpendryThe target volume, in its general form, is a tuple (host, filesystem,
32747501Spendrysublink) which can be used to name the physical location of any volume
32847501Spendryin the network.
32947501Spendry
33047501SpendryWhen a target is referenced, @i{Amd} ignores the sublink element and
33147501Spendrydetermines whether the required filesystem is already mounted.  This is
33247501Spendrydone by computing the local mount point for the filesystem and checking
33347501Spendryfor an existing filesystem mounted at the same place.  If such a
33447501Spendryfilesystem already exists then it is assumed to be functionally
33547501Spendryidentical to the target filesystem.  By default there is a one-to-one
33647501Spendrymapping between the pair (host, filesystem) and the local mount point so
33747501Spendrythis assumption is valid.
33847501Spendry
33947501Spendry@node     Operational Principles, Mounting a Volume, Volume Binding, Overview
34047501Spendry@comment  node-name,  next,  previous,  up
34147501Spendry@section Operational Principles
34247501Spendry@cindex Operational principles
34347501Spendry
34447501Spendry@i{Amd} operates by introducing new mount points into the namespace.
34547501SpendryThese are called @dfn{automount} points.  The kernel sees these
34647501Spendryautomount points as NFS filesystems being served by @i{Amd}.  Having
34747501Spendryattached itself to the namespace, @i{Amd} is now able to control the
34847501Spendryview the rest of the system has of those mount points.  RPC calls are
34947501Spendryreceived from the kernel one at a time.
35047501Spendry
35147501SpendryWhen a @dfn{lookup} call is received @i{Amd} checks whether the name is
35247501Spendryalready known.  If it is not, the required volume is mounted.  A
35347501Spendrysymbolic link pointing to the volume root is then returned.  Once the
35447501Spendrysymbolic link is returned, the kernel will send all other requests
35547501Spendrydirect to the mounted filesystem.
35647501Spendry
35747501SpendryIf a volume is not yet mounted, @i{Amd} consults a configuration
35847501Spendry@dfn{mount-map} corresponding to the automount point.  @i{Amd} then
35947501Spendrymakes a runtime decision on what and where to mount a filesystem based
36047501Spendryon the information obtained from the map.
36147501Spendry
36247501Spendry@i{Amd} does not implement all the NFS requests; only those relevant
36347501Spendryto name binding such as @dfn{lookup}, @dfn{readlink} and @dfn{readdir}.
36447501SpendrySome other calls are also implemented but most simply return an error
36547501Spendrycode; for example @dfn{mkdir} always returns ``read-only filesystem''.
36647501Spendry
36747501Spendry@node     Mounting a Volume, Automatic Unmounting, Operational Principles, Overview
36847501Spendry@comment  node-name,  next,  previous,  up
36947501Spendry@section Mounting a Volume
37047501Spendry@cindex Mounting a volume
37147501Spendry@cindex Location lists
37247501Spendry@cindex Alternate locations
37347501Spendry@cindex Mount retries
37447501Spendry@cindex Background mounts
37547501Spendry
37647501SpendryEach automount point has a corresponding mount map.  The mount map
37747501Spendrycontains a list of key--value pairs.  The key is the name of the volume
37847501Spendryto be mounted.  The value is a list of locations describing where the
37947501Spendryfilesystem is stored in the network.  In the source for the map the
38047501Spendryvalue would look like
38147501Spendry
38247501Spendry@display
38347501Spendrylocation1  location2  @dots{}  locationN
38447501Spendry@end display
38547501Spendry
38647501Spendry@i{Amd} examines each location in turn.  Each location may contain
38747501Spendry@dfn{selectors} which control whether @i{Amd} can use that location.
38847501SpendryFor example, the location may be restricted to use by certain hosts.
38947501SpendryThose locations which cannot be used are ignored.
39047501Spendry
39147501Spendry@i{Amd} attempts to mount the filesystem described by each remaining
39247501Spendrylocation until a mount succeeds or @i{Amd} can no longer proceed.  The
39347501Spendrylatter can occur in three ways:
39447501Spendry
39547501Spendry@itemize @bullet
39647501Spendry@item
39747501SpendryIf none of the locations could be used, or if all of the locations
39847501Spendrycaused an error, then the last error is returned.
39947501Spendry
40047501Spendry@item
40147501SpendryIf a location could be used but was being mounted in the background then
40247501Spendry@i{Amd} marks that mount as being ``in progress'' and continues with
40347501Spendrythe next request; no reply is sent to the kernel.
40447501Spendry
40547501Spendry@item
40647501SpendryLastly, one or more of the mounts may have been @dfn{deferred}.  A mount
40747501Spendryis deferred if extra information is required before the mount can
40847501Spendryproceed.  When the information becomes available the mount will take
40947501Spendryplace, but in the mean time no reply is sent to the kernel.  If the
41047501Spendrymount is deferred, @i{Amd} continues to try any remaining locations.
41147501Spendry@end itemize
41247501Spendry
41347501SpendryOnce a volume has been mounted, @i{Amd} establishes a @dfn{volume
41447501Spendrymapping} which is used to satisfy subsequent requests.@refill
41547501Spendry
41647501Spendry@node     Automatic Unmounting, Keep-alives, Mounting a Volume, Overview
41747501Spendry@comment  node-name,  next,  previous,  up
41847501Spendry@section Automatic Unmounting
41947501Spendry
42047501SpendryTo avoid an ever increasing number of filesystem mounts, @i{Amd} removes
42147501Spendryvolume mappings which have not been used recently.  A time-to-live
42247501Spendryinterval is associated with each mapping and when that expires the
42347501Spendrymapping is removed.  When the last reference to a filesystem is removed,
42447501Spendrythat filesystem is unmounted.  If the unmount fails, for example the
42547501Spendryfilesystem is still busy, the mapping is re-instated and its
42647501Spendrytime-to-live interval is extended.  The global default for this grace
42747501Spendryperiod is controlled by the ``-w'' command-line option (@pxref{-w
42847501SpendryOption, -w}).  It is also possible to set this value on a per-mount
42947501Spendrybasis (@pxref{opts Option, opts, opts}).@refill
43047501Spendry
43147501SpendryFilesystems can be forcefully timed out using the @i{Amq} command.
43247501Spendry@xref{Run-time Administration}.
43347501Spendry
43447501Spendry@node     Keep-alives, Non-blocking Operation, Automatic Unmounting, Overview
43547501Spendry@comment  node-name,  next,  previous,  up
43647501Spendry@section Keep-alives
43747501Spendry@cindex Keep-alives
43847501Spendry@cindex Server crashes
43947501Spendry@cindex NFS ping
44047501Spendry
44147501SpendryUse of some filesystem types requires the presence of a server on
44247501Spendryanother machine.  If a machine crashes then it is of no concern to
44347501Spendryprocesses on that machine that the filesystem is unavailable.  However,
44447501Spendryto processes on a remote host using that machine as a fileserver this
44547501Spendryevent is important.  This situation is most widely recognised when an
44647501SpendryNFS server crashes and the behaviour observed on client machines is that
44747501Spendrymore and more processes hang.  In order to provide the possibility of
44847501Spendryrecovery, @i{Amd} implements a @dfn{keep-alive} interval timer for some
44947501Spendryfilesystem types.  Currently only NFS makes use of this service.
45047501Spendry
45147501SpendryThe basis of the NFS keep-alive implementation is the observation that
45247501Spendrymost sites maintain replicated copies of common system data such as
45347501Spendrymanual pages, most or all programs, system source code and so on.  If
45447501Spendryone of those servers goes down it would be reasonable to mount one of
45547501Spendrythe others as a replacement.
45647501Spendry
45747501SpendryThe first part of the process is to keep track of which fileservers are
45847501Spendryup and which are down.  @i{Amd} does this by sending RPC requests to the
45947501Spendryservers' NFS @code{NullProc} and checking whether a reply is returned.
46047501SpendryWhile the server state is uncertain the requests are re-transmitted at
46147501Spendrythree second intervals and if no reply is received after four attempts
46247501Spendrythe server is marked down.  If a reply is received the fileserver is
46347501Spendrymarked up and stays in that state for 30 seconds at which time another
46447501SpendryNFS ping is sent.
46547501Spendry
46647501SpendryOnce a fileserver is marked down, requests continue to be sent every 30
46747501Spendryseconds in order to determine when the fileserver comes back up.  During
46847501Spendrythis time any reference through @i{Amd} to the filesystems on that
46947501Spendryserver fail with the error ``Operation would block''.  If a replacement
47047501Spendryvolume is available then it will be mounted, otherwise the error is
47147501Spendryreturned to the user.
47247501Spendry
47347501Spendry@c @i{Amd} keeps track of which servers are up and which are down.
47447501Spendry@c It does this by sending RPC requests to the servers' NFS {\sc NullProc} and
47547501Spendry@c checking whether a reply is returned.  If no replies are received after a
47647501Spendry@c short period, @i{Amd} marks the fileserver @dfn{down}.
47747501Spendry@c RPC requests continue to be sent so that it will notice when a fileserver
47847501Spendry@c comes back up.
47947501Spendry@c ICMP echo packets \cite{rfc:icmp} are not used because it is the availability
48047501Spendry@c of the NFS service that is important, not the existence of a base kernel.
48147501Spendry@c Whenever a reference to a fileserver which is down is made via @i{Amd}, an alternate
48247501Spendry@c filesystem is mounted if one is available.
48347501Spendry@c
48447501SpendryAlthough this action does not protect user files, which are unique on
48547501Spendrythe network, or processes which do not access files via @i{Amd} or
48647501Spendryalready have open files on the hung filesystem, it can prevent most new
48747501Spendryprocesses from hanging.
48847501Spendry
48947501SpendryBy default, fileserver state is not maintained for NFS/TCP mounts.  The
49047501Spendryremote fileserver is always assumed to be up.
49147501Spendry@c
49247501Spendry@c With a suitable combination of filesystem management and mount-maps,
49347501Spendry@c machines can be protected against most server downtime.  This can be
49447501Spendry@c enhanced by allocating boot-servers dynamically which allows a diskless
49547501Spendry@c workstation to be quickly restarted if necessary.  Once the root filesystem
49647501Spendry@c is mounted, @i{Amd} can be started and allowed to mount the remainder of
49747501Spendry@c the filesystem from whichever fileservers are available.
49847501Spendry
49947501Spendry@node     Non-blocking Operation, , Keep-alives, Overview
50047501Spendry@comment  node-name,  next,  previous,  up
50147501Spendry@section Non-blocking Operation
50247501Spendry@cindex Non-blocking operation
50347501Spendry@cindex Multiple-threaded server
50447501Spendry@cindex RPC retries
50547501Spendry
50647501SpendrySince there is only one instance of @i{Amd} for each automount point,
50747501Spendryand usually only one instance on each machine, it is important that it
50847501Spendryis always available to service kernel calls.  @i{Amd} goes to great
50947501Spendrylengths to ensure that it does not block in a system call.  As a last
51047501Spendryresort @i{Amd} will fork before it attempts a system call that may block
51147501Spendryindefinitely, such as mounting an NFS filesystem.  Other tasks such as
51247501Spendryobtaining filehandle information for an NFS filesystem, are done using a
51347501Spendrypurpose built non-blocking RPC library which is integrated with
51447501Spendry@i{Amd}'s task scheduler.  This library is also used to implement NFS
51547501Spendrykeep-alives (@pxref{Keep-alives}).
51647501Spendry
51747501SpendryWhenever a mount is deferred or backgrounded, @i{Amd} must wait for it
51847501Spendryto complete before replying to the kernel.  However, this would cause
51947501Spendry@i{Amd} to block waiting for a reply to be constructed.  Rather than do
52047501Spendrythis, @i{Amd} simply @dfn{drops} the call under the assumption that the
52147501Spendrykernel RPC mechanism will automatically retry the request.
52247501Spendry
52347501Spendry@node     Supported Platforms, Mount Maps, Overview, Top
52447501Spendry@comment  node-name,  next,  previous,  up
52547501Spendry@chapter Supported Platforms
52647501Spendry
52747501Spendry@i{Amd} has been ported to a wide variety of machines and operating systems.
52847501SpendryThe table below lists those platforms supported by the current release.
52947501Spendry
53047501Spendry@menu
53147501Spendry* Supported Operating Systems::
53247501Spendry* Supported Machine Architectures::
53347501Spendry@end menu
53447501Spendry
53547501Spendry@node     Supported Operating Systems, Supported Machine Architectures, Supported Platforms, Supported Platforms
53647501Spendry@comment  node-name,  next,  previous,  up
53747501Spendry@section Supported Operating Systems
53847501Spendry@cindex Operating system names
53947501Spendry@cindex Operating systems supported by Amd
54047501Spendry@cindex Supported operating systems
54147501Spendry
54247501SpendryThe following operating systems are currently supported by @i{Amd}.
54347501Spendry@i{Amd}'s conventional name for each system is given.
54447501Spendry
54547501Spendry@table @code
54647501Spendry@item acis43
54747501Spendry4.3 BSD for IBM RT.  Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>}
54847501Spendry@item aix3
54947501SpendryAIX 3.1.  Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>}
55047501Spendry@item aux
55147501SpendrySystem V for Mac-II.  Contributed by Julian Onions @t{<jpo@@cs.nott.ac.uk>}
55247501Spendry@item bsd44
55347501Spendry4.4 BSD.  Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>}
55447501Spendry@item concentrix
55547501SpendryConcentrix 5.0.  Contributed by Sjoerd Mullender @t{<sjoerd@@cwi.nl>}
55647501Spendry@item convex
55747501SpendryConvex OS 7.1.  Contributed by Eitan Mizrotsky @t{<eitan@@shumuji.ac.il>}
55847501Spendry@item dgux
55947501SpendryData General DG/UX.  Contributed by Mark Davies @t{<mark@@comp.vuw.ac.nz>}
56047501Spendry@item fpx4
56147501SpendryCelerity FPX 4.1/2.  Contributed by Stephen Pope @t{<scp@@grizzly.acl.lanl.gov>}
56247501Spendry@item hcx
56347501SpendryHarris HCX/UX.  Contributed by Chris Metcalf @t{<metcalf@@masala.lcs.mit.edu>}
56447501Spendry@item hlh42
56547501SpendryHLH OTS 1.@i{x} (4.2 BSD).  Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>}
56647501Spendry@item hpux
56747501SpendryHP-UX 6.@i{x} or 7.0.  Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>}
56847501Spendry@item irix
56947501SpendrySGI Irix.  Contributed by Scott R. Presnell @t{<srp@@cgl.ucsf.edu>}
57047501Spendry@item next
57147501SpendryMach for NeXT.  Contributed by Bill Trost @t{<trost%reed@@cse.ogi.edu>}
57247501Spendry@item pyrOSx
57347501SpendryPyramid OSx.  Contributed by Stefan Petri @t{<petri@@tubsibr.UUCP>}
57447501Spendry@item riscix
57547501SpendryAcorn RISC iX.  Contributed by Piete Brooks @t{<pb@@cam.cl.ac.uk>}
57647501Spendry@item sos3
57747501SpendrySunOS 3.4 & 3.5.  Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>}
57847501Spendry@item sos4
57947501SpendrySunOS 4.@i{x}.  Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>}
58047501Spendry@item u2_2
58147501SpendryUltrix 2.2.  Contributed by Piete Brooks @t{<pb@@cam.cl.ac.uk>}
58247501Spendry@item u3_0
58347501SpendryUltrix 3.  Contributed by Piete Brooks @t{<pb@@cam.cl.ac.uk>}
58447501Spendry@item u4_0
58547501SpendryUltrix 4.0.  Contributed by Chris Lindblad @t{<cjl@@ai.mit.edu>}
58647501Spendry@item umax43
58747501SpendryUmax 4.3 BSD.  Contributed by Sjoerd Mullender @t{<sjoerd@@cwi.nl>}
58847501Spendry@item utek
58947501SpendryUtek 4.0.  Contributed by Bill Trost @t{<trost%reed@@cse.ogi.edu>}
59047501Spendry@item xinu43
59147501Spendrymt Xinu MORE/bsd.  Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>}
59247501Spendry@end table
59347501Spendry
59447501Spendry@node     Supported Machine Architectures, , Supported Operating Systems, Supported Platforms
59547501Spendry@comment  node-name,  next,  previous,  up
59647501Spendry@section Supported Machine Architectures
59747501Spendry@cindex Supported machine architectures
59847501Spendry@cindex Machine architecture names
59947501Spendry@cindex Machine architectures supported by Amd
60047501Spendry
60147501Spendry@table @code
60247501Spendry@item alliant
60347501SpendryAlliant FX/4
60447501Spendry@item arm
60547501SpendryAcorn ARM
60647501Spendry@item aviion
60747501SpendryData General AViiON
60847501Spendry@item encore
60947501SpendryEncore
61047501Spendry@item fps500
61147501SpendryFPS Model 500
61247501Spendry@item hp9000
61347501SpendryHP 9000/300 family
61447501Spendry@item hp9k8
61547501SpendryHP 9000/800 family
61647501Spendry@item ibm032
61747501SpendryIBM RT
61847501Spendry@item ibm6000
61947501SpendryIBM RISC System/6000
62047501Spendry@item iris4d
62147501SpendrySGI Iris 4D
62247501Spendry@item macII
62347501SpendryApple Mac II
62447501Spendry@item mips
62547501SpendryMIPS RISC
62647501Spendry@item multimax
62747501SpendryEncore Multimax
62847501Spendry@item orion105
62947501SpendryHLH Orion 1/05
63047501Spendry@item sun3
63147501SpendrySun-3 family
63247501Spendry@item sun4
63347501SpendrySun-4 family
63447501Spendry@item tahoe
63547501SpendryTahoe family
63647501Spendry@item vax
63747501SpendryDEC Vax
63847501Spendry@end table
63947501Spendry
64047501Spendry@node     Mount Maps, Amd Command Line Options, Supported Platforms, Top
64147501Spendry@comment  node-name,  next,  previous,  up
64247501Spendry@chapter Mount Maps
64347501Spendry@cindex Mount maps
64447501Spendry@cindex Automounter configuration maps
64547501Spendry@cindex Mount information
64647501Spendry
64747501Spendry@i{Amd} has no built-in knowledge of machines or filesystems.
64847501SpendryExternal @dfn{mount-maps} are used to provide the required information.
64947501SpendrySpecifically, @i{Amd} needs to know when and under what conditions it
65047501Spendryshould mount filesystems.
65147501Spendry
65247501SpendryThe map entry corresponding to the requested name contains a list of
65347501Spendrypossible locations from which to resolve the request.  Each location
65447501Spendryspecifies filesystem type, information required by that filesystem (for
65547501Spendryexample the block special device in the case of UFS), and some
65647501Spendryinformation describing where to mount the filesystem (@pxref{fs Option}).  A
65747501Spendrylocation may also contain @dfn{selectors} (@pxref{Selectors}).@refill
65847501Spendry
65947501Spendry@menu
66047501Spendry* Map Types::
66147501Spendry* Key Lookup::
66247501Spendry* Location Format::
66347501Spendry@end menu
66447501Spendry
66547501Spendry@node     Map Types, Key Lookup, Mount Maps, Mount Maps
66647501Spendry@comment  node-name,  next,  previous,  up
66747501Spendry@section Map Types
66847501Spendry@cindex Mount map types
66947501Spendry@cindex Map types
67047501Spendry@cindex Configuration map types
67147501Spendry@cindex Types of mount map
67247501Spendry@cindex Types of configuration map
67347501Spendry@cindex Determining the map type
67447501Spendry
67547501SpendryA mount-map provides the run-time configuration information to @i{Amd}.
67647501SpendryMaps can be implemented in many ways.  Some of the forms supported by
67747501Spendry@i{Amd} are regular files, ndbm databases, NIS maps the @dfn{Hesiod}
67847501Spendryname server and even the password file.
67947501Spendry
68047501SpendryA mount-map @dfn{name} is a sequence of characters.  When an automount
68147501Spendrypoint is created a handle on the mount-map is obtained.  For each map
68247501Spendrytype configured @i{Amd} attempts to reference the a map of the
68347501Spendryappropriate type.  If a map is found, @i{Amd} notes the type for future
68447501Spendryuse and deletes the reference, for example closing any open file
68547501Spendrydescriptors.  The available maps are configure when @i{Amd} is built and
68647501Spendrycan be displayed by running the command @samp{amd -v}.
68747501Spendry
68847501SpendryBy default, @i{Amd} caches data in a mode dependent on the type of map.
68947501SpendryThis is the same as specifying @samp{cache:=mapdefault} and selects a
69047501Spendrysuitable default cache mode depending on the map type.  The individual
69147501Spendrydefaults are described below.  The @var{cache} option can be specified
69247501Spendryon automount points to alter the caching behaviour (@pxref{Automount
69347501SpendryFilesystem}).@refill
69447501Spendry
69547501SpendryThe following map types have been implemented, though some are not
69647501Spendryavailable on all machines.  Run the command @samp{amd -v} to obtain a
69747501Spendrylist of map types configured on your machine.
69847501Spendry
69947501Spendry@menu
70047501Spendry* File maps::
70147501Spendry* ndbm maps::
70247501Spendry* NIS maps::
70347501Spendry* Hesiod maps::
70447501Spendry* Password maps::
70547501Spendry* Union maps::
70647501Spendry@end menu
70747501Spendry
70847501Spendry@node     File maps, ndbm maps, Map Types, Map Types
70947501Spendry@comment  node-name,  next,  previous,  up
71047501Spendry@subsection File maps
71147501Spendry@cindex File maps
71247501Spendry@cindex Flat file maps
71347501Spendry@cindex File map syntactic conventions
71447501Spendry
71547501SpendryWhen @i{Amd} searches a file for a map entry it does a simple scan of
71647501Spendrythe file and supports both comments and continuation lines.
71747501Spendry
71847501SpendryContinuation lines are indicated by a backslash character (@samp{\}) as
71947501Spendrythe last character of a line in the file.  The backslash, newline character
72047501Spendry@emph{and any leading white space on the following line} are discarded.  A maximum
72147501Spendryline length of 2047 characters is enforced after continuation lines are read
72247501Spendrybut before comments are stripped.  Each line must end with
72347501Spendrya newline character; that is newlines are terminators, not separators.
72447501SpendryThe following examples illustrate this:
72547501Spendry
72647501Spendry@example
72747501Spendrykey     valA   valB;   \
72847501Spendry          valC
72947501Spendry@end example
73047501Spendry
73147501Spendryspecifies @emph{three} locations, and is identical to
73247501Spendry
73347501Spendry@example
73447501Spendrykey     valA   valB;   valC
73547501Spendry@end example
73647501Spendry
73747501SpendryHowever,
73847501Spendry
73947501Spendry@example
74047501Spendrykey     valA   valB;\
74147501Spendry          valC
74247501Spendry@end example
74347501Spendry
74447501Spendryspecifies only @emph{two} locations, and is identical to
74547501Spendry
74647501Spendry@example
74747501Spendrykey     valA   valB;valC
74847501Spendry@end example
74947501Spendry
75047501SpendryAfter a complete line has been read from the file, including
75147501Spendrycontinuations, @i{Amd} determines whether there is a comment on the
75247501Spendryline.  A comment begins with a hash (``@samp{#}'') character and
75347501Spendrycontinues to the end of the line.  There is no way to escape or change
75447501Spendrythe comment lead-in character.
75547501Spendry
75647501SpendryNote that continuation lines and comment support @dfn{only} apply to
75747501Spendryfile maps, or ndbm maps built with the @code{mk-amd-map} program.
75847501Spendry
75947501SpendryWhen caching is enabled, file maps have a default cache mode of
76047501Spendry@code{all} (@pxref{Automount Filesystem}).
76147501Spendry
76247501Spendry@node     ndbm maps, NIS maps, File maps, Map Types
76347501Spendry@comment  node-name,  next,  previous,  up
76447501Spendry@subsection ndbm maps
76547501Spendry@cindex ndbm maps
76647501Spendry
76747501SpendryAn ndbm map may be used as a fast access form of a file map.  The program,
76847501Spendry@code{mk-amd-map}, converts a normal map file into an ndbm database.
76947501SpendryThis program supports the same continuation and comment conventions that
77047501Spendryare provided for file maps.  Note that ndbm format files may @emph{not}
77147501Spendrybe sharable across machine architectures.  The notion of speed generally
77247501Spendryonly applies to large maps; a small map, less than a single disk block,
77347501Spendryis almost certainly better implemented as a file map.
77447501Spendry
77547501Spendryndbm maps do not support cache mode @samp{all} and, when caching is
77647501Spendryenabled, have a default cache mode of @samp{inc} (@pxref{Automount Filesystem}).
77747501Spendry
77847501Spendry@node     NIS maps, Hesiod maps, ndbm maps, Map Types
77947501Spendry@comment  node-name,  next,  previous,  up
78047501Spendry@subsection NIS maps
78147501Spendry@cindex NIS (YP) maps
78247501Spendry
78347501SpendryWhen using NIS (formerly YP), an @i{Amd} map is implemented directly
78447501Spendryby the underlying NIS map.  Comments and continuation lines are
78547501Spendry@emph{not} supported in the automounter and must be stripped when
78647501Spendryconstructing the NIS server's database.
78747501Spendry
78847501SpendryNIS maps do not support cache mode @code{all} and, when caching is
78947501Spendryenabled, have a default cache mode of @code{inc} (@pxref{Automount Filesystem}).
79047501Spendry
79147501SpendryThe following rule illustrates what could be added to your NIS @file{Makefile},
79247501Spendryin this case causing the @file{amd.home} map to be rebuilt:
79347501Spendry@example
79447501Spendry$(YPTSDIR)/amd.home.time: $(ETCDIR)/amd.home
79547501Spendry        -@@sed -e "s/#.*$$//" -e "/^$$/d" $(ETCDIR)/amd.home | \
79652454Spendry          awk '@{  \
79747501Spendry                 for (i = 1; i <= NF; i++) \
79852454Spendry                     if (i == NF) @{ \
79947501Spendry                         if (substr($$i, length($$i), 1) == "\\") \
80047501Spendry                             printf("%s", substr($$i, 1, length($$i) - 1)); \
80147501Spendry                         else \
80247501Spendry                             printf("%s\n", $$i); \
80352454Spendry                     @} \
80447501Spendry                     else \
80547501Spendry                         printf("%s ", $$i); \
80652454Spendry             @}' | \
80747501Spendry        $(MAKEDBM) - $(YPDBDIR)/amd.home; \
80847501Spendry        touch $(YPTSDIR)/amd.home.time; \
80947501Spendry        echo "updated amd.home"; \
81047501Spendry        if [ ! $(NOPUSH) ]; then \
81147501Spendry                $(YPPUSH) amd.home; \
81247501Spendry                echo "pushed amd.home"; \
81347501Spendry        else \
81447501Spendry                : ; \
81547501Spendry        fi
81647501Spendry@end example
81747501Spendry
81847501SpendryHere @code{$(YPTSDIR)} contains the time stamp files, and @code{$(YPDBDIR)} contains
81947501Spendrythe dbm format NIS files.
82047501Spendry
82147501Spendry@node     Hesiod maps, Password maps, NIS maps, Map Types
82247501Spendry@comment  node-name,  next,  previous,  up
82347501Spendry@subsection Hesiod maps
82447501Spendry@cindex Hesiod maps
82547501Spendry
82647501SpendryWhen the map name begins with the string @samp{hesiod.} lookups are made
82747501Spendryusing the @dfn{Hesiod} name server.  The string following the dot is
82847501Spendryused as a name qualifier and is prepended with the key being located.
82947501SpendryThe entire string is then resolved in the @code{automount} context.  For
83047501Spendryexample, if the the key is @samp{jsp} and map name is
83147501Spendry@samp{hesiod.homes} then @dfn{Hesiod} is asked to resolve
83247501Spendry@samp{jsp.homes.automount}.
83347501Spendry
83447501SpendryHesiod maps do not support cache mode @samp{all} and, when caching is
83547501Spendryenabled, have a default cache mode of @samp{inc} (@pxref{Automount Filesystem}).
83647501Spendry
83747501SpendryThe following is an example of a @dfn{Hesiod} map entry:
83847501Spendry
83947501Spendry@example
84047501Spendryjsp.homes.automount HS TXT "rfs:=/home/charm;rhost:=charm;sublink:=jsp"
84147501Spendrynjw.homes.automount HS TXT "rfs:=/home/dylan/dk2;rhost:=dylan;sublink:=njw"
84247501Spendry@end example
84347501Spendry
84447501Spendry@node     Password maps, Union maps, Hesiod maps, Map Types
84547501Spendry@comment  node-name,  next,  previous,  up
84647501Spendry@subsection Password maps
84747501Spendry@cindex Password file maps
84847501Spendry@cindex /etc/passwd maps
84947501Spendry@cindex User maps, automatic generation
85047501Spendry@cindex Automatic generation of user maps
85147501Spendry@cindex Using the password file as a map
85247501Spendry
85347501SpendryThe password map support is unlike the four previous map types.  When
85447501Spendrythe map name is the string @file{/etc/passwd} @i{Amd} can lookup a user
85547501Spendryname in the password file and re-arrange the home directory field to
85647501Spendryproduce a usable map entry.
85747501Spendry
85847501Spendry@i{Amd} assumes the home directory has the format
85947501Spendry`@t{/}@i{anydir}@t{/}@i{dom1}@t{/../}@i{domN}@t{/}@i{login}'.
86047501Spendry@c @footnote{This interpretation is not necessarily exactly what you want.}
86147501SpendryIt breaks this string into a map entry where @code{$@{rfs@}} has the
86247501Spendryvalue `@t{/}@i{anydir}@t{/}@i{domN}', @code{$@{rhost@}} has the value
86347501Spendry`@i{domN}@t{.}@i{...}@t{.}@i{dom1}', and @code{$@{sublink@}} has the
86447501Spendryvalue @samp{login}.@refill
86547501Spendry
86647501SpendryThus if the password file entry was
86747501Spendry
86847501Spendry@example
86947501Spendry/home/achilles/jsp
87047501Spendry@end example
87147501Spendry
87247501Spendrythe map entry used by @i{Amd} would be
87347501Spendry
87447501Spendry@example
87547501Spendryrfs:=/home/achilles;rhost:=achilles;sublink:=jsp
87647501Spendry@end example
87747501Spendry
87847501SpendrySimilarly, if the password file entry was
87947501Spendry
88047501Spendry@example
88147501Spendry/home/cc/sugar/mjh
88247501Spendry@end example
88347501Spendry
88447501Spendrythe map entry used by @i{Amd} would be
88547501Spendry
88647501Spendry@example
88747501Spendryrfs:=/home/sugar;rhost:=sugar.cc;sublink:=jsp
88847501Spendry@end example
88947501Spendry
89052454Spendry@node     Union maps, , Password maps, Map Types
89147501Spendry@comment  node-name,  next,  previous,  up
89247501Spendry@subsection Union maps
89347501Spendry@cindex Union file maps
89447501Spendry
89547501SpendryThe union map support is provided specifically for use with the union
89647501Spendryfilesystem, @pxref{Union Filesystem}.
89747501Spendry
89847501SpendryIt is identified by the string @samp{union:} which is followed by a
89947501Spendrycolon separated list of directories.  The directories are read in order,
90047501Spendryand the names of all entries are recorded in the map cache.  Later
90147501Spendrydirectories take precedence over earlier ones.  The union filesystem
90247501Spendrytype then uses the map cache to determine the union of the names in all
90347501Spendrythe directories.
90447501Spendry
90547501Spendry@c subsection Gdbm
90647501Spendry
90747501Spendry@node     Key Lookup, Location Format, Map Types, Mount Maps
90847501Spendry@comment  node-name,  next,  previous,  up
90947501Spendry@section How keys are looked up
91047501Spendry@cindex Key lookup
91147501Spendry@cindex Map lookup
91247501Spendry@cindex Looking up keys
91347501Spendry@cindex How keys are looked up
91447501Spendry@cindex Wildcards in maps
91547501Spendry
91647501SpendryThe key is located in the map whose type was determined when the
91747501Spendryautomount point was first created.  In general the key is a pathname
91847501Spendrycomponent.  In some circumstances this may be modified by variable
91947501Spendryexpansion (@pxref{Variable Expansion}) and prefixing.  If the automount
92047501Spendrypoint has a prefix, specified by the @var{pref} option, then that is
92147501Spendryprepended to the search key before the map is searched.
92247501Spendry
92347501SpendryIf the map cache is a @samp{regexp} cache then the key is treated as an
92447501Spendryegrep-style regular expression, otherwise a normal string comparison is
92547501Spendrymade.
92647501Spendry
92747501SpendryIf the key cannot be found then a @dfn{wildcard} match is attempted.
92847501Spendry@i{Amd} repeatedly strips the basename from the key, appends @samp{/*} and
92947501Spendryattempts a lookup.  Finally, @i{Amd} attempts to locate the special key @samp{*}.
93047501Spendry
93147501Spendry@group
93247501SpendryFor example, the following sequence would be checked if @file{home/dylan/dk2} was
93347501Spendrybeing located:
93447501Spendry
93547501Spendry@example
93647501Spendry   home/dylan/dk2
93747501Spendry   home/dylan/*
93847501Spendry   home/*
93947501Spendry   *
94047501Spendry@end example
94147501Spendry@end group
94247501Spendry
94347501SpendryAt any point when a wildcard is found, @i{Amd} proceeds as if an exact
94447501Spendrymatch had been found and the value field is then used to resolve the
94547501Spendrymount request, otherwise an error code is propagated back to the kernel.
94647501Spendry(@pxref{Filesystem Types}).@refill
94747501Spendry
94847501Spendry@node     Location Format, , Key Lookup, Mount Maps
94947501Spendry@comment  node-name,  next,  previous,  up
95047501Spendry@section Location Format
95147501Spendry@cindex Location format
95247501Spendry@cindex Map entry format
95347501Spendry@cindex How locations are parsed
95447501Spendry
95547501SpendryThe value field from the lookup provides the information required to
95647501Spendrymount a filesystem.  The information is parsed according to the syntax
95747501Spendryshown below.
95847501Spendry
95947501Spendry@display
96047501Spendry@i{location-list}:
96147501Spendry                  @i{location-selection}
96247501Spendry                  @i{location-list} @i{white-space} @t{||} @i{white-space} @i{location-selection}
96347501Spendry@i{location-selection}:
96447501Spendry                  @i{location}
96547501Spendry                  @i{location-selection} @i{white-space} @i{location}
96647501Spendry@i{location}:
96747501Spendry                  @i{location-info}
96847501Spendry                  @t{-}@i{location-info}
96947501Spendry                  @t{-}
97047501Spendry@i{location-info}:
97147501Spendry                  @i{sel-or-opt}
97247501Spendry                  @i{location-info}@t{;}@i{sel-or-opt}
97347501Spendry                  @t{;}
97447501Spendry@i{sel-or-opt}:
97547501Spendry                  @i{selection}
97647501Spendry                  @i{opt-ass}
97747501Spendry@i{selection}:
97847501Spendry                  selector@t{==}@i{value}
97947501Spendry                  selector@t{!=}@i{value}
98047501Spendry@i{opt-ass}:
98147501Spendry                  option@t{:=}@i{value}
98247501Spendry@i{white-space}:
98347501Spendry                  space
98447501Spendry                  tab
98547501Spendry@end display
98647501Spendry
98747501SpendryNote that unquoted whitespace is not allowed in a location description.
98847501SpendryWhite space is only allowed, and is mandatory, where shown with non-terminal
98947501Spendry@samp{white-space}.
99047501Spendry
99147501SpendryA @dfn{location-selection} is a list of possible volumes with which to
99247501Spendrysatisfy the request.  @dfn{location-selection}s are separated by the
99347501Spendry@samp{||} operator.  The effect of this operator is to prevent use of
99447501Spendrylocation-selections to its right if any of the location-selections on
99547501Spendryits left were selected whether or not any of them were successfully
99647501Spendrymounted (@pxref{Selectors}).@refill
99747501Spendry
99847501SpendryThe location-selection, and singleton @dfn{location-list},
99947501Spendry@samp{type:=ufs;dev:=/dev/xd1g} would inform @i{Amd} to mount a UFS
100047501Spendryfilesystem from the block special device @file{/dev/xd1g}.
100147501Spendry
100247501SpendryThe @dfn{sel-or-opt} component is either the name of an option required
100347501Spendryby a specific filesystem, or it is the name of a built-in, predefined
100447501Spendryselector such as the architecture type.  The value may be quoted with
100547501Spendrydouble quotes @samp{"}, for example
100647501Spendry@samp{type:="ufs";dev:="/dev/xd1g"}.  These quotes are stripped when the
100747501Spendryvalue is parsed and there is no way to get a double quote into a value
100847501Spendryfield.  Double quotes are used to get white space into a value field,
100947501Spendrywhich is needed for the program filesystem (@pxref{Program Filesystem}).@refill
101047501Spendry
101147501Spendry@menu
101247501Spendry* Map Defaults::
101347501Spendry* Variable Expansion::
101447501Spendry* Selectors::
101547501Spendry* Map Options::
101647501Spendry@end menu
101747501Spendry
101847501Spendry@node     Map Defaults, Variable Expansion, Location Format, Location Format
101947501Spendry@comment  node-name,  next,  previous,  up
102047501Spendry@subsection Map Defaults
102147501Spendry@cindex Map defaults
102247501Spendry@cindex How to set default map parameters
102347501Spendry@cindex Setting default map parameters
102447501Spendry
102547501SpendryA location beginning with a dash @samp{-} is used to specify default
102647501Spendryvalues for subsequent locations.  Any previously specified defaults in
102747501Spendrythe location-list are discarded.  The default string can be empty in
102847501Spendrywhich case no defaults apply.
102947501Spendry
103047501SpendryThe location @samp{-fs:=/mnt;opts:=ro} would set the local mount point
103147501Spendryto @file{/mnt} and cause mounts to be read-only by default.  Defaults
103247501Spendryspecified this way are appended to, and so override, any global map
103347501Spendrydefaults given with @samp{/defaults}).
103447501Spendry@c
103547501Spendry@c A @samp{/defaults} value @dfn{gdef} and a location list
103647501Spendry@c \begin{quote}
103747501Spendry@c $@samp{-}@dfn{def}_a $\verb*+ +$ @dfn{loc}_{a_1} $\verb*+ +$ @dfn{loc}_{a_2} $\verb*+ +$ @samp{-}@dfn{def}_b $\verb*+ +$ @dfn{loc}_{b_1} \ldots$
103847501Spendry@c \end{quote}
103947501Spendry@c is equivalent to
104047501Spendry@c \begin{quote}
104147501Spendry@c $@samp{-}@dfn{gdef}@samp{;}@dfn{def}_a $\verb*+ +$ @dfn{loc}_{a_1} $\verb*+ +$ @dfn{loc}_{a_2} $\verb*+ +$ @samp{-}@dfn{gdef}@samp{;}@dfn{def}_b $\verb*+ +$ @dfn{loc}_{b_1} \ldots$
104247501Spendry@c \end{quote}
104347501Spendry@c which is equivalent to
104447501Spendry@c \begin{quote}
104547501Spendry@c $@dfn{gdef}@samp{;}@dfn{def}_a@samp{;}@dfn{loc}_{a_1} $\verb*+ +$@dfn{gdef}@samp{;}@dfn{def}_a@samp{;}@dfn{loc}_{a_2} $\verb*+ +$@dfn{gdef}@samp{;}@dfn{def}_b@samp{;}@dfn{loc}_{b_1} \ldots$
104652454Spendry@c \end{quote}
104747501Spendry
104847501Spendry@node     Variable Expansion, Selectors, Map Defaults, Location Format
104947501Spendry@comment  node-name,  next,  previous,  up
105047501Spendry@subsection Variable Expansion
105147501Spendry@cindex Variable expansion
105247501Spendry@cindex How variables are expanded
105347501Spendry@cindex Pathname operators
105447501Spendry@cindex Domain stripping
105547501Spendry@cindex Domainname operators
105647501Spendry@cindex Stripping the local domain name
105747501Spendry@cindex Environment variables
105847501Spendry@cindex How to access environment variables in maps
105947501Spendry
106047501SpendryTo allow generic location specifications @i{Amd} does variable expansion
106147501Spendryon each location and also on some of the option strings.  Any option or
106247501Spendryselector appearing in the form @code{$@dfn{var}} is replaced by the
106347501Spendrycurrent value of that option or selector.  For example, if the value of
106447501Spendry@code{$@{key@}} was @samp{bin}, @code{$@{autodir@}} was @samp{/a} and
106547501Spendry@code{$@{fs@}} was `@t{$@{autodir@}}@t{/local/}@t{$@{key@}}' then
106647501Spendryafter expansion @code{$@{fs@}} would have the value @samp{/a/local/bin}.
106747501SpendryAny environment variable can be accessed in a similar way.@refill
106847501Spendry
106947501SpendryTwo pathname operators are available when expanding a variable.  If the
107047501Spendryvariable name begins with @samp{/} then only the last component of
107147501Spendrythen pathname is substituted.  For example, if @code{$@{path@}} was
107247501Spendry@samp{/foo/bar} then @code{$@{/path@}} would be expanded to @samp{bar}.
107347501SpendrySimilarly, if the variable name ends with @samp{/} then all but the
107447501Spendrylast component of the pathname is substituted.  In the previous example,
107547501Spendry@code{$@{path/@}} would be expanded to @samp{/foo}.@refill
107647501Spendry
107747501SpendryTwo domain name operators are also provided.  If the variable name
107847501Spendrybegins with @samp{.} then only the domain part of the name is
107947501Spendrysubstituted.  For example, if @code{$@{rhost@}} was
108047501Spendry@samp{swan.doc.ic.ac.uk} then @code{$@{.rhost@}} would be expanded to
108147501Spendry@samp{doc.ic.ac.uk}.  Similarly, if the variable name ends with @samp{.}
108247501Spendrythen only the host component is substituted.  In the previous example,
108347501Spendry@code{$@{rhost.@}} would be expanded to @samp{swan}.@refill
108447501Spendry
108547501SpendryVariable expansion is a two phase process.  Before a location is parsed,
108647501Spendryall references to selectors, @i{eg} @code{$@{path@}}, are expanded.  The
108747501Spendrylocation is then parsed, selections are evaluated and option assignments
108847501Spendryrecorded.  If there were no selections or they all succeeded the
108947501Spendrylocation is used and the values of the following options are expanded in
109047501Spendrythe order given: @var{sublink}, @var{rfs}, @var{fs}, @var{opts},
109152454Spendry@var{remopts}, @var{mount} and @var{unmount}.
109247501Spendry
109347501SpendryNote that expansion of option values is done after @dfn{all} assignments
109447501Spendryhave been completed and not in a purely left to right order as is done
109547501Spendryby the shell.  This generally has the desired effect but care must be
109647501Spendrytaken if one of the options references another, in which case the
109747501Spendryordering can become significant.
109847501Spendry
109947501SpendryThere are two special cases concerning variable expansion:
110047501Spendry
110147501Spendry@enumerate
110247501Spendry@item
110347501Spendrybefore a map is consulted, any selectors in the name received
110447501Spendryfrom the kernel are expanded.  For example, if the request from the
110547501Spendrykernel was for `@t{$@{arch@}}@t{.bin}' and the machine architecture
110647501Spendrywas @samp{vax}, the value given to @code{$@{key@}} would be
110747501Spendry@samp{vax.bin}.@refill
110847501Spendry
110947501Spendry@item
111047501Spendrythe value of @code{$@{rhost@}} is expanded and normalized before the
111147501Spendryother options are expanded.  The normalization process strips any local
111247501Spendrysub-domain components.  For example, if @code{$@{domain@}} was
111347501Spendry@samp{Berkeley.EDU} and @code{$@{rhost@}} was initially
111447501Spendry@samp{snow.Berkeley.EDU}, after the normalization it would simply be
111547501Spendry@samp{snow}.  Hostname normalization is currently done in a
111647501Spendry@emph{case-dependent} manner.@refill
111747501Spendry@end enumerate
111847501Spendry
111947501Spendry@node     Selectors, Map Options, Variable Expansion, Location Format
112047501Spendry@comment  node-name,  next,  previous,  up
112147501Spendry@subsection Selectors
112247501Spendry@cindex Selectors
112347501Spendry
112447501SpendrySelectors are used to control the use of a location.  It is possible to
112547501Spendryshare a mount map between many machines in such a way that filesystem
112647501Spendrylocation, architecture and operating system differences are hidden from
112747501Spendrythe users.  A selector of the form @samp{arch==sun3;os==sos4} would only
112847501Spendryapply on Sun-3s running SunOS 4.x.
112947501Spendry
113047501SpendrySelectors are evaluated left to right.  If a selector fails then that
113147501Spendrylocation is ignored.  Thus the selectors form a conjunction and the
113247501Spendrylocations form a disjunction.  If all the locations are ignored or
113347501Spendryotherwise fail then @i{Amd} uses the @dfn{error} filesystem
113447501Spendry(@pxref{Error Filesystem}).  This is equivalent to having a location
113547501Spendry@samp{type:=error} at the end of each mount-map entry.@refill
113647501Spendry
113747501SpendryThe selectors currently implemented are:
113847501Spendry
113947501Spendry@table @samp
114047501Spendry@cindex arch, mount selector
114147501Spendry@cindex Mount selector; arch
114247501Spendry@cindex Selector; arch
114347501Spendry@item arch
114447501Spendrythe machine architecture which was automatically determined at compile
114547501Spendrytime.  The architecture type can be displayed by running the command
114647501Spendry@samp{amd -v}.  @xref{Supported Machine Architectures}.@refill
114747501Spendry
114847501Spendry@item autodir
114947501Spendry@cindex autodir, mount selector
115047501Spendry@cindex Mount selector; autodir
115147501Spendry@cindex Selector; autodir
115247501Spendrythe default directory under which to mount filesystems.  This may be
115347501Spendrychanged by the ``-a'' command line option.  See the @var{fs} option.
115447501Spendry
115547501Spendry@item byte
115647501Spendry@cindex byte, mount selector
115747501Spendry@cindex Mount selector; byte
115847501Spendry@cindex Selector; byte
115947501Spendrythe machine's byte ordering.  This is either @samp{little}, indicating
116047501Spendrylittle-endian, or @samp{big}, indicating big-endian.  One possible use
116147501Spendryis to share @samp{rwho} databases (@pxref{rwho servers}).  Another is to
116247501Spendryshare ndbm databases, however this use can be considered a courageous
116347501Spendryjuggling act.
116447501Spendry
116547501Spendry@item cluster
116647501Spendry@cindex cluster, mount selector
116747501Spendry@cindex Mount selector; cluster
116847501Spendry@cindex Selector; cluster
116947501Spendryis provided as a hook for the name of the local cluster.  This can be
117047501Spendryused to decide which servers to use for copies of replicated
117147501Spendryfilesystems.  @code{$@{cluster@}} defaults to the value of
117247501Spendry@code{$@{domain@}} unless a different value is set with the ``-C''
117347501Spendrycommand line option.
117447501Spendry
117547501Spendry@item domain
117647501Spendry@cindex domain, mount selector
117747501Spendry@cindex Mount selector; domain
117847501Spendry@cindex Selector; domain
117947501Spendrythe local domain name as specified by the ``-d'' command line option.
118047501SpendrySee @samp{host}.
118147501Spendry
118247501Spendry@item host
118347501Spendry@cindex host, mount selector
118447501Spendry@cindex Mount selector; host
118547501Spendry@cindex Selector; host
118647501Spendrythe local hostname as determined by @b{gethostname}(2).  If no domain
118747501Spendryname was specified on the command line and the hostname contains a
118847501Spendryperiod @samp{.} then the string before the period is used as the
118947501Spendryhost name, and the string after the period is assigned to
119047501Spendry@code{$@{domain@}}.  For example, if the hostname is
119147501Spendry@samp{styx.doc.ic.ac.uk} then @code{host} would be @samp{styx} and
119247501Spendry@code{domain} would be @samp{doc.ic.ac.uk}.  @code{hostd} would be
119347501Spendry@samp{styx.doc.ic.ac.uk}.@refill
119447501Spendry
119547501Spendry@item hostd
119647501Spendry@cindex hostd, mount selector
119747501Spendry@cindex Mount selector; hostd
119847501Spendry@cindex Selector; hostd
119947501Spendryis @code{$@{host@}} and @code{$@{domain@}} concatenated with a
120047501Spendry@samp{.} inserted between them if required.  If @code{$@{domain@}}
120147501Spendryis an empty string then @code{$@{host@}} and @code{$@{hostd@}} will be
120247501Spendryidentical.
120347501Spendry
120447501Spendry@item karch
120547501Spendry@cindex karch, mount selector
120647501Spendry@cindex Mount selector; karch
120747501Spendry@cindex Selector; karch
120847501Spendryis provided as a hook for the kernel architecture.  This is used on
120947501SpendrySunOS 4, for example, to distinguish between different @samp{/usr/kvm}
121047501Spendryvolumes.  @code{$@{karch@}} defaults to the value of @code{$@{arch@}}
121147501Spendryunless a different value is set with the ``-k'' command line option.
121247501Spendry
121347501Spendry@item os
121447501Spendry@cindex os, mount selector
121547501Spendry@cindex Mount selector; os
121647501Spendry@cindex Selector; os
121747501Spendrythe operating system.  Like the machine architecture, this is
121847501Spendryautomatically determined at compile time.  The operating system name can
121947501Spendrybe displayed by running the command @samp{amd -v}.  @xref{Supported
122047501SpendryOperating Systems}.@refill
122147501Spendry
122247501Spendry@end table
122347501Spendry
122447501SpendryThe following selectors are also provided.  Unlike the other selectors,
122547501Spendrythey vary for each lookup.  Note that when the name from the kernel is
122647501Spendryexpanded prior to a map lookup, these selectors are all defined as empty
122747501Spendrystrings.
122847501Spendry
122947501Spendry@table @samp
123047501Spendry@item key
123147501Spendry@cindex key, mount selector
123247501Spendry@cindex Mount selector; key
123347501Spendry@cindex Selector; key
123447501Spendrythe name being resolved.  For example, if @file{/home} is an automount
123547501Spendrypoint, then accessing @file{/home/foo} would set @code{$@{key@}} to the
123647501Spendrystring @samp{foo}.  The key is prefixed by the @var{pref} option set in
123747501Spendrythe parent mount point.  The default prefix is an empty string.  If the
123847501Spendryprefix was @file{blah/} then @code{$@{key@}} would be set to
123947501Spendry@file{blah/foo}.@refill
124047501Spendry
124147501Spendry@item map
124247501Spendry@cindex map, mount selector
124347501Spendry@cindex Mount selector; map
124447501Spendry@cindex Selector; map
124547501Spendrythe name of the mount map being used.
124647501Spendry
124747501Spendry@item path
124847501Spendry@cindex path, mount selector
124947501Spendry@cindex Mount selector; path
125047501Spendry@cindex Selector; path
125147501Spendrythe full pathname of the name being resolved.  For example
125247501Spendry@file{/home/foo} in the example above.
125347501Spendry
125447501Spendry@item wire
125547501Spendry@cindex wire, mount selector
125647501Spendry@cindex Mount selector; wire
125747501Spendry@cindex Selector; wire
125847501Spendrythe name of the network to which the primary network interface is
125947501Spendryattached.  If a symbolic name cannot be found in the networks or hosts
126047501Spendrydatabase then dotted IP address format is used.  This value is also
126147501Spendryoutput by the ``-v'' option.
126247501Spendry
126347501Spendry@end table
126447501Spendry
126547501SpendrySelectors can be negated by using @samp{!=} instead of @samp{==}.  For
126647501Spendryexample to select a location on all non-Vax machines the selector
126747501Spendry@samp{arch!=vax} would be used.
126847501Spendry
126947501Spendry@node     Map Options,  , Selectors, Location Format
127047501Spendry@comment  node-name,  next,  previous,  up
127147501Spendry@subsection Map Options
127247501Spendry@cindex Map options
127347501Spendry@cindex Setting map options
127447501Spendry
127547501SpendryOptions are parsed concurrently with selectors.  The difference is that
127647501Spendrywhen an option is seen the string following the @samp{:=} is
127747501Spendryrecorded for later use.  As a minimum the @var{type} option must be
127847501Spendryspecified.  Each filesystem type has other options which must also be
127947501Spendryspecified.  @xref{Filesystem Types}, for details on the filesystem
128047501Spendryspecific options.@refill
128147501Spendry
128247501SpendrySuperfluous option specifications are ignored and are not reported
128347501Spendryas errors.
128447501Spendry
128547501SpendryThe following options apply to more than one filesystem type.
128647501Spendry
128747501Spendry@menu
128847501Spendry* delay Option::
128947501Spendry* fs Option::
129047501Spendry* opts Option::
129152454Spendry* remopts Option::
129247501Spendry* sublink Option::
129347501Spendry* type Option::
129447501Spendry@end menu
129547501Spendry
129647501Spendry@node     delay Option, fs Option, Map Options, Map Options
129747501Spendry@comment  node-name,  next,  previous,  up
129847501Spendry@subsubsection delay Option
129947501Spendry@cindex Setting a delay on a mount location
130047501Spendry@cindex Delaying mounts from specific locations
130147501Spendry@cindex Primary server
130247501Spendry@cindex Secondary server
130347501Spendry@cindex delay, mount option
130447501Spendry@cindex Mount option; delay
130547501Spendry
130647501SpendryThe delay, in seconds, before an attempt will be made to mount from the current location.
130747501SpendryAuxilliary data, such as network address, file handles and so on are computed
130847501Spendryregardless of this value.
130947501Spendry
131047501SpendryA delay can be used to implement the notion of primary and secondary file servers.
131147501SpendryThe secondary servers would have a delay of a few seconds,
131247501Spendrythus giving the primary servers a chance to respond first.
131347501Spendry
131447501Spendry@node     fs Option, opts Option, delay Option, Map Options
131547501Spendry@comment  node-name,  next,  previous,  up
131647501Spendry@subsubsection fs Option
131747501Spendry@cindex Setting the local mount point
131847501Spendry@cindex Overriding the default mount point
131947501Spendry@cindex fs, mount option
132047501Spendry@cindex Mount option; fs
132147501Spendry
132247501SpendryThe local mount point.  The semantics of this option vary between
132347501Spendryfilesystems.
132447501Spendry
132547501SpendryFor NFS and UFS filesystems the value of @code{$@{fs@}} is used as the
132647501Spendrylocal mount point.  For other filesystem types it has other meanings
132747501Spendrywhich are described in the section describing the respective filesystem
132847501Spendrytype.  It is important that this string uniquely identifies the
132947501Spendryfilesystem being mounted.  To satisfy this requirement, it should
133047501Spendrycontain the name of the host on which the filesystem is resident and the
133147501Spendrypathname of the filesystem on the local or remote host.
133247501Spendry
133347501SpendryThe reason for requiring the hostname is clear if replicated filesystems
133447501Spendryare considered.  If a fileserver goes down and a replacement filesystem
133547501Spendryis mounted then the @dfn{local} mount point @dfn{must} be different from
133647501Spendrythat of the filesystem which is hung.  Some encoding of the filesystem
133747501Spendryname is required if more than one filesystem is to be mounted from any
133847501Spendrygiven host.
133947501Spendry
134047501SpendryIf the hostname is first in the path then all mounts from a particular
134147501Spendryhost will be gathered below a single directory.  If that server goes
134247501Spendrydown then the hung mount points are less likely to be accidentally
134347501Spendryreferenced, for example when @b{getwd}(3) traverses the namespace to
134447501Spendryfind the pathname of the current directory.
134547501Spendry
134647501SpendryThe @samp{fs} option defaults to
134747501Spendry@code{$@{autodir@}/$@{rhost@}$@{rfs@}}.  In addition,
134847501Spendry@samp{rhost} defaults to the local host name (@code{$@{host@}}) and
134947501Spendry@samp{rfs} defaults to the value of @code{$@{path@}}, which is the full
135047501Spendrypath of the requested file; @samp{/home/foo} in the example above
135147501Spendry(@pxref{Selectors}).  @code{$@{autodir@}} defaults to @samp{/a} but may
135247501Spendrybe changed with the ``-a'' command line option.  Sun's automounter
135347501Spendrydefaults to @samp{/tmp_mnt}.  Note that there is no @samp{/} between
135447501Spendrythe @code{$@{rhost@}} and @code{$@{rfs@}} since @code{$@{rfs@}} begins
135547501Spendrywith a @samp{/}.@refill
135647501Spendry
135752454Spendry@node     opts Option, remopts Option, fs Option, Map Options
135847501Spendry@comment  node-name,  next,  previous,  up
135947501Spendry@subsubsection opts Option
136047501Spendry@cindex Setting system mount options
136147501Spendry@cindex Passing parameters to the mount system call
136247501Spendry@cindex mount system call
136347501Spendry@cindex mount system call flags
136447501Spendry@cindex The mount system call
136547501Spendry@cindex opts, mount option
136647501Spendry@cindex Mount option; opts
136747501Spendry
136847501SpendryThe options to pass to the mount system call.  A leading @samp{-} is
136947501Spendrysilently ignored.  The mount options supported generally correspond to
137047501Spendrythose used by @b{mount}(8) and are listed below.  Some additional
137147501Spendrypseudo-options are interpreted by @i{Amd} and are also listed.
137247501Spendry
137347501SpendryUnless specifically overridden, each of the system default mount options
137447501Spendryapplies.  Any options not recognised are ignored.  If no options list is
137547501Spendrysupplied the string @samp{rw,defaults} is used and all the system
137647501Spendrydefault mount options apply.  Options which are not applicable for a
137747501Spendryparticular operating system are silently ignored.  For example, only 4.4
137847501SpendryBSD is known to implement the @code{compress} and @code{spongy} options.
137947501Spendry
138047501Spendry@table @code
138147501Spendry@item compress
138247501SpendryUse NFS compression protocol.
138347501Spendry@item grpid
138447501SpendryUse BSD directory group-id semantics.
138547501Spendry@item intr
138647501SpendryAllow keyboard interrupts on hard mounts.
138747501Spendry@item noconn
138847501SpendryDon't make a connection on datagram transports.
138947501Spendry@item nocto
139047501SpendryNo close-to-open consistency.
139147501Spendry@item nodevs
139247501SpendryDon't allow local special devices on this filesystem.
139347501Spendry@item nosuid
139447501SpendryDon't allow set-uid or set-gid executables on this filesystem.
139547501Spendry@item quota
139647501SpendryEnable quota checking on this mount.
139747501Spendry@item retrans=@i{n}
139847501SpendryThe number of NFS retransmits made before a user error is generated by a
139947501Spendry@samp{soft} mounted filesystem, and before a @samp{hard} mounted
140047501Spendryfilesystem reports @samp{NFS server @dfn{yoyo} not responding still
140147501Spendrytrying}.
140247501Spendry@item ro
140347501SpendryMount this filesystem readonly.
140447501Spendry@item rsize=@var{n}
140547501SpendryThe NFS read packet size.  You may need to set this if you are using
140647501SpendryNFS/UDP through a gateway.
140747501Spendry@item soft
140847501SpendryGive up after @dfn{retrans} retransmissions.
140947501Spendry@item spongy
141047501SpendryLike @samp{soft} for status requests, and @samp{hard} for data transfers.
141147501Spendry@item tcp
141247501SpendryUse TCP/IP instead of UDP/IP, ignored if the NFS implementation does not
141347501Spendrysupport TCP/IP mounts.
141447501Spendry@item timeo=@var{n}
141547501SpendryThe NFS timeout, in tenth-seconds, before a request is retransmitted.
141647501Spendry@item wsize=@var{n}
141747501SpendryThe NFS write packet size.  You may need to set this if you are using
141847501SpendryNFS/UDP through a gateway.
141947501Spendry@end table
142047501Spendry
142147501SpendryThe following options are implemented by @i{Amd}, rather than being
142247501Spendrypassed to the kernel.
142347501Spendry
142447501Spendry@table @code
142547501Spendry@item nounmount
142647501SpendryConfigures the mount so that its time-to-live will
142747501Spendrynever expire.  This is also the default for some filesystem types.
142847501Spendry@c
142947501Spendry@c Implementation broken:
143047501Spendry@item ping=@var{n}
143147501SpendryThe interval, in seconds, between keep-alive pings.  When four
143247501Spendryconsecutive pings have failed the mount point is marked as hung.  This
143352454Spendryinterval defaults to 30 seconds.  If the ping interval is less than zero,
143452454Spendryno pings are sent and the host is assumed to be always
143547501Spendryup.  By default, pings are not sent for an NFS/TCP mount.
143647501Spendry@item retry=@var{n}
143747501SpendryThe number of times to retry the mount system call.
143847501Spendry@item utimeout=@var{n}
143947501SpendryThe interval, in seconds, by which the mount's
144047501Spendrytime-to-live is extended after an unmount attempt
144147501Spendryhas failed.  In fact the interval is extended before the unmount is
144247501Spendryattempted to avoid thrashing.  The default value is 120 seconds (two
144347501Spendryminutes) or as set by the ``-w'' command line option.
144447501Spendry@end table
144547501Spendry
144652454Spendry@node     remopts Option, sublink Option, opts Option, Map Options
144747501Spendry@comment  node-name,  next,  previous,  up
144852454Spendry@subsubsection remopts Option
144952454Spendry@cindex Setting system mount options for non-local networks
145052454Spendry@cindex remopts, mount option
145152454Spendry@cindex Mount option; remopts
145252454Spendry
145352454SpendryThis option has the same use as @code{$@{opts@}} but applies only when
145452454Spendrythe remote host is on a non-local network.  For example, when using NFS
145552454Spendryacross a gateway it is often necessary to use smaller values for the
145652454Spendrydata read and write sizes.  This can simply be done by specifying the
145752454Spendrysmall values in @var{remopts}.  When a non-local host is accessed, the
145852454Spendrysmaller sizes will automatically be used.
145952454Spendry
146052454Spendry@i{Amd} determines whether a host is local by examining the network
146152454Spendryinterface configuration at startup.  Any interface changes made after
146252454Spendry@i{Amd} has been started will not be noticed.  The likely effect will
146352454Spendrybe that a host may incorrectly be declared non-local.
146452454Spendry
146552454SpendryUnless otherwise set, the value of @code{$@{rem@}} is the same as the
146652454Spendryvalue of @code{$@{opts@}}.
146752454Spendry
146852454Spendry@node     sublink Option, type Option, remopts Option, Map Options
146952454Spendry@comment  node-name,  next,  previous,  up
147047501Spendry@subsubsection sublink Option
147147501Spendry@cindex Setting the sublink option
147247501Spendry@cindex sublink, mount option
147347501Spendry@cindex Mount option; sublink
147447501Spendry
147547501SpendryThe subdirectory within the mounted filesystem to which the reference
147647501Spendryshould point.  This can be used to prevent duplicate mounts in cases
147747501Spendrywhere multiple directories in the same mounted filesystem are used.
147847501Spendry
147952454Spendry@node     type Option, , sublink Option, Map Options
148047501Spendry@comment  node-name,  next,  previous,  up
148147501Spendry@subsubsection type Option
148247501Spendry@cindex Setting the filesystem type option
148347501Spendry@cindex type, mount option
148447501Spendry@cindex Mount option; type
148547501Spendry
148647501SpendryThe filesystem type to be used.  @xref{Filesystem Types}, for a full
148747501Spendrydescription of each type.@refill
148847501Spendry
148947501Spendry@node     Amd Command Line Options, Filesystem Types, Mount Maps, Top
149047501Spendry@comment  node-name,  next,  previous,  up
149147501Spendry@chapter @i{Amd} Command Line Options
149247501Spendry@cindex Command line options, Amd
149347501Spendry@cindex Amd command line options
149447501Spendry@cindex Overriding defaults on the command line
149547501Spendry
149647501SpendryMany of @i{Amd}'s parameters can be set from the command line.  The
149747501Spendrycommand line is also used to specify automount points and maps.
149847501Spendry
149947501SpendryThe general format of a command line is
150047501Spendry
150147501Spendry@example
150252454Spendryamd [@i{options}] @{ @i{directory} @i{map-name} [-@i{map-options}] @} ...
150347501Spendry@end example
150447501Spendry
150547501SpendryFor each directory and map-name given, @i{Amd} establishes an
150647501Spendryautomount point.  The @dfn{map-options} may be any sequence of options
150747501Spendryor selectors---@pxref{Location Format}.  The @dfn{map-options}
150847501Spendryapply only to @i{Amd}'s mount point.
150947501Spendry
151047501Spendry@samp{type:=toplvl;cache:=mapdefault;fs:=$@{map@}} is the default value for the
151147501Spendrymap options.  Default options for a map are read from a special entry in
151247501Spendrythe map whose key is the string @samp{/defaults}.  When default options
151347501Spendryare given they are prepended to any options specified in the mount-map
151447501Spendrylocations as explained in.  @xref{Map Defaults}, for more details.
151547501Spendry
151647501SpendryThe @dfn{options} are any combination of those listed below.
151747501Spendry
151847501SpendryOnce the command line has been parsed, the automount points are mounted.
151947501SpendryThe mount points are created if they do not already exist, in which case they
152047501Spendrywill be removed when @i{Amd} exits.
152147501SpendryFinally, @i{Amd} disassociates itself from its controlling terminal and
152247501Spendryforks into the background.
152347501Spendry
152447501SpendryNote: Even if @i{Amd} has been built with @samp{-DDEBUG} it will still
152547501Spendrybackground itself and disassociate itself from the controlling terminal.
152647501SpendryTo use a debugger it is necessary to specify @samp{-D nodaemon} on the
152747501Spendrycommand line.
152847501Spendry
152947501Spendry@menu
153047501Spendry* -a Option::	Automount directory.
153147501Spendry* -c Option::	Cache timeout interval.
153247501Spendry* -d Option::	Domain name.
153347501Spendry* -k Option::	Kernel architecture.
153447501Spendry* -l Option::	Log file.
153547501Spendry* -n Option::	Hostname normalisation.
153647501Spendry* -p Option::	Output process id.
153747501Spendry* -r Option::	Restart existing mounts.
153847501Spendry* -t Option::	Kernel RPC timeout.
153947501Spendry* -v Option::	Version information.
154047501Spendry* -w Option::	Wait interval after failed unmount.
154147501Spendry* -x Option::	Log options.
154247501Spendry* -y Option::	NIS domain.
154347501Spendry* -C-Option::	Cluster name.
154447501Spendry* -D-Option::	Debug flags.
154547501Spendry@end menu
154647501Spendry
154747501Spendry@node     -a Option, -c Option, Amd Command Line Options, Amd Command Line Options
154847501Spendry@comment  node-name,  next,  previous,  up
154947501Spendry@section @code{-a} @var{directory}
155047501Spendry@cindex Automount directory
155147501Spendry@cindex Setting the default mount directory
155247501Spendry
155347501SpendrySpecifies the default mount directory.  This option changes the variable
155447501Spendry@code{$@{autodir@}} which otherwise defaults to @file{/a}.  For example,
155547501Spendrysome sites prefer @file{/amd}.
155647501Spendry
155747501Spendry@example
155847501Spendryamd -a /amd ...
155947501Spendry@end example
156047501Spendry
156147501Spendry@node     -c Option, -d Option, -a Option, Amd Command Line Options
156247501Spendry@comment  node-name,  next,  previous,  up
156347501Spendry@section @code{-c} @var{cache-interval}
156447501Spendry@cindex Cache interval
156547501Spendry@cindex Interval before a filesystem times out
156647501Spendry@cindex Setting the interval before a filesystem times out
156747501Spendry@cindex Changing the interval before a filesystem times out
156847501Spendry
156947501SpendrySelects the period, in seconds, for which a name is cached by @i{Amd}.
157047501SpendryIf no reference is made to the volume in this period, @i{Amd} discards
157147501Spendrythe volume name to filesystem mapping.
157247501Spendry
157347501SpendryOnce the last reference to a filesystem has been removed, @i{Amd}
157447501Spendryattempts to unmount the filesystem.  If the unmount fails the interval
157547501Spendryis extended by a further period as specified by the @samp{-w} command
157647501Spendryline option or by the @samp{utimeout} mount option.
157747501Spendry
157847501SpendryThe default @dfn{cache-interval} is 300 seconds (five minutes).
157947501Spendry
158052454Spendry@node     -d Option, -k Option, -c Option, Amd Command Line Options
158147501Spendry@comment  node-name,  next,  previous,  up
158247501Spendry@section @code{-d} @var{domain}
158347501Spendry@cindex Domain name
158447501Spendry@cindex Setting the local domain name
158547501Spendry@cindex Overriding the local domain name
158647501Spendry
158747501SpendrySpecifies the host's domain.  This sets the internal variable
158847501Spendry@code{$@{domain@}} and affects the @code{$@{hostd@}} variable.
158947501Spendry
159047501SpendryIf this option is not specified and the hostname already contains the
159147501Spendrylocal domain then that is used, otherwise the default value of
159247501Spendry@code{$@{domain@}} is @samp{unknown.domain}.
159347501Spendry
159447501SpendryFor example, if the local domain was @samp{doc.ic.ac.uk}, @i{Amd} could
159547501Spendrybe started as follows:
159647501Spendry
159747501Spendry@example
159847501Spendryamd -d doc.ic.ac.uk ...
159947501Spendry@end example
160047501Spendry
160147501Spendry@node     -k Option, -l Option, -d Option, Amd Command Line Options
160247501Spendry@comment  node-name,  next,  previous,  up
160347501Spendry@section @code{-k} @var{kernel-architecture}
160447501Spendry@cindex Setting the Kernel architecture
160547501Spendry
160647501SpendrySpecifies the kernel architecture of the system.  This is usually the
160747501Spendryoutput of @samp{arch -k} and its only effect is to set the variable
160847501Spendry@code{$@{karch@}}.  If this option is not given, @code{$@{karch@}} has
160947501Spendrythe same value as @code{$@{arch@}}.
161047501Spendry
161147501SpendryThis would be used as follows:
161247501Spendry
161347501Spendry@example
161447501Spendryamd -k `arch -k` ...
161547501Spendry@end example
161647501Spendry
161747501Spendry@node     -l Option, -n Option, -k Option, Amd Command Line Options
161847501Spendry@comment  node-name,  next,  previous,  up
161947501Spendry@section @code{-l} @var{log-option}
162047501Spendry@cindex Log filename
162147501Spendry@cindex Setting the log file
162247501Spendry@cindex Using syslog to log errors
162347501Spendry@cindex syslog
162447501Spendry
162547501SpendrySelects the form of logging to be made.  Two special @dfn{log-options}
162647501Spendryare recognised.
162747501Spendry
162847501Spendry@enumerate
162947501Spendry@item
163047501SpendryIf @dfn{log-option} is the string @samp{syslog}, @i{Amd} will use the
163147501Spendry@b{syslog}(3) mechanism.@refill
163247501Spendry
163347501Spendry@item
163447501SpendryIf @dfn{log-option} is the string @samp{/dev/stderr}, @i{Amd} will use
163547501Spendrystandard error, which is also the default target for log messages.  To
163647501Spendryimplement this, @i{Amd} simulates the effect of the @samp{/dev/fd}
163747501Spendrydriver.
163847501Spendry@end enumerate
163947501Spendry
164047501SpendryAny other string is taken as a filename to use for logging.  Log
164147501Spendrymessages are appended to the file if it already exists, otherwise a new
164247501Spendryfile is created.  The file is opened once and then held open, rather
164347501Spendrythan being re-opened for each message.
164447501Spendry
164547501SpendryIf the @samp{syslog} option is specified but the system does not support
164647501Spendrysyslog or if the named file cannot be opened or created, @i{Amd} will
164747501Spendryuse standard error.  Error messages generated before @i{Amd} has
164847501Spendryfinished parsing the command line are printed on standard error.
164947501Spendry
165047501SpendryUsing @samp{syslog} is usually best, in which case @i{Amd} would be
165147501Spendrystarted as follows:
165247501Spendry
165347501Spendry@example
165447501Spendryamd -l syslog ...
165547501Spendry@end example
165647501Spendry
165747501Spendry@node     -n Option, -p Option, -l Option, Amd Command Line Options
165847501Spendry@comment  node-name,  next,  previous,  up
165947501Spendry@section @code{-n}
166047501Spendry@cindex Hostname normalisation
166147501Spendry@cindex Aliased hostnames
166247501Spendry@cindex Resolving aliased hostnames
166347501Spendry@cindex Normalising hostnames
166447501Spendry
166547501SpendryNormalises the remote hostname before using it.  Normalisation is done
166647501Spendryby replacing the value of @code{$@{rhost@}} with the primary name
166747501Spendryreturned by a hostname lookup.
166847501Spendry
166947501SpendryThis option should be used if several names are used to refer to a
167047501Spendrysingle host in a mount map.
167147501Spendry
167252454Spendry@node     -p Option, -r Option, -n Option, Amd Command Line Options
167347501Spendry@comment  node-name,  next,  previous,  up
167447501Spendry@section @code{-p}
167547501Spendry@cindex Process id
167647501Spendry@cindex Displaying the process id
167747501Spendry@cindex process id of Amd daemon
167847501Spendry@cindex pid file, creating with -p option
167947501Spendry@cindex Creating a pid file
168047501Spendry
168147501SpendryCauses @i{Amd}'s process id to be printed on standard output.
168247501SpendryThis can be redirected to a suitable file for use with kill:
168347501Spendry
168447501Spendry@example
168547501Spendryamd -p > /var/run/amd.pid ...
168647501Spendry@end example
168747501Spendry
168847501SpendryThis option only has an affect if @i{Amd} is running in daemon mode.
168947501SpendryIf @i{Amd} is started with the @code{-D nodaemon} debug flag, this
169047501Spendryoption is ignored.
169147501Spendry
169247501Spendry@node     -r Option, -t Option, -p Option, Amd Command Line Options
169347501Spendry@comment  node-name,  next,  previous,  up
169447501Spendry@section @code{-r}
169547501Spendry@cindex Restarting existing mounts
169647501Spendry@cindex Picking up existing mounts
169747501Spendry
169847501SpendryTells @i{Amd} to restart existing mounts (@pxref{Inheritance Filesystem}).
169947501Spendry@c @dfn{This option will be made the default in the next release.}
170047501Spendry
170147501Spendry@node     -t Option, -v Option, -r Option, Amd Command Line Options
170247501Spendry@comment  node-name,  next,  previous,  up
170347501Spendry@section @code{-t} @var{timeout.retransmit}
170447501Spendry@cindex Setting Amd's RPC parameters
170547501Spendry
170647501SpendrySpecifies the RPC @dfn{timeout} and @dfn{retransmit} intervals used by
170747501Spendrythe kernel to communicate to @i{Amd}.  These are used to set the
170847501Spendry@samp{timeo} and @samp{retrans} mount options.
170947501Spendry
171047501Spendry@i{Amd} relies on the kernel RPC retransmit mechanism to trigger mount
171147501Spendryretries.  The value of this parameter changes the retry interval.  Too
171247501Spendrylong an interval gives poor interactive response, too short an interval
171347501Spendrycauses excessive retries.
171447501Spendry
171547501Spendry@node     -v Option, -w Option, -t Option, Amd Command Line Options
171647501Spendry@comment  node-name,  next,  previous,  up
171747501Spendry@section @code{-v}
171847501Spendry@cindex Version information
171947501Spendry@cindex Discovering version information
172047501Spendry@cindex How to discover your version of Amd
172147501Spendry
172247501SpendryPrint version information on standard error and then exit.  The output
172347501Spendryis of the form:
172447501Spendry
172547501Spendry@example
172647501Spendryamd 5.2.1.11 of 91/03/17 18:04:05 5.3Alpha11 #0: Sun Mar 17 18:07:28 GMT 1991
172747501SpendryBuilt by pendry@@vangogh.Berkeley.EDU for a hp300 running bsd44 (big-endian).
172847501SpendryMap support for: root, passwd, union, file, error.
172947501SpendryFS: ufs, nfs, nfsx, host, link, program, union, auto, direct, toplvl, error.
173047501SpendryPrimary network is 128.32.130.0.
173147501Spendry@end example
173247501Spendry
173347501SpendryThe information includes the version number, release date and name of
173447501Spendrythe release.  The architecture (@pxref{Supported Machine Architectures}),
173547501Spendryoperating system (@pxref{Supported Operating Systems})
173647501Spendryand byte ordering are also printed as they appear in the @code{$@{os@}},
173747501Spendry@code{$@{arch@}} and @code{$@{byte@}} variables.@refill
173847501Spendry
173947501Spendry@node     -w Option, -x Option, -v Option, Amd Command Line Options
174047501Spendry@comment  node-name,  next,  previous,  up
174147501Spendry@section @code{-w} @var{wait-timeout}
174247501Spendry@cindex Setting the interval between unmount attempts
174347501Spendry@cindex unmount attempt backoff interval
174447501Spendry
174547501SpendrySelects the interval in seconds between unmount attempts after the
174647501Spendryinitial time-to-live has expired.
174747501Spendry
174847501SpendryThis defaults to 120 seconds (two minutes).
174947501Spendry
175047501Spendry@node     -x Option, -y Option, -w Option, Amd Command Line Options
175147501Spendry@comment  node-name,  next,  previous,  up
175247501Spendry@section @code{-x} @var{opts}
175347501Spendry@cindex Log message selection
175447501Spendry@cindex Selecting specific log messages
175547501Spendry@cindex How to select log messages
175647501Spendry@cindex syslog priorities
175747501Spendry
175847501SpendrySpecifies the type and verbosity of log messages.  @dfn{opts} is
175947501Spendrya comma separated list selected from the following options:
176047501Spendry
176147501Spendry@table @code
176247501Spendry@item fatal
176347501SpendryFatal errors
176447501Spendry@item error
176547501SpendryNon-fatal errors
176647501Spendry@item user
176747501SpendryNon-fatal user errors
176847501Spendry@item warn
176947501SpendryRecoverable errors
177047501Spendry@item warning
177147501SpendryAlias for @code{warn}
177247501Spendry@item info
177347501SpendryInformation messages
177447501Spendry@item map
177547501SpendryMount map usage
177647501Spendry@item stats
177747501SpendryAdditional statistics
177847501Spendry@item all
177947501SpendryAll of the above
178047501Spendry@end table
178147501Spendry
178247501SpendryInitially a set of default logging flags is enabled.  This is as if
178347501Spendry@samp{-x all,nomap,nostats} had been selected.  The command line is
178447501Spendryparsed and logging is controlled by the ``-x'' option.  The very first
178547501Spendryset of logging flags is saved and can not be subsequently disabled using
178647501Spendry@i{Amq}.  This default set of options is useful for general production
178747501Spendryuse.@refill
178847501Spendry
178947501SpendryThe @samp{info} messages include details of what is mounted and
179047501Spendryunmounted and when filesystems have timed out.  If you want to have the
179147501Spendrydefault set of messages without the @samp{info} messages then you simply
179247501Spendryneed @samp{-x noinfo}.  The messages given by @samp{user} relate to
179347501Spendryerrors in the mount maps, so these are useful when new maps are
179447501Spendryinstalled.  The following table lists the syslog priorites used for each
179547501Spendryof the message types.@refill
179647501Spendry
179747501Spendry@table @code
179847501Spendry@item fatal
179947501SpendryLOG_CRIT
180047501Spendry@item error
180147501SpendryLOG_ERR
180247501Spendry@item user
180347501SpendryLOG_WARNING
180447501Spendry@item warning
180547501SpendryLOG_WARNING
180647501Spendry@item info
180747501SpendryLOG_INFO
180847501Spendry@item debug
180947501SpendryLOG_DEBUG
181047501Spendry@item map
181147501SpendryLOG_DEBUG
181247501Spendry@item stats
181347501SpendryLOG_INFO
181447501Spendry@end table
181547501Spendry
181647501Spendry
181747501SpendryThe options can be prefixed by the string @samp{no} to indicate
181847501Spendrythat this option should be turned off.  For example, to obtain all
181947501Spendrybut @samp{info} messages the option @samp{-x all,noinfo} would be used.
182047501Spendry
182147501SpendryIf @i{Amd} was built with debugging enabled the @code{debug} option is
182247501Spendryautomatically enabled regardless of the command line options.
182347501Spendry
182447501Spendry@node     -y Option, -C-Option, -x Option, Amd Command Line Options
182547501Spendry@comment  node-name,  next,  previous,  up
182647501Spendry@section @code{-y} @var{NIS-domain}
182747501Spendry@cindex NIS (YP) domain name
182847501Spendry@cindex Overriding the NIS (YP) domain name
182947501Spendry@cindex Setting the NIS (YP) domain name
183047501Spendry@cindex YP domain name
183147501Spendry
183247501SpendrySelects an alternate NIS domain.  This is useful for debugging and
183347501Spendrycross-domain shared mounting.  If this flag is specified, @i{Amd}
183447501Spendryimmediately attempts to bind to a server for this domain.
183547501Spendry@c @i{Amd} refers to NIS maps when it starts, unless the ``-m'' option
183647501Spendry@c is specified, and whenever required in a mount map.
183747501Spendry
183847501Spendry@node     -C-Option, -D-Option, -y Option, Amd Command Line Options
183947501Spendry@comment  node-name,  next,  previous,  up
184047501Spendry@section @code{-C} @var{cluster-name}
184147501Spendry@cindex Cluster names
184247501Spendry@cindex Setting the cluster name
184347501Spendry
184447501SpendrySpecifies the name of the cluster of which the local machine is a member.
184547501SpendryThe only effect is to set the variable @code{$@{cluster@}}.
184647501SpendryThe @dfn{cluster-name} is will usually obtained by running another command which uses
184747501Spendrya database to map the local hostname into a cluster name.
184847501Spendry@code{$@{cluster@}} can then be used as a selector to restrict mounting of
184947501Spendryreplicated data.
185047501SpendryIf this option is not given, @code{$@{cluster@}} has the same value as @code{$@{domain@}}.
185147501SpendryThis would be used as follows:
185247501Spendry
185347501Spendry@example
185447501Spendryamd -C `clustername` ...
185547501Spendry@end example
185647501Spendry
185747501Spendry@node     -D-Option, , -C-Option, Amd Command Line Options
185847501Spendry@comment  node-name,  next,  previous,  up
185947501Spendry@section @code{-D} @var{opts}
186047501Spendry@cindex Debug options
186147501Spendry@cindex Setting debug flags
186247501Spendry
186347501SpendryControls the verbosity and coverage of the debugging trace; @dfn{opts}
186447501Spendryis a comma separated list of debugging options.  The ``-D'' option is
186547501Spendryonly available if @i{Amd} was compiled with @samp{-DDEBUG}.  The memory
186647501Spendrydebugging facilities are only available if @i{Amd} was compiled with
186747501Spendry@samp{-DDEBUG_MEM} (in addition to @samp{-DDEBUG}).
186847501Spendry
186947501SpendryThe most common options to use are @samp{-D trace} and @samp{-D test}
187047501Spendry(which turns on all the useful debug options).  See the program source
187147501Spendryfor a more detailed explanation of the available options.
187247501Spendry
187347501Spendry@node     Filesystem Types, Run-time Administration, Amd Command Line Options, Top
187447501Spendry@comment  node-name,  next,  previous,  up
187547501Spendry@chapter Filesystem Types
187647501Spendry@cindex Filesystem types
187747501Spendry@cindex Mount types
187847501Spendry@cindex Types of filesystem
187947501Spendry
188047501SpendryTo mount a volume, @i{Amd} must be told the type of filesystem to be
188147501Spendryused.  Each filesystem type typically requires additional information
188247501Spendrysuch as the fileserver name for NFS.
188347501Spendry
188447501SpendryFrom the point of view of @i{Amd}, a @dfn{filesystem} is anything that
188547501Spendrycan resolve an incoming name lookup.  An important feature is support
188647501Spendryfor multiple filesystem types.  Some of these filesystems are
188747501Spendryimplemented in the local kernel and some on remote fileservers, whilst
188847501Spendrythe others are implemented internally by @i{Amd}.@refill
188947501Spendry
189047501SpendryThe two common filesystem types are UFS and NFS.  Four other user
189147501Spendryaccessible filesystems (@samp{link}, @samp{program}, @samp{auto} and
189247501Spendry@samp{direct}) are also implemented internally by @i{Amd} and these are
189347501Spendrydescribed below.  There are two additional filesystem types internal to
189447501Spendry@i{Amd} which are not directly accessible to the user (@samp{inherit}
189547501Spendryand @samp{error}).  Their use is described since they may still have an
189647501Spendryeffect visible to the user.@refill
189747501Spendry
189847501Spendry@menu
189947501Spendry* Network Filesystem::		A single NFS filesystem.
190047501Spendry* Network Host Filesystem::	NFS mount a host's entire export tree.
190147501Spendry* Network Filesystem Group::	An atomic group of NFS filesystems.
190247501Spendry* Unix Filesystem::		Native disk filesystem.
190347501Spendry* Program Filesystem::		Generic Program mounts.
190447501Spendry* Symbolic Link Filesystem::	Local link referencing existing filesystem.
190547501Spendry* Automount Filesystem::
190647501Spendry* Direct Automount Filesystem::
190747501Spendry* Union Filesystem::
190847501Spendry* Error Filesystem::
190947501Spendry* Top-level Filesystem::
191047501Spendry* Root Filesystem::
191147501Spendry* Inheritance Filesystem::
191247501Spendry@end menu
191347501Spendry
191447501Spendry@node     Network Filesystem, Network Host Filesystem, Filesystem Types, Filesystem Types
191547501Spendry@comment  node-name,  next,  previous,  up
191647501Spendry@section Network Filesystem (@samp{type:=nfs})
191747501Spendry@cindex NFS
191847501Spendry@cindex Mounting an NFS filesystem
191947501Spendry@cindex How to mount and NFS filesystem
192047501Spendry@cindex nfs, filesystem type
192147501Spendry@cindex Filesystem type; nfs
192247501Spendry
192347501SpendryThe @dfn{nfs} filesystem type provides access to Sun's NFS.
192447501Spendry
192547501Spendry@noindent
192647501SpendryThe following options must be specified:
192747501Spendry
192847501Spendry@table @code
192947501Spendry@cindex rhost, mount option
193047501Spendry@cindex Mount option; rhost
193147501Spendry@item rhost
193247501Spendrythe remote fileserver.  This must be an entry in the hosts database.  IP
193347501Spendryaddresses are not accepted.  The default value is taken
193447501Spendryfrom the local host name (@code{$@{host@}}) if no other value is
193547501Spendryspecified.
193647501Spendry
193747501Spendry@cindex rfs, mount option
193847501Spendry@cindex Mount option; rfs
193947501Spendry@item rfs
194047501Spendrythe remote filesystem.
194147501SpendryIf no value is specified for this option, an internal default of
194247501Spendry@code{$@{path@}} is used.
194347501Spendry@end table
194447501Spendry
194547501SpendryNFS mounts require a two stage process.  First, the @dfn{file handle} of
194647501Spendrythe remote file system must be obtained from the server.  Then a mount
194747501Spendrysystem call must be done on the local system.  @i{Amd} keeps a cache
194847501Spendryof file handles for remote file systems.  The cache entries have a
194947501Spendrylifetime of a few minutes.
195047501Spendry
195147501SpendryIf a required file handle is not in the cache, @i{Amd} sends a request
195247501Spendryto the remote server to obtain it.  @i{Amd} @dfn{does not} wait for
195347501Spendrya response; it notes that one of the locations needs retrying, but
195447501Spendrycontinues with any remaining locations.  When the file handle becomes
195547501Spendryavailable, and assuming none of the other locations was successfully
195647501Spendrymounted, @i{Amd} will retry the mount.  This mechanism allows several
195747501SpendryNFS filesystems to be mounted in parallel.
195847501Spendry@c @footnote{The mechanism
195947501Spendry@c is general, however NFS is the only filesystem
196047501Spendry@c for which the required hooks have been written.}
196147501SpendryThe first one which responds with a valid file handle will be used.
196247501Spendry
196347501Spendry@noindent
196447501SpendryAn NFS entry might be:
196547501Spendry
196647501Spendry@example
196747501Spendryjsp  host!=charm;type:=nfs;rhost:=charm;rfs:=/home/charm;sublink:=jsp
196847501Spendry@end example
196947501Spendry
197047501SpendryThe mount system call and any unmount attempts are always done
197147501Spendryin a new task to avoid the possibilty of blocking @i{Amd}.
197247501Spendry
197347501Spendry@node     Network Host Filesystem, Network Filesystem Group, Network Filesystem, Filesystem Types
197447501Spendry@comment  node-name,  next,  previous,  up
197547501Spendry@section Network Host Filesystem (@samp{type:=host})
197647501Spendry@cindex Network host filesystem
197747501Spendry@cindex Mounting entire export trees
197847501Spendry@cindex How to mount all NFS exported filesystems
197947501Spendry@cindex host, filesystem type
198047501Spendry@cindex Filesystem type; host
198147501Spendry
198247501Spendry@c NOTE: the current implementation of the @dfn{host} filesystem type
198347501Spendry@c sometimes fails to maintain a consistent view of the remote mount tree.
198447501Spendry@c This happens when the mount times out and only some of the remote mounts
198547501Spendry@c are successfully unmounted.  To prevent this from occuring, use the
198647501Spendry@c @samp{nounmount} mount option.
198747501Spendry
198847501SpendryThe @dfn{host} filesystem allows access to the entire export tree of an
198947501SpendryNFS server.  The implementation is layered above the @samp{nfs}
199047501Spendryimplementation so keep-alives work in the same way.  The only option
199147501Spendrywhich needs to specified is @samp{rhost} which is the name of the
199247501Spendryfileserver to mount.
199347501Spendry
199447501SpendryThe @samp{host} filesystem type works by querying the mount daemon on
199547501Spendrythe given fileserver to obtain its export list.  @i{Amd} then obtains
199647501Spendryfilehandles for each of the exported filesystems.  Any errors at this
199747501Spendrystage cause that particular filesystem to be ignored.  Finally each
199847501Spendryfilesystem is mounted.  Again, errors are logged but ignored.  One
199947501Spendrycommon reason for mounts to fail is that the mount point does not exist.
200047501SpendryAlthough @i{Amd} attempts to automatically create the mount point, it
200147501Spendrymay be on a remote filesystem to which @i{Amd} does not have write
200247501Spendrypermission.
200347501Spendry
200447501SpendryWhen an attempt to unmount a @samp{host} filesystem mount fails, @i{Amd}
200547501Spendryremounts any filesystems which had succesfully been unmounted.  To do
200647501Spendrythis @i{Amd} queries the mount daemon again and obtains a fresh copy of
200747501Spendrythe export list.  @i{Amd} then tries to mount any exported filesystems
200847501Spendrywhich are not currently mounted.
200947501Spendry
201047501SpendrySun's automounter provides a special @samp{-hosts} map.  To achieve the
201147501Spendrysame effect with @i{Amd} requires two steps.  First a mount map must
201247501Spendrybe created as follows:
201347501Spendry
201447501Spendry@example
201547501Spendry/defaults  type:=host;fs:=$@{autodir@}/$@{rhost@}/root;rhost:=$@{key@}
201647501Spendry*          opts:=rw,nosuid,grpid
201747501Spendry@end example
201847501Spendry
201947501Spendry@noindent
202047501Spendryand then start @i{Amd} with the following command
202147501Spendry
202247501Spendry@example
202347501Spendryamd /n net.map
202447501Spendry@end example
202547501Spendry
202647501Spendry@noindent
202747501Spendrywhere @samp{net.map} is the name of map described above.  Note that the
202847501Spendryvalue of @code{$@{fs@}} is overridden in the map.  This is done to avoid
202947501Spendrya clash between the mount tree and any other filesystem already mounted
203047501Spendryfrom the same fileserver.
203147501Spendry
203247501SpendryIf different mount options are needed for different hosts then
203347501Spendryadditional entries can be added to the map, for example
203447501Spendry
203547501Spendry@example
203647501Spendryhost2       opts:=ro,nosuid,soft
203747501Spendry@end example
203847501Spendry
203947501Spendry@noindent
204047501Spendrywould soft mount @samp{host2} read-only.
204147501Spendry
204247501Spendry@node     Network Filesystem Group, Unix Filesystem, Network Host Filesystem, Filesystem Types
204347501Spendry@comment  node-name,  next,  previous,  up
204447501Spendry@section Network Filesystem Group (@samp{type:=nfsx})
204547501Spendry@cindex Network filesystem group
204647501Spendry@cindex Atomic NFS mounts
204747501Spendry@cindex Mounting an atomic group of NFS filesystems
204847501Spendry@cindex How to mount an atomic group of NFS filesystems
204947501Spendry@cindex nfsx, filesystem type
205047501Spendry@cindex Filesystem type; nfsx
205147501Spendry
205247501SpendryThe @dfn{nfsx} filesystem allows a group of filesystems to be mounted
205347501Spendryfrom a single NFS server.  The implementation is layered above the
205447501Spendry@samp{nfs} implementation so keep-alives work in the same way.
205547501Spendry
205647501SpendryThe options are the same as for the @samp{nfs} filesystem with one
205747501Spendrydifference.
205847501Spendry
205947501Spendry@noindent
206047501SpendryThe following options must be specified:
206147501Spendry
206247501Spendry@table @code
206347501Spendry@item rhost
206447501Spendrythe remote fileserver.  This must be an entry in the hosts database.  IP
206547501Spendryaddresses are not accepted.  The default value is taken from the local
206647501Spendryhost name (@code{$@{host@}}) if no other value is specified.
206747501Spendry
206847501Spendry@item rfs
206947501Spendryas a list of filesystems to mount.  The list is in the form of a comma
207047501Spendryseparated strings.
207147501Spendry@end table
207247501Spendry
207347501Spendry@noindent
207447501SpendryFor example:
207547501Spendry
207647501Spendry@example
207749684Spendrypub      type:=nfsx;rhost:=gould;\
207852454Spendry		rfs:=/public,/,graphics,usenet;fs:=$@{autodir@}/$@{rhost@}/root
207947501Spendry@end example
208047501Spendry
208147501SpendryThe first string defines the root of the tree, and is applied as a
208247501Spendryprefix to the remaining members of the list which define the individual
208347501Spendryfilesystems.  The first string is @emph{not} used as a filesystem name.
208447501SpendryA parallel operation is used to determine the local mount points to
208547501Spendryensure a consistent layout of a tree of mounts.
208647501Spendry
208747501SpendryHere, the @emph{three} filesystems, @samp{/public},
208847501Spendry@samp{/public/graphics} and @samp{/public/usenet}, would be mounted.@refill
208947501Spendry
209049684SpendryA local mount point, @code{$@{fs@}}, @emph{must} be specified.  The
209149684Spendrydefault local mount point will not work correctly in the general case.
209249684SpendryA suggestion is to use @samp{fs:=$@{autodir@}/$@{rhost@}/root}.@refill
209349684Spendry
209447501Spendry@node     Unix Filesystem, Program Filesystem, Network Filesystem Group, Filesystem Types
209547501Spendry@comment  node-name,  next,  previous,  up
209647501Spendry@section Unix Filesystem (@samp{type:=ufs})
209747501Spendry@cindex Unix filesystem
209847501Spendry@cindex UFS
209947501Spendry@cindex Mounting a UFS filesystem
210047501Spendry@cindex Mounting a local disk
210147501Spendry@cindex How to mount a UFS filesystems
210247501Spendry@cindex How to mount a local disk
210347501Spendry@cindex Disk filesystems
210447501Spendry@cindex ufs, filesystem type
210547501Spendry@cindex Filesystem type; ufs
210647501Spendry
210747501SpendryThe @dfn{ufs} filesystem type provides access to the system's
210847501Spendrystandard disk filesystem---usually a derivative of the Berkeley Fast Filesystem.
210947501Spendry
211047501Spendry@noindent
211147501SpendryThe following option must be specified:
211247501Spendry
211347501Spendry@table @code
211447501Spendry@cindex dev, mount option
211547501Spendry@cindex Mount option; dev
211647501Spendry@item dev
211747501Spendrythe block special device to be mounted.
211847501Spendry@end table
211947501Spendry
212047501SpendryA UFS entry might be:
212147501Spendry
212247501Spendry@example
212347501Spendryjsp   host==charm;type:=ufs;dev:=/dev/xd0g;sublink:=jsp
212447501Spendry@end example
212547501Spendry
212647501Spendry@node     Program Filesystem, Symbolic Link Filesystem, Unix Filesystem, Filesystem Types
212747501Spendry@comment  node-name,  next,  previous,  up
212847501Spendry@section Program Filesystem (@samp{type:=program})
212947501Spendry@cindex Program filesystem
213047501Spendry@cindex Mount a filesystem under program control
213147501Spendry@cindex program, filesystem type
213247501Spendry@cindex Filesystem type; program
213347501Spendry
213447501SpendryThe @dfn{program} filesystem type allows a program to be run whenever a
213547501Spendrymount or unmount is required.  This allows easy addition of support for
213647501Spendryother filesystem types, such as MIT's Remote Virtual Disk (RVD)
213747501Spendrywhich has a programmatic interface via the commands
213847501Spendry@samp{rvdmount} and @samp{rvdunmount}.
213947501Spendry
214047501Spendry@noindent
214147501SpendryThe following options must be specified:
214247501Spendry
214347501Spendry@table @code
214447501Spendry@cindex mount, mount option
214547501Spendry@cindex Mount option; mount
214647501Spendry@item mount
214747501Spendrythe program which will perform the mount.
214847501Spendry
214947501Spendry@cindex unmount, mount option
215047501Spendry@cindex Mount option; unmount
215147501Spendry@item unmount
215247501Spendrythe program which will perform the unmount.
215347501Spendry@end table
215447501Spendry
215547501SpendryThe exit code from these two programs is interpreted as a Unix error
215647501Spendrycode.  As usual, exit code zero indicates success.  To execute the
215747501Spendryprogram @i{Amd} splits the string on whitespace to create an array of
215847501Spendrysubstrings.  Single quotes @samp{'} can be used to quote whitespace
215947501Spendryif that is required in an argument.  There is no way to escape or change
216047501Spendrythe quote character.
216147501Spendry
216247501SpendryTo run the program @samp{rvdmount} with a host name and filesystem as
216347501Spendryarguments would be specified by @samp{mount:="/etc/rvdmount rvdmount
216447501Spendryfserver $@{path@}"}.
216547501Spendry
216647501SpendryThe first element in the array is taken as the pathname of the program
216747501Spendryto execute.  The other members of the array form the argument vector to
216847501Spendrybe passed to the program, @dfn{including argument zero}.  This means
216947501Spendrythat the split string must have at least two elements.  The program is
217047501Spendrydirectly executed by @i{Amd}, not via a shell.  This means that scripts
217147501Spendrymust begin with a @code{#!} interpreter specification.
217247501Spendry
217347501SpendryIf a filesystem type is to be heavily used, it may be worthwhile adding
217447501Spendrya new filesystem type into @i{Amd}, but for most uses the program
217547501Spendryfilesystem should suffice.
217647501Spendry
217747501SpendryWhen the program is run, standard input and standard error are inherited
217847501Spendryfrom the current values used by @i{Amd}.  Standard output is a
217947501Spendryduplicate of standard error.  The value specified with the ``-l''
218047501Spendrycommand line option has no effect on standard error.
218147501Spendry
218252454Spendry@node     Symbolic Link Filesystem, Symbolic Link Filesystem II, Program Filesystem, Filesystem Types
218347501Spendry@comment  node-name,  next,  previous,  up
218447501Spendry@section Symbolic Link Filesystem (@samp{type:=link})
218547501Spendry@cindex Symbolic link filesystem
218647501Spendry@cindex Referencing part of the local name space
218747501Spendry@cindex Mounting part of the local name space
218847501Spendry@cindex How to reference part of the local name space
218947501Spendry@cindex link, filesystem type
219047501Spendry@cindex symlink, link filesystem type
219147501Spendry@cindex Filesystem type; link
219247501Spendry
219347501SpendryEach filesystem type creates a symbolic link to point from the volume
219447501Spendryname to the physical mount point.  The @samp{link} filesystem does the
219547501Spendrysame without any other side effects.  This allows any part of the
219647501Spendrymachines name space to be accessed via @i{Amd}.
219747501Spendry
219847501SpendryOne common use for the symlink filesystem is @file{/homes} which can be
219947501Spendrymade to contain an entry for each user which points to their
220047501Spendry(auto-mounted) home directory.  Although this may seem rather expensive,
220147501Spendryit provides a great deal of administrative flexibility.
220247501Spendry
220347501Spendry@noindent
220447501SpendryThe following option must be defined:
220547501Spendry
220647501Spendry@table @code
220747501Spendry@item fs
220847501SpendryThe value of @var{fs} option specifies the destination of the link, as
220947501Spendrymodified by the @var{sublink} option.  If @var{sublink} is non-null, it
221047501Spendryis appended to @code{$@{fs@}}@code{/} and the resulting string is used
221147501Spendryas the target.
221247501Spendry@end table
221347501Spendry
221447501SpendryThe @samp{link} filesystem can be though of as identical to the
221547501Spendry@samp{ufs} filesystem but without actually mounting anything.
221647501Spendry
221747501SpendryAn example entry might be:
221847501Spendry
221947501Spendry@example
222047501Spendryjsp   host==charm;type:=link;fs:=/home/charm;sublink:=jsp
222147501Spendry@end example
222247501Spendrywhich would return a symbolic link pointing to @file{/home/charm/jsp}.
222347501Spendry
222452454Spendry@node     Symbolic Link Filesystem II, Automount Filesystem, Program Filesystem, Filesystem Types
222547501Spendry@comment  node-name,  next,  previous,  up
222652454Spendry@section Symbolic Link Filesystem II (@samp{type:=link})
222752454Spendry@cindex Symbolic link filesystem II
222852454Spendry@cindex Referencing an existing part of the local name space
222952454Spendry@cindex Mounting an existing part of the local name space
223052454Spendry@cindex How to reference an existing part of the local name space
223152454Spendry@cindex linkx, filesystem type
223252454Spendry@cindex symlink, linkx filesystem type
223352454Spendry@cindex Filesystem type; linkx
223452454Spendry
223552454SpendryThe @samp{linkx} filesystem type is identical to @samp{link} with the
223652454Spendryexception that the target of the link must exist.  Existence is checked
223752454Spendrywith the @samp{lstat} system call.
223852454Spendry
223952454SpendryThe @samp{linkx} filesystem type is particularly useful for wildcard map
224052454Spendryentries.  In this case, a list of possible targets can be give and
224152454Spendry@i{Amd} will choose the first one which exists on the local machine.
224252454Spendry
224352454Spendry@node     Automount Filesystem, Direct Automount Filesystem, Symbolic Link Filesystem II, Filesystem Types
224452454Spendry@comment  node-name,  next,  previous,  up
224547501Spendry@section Automount Filesystem (@samp{type:=auto})
224647501Spendry@cindex Automount filesystem
224747501Spendry@cindex Map cache types
224847501Spendry@cindex Setting map cache parameters
224947501Spendry@cindex How to set map cache parameters
225047501Spendry@cindex How to start an indirect automount point
225147501Spendry@cindex auto, filesystem type
225247501Spendry@cindex Filesystem type; auto
225347501Spendry@cindex SIGHUP signal
225447501Spendry@cindex Map cache synchronising
225547501Spendry@cindex Synchronising the map cache
225647501Spendry@cindex Map cache options
225747501Spendry@cindex Regular expressions in maps
225847501Spendry
225947501SpendryThe @dfn{auto} filesystem type creates a new automount point below an
226047501Spendryexisting automount point.  Top-level automount points appear as system
226147501Spendrymount points.  An automount mount point can also appear as a
226247501Spendrysub-directory of an existing automount point.  This allows some
226347501Spendryadditional structure to be added, for example to mimic the mount tree of
226447501Spendryanother machine.
226547501Spendry
226647501SpendryThe following options may be specified:
226747501Spendry
226847501Spendry@table @code
226947501Spendry@cindex cache, mount option
227047501Spendry@cindex Mount option; cache
227147501Spendry@item cache
227247501Spendryspecifies whether the data in this mount-map should be
227347501Spendrycached.  The default value is @samp{none}, in which case
227447501Spendryno caching is done in order to conserve memory.
227547501SpendryHowever, better performance and reliability can be obtained by caching
227647501Spendrysome or all of a mount-map.
227747501Spendry
227847501SpendryIf the cache option specifies @samp{all},
227947501Spendrythe entire map is enumerated when the mount point is created.
228047501Spendry
228147501SpendryIf the cache option specifies @samp{inc}, caching is done incrementally
228247501Spendryas and when data is required.
228347501SpendrySome map types do not support cache mode @samp{all}, in which case @samp{inc}
228447501Spendryis used whenever @samp{all} is requested.
228547501Spendry
228647501SpendryCaching can be entirely disabled by using cache mode @samp{none}.
228747501Spendry
228847501SpendryIf the cache option specifies @samp{regexp} then the entire map will be
228947501Spendryenumerated and each key will be treated as an egrep-style regular
229047501Spendryexpression.  The order in which a cached map is searched does not
229147501Spendrycorrespond to the ordering in the source map so the regular expressions
229247501Spendryshould be mutually exclusive to avoid confusion.
229347501Spendry
229447501SpendryEach mount map type has a default cache type, usually @samp{inc}, which
229547501Spendrycan be selected by specifying @samp{mapdefault}.
229647501Spendry
229747501SpendryThe cache mode for a mount map can only be selected on the command line.
229847501SpendryStarting @i{Amd} with the command:
229947501Spendry
230047501Spendry@example
230147501Spendryamd /homes hesiod.homes -cache:=inc
230247501Spendry@end example
230347501Spendry
230447501Spendrywill cause @samp{/homes} to be automounted using the @dfn{Hesiod} name
230547501Spendryserver with local incremental caching of all succesfully resolved names.
230647501Spendry
230747501SpendryAll cached data is forgotten whenever @i{Amd} receives a @samp{SIGHUP}
230847501Spendrysignal and, if cache @samp{all} mode was selected, the cache will be
230947501Spendryreloaded.  This can be used to inform @i{Amd} that a map has been
231047501Spendryupdated.  In addition, whenever a cache lookup fails and @i{Amd} needs
231147501Spendryto examine a map, the map's modify time is examined.  If the cache is
231247501Spendryout of date with respect to the map then it is flushed as if a
231347501Spendry@samp{SIGHUP} had been received.
231447501Spendry
231547501SpendryAn additional option (@samp{sync}) may be specified to force @i{Amd} to
231647501Spendrycheck the map's modify time whenever a cached entry is being used.  For
231747501Spendryexample, an incremental, synchronised cache would be created by the
231847501Spendryfollowing command:
231947501Spendry
232047501Spendry@example
232147501Spendryamd /homes hesiod.homes -cache:=inc,sync
232247501Spendry@end example
232347501Spendry
232447501Spendry@item fs
232547501Spendryspecifies the name of the mount map to use for the new mount point.
232647501Spendry
232747501SpendryArguably this should have been specified with the @code{$@{rfs@}} option but
232847501Spendrywe are now stuck with it due to historical accident.
232947501Spendry
233047501Spendry@c %If the string @samp{.} is used then the same map is used;
233147501Spendry@c %in addition the lookup prefix is set to the name of the mount point followed
233247501Spendry@c %by a slash @samp{/}.
233352454Spendry@c %This is the same as specifying @samp{fs:=\$@{map@};pref:=\$@{key@}/}.
233447501Spendry@c
233547501Spendry
233647501Spendry@item pref
233747501Spendryalters the name that is looked up in the mount map.  If
233847501Spendry@code{$@{pref@}}, the @dfn{prefix}, is non-null then it is prepended to
233947501Spendrythe name requested by the kernel @dfn{before} the map is searched.
234047501Spendry@end table
234147501Spendry
234247501SpendryThe server @samp{dylan.doc.ic.ac.uk} has two user disks:
234347501Spendry@samp{/dev/dsk/2s0} and @samp{/dev/dsk/5s0}.  These are accessed as
234447501Spendry@samp{/home/dylan/dk2} and @samp{/home/dylan/dk5} respectively.  Since
234547501Spendry@samp{/home} is already an automount point, this naming is achieved with
234647501Spendrythe following map entries:@refill
234747501Spendry
234847501Spendry@example
234947501Spendrydylan        type:=auto;fs:=$@{map@};pref:=$@{key@}/
235047501Spendrydylan/dk2    type:=ufs;dev:=/dev/dsk/2s0
235147501Spendrydylan/dk5    type:=ufs;dev:=/dev/dsk/5s0
235247501Spendry@end example
235347501Spendry
235447501Spendry@node     Direct Automount Filesystem, Union Filesystem, Automount Filesystem, Filesystem Types
235547501Spendry@comment  node-name,  next,  previous,  up
235647501Spendry@section Direct Automount Filesystem (@samp{type:=direct})
235747501Spendry@cindex Direct automount filesystem
235847501Spendry@cindex How to start a direct automount point
235947501Spendry@cindex direct, filesystem type
236047501Spendry@cindex Filesystem type; direct
236147501Spendry
236247501SpendryThe @dfn{direct} filesystem is almost identical to the automount
236347501Spendryfilesystem.  Instead of appearing to be a directory of mount points, it
236447501Spendryappears as a symbolic link to a mounted filesystem.  The mount is done
236547501Spendryat the time the link is accessed.  @xref{Automount Filesystem} for a
236647501Spendrylist of required options.
236747501Spendry
236847501SpendryDirect automount points are created by specifying the @samp{direct}
236947501Spendryfilesystem type on the command line:
237047501Spendry
237147501Spendry@example
237247501Spendryamd ... /usr/man auto.direct -type:=direct
237347501Spendry@end example
237447501Spendry
237547501Spendrywhere @samp{auto.direct} would contain an entry such as:
237647501Spendry
237747501Spendry@example
237847501Spendryusr/man    -type:=nfs;rfs:=/usr/man \
237947501Spendry           rhost:=man-server1  rhost:=man-server2
238047501Spendry@end example
238147501Spendry
238247501SpendryIn this example, @samp{man-server1} and @samp{man-server2} are file
238347501Spendryservers which export copies of the manual pages.  Note that the key
238447501Spendrywhich is looked up is the name of the automount point without the
238547501Spendryleading @samp{/}.
238647501Spendry
238747501Spendry@node     Union Filesystem, Error Filesystem, Direct Automount Filesystem, Filesystem Types
238847501Spendry@comment  node-name,  next,  previous,  up
238947501Spendry@section Union Filesystem (@samp{type:=union})
239047501Spendry@cindex Union filesystem
239147501Spendry@cindex union, filesystem type
239247501Spendry@cindex Filesystem type; union
239347501Spendry
239447501SpendryThe @dfn{union} filesystem type allows the contents of several
239547501Spendrydirectories to be merged and made visible in a single directory.  This
239647501Spendrycan be used to overcome one of the major limitations of the Unix mount
239747501Spendrymechanism which only allows complete directories to be mounted.
239847501Spendry
239947501SpendryFor example, supposing @file{/tmp} and @file{/var/tmp} were to be merged
240047501Spendryinto a new directory called @file{/mtmp}, with files in @file{/var/tmp}
240147501Spendrytaking precedence.  The following command could be used to achieve this
240247501Spendryeffect:
240347501Spendry
240447501Spendry@example
240547501Spendryamd ... /mtmp union:/tmp:/var/tmp -type:=union
240647501Spendry@end example
240747501Spendry
240847501SpendryCurrently, the unioned directories must @emph{not} be automounted.  That
240947501Spendrywould cause a deadlock.  This seriously limits the current usefulness of
241047501Spendrythis filesystem type and the problem will be addressed in a future
241147501Spendryrelease of @i{Amd}.
241247501Spendry
241347501SpendryFiles created in the union directory are actually created in the last
241447501Spendrynamed directory.  This is done by creating a wildcard entry which points
241547501Spendryto the correct directory.  The wildcard entry is visible if the union
241647501Spendrydirectory is listed, so allowing you to see which directory has
241747501Spendrypriority.
241847501Spendry
241947501SpendryThe files visible in the union directory are computed at the time
242047501Spendry@i{Amd} is started, and are not kept uptodate with respect to the
242147501Spendryunderlying directories.  Similarly, if a link is removed, for example
242247501Spendrywith the @samp{rm} command, it will be lost forever.
242347501Spendry
242452454Spendry@node     Error Filesystem, Top-level Filesystem, Union Filesystem, Filesystem Types
242547501Spendry@comment  node-name,  next,  previous,  up
242647501Spendry@section Error Filesystem (@samp{type:=error})
242747501Spendry@cindex Error filesystem
242847501Spendry@cindex error, filesystem type
242947501Spendry@cindex Filesystem type; error
243047501Spendry
243147501SpendryThe @dfn{error} filesystem type is used internally as a catch-all in
243247501Spendrythe case where none of the other filesystems was selected, or some other
243347501Spendryerror occurred.
243447501SpendryLookups and mounts always fail with ``No such file or directory''.
243547501SpendryAll other operations trivially succeed.
243647501Spendry
243747501SpendryThe error filesystem is not directly accessible.
243847501Spendry
243947501Spendry@node     Top-level Filesystem, Root Filesystem, Error Filesystem, Filesystem Types
244047501Spendry@comment  node-name,  next,  previous,  up
244147501Spendry@section Top-level Filesystem (@samp{type:=toplvl})
244247501Spendry@cindex Top level filesystem
244347501Spendry@cindex toplvl, filesystem type
244447501Spendry@cindex Filesystem type; toplvl
244547501Spendry
244647501SpendryThe @dfn{toplvl} filesystems is derived from the @samp{auto} filesystem
244747501Spendryand is used to mount the top-level automount nodes.  Requests of this
244847501Spendrytype are automatically generated from the command line arguments and
244947501Spendrycan also be passed in by using the ``-M'' option of the @dfn{Amq} command.
245047501Spendry
245147501Spendry@node     Root Filesystem, Inheritance Filesystem, Top-level Filesystem, Filesystem Types
245247501Spendry@comment  node-name,  next,  previous,  up
245347501Spendry@section Root Filesystem
245447501Spendry@cindex Root filesystem
245547501Spendry@cindex root, filesystem type
245647501Spendry@cindex Filesystem type; root
245747501Spendry
245847501SpendryThe @dfn{root} (@samp{type:=root}) filesystem type acts as an internal
245947501Spendryplaceholder onto which @i{Amd} can pin @samp{toplvl} mounts.  Only one
246047501Spendrynode of this type need ever exist and one is created automatically
246147501Spendryduring startup.  The effect of creating a second root node is undefined.
246247501Spendry
246347501Spendry@node     Inheritance Filesystem, , Root Filesystem, Filesystem Types
246447501Spendry@comment  node-name,  next,  previous,  up
246547501Spendry@section Inheritance Filesystem
246647501Spendry@cindex Inheritance filesystem
246747501Spendry@cindex Nodes generated on a restart
246847501Spendry@cindex inherit, filesystem type
246947501Spendry@cindex Filesystem type; inherit
247047501Spendry
247147501SpendryThe @dfn{inheritance} (@samp{type:=inherit}) filesystem is not directly
247247501Spendryaccessible.  Instead, internal mount nodes of this type are
247347501Spendryautomatically generated when @i{Amd} is started with the ``-r'' option.
247447501SpendryAt this time the system mount table is scanned to locate any filesystems
247547501Spendrywhich are already mounted.  If any reference to these filesystems is
247647501Spendrymade through @i{Amd} then instead of attempting to mount it, @i{Amd}
247747501Spendrysimulates the mount and @dfn{inherits} the filesystem.  This allows a
247847501Spendrynew version of @i{Amd} to be installed on a live system simply by
247947501Spendrykilling the old daemon with @code{SIGTERM} and starting the new one.@refill
248047501Spendry
248147501SpendryThis filesystem type is not generally visible externally, but it is
248247501Spendrypossible that the output from @samp{amq -m} may list @samp{inherit} as
248347501Spendrythe filesystem type.  This happens when an inherit operation cannot
248447501Spendrybe completed for some reason, usually because a fileserver is down.
248547501Spendry
248652454Spendry@node     Run-time Administration, FSinfo, Filesystem Types, Top
248747501Spendry@comment  node-name,  next,  previous,  up
248847501Spendry@chapter Run-time Administration
248947501Spendry@cindex Run-time administration
249047501Spendry@cindex Amq command
249147501Spendry
249247501Spendry@menu
249347501Spendry* Starting Amd::
249447501Spendry* Stopping Amd::
249547501Spendry* Controlling Amd::
249647501Spendry@end menu
249747501Spendry
249847501Spendry@node     Starting Amd, Stopping Amd, Run-time Administration, Run-time Administration
249947501Spendry@comment  node-name,  next,  previous,  up
250047501Spendry@section Starting @i{Amd}
250147501Spendry@cindex Starting Amd
250247501Spendry@cindex Additions to /etc/rc.local
250347501Spendry@cindex /etc/rc.local additions
250447501Spendry@cindex /etc/amd.start
250547501Spendry
250647501Spendry@i{Amd} is best started from @samp{/etc/rc.local}:
250747501Spendry
250847501Spendry@example
250947501Spendryif [ -f /etc/amd.start ]; then
251047501Spendry        sh /etc/amd.start; (echo -n ' amd')      >/dev/console
251147501Spendryfi
251247501Spendry@end example
251347501Spendry
251447501Spendry@noindent
251547501SpendryThe shell script, @samp{amd.start}, contains:
251647501Spendry
251747501Spendry@example
251847501Spendry#!/bin/sh -
251947501SpendryPATH=/etc:/bin:/usr/bin:/usr/ucb:$PATH export PATH
252047501Spendry
252147501Spendry#
252247501Spendry# Either name of logfile or "syslog"
252347501Spendry#
252447501SpendryLOGFILE=syslog
252547501Spendry#LOGFILE=/var/log/amd
252647501Spendry
252747501Spendry#
252847501Spendry# Figure out whether domain name is in host name
252947501Spendry# If the hostname is just the machine name then
253047501Spendry# pass in the name of the local domain so that the
253147501Spendry# hostnames in the map are domain stripped correctly.
253247501Spendry#
253347501Spendrycase `hostname` in
253447501Spendry*.*) dmn= ;;
253547501Spendry*) dmn='-d doc.ic.ac.uk'
253647501Spendryesac
253747501Spendry
253847501Spendry#
253947501Spendry# Zap earlier log file
254047501Spendry#
254147501Spendrycase "$LOGFILE" in
254247501Spendry*/*)
254347501Spendry        mv "$LOGFILE" "$LOGFILE"-
254447501Spendry        > "$LOGFILE"
254547501Spendry        ;;
254647501Spendrysyslog)
254747501Spendry        : nothing
254847501Spendry        ;;
254947501Spendryesac
255047501Spendry
255147501Spendrycd /usr/sbin
255247501Spendry#
255347501Spendry# -r            restart
255447501Spendry# -d dmn        local domain
255547501Spendry# -w wait       wait between unmount attempts
255647501Spendry# -l log        logfile or "syslog"
255747501Spendry#
255847501Spendryeval ./amd -r $dmn -w 240 -l "$LOGFILE" \
255947501Spendry        /homes amd.homes -cache:=inc \
256047501Spendry        /home amd.home -cache:=inc \
256147501Spendry        /vol amd.vol -cache:=inc \
256247501Spendry        /n amd.net -cache:=inc
256347501Spendry@end example
256447501Spendry
256547501SpendryIf the list of automount points and maps is contained in a file or NIS map
256647501Spendryit is easily incorporated onto the command line:
256747501Spendry
256847501Spendry@example
256947501Spendry...
257047501Spendryeval ./amd -r $dmn -w 240 -l "$LOGFILE" `ypcat -k auto.master`
257147501Spendry@end example
257247501Spendry
257347501Spendry@node     Stopping Amd, Controlling Amd, Starting Amd, Run-time Administration
257447501Spendry@comment  node-name,  next,  previous,  up
257547501Spendry@section Stopping @i{Amd}
257647501Spendry@cindex Stopping Amd
257747501Spendry@cindex SIGTERM signal
257847501Spendry@cindex SIGINT signal
257947501Spendry
258047501Spendry@i{Amd} stops in response to two signals.
258147501Spendry
258247501Spendry@table @samp
258347501Spendry@item SIGTERM
258447501Spendrycauses the top-level automount points to be unmounted and then @i{Amd}
258547501Spendryto exit.  Any automounted filesystems are left mounted.  They can be
258647501Spendryrecovered by restarting @i{Amd} with the ``-r'' command line option.@refill
258747501Spendry
258847501Spendry@item SIGINT
258947501Spendrycauses @i{Amd} to attempt to unmount any filesystems which it has
259047501Spendryautomounted, in addition to the actions of @samp{SIGTERM}.  This signal
259147501Spendryis primarly used for debugging.@refill
259247501Spendry@end table
259347501Spendry
259447501SpendryActions taken for other signals are undefined.
259547501Spendry
259652454Spendry@node     Controlling Amd, , Stopping Amd, Run-time Administration
259747501Spendry@comment  node-name,  next,  previous,  up
259847501Spendry@section Controlling @i{Amd}
259947501Spendry@cindex Controlling Amd
260047501Spendry@cindex Discovering what is going on at run-time
260147501Spendry@cindex Listing currently mounted filesystems
260247501Spendry
260347501SpendryIt is sometimes desirable or necessary to exercise external control
260447501Spendryover some of @i{Amd}'s internal state.  To support this requirement,
260547501Spendry@i{Amd} implements an RPC interface which is used by the @dfn{Amq} program.
260647501SpendryA variety of information is available.
260747501Spendry
260847501Spendry@i{Amq} generally applies an operation, specified by a single letter option,
260947501Spendryto a list of mount points.  The default operation is to obtain statistics
261047501Spendryabout each mount point.  This is similar to the output shown above
261147501Spendrybut includes information about the number and type of accesses to each
261247501Spendrymount point.
261347501Spendry
261447501Spendry@menu
261552454Spendry* Amq default::      Default command behaviour.
261652454Spendry* Amq -f option::     Flushing the map cache.
261752454Spendry* Amq -h option::     Controlling a non-local host.
261852454Spendry* Amq -m option::     Obtaining mount statistics.
261952454Spendry* Amq -M-option::     Mounting a volume.
262052454Spendry* Amq -s option::     Obtaining global statistics.
262152454Spendry* Amq -u option::     Forcing volumes to time out.
262252454Spendry* Amq -v option::     Version information.
262352454Spendry* Other Amq options:: Three other special options.
262447501Spendry@end menu
262547501Spendry
262647501Spendry@node     Amq default, Amq -f option, Controlling Amd, Controlling Amd
262747501Spendry@comment  node-name,  next,  previous,  up
262847501Spendry@subsection @i{Amq} default information
262947501Spendry
263047501SpendryWith no arguments, @dfn{Amq} obtains a brief list of all existing
263147501Spendrymounts created by @i{Amd}.  This is different from the list displayed by
263247501Spendry@b{df}(1) since the latter only includes system mount points.
263347501Spendry
263447501Spendry@noindent
263547501SpendryThe output from this option includes the following information:
263647501Spendry
263747501Spendry@itemize @bullet
263847501Spendry@item
263947501Spendrythe automount point,
264047501Spendry@item
264147501Spendrythe filesystem type,
264247501Spendry@item
264347501Spendrythe mount map or mount information,
264447501Spendry@item
264547501Spendrythe internal, or system mount point.
264647501Spendry@end itemize
264747501Spendry
264847501Spendry@noindent
264947501SpendryFor example:
265047501Spendry
265147501Spendry@example
265247501Spendry/            root   "root"                    sky:(pid75)
265347501Spendry/homes       toplvl /usr/local/etc/amd.homes  /homes
265447501Spendry/home        toplvl /usr/local/etc/amd.home   /home
265547501Spendry/homes/jsp   nfs    charm:/home/charm         /a/charm/home/charm/jsp
265647501Spendry/homes/phjk  nfs    toytown:/home/toytown     /a/toytown/home/toytown/ai/phjk
265747501Spendry@end example
265847501Spendry
265947501Spendry@noindent
266047501SpendryIf an argument is given then statistics for that volume name will
266147501Spendrybe output.  For example:
266247501Spendry
266347501Spendry@example
266447501SpendryWhat            Uid   Getattr Lookup RdDir   RdLnk   Statfs Mounted@@
266547501Spendry/homes          0     1196    512    22      0       30     90/09/14 12:32:55
266647501Spendry/homes/jsp      0     0       0      0       1180    0      90/10/13 12:56:58
266747501Spendry@end example
266847501Spendry
266947501Spendry@table @code
267047501Spendry@item What
267147501Spendrythe volume name.
267247501Spendry
267347501Spendry@item Uid
267447501Spendryignored.
267547501Spendry
267647501Spendry@item Getattr
267747501Spendrythe count of NFS @dfn{getattr} requests on this node.  This should only be
267847501Spendrynon-zero for directory nodes.
267947501Spendry
268047501Spendry@item Lookup
268147501Spendrythe count of NFS @dfn{lookup} requests on this node.  This should only be
268247501Spendrynon-zero for directory nodes.
268347501Spendry
268447501Spendry@item RdDir
268547501Spendrythe count of NFS @dfn{readdir} requests on this node.  This should only
268647501Spendrybe non-zero for directory nodes.
268747501Spendry
268847501Spendry@item RdLnk
268947501Spendrythe count of NFS @dfn{readlink} requests on this node.  This should be
269047501Spendryzero for directory nodes.
269147501Spendry
269247501Spendry@item Statfs
269347501Spendrythe could of NFS @dfn{statfs} requests on this node.  This should only
269447501Spendrybe non-zero for top-level automount points.
269547501Spendry
269647501Spendry@item Mounted@@
269747501Spendrythe date and time the volume name was first referenced.
269847501Spendry@end table
269947501Spendry
270047501Spendry@node     Amq -f option, Amq -h option, Amq default, Controlling Amd
270147501Spendry@comment  node-name,  next,  previous,  up
270247501Spendry@subsection @i{Amq} -f option
270347501Spendry@cindex Flushing the map cache
270447501Spendry@cindex Map cache, flushing
270547501Spendry
270647501SpendryThe ``-f'' option causes @i{Amd} to flush the internal mount map cache.
270747501SpendryThis is useful for Hesiod maps since @i{Amd} will not automatically
270847501Spendrynotice when they have been updated.  The map cache can also be
270947501Spendrysynchronised with the map source by using the @samp{sync} option
271047501Spendry(@pxref{Automount Filesystem}).@refill
271147501Spendry
271247501Spendry@node     Amq -h option, Amq -m option, Amq -f option, Controlling Amd
271347501Spendry@comment  node-name,  next,  previous,  up
271447501Spendry@subsection @i{Amq} -h option
271547501Spendry@cindex Querying an alternate host
271647501Spendry
271747501SpendryBy default the local host is used.  In an HP-UX cluster the root server
271847501Spendryis used since that is the only place in the cluster where @i{Amd} will
271947501Spendrybe running.  To query @i{Amd} on another host the ``-h'' option should
272047501Spendrybe used.
272147501Spendry
272247501Spendry@node     Amq -m option, Amq -M-option, Amq -h option, Controlling Amd
272347501Spendry@comment  node-name,  next,  previous,  up
272447501Spendry@subsection @i{Amq} -m option
272547501Spendry
272647501SpendryThe ``-m'' option displays similar information about mounted
272747501Spendryfilesystems, rather than automount points.  The output includes the
272847501Spendryfollowing information:
272947501Spendry
273047501Spendry@itemize @bullet
273147501Spendry@item
273247501Spendrythe mount information,
273347501Spendry@item
273447501Spendrythe mount point,
273547501Spendry@item
273647501Spendrythe filesystem type,
273747501Spendry@item
273847501Spendrythe number of references to this filesystem,
273947501Spendry@item
274047501Spendrythe server hostname,
274147501Spendry@item
274247501Spendrythe state of the file server,
274347501Spendry@item
274447501Spendryany error which has occured.
274547501Spendry@end itemize
274647501Spendry
274747501SpendryFor example:
274847501Spendry
274947501Spendry@example
275047501Spendry"root"           truth:(pid602)     root   1 localhost is up
275147501Spendryhesiod.home      /home              toplvl 1 localhost is up
275247501Spendryhesiod.vol       /vol               toplvl 1 localhost is up
275347501Spendryhesiod.homes     /homes             toplvl 1 localhost is up
275447501Spendryamy:/home/amy    /a/amy/home/amy    nfs    5 amy is up
275547501Spendryswan:/home/swan  /a/swan/home/swan  nfs    0 swan is up (Permission denied)
275647501Spendryex:/home/ex      /a/ex/home/ex      nfs    0 ex is down
275747501Spendry@end example
275847501Spendry
275947501SpendryWhen the reference count is zero the filesystem is not mounted but
276047501Spendrythe mount point and server information is still being maintained
276147501Spendryby @i{Amd}.
276247501Spendry
276347501Spendry@node     Amq -M-option, Amq -s option, Amq -m option, Controlling Amd
276447501Spendry@comment  node-name,  next,  previous,  up
276547501Spendry@subsection @i{Amq} -M option
276647501Spendry
276747501SpendryThe ``-M'' option passes a new map entry to @i{Amd} and waits for it to
276847501Spendrybe evaluated, possibly causing a mount.  For example, the following
276947501Spendrycommand would cause @samp{/home/toytown} on host @samp{toytown} to be
277047501Spendrymounted locally on @samp{/mnt/toytown}.
277147501Spendry
277247501Spendry@example
277347501Spendryamq -M '/mnt/toytown type:=nfs;rfs:=/home/toytown;rhost:=toytown;fs:=$@{key@}'
277447501Spendry@end example
277547501Spendry
277647501Spendry@i{Amd} applies some simple security checks before allowing this
277747501Spendryoperation.  The check tests whether the incoming request is from a
277847501Spendryprivileged UDP port on the local machine.  ``Permission denied'' is
277947501Spendryreturned if the check fails.
278047501Spendry
278147501SpendryA future release of @i{Amd} will include code to allow the @b{mount}(8)
278247501Spendrycommand to mount automount points:
278347501Spendry
278447501Spendry@example
278547501Spendrymount -t amd /vol hesiod.vol
278647501Spendry@end example
278747501Spendry
278847501SpendryThis will then allow @i{Amd} to be controlled from the standard system
278947501Spendryfilesystem mount list.
279047501Spendry
279147501Spendry@node     Amq -s option, Amq -u option, Amq -M-option, Controlling Amd
279247501Spendry@comment  node-name,  next,  previous,  up
279347501Spendry@subsection @i{Amq} -s option
279447501Spendry@cindex Global statistics
279547501Spendry@cindex Statistics
279647501Spendry
279747501SpendryThe ``-s'' option displays global statistics.  If any other options are specified
279847501Spendryor any filesystems named then this option is ignored.  For example:
279947501Spendry
280047501Spendry@example
280147501Spendryrequests  stale     mount     mount     unmount
280247501Spendrydeferred  fhandles  ok        failed    failed
280347501Spendry1054      1         487       290       7017
280447501Spendry@end example
280547501Spendry
280647501Spendry@table @samp
280747501Spendry@item Deferred requests
280847501Spendryare those for which an immediate reply could not be constructed.  For
280947501Spendryexample, this would happen if a background mount was required.
281047501Spendry
281147501Spendry@item Stale filehandles
281247501Spendrycounts the number of times the kernel passes a stale filehandle to @i{Amd}.
281347501SpendryLarge numbers indicate problems.
281447501Spendry
281547501Spendry@item Mount ok
281647501Spendrycounts the number of automounts which were successful.
281747501Spendry
281847501Spendry@item Mount failed
281947501Spendrycounts the number of automounts which failed.
282047501Spendry
282147501Spendry@item Unmount failed
282247501Spendrycounts the number of times a filesystem could not be unmounted.  Very
282347501Spendrylarge numbers here indicate that the time between unmount attempts
282447501Spendryshould be increased.
282547501Spendry@end table
282647501Spendry
282747501Spendry@node     Amq -u option, Amq -v option, Amq -s option, Controlling Amd
282847501Spendry@comment  node-name,  next,  previous,  up
282947501Spendry@subsection @i{Amq} -u option
283047501Spendry@cindex Forcing filesystem to time out
283147501Spendry@cindex Unmounting a filesystem
283247501Spendry
283347501SpendryThe ``-u'' option causes the time-to-live interval of the named mount
283447501Spendrypoints to be expired, thus causing an unmount attempt.  This is the only
283547501Spendrysafe way to unmount an automounted filesystem.  It is not possible to
283647501Spendryunmount a filesystem which has been mounted with the @samp{nounmount}
283747501Spendryflag.
283847501Spendry
283947501Spendry@c The ``-H'' option informs @i{Amd} that the specified mount point has hung -
284047501Spendry@c as if its keepalive timer had expired.
284147501Spendry
284247501Spendry@node     Amq -v option, Other Amq options, Amq -u option, Controlling Amd
284347501Spendry@comment  node-name,  next,  previous,  up
284447501Spendry@subsection @i{Amq} -v option
284547501Spendry@cindex Version information at run-time
284647501Spendry
284747501SpendryThe ``-v'' option displays the version of @i{Amd} in a similar way to
284847501Spendry@i{Amd}'s ``-v'' option.
284947501Spendry
285052454Spendry@node     Other Amq options, , Amq -v option, Controlling Amd
285147501Spendry@comment  node-name,  next,  previous,  up
285247501Spendry@subsection Other @i{Amq} options
285347501Spendry
285447501SpendryThree other operations are implemented.  These modify the state of
285547501Spendry@i{Amd} as a whole, rather than any particular filesystem.  The ``-l'',
285647501Spendry``-x'' and ``-D'' options have exactly the same effect as @i{Amd}'s
285747501Spendrycorresponding command line options.  The ``-l'' option is rejected by
285847501Spendry@i{Amd} in the current version for obvious security reasons.  When
285947501Spendry@i{Amd} receives a ``-x''flag it limits the log options being modified
286047501Spendryto those which were not enabled at startup.  This prevents a user
286147501Spendryturning @emph{off} any logging option which was specified at startup,
286247501Spendrythough any which have been turned off since then can still be turned
286347501Spendryoff.  The ``-D'' option has a similar behaviour.
286447501Spendry
286547501Spendry@node     FSinfo, Examples, Run-time Administration, Top
286647501Spendry@comment  node-name,  next,  previous,  up
286747501Spendry@chapter FSinfo
286847501Spendry@cindex FSinfo
286947501Spendry@cindex Filesystem info package
287047501Spendry
287147501Spendry@menu
287247501Spendry* FSinfo Overview::                 Introduction to FSinfo.
287347501Spendry* Using FSinfo::                    Basic concepts.
287447501Spendry* FSinfo Grammar::                  Language syntax, semantics and examples.
287547501Spendry* FSinfo host definitions::         Defining a new host.
287647501Spendry* FSinfo host attributes::          Definable host attributes.
287747501Spendry* FSinfo filesystems::              Defining locally attached filesystems.
287847501Spendry* FSinfo static mounts::            Defining additional static mounts.
287947501Spendry* FSinfo automount definitions::
288047501Spendry* FSinfo command line options::
288147501Spendry* FSinfo errors::
288247501Spendry@end menu
288347501Spendry
288447501Spendry@node     FSinfo Overview, Using FSinfo, FSinfo, FSinfo
288547501Spendry@comment  node-name,  next,  previous,  up
288647501Spendry@section @i{FSinfo} overview
288747501Spendry@cindex FSinfo overview
288847501Spendry
288947501Spendry@i{FSinfo} is a filesystem management tool.  It has been designed to
289047501Spendrywork with @i{Amd} to help system administrators keep track of the ever
289147501Spendryincreasing filesystem namespace under their control.
289247501Spendry
289347501SpendryThe purpose of @i{FSinfo} is to generate all the important standard
289447501Spendryfilesystem data files from a single set of input data.  Starting with a
289547501Spendrysingle data source guarantees that all the generated files are
289647501Spendryself-consistent.  One of the possible output data formats is a set of
289747501Spendry@i{Amd} maps which can be used amongst the set of hosts described in the
289847501Spendryinput data.
289947501Spendry
290047501Spendry@i{FSinfo} implements a declarative language.  This language is
290147501Spendryspecifically designed for describing filesystem namespace and physical
290247501Spendrylayouts.  The basic declaration defines a mounted filesystem including
290347501Spendryits device name, mount point, and all the volumes and access
290447501Spendrypermissions.  @i{FSinfo} reads this information and builds an internal
290547501Spendrymap of the entire network of hosts.  Using this map, many different data
290647501Spendryformats can be produced including @file{/etc/fstab},
290747501Spendry@file{/etc/exports}, @i{Amd} mount maps and
290847501Spendry@file{/etc/bootparams}.@refill
290947501Spendry
291047501Spendry@node     Using FSinfo, FSinfo Grammar, FSinfo Overview, FSinfo
291147501Spendry@comment  node-name,  next,  previous,  up
291247501Spendry@section Using @i{FSinfo}
291347501Spendry@cindex Using FSinfo
291447501Spendry
291547501SpendryThe basic strategy when using @i{FSinfo} is to gather all the
291647501Spendryinformation about all disks on all machines into one set of
291747501Spendrydeclarations.  For each machine being managed, the following data is
291847501Spendryrequired:
291947501Spendry
292047501Spendry@itemize @bullet
292147501Spendry@item
292247501SpendryHostname
292347501Spendry@item
292447501SpendryList of all filesystems and, optionally, their mount points.
292547501Spendry@item
292647501SpendryNames of volumes stored on each filesystem.
292747501Spendry@item
292847501SpendryNFS export information for each volume.
292947501Spendry@item
293047501SpendryThe list of static filesystem mounts.
293147501Spendry@end itemize
293247501Spendry
293347501SpendryThe following information can also be entered into the same
293447501Spendryconfiguration files so that all data can be kept in one place.
293547501Spendry
293647501Spendry@itemize @bullet
293747501Spendry@item
293847501SpendryList of network interfaces
293947501Spendry@item
294047501SpendryIP address of each interface
294147501Spendry@item
294247501SpendryHardware address of each interface
294347501Spendry@item
294447501SpendryDumpset to which each filesystem belongs
294547501Spendry@item
294647501Spendryand more @dots{}
294747501Spendry@end itemize
294847501Spendry
294947501SpendryTo generate @i{Amd} mount maps, the automount tree must also be defined
295047501Spendry(@pxref{FSinfo automount definitions}).  This will have been designed at
295147501Spendrythe time the volume names were allocated.  Some volume names will not be
295247501Spendryautomounted, so @i{FSinfo} needs an explicit list of which volumes
295347501Spendryshould be automounted.@refill
295447501Spendry
295547501SpendryHostnames are required at several places in the @i{FSinfo} language.  It
295647501Spendryis important to stick to either fully qualified names or unqualified
295747501Spendrynames.  Using a mixture of the two will inevitably result in confusion.
295847501Spendry
295947501SpendrySometimes volumes need to be referenced which are not defined in the set
296047501Spendryof hosts being managed with @i{FSinfo}.  The required action is to add a
296147501Spendrydummy set of definitions for the host and volume names required.  Since
296247501Spendrythe files generated for those particular hosts will not be used on them,
296347501Spendrythe exact values used is not critical.
296447501Spendry
296552454Spendry@node     FSinfo Grammar, FSinfo host definitions, Using FSinfo, FSinfo
296647501Spendry@comment  node-name,  next,  previous,  up
296747501Spendry@section @i{FSinfo} grammar
296847501Spendry@cindex FSinfo grammar
296947501Spendry@cindex Grammar, FSinfo
297047501Spendry
297147501Spendry@i{FSinfo} has a relatively simple grammar.  Distinct syntactic
297247501Spendryconstructs exist for each of the different types of data, though they
297347501Spendryshare a common flavour.  Several conventions are used in the grammar
297447501Spendryfragments below.
297547501Spendry
297647501SpendryThe notation, @i{list(}@t{xxx}@i{)}, indicates a list of zero or more
297747501Spendry@t{xxx}'s.  The notation, @i{opt(}@t{xxx}@i{)}, indicates zero or one
297847501Spendry@t{xxx}.  Items in double quotes, @i{eg} @t{"host"}, represent input
297947501Spendrytokens.  Items in angle brackets, @i{eg} @var{<hostname>}, represent
298047501Spendrystrings in the input.  Strings need not be in double quotes, except to
298147501Spendrydifferentiate them from reserved words.  Quoted strings may include the
298247501Spendryusual set of C ``@t{\}'' escape sequences with one exception: a
298347501Spendrybackslash-newline-whitespace sequence is squashed into a single space
298447501Spendrycharacter.  To defeat this feature, put a further backslash at the start
298547501Spendryof the second line.
298647501Spendry
298747501SpendryAt the outermost level of the grammar, the input consists of a
298847501Spendrysequence of host and automount declarations.  These declarations are
298947501Spendryall parsed before they are analyzed.  This means they can appear in
299047501Spendryany order and cyclic host references are possible.
299147501Spendry
299247501Spendry@example
299347501Spendryfsinfo      : @i{list(}fsinfo_attr@i{)} ;
299447501Spendry
299547501Spendryfsinfo_attr : host | automount ;
299647501Spendry@end example
299747501Spendry
299847501Spendry@menu
299947501Spendry* FSinfo host definitions::
300047501Spendry* FSinfo automount definitions::
300147501Spendry@end menu
300247501Spendry
300347501Spendry@node FSinfo host definitions, FSinfo host attributes, FSinfo grammar, FSinfo
300447501Spendry@comment  node-name,  next,  previous,  up
300547501Spendry@section @i{FSinfo} host definitions
300647501Spendry@cindex FSinfo host definitions
300747501Spendry@cindex Defining a host, FSinfo
300847501Spendry
300947501SpendryA host declaration consists of three parts: a set of machine attribute
301047501Spendrydata, a list of filesystems physically attached to the machine, and a
301147501Spendrylist of additional statically mounted filesystems.
301247501Spendry
301347501Spendry@example
301447501Spendryhost        : "host" host_data @i{list(}filesystem@i{@i{)}} @i{list(}mount@i{@i{)}} ;
301547501Spendry@end example
301647501Spendry
301747501SpendryEach host must be declared in this way exactly once.  Such things as the
301847501Spendryhardware address, the architecture and operating system types and the
301947501Spendrycluster name are all specified within the @dfn{host data}.
302047501Spendry
302147501SpendryAll the disks the machine has should then be described in the @dfn{list
302247501Spendryof filesystems}.  When describing disks, you can specify what
302347501Spendry@dfn{volname} the disk/partition should have and all such entries are
302447501Spendrybuilt up into a dictionary which can then be used for building the
302547501Spendryautomounter maps.
302647501Spendry
302747501SpendryThe @dfn{list of mounts} specifies all the filesystems that should be
302847501Spendrystatically mounted on the machine.
302947501Spendry
303047501Spendry@menu
303147501Spendry* FSinfo host attributes::
303247501Spendry* FSinfo filesystems::
303347501Spendry* FSinfo static mounts::
303447501Spendry@end menu
303547501Spendry
303647501Spendry@node FSinfo host attributes, FSinfo filesystems, FSinfo host definitions , FSinfo host definitions
303747501Spendry@comment  node-name,  next,  previous,  up
303847501Spendry@section @i{FSinfo} host attributes
303947501Spendry@cindex FSinfo host attributes
304047501Spendry@cindex Defining host attributes, FSinfo
304147501Spendry
304247501SpendryThe host data, @dfn{host_data}, always includes the @dfn{hostname}.  In
304347501Spendryaddition, several other host attributes can be given.
304447501Spendry
304547501Spendry@example
304647501Spendryhost_data   : @var{<hostname>}
304747501Spendry            | "@{" @i{list(}host_attrs@i{)} "@}" @var{<hostname>}
304847501Spendry            ;
304947501Spendry
305047501Spendryhost_attrs  : host_attr "=" @var{<string>}
305147501Spendry            | netif
305247501Spendry            ;
305347501Spendry
305447501Spendryhost_attr   : "config"
305547501Spendry            | "arch"
305647501Spendry            | "os"
305747501Spendry            | "cluster"
305847501Spendry            ;
305947501Spendry@end example
306047501Spendry
306147501SpendryThe @dfn{hostname} is, typically, the fully qualified hostname of the
306247501Spendrymachine.
306347501Spendry
306447501SpendryExamples:
306547501Spendry
306647501Spendry@example
306747501Spendryhost dylan.doc.ic.ac.uk
306847501Spendry
306947501Spendryhost @{
307047501Spendry    os = hpux
307147501Spendry    arch = hp300
307247501Spendry@} dougal.doc.ic.ac.uk
307347501Spendry@end example
307447501Spendry
307547501SpendryThe options that can be given as host attributes are shown below.
307647501Spendry
307747501Spendry@menu
307847501Spendry* netif Option:		FSinfo host netif:
307952454Spendry* config Option:	FSinfo host config:
308047501Spendry* arch Option:		FSinfo host arch:
308147501Spendry* os Option:		FSinfo host os:
308247501Spendry* cluster Option:	FSinfo host cluster:
308347501Spendry@end menu
308447501Spendry
308552454Spendry@node FSinfo host netif, FSinfo host config, , FSinfo host attributes
308647501Spendry@comment  node-name,  next,  previous,  up
308747501Spendry@subsection netif Option
308847501Spendry
308947501SpendryThis defines the set of network interfaces configured on the machine.
309047501SpendryThe interface attributes collected by @i{FSinfo} are the IP address,
309147501Spendrysubnet mask and hardware address.  Multiple interfaces may be defined
309247501Spendryfor hosts with several interfaces by an entry for each interface.  The
309347501Spendryvalues given are sanity checked, but are currently unused for anything
309447501Spendryelse.
309547501Spendry
309647501Spendry@example
309747501Spendrynetif       : "netif" @var{<string>} "@{" @i{list(}netif_attrs@i{)} "@}" ;
309847501Spendry
309947501Spendrynetif_attrs : netif_attr "=" @var{<string>} ;
310047501Spendry
310147501Spendrynetif_attr  : "inaddr" | "netmask" | "hwaddr" ;
310247501Spendry@end example
310347501Spendry
310447501SpendryExamples:
310547501Spendry
310647501Spendry@example
310747501Spendrynetif ie0 @{
310847501Spendry    inaddr  = 129.31.81.37
310947501Spendry    netmask = 0xfffffe00
311047501Spendry    hwaddr  = "08:00:20:01:a6:a5"
311147501Spendry@}
311247501Spendry
311347501Spendrynetif ec0 @{ @}
311447501Spendry@end example
311547501Spendry
311647501Spendry@node FSinfo host config, FSinfo host arch, FSinfo host netif, FSinfo host attributes
311747501Spendry@comment  node-name,  next,  previous,  up
311847501Spendry@subsection config Option
311947501Spendry@cindex FSinfo config host attribute
312047501Spendry@cindex config, FSinfo host attribute
312147501Spendry
312247501SpendryThis option allows you to specify configuration variables for the
312347501Spendrystartup scripts (@file{rc} scripts).  A simple string should immediately
312447501Spendryfollow the keyword.
312547501Spendry
312647501SpendryExample:
312747501Spendry
312847501Spendry@example
312947501Spendryconfig "NFS_SERVER=true"
313047501Spendryconfig "ZEPHYR=true"
313147501Spendry@end example
313247501Spendry
313347501SpendryThis option is currently unsupported.
313447501Spendry
313547501Spendry@node FSinfo host arch, FSinfo host os, FSinfo host config, FSinfo host attributes
313647501Spendry@comment  node-name,  next,  previous,  up
313747501Spendry@subsection arch Option
313847501Spendry@cindex FSinfo arch host attribute
313947501Spendry@cindex arch, FSinfo host attribute
314047501Spendry
314147501SpendryThis defines the architecture of the machine.  For example:
314247501Spendry
314347501Spendry@example
314447501Spendryarch = hp300
314547501Spendry@end example
314647501Spendry
314747501SpendryThis is intended to be of use when building architecture specific
314847501Spendrymountmaps, however, the option is currently unsupported.
314947501Spendry
315047501Spendry@node FSinfo host os, FSinfo host cluster, FSinfo host arch, FSinfo host attributes
315147501Spendry@comment  node-name,  next,  previous,  up
315247501Spendry@subsection os Option
315347501Spendry@cindex FSinfo os host attribute
315447501Spendry@cindex os, FSinfo host attribute
315547501Spendry
315647501SpendryThis defines the operating system type of the host.  For example:
315747501Spendry
315847501Spendry@example
315947501Spendryos = hpux
316047501Spendry@end example
316147501Spendry
316247501SpendryThis information is used when creating the @file{fstab} files, for
316347501Spendryexample in choosing which format to use for the @file{fstab} entries
316447501Spendrywithin the file.
316547501Spendry
316647501Spendry@node FSinfo host cluster, , FSinfo host os, FSinfo host attributes
316747501Spendry@comment  node-name,  next,  previous,  up
316847501Spendry@subsection cluster Option
316947501Spendry@cindex FSinfo cluster host attribute
317047501Spendry@cindex cluster, FSinfo host attribute
317147501Spendry
317247501SpendryThis is used for specifying in which cluster the machine belongs.  For
317347501Spendryexample:
317447501Spendry
317547501Spendry@example
317647501Spendrycluster = "theory"
317747501Spendry@end example
317847501Spendry
317947501SpendryThe cluster is intended to be used when generating the automount maps,
318047501Spendryalthough it is currently unsupported.
318147501Spendry
318247501Spendry@node FSinfo filesystems, FSinfo static mounts, FSinfo host attributes, FSinfo host definitions
318347501Spendry@comment  node-name,  next,  previous,  up
318447501Spendry@section @i{FSinfo} filesystems
318547501Spendry@cindex FSinfo filesystems
318647501Spendry
318747501SpendryThe list of physically attached filesystems follows the machine
318847501Spendryattributes.  These should define all the filesystems available from this
318947501Spendrymachine, whether exported or not.  In addition to the device name,
319047501Spendryfilesystems have several attributes, such as filesystem type, mount
319147501Spendryoptions, and @samp{fsck} pass number which are needed to generate
319247501Spendry@file{fstab} entries.
319347501Spendry
319447501Spendry@example
319547501Spendryfilesystem  : "fs" @var{<device>} "@{" @i{list(}fs_data@i{)} "@}" ;
319647501Spendry
319747501Spendryfs_data     : fs_data_attr "=" @var{<string>}
319847501Spendry            | mount
319947501Spendry            ;
320047501Spendry
320147501Spendryfs_data_attr
320247501Spendry            : "fstype" | "opts" | "passno"
320347501Spendry            | "freq" | "dumpset" | "log"
320447501Spendry            ;
320547501Spendry@end example
320647501Spendry
320747501SpendryHere, @var{<device>} is the device name of the disk (for example,
320847501Spendry@file{/dev/dsk/2s0}).  The device name is used for building the mount
320947501Spendrymaps and for the @file{fstab} file.  The attributes that can be
321047501Spendryspecified are shown in the following section.
321147501Spendry
321247501SpendryThe @i{FSinfo} configuration file for @code{dylan.doc.ic.ac.uk} is listed below.
321347501Spendry
321447501Spendry@example
321547501Spendryhost dylan.doc.ic.ac.uk
321647501Spendry
321752454Spendryfs /dev/dsk/0s0 @{
321847501Spendry	fstype = swap
321952454Spendry@}
322047501Spendry
322152454Spendryfs /dev/dsk/0s0 @{
322247501Spendry	fstype = hfs
322347501Spendry	opts = rw,noquota,grpid
322447501Spendry	passno = 0;
322547501Spendry	freq = 1;
322652454Spendry	mount / @{ @}
322752454Spendry@}
322847501Spendry
322952454Spendryfs /dev/dsk/1s0 @{
323047501Spendry	fstype = hfs
323147501Spendry	opts = defaults
323247501Spendry	passno = 1;
323347501Spendry	freq = 1;
323452454Spendry	mount /usr @{
323552454Spendry		local @{
323647501Spendry			exportfs "dougal eden dylan zebedee brian"
323747501Spendry			volname /nfs/hp300/local
323852454Spendry		@}
323952454Spendry	@}
324052454Spendry@}
324147501Spendry
324252454Spendryfs /dev/dsk/2s0 @{
324347501Spendry	fstype = hfs
324447501Spendry	opts = defaults
324547501Spendry	passno = 1;
324647501Spendry	freq = 1;
324752454Spendry	mount default @{
324847501Spendry		exportfs "toytown_clients hangers_on"
324947501Spendry		volname /home/dylan/dk2
325052454Spendry	@}
325152454Spendry@}
325247501Spendry
325352454Spendryfs /dev/dsk/3s0 @{
325447501Spendry	fstype = hfs
325547501Spendry	opts = defaults
325647501Spendry	passno = 1;
325747501Spendry	freq = 1;
325852454Spendry	mount default @{
325947501Spendry		exportfs "toytown_clients hangers_on"
326047501Spendry		volname /home/dylan/dk3
326152454Spendry	@}
326252454Spendry@}
326347501Spendry
326452454Spendryfs /dev/dsk/5s0 @{
326547501Spendry	fstype = hfs
326647501Spendry	opts = defaults
326747501Spendry	passno = 1;
326847501Spendry	freq = 1;
326952454Spendry	mount default @{
327047501Spendry		exportfs "toytown_clients hangers_on"
327147501Spendry		volname /home/dylan/dk5
327252454Spendry	@}
327352454Spendry@}
327447501Spendry@end example
327547501Spendry
327647501Spendry@menu
327747501Spendry* fstype Option:	FSinfo filesystems fstype:
327847501Spendry* opts Option:		FSinfo filesystems opts:
327947501Spendry* passno Option:	FSinfo filesystems passno:
328047501Spendry* freq Option:		FSinfo filesystems freq:
328147501Spendry* mount Option:		FSinfo filesystems mount:
328247501Spendry* dumpset Option:	FSinfo filesystems dumpset:
328347501Spendry* log Option:		FSinfo filesystems log:
328447501Spendry@end menu
328547501Spendry
328647501Spendry@node FSinfo filesystems fstype, FSinfo filesystems opts, , FSinfo filesystems
328747501Spendry@comment  node-name,  next,  previous,  up
328847501Spendry@subsection fstype Option
328947501Spendry@cindex FSinfo fstype filesystems option
329047501Spendry@cindex fstype, FSinfo filesystems option
329147501Spendry@cindex export, FSinfo special fstype
329247501Spendry
329347501SpendryThis specifies the type of filesystem being declared and will be placed
329447501Spendryinto the @file{fstab} file as is.  The value of this option will be
329547501Spendryhanded to @code{mount} as the filesystem type---it should have such
329647501Spendryvalues as @code{4.2}, @code{nfs} or @code{swap}.  The value is not
329747501Spendryexamined for correctness.
329847501Spendry
329947501SpendryThere is one special case.  If the filesystem type is specified as
330047501Spendry@samp{export} then the filesystem information will not be added to the
330147501Spendryhost's @file{fstab} information, but it will still be visible on the
330247501Spendrynetwork.  This is useful for defining hosts which contain referenced
330347501Spendryvolumes but which are not under full control of @i{FSinfo}.
330447501Spendry
330547501SpendryExample:
330647501Spendry
330747501Spendry@example
330847501Spendryfstype = swap
330947501Spendry@end example
331047501Spendry
331147501Spendry@node FSinfo filesystems opts, FSinfo filesystems passno,FSinfo filesystems fstype, FSinfo filesystems
331247501Spendry@comment  node-name,  next,  previous,  up
331347501Spendry@subsection opts Option
331447501Spendry@cindex FSinfo opts filesystems option
331547501Spendry@cindex opts, FSinfo filesystems option
331647501Spendry
331747501SpendryThis defines any options that should be given to @b{mount}(8) in the
331847501Spendry@file{fstab} file.  For example:
331947501Spendry
332047501Spendry@example
332147501Spendryopts = rw,nosuid,grpid
332247501Spendry@end example
332347501Spendry
332447501Spendry@node FSinfo filesystems passno, FSinfo filesystems freq, FSinfo filesystems opts, FSinfo filesystems
332547501Spendry@comment  node-name,  next,  previous,  up
332647501Spendry@subsection passno Option
332747501Spendry@cindex FSinfo passno filesystems option
332847501Spendry@cindex passno, FSinfo filesystems option
332947501Spendry
333047501SpendryThis defines the @b{fsck}(8) pass number in which to check the
333147501Spendryfilesystem.  This value will be placed into the @file{fstab} file.
333247501Spendry
333347501SpendryExample:
333447501Spendry
333547501Spendry@example
333647501Spendrypassno = 1
333747501Spendry@end example
333847501Spendry
333947501Spendry@node FSinfo filesystems freq, FSinfo filesystems mount, FSinfo filesystems passno, FSinfo filesystems
334047501Spendry@comment  node-name,  next,  previous,  up
334147501Spendry@subsection freq Option
334247501Spendry@cindex FSinfo freq filesystems option
334347501Spendry@cindex freq, FSinfo filesystems option
334447501Spendry
334547501SpendryThis defines the interval (in days) between dumps.  The value is placed
334647501Spendryas is into the @file{fstab} file.
334747501Spendry
334847501SpendryExample:
334947501Spendry
335047501Spendry@example
335147501Spendryfreq = 3
335247501Spendry@end example
335347501Spendry
335447501Spendry@node FSinfo filesystems mount, FSinfo filesystems dumpset, FSinfo filesystems freq, FSinfo filesystems
335547501Spendry@comment  node-name,  next,  previous,  up
335647501Spendry@subsection mount Option
335747501Spendry@cindex FSinfo mount filesystems option
335847501Spendry@cindex mount, FSinfo filesystems option
335947501Spendry@cindex exportfs, FSinfo mount option
336047501Spendry@cindex volname, FSinfo mount option
336147501Spendry@cindex sel, FSinfo mount option
336247501Spendry
336347501SpendryThis defines the mountpoint at which to place the filesystem.  If the
336447501Spendrymountpoint of the filesystem is specified as @code{default}, then the
336547501Spendryfilesystem will be mounted in the automounter's tree under its volume
336647501Spendryname and the mount will automatically be inherited by the automounter.
336747501Spendry
336847501SpendryFollowing the mountpoint, namespace information for the filesystem may
336947501Spendrybe described.  The options that can be given here are @code{exportfs},
337047501Spendry@code{volname} and @code{sel}.
337147501Spendry
337247501SpendryThe format is:
337347501Spendry
337447501Spendry@example
337547501Spendrymount       : "mount" vol_tree ;
337647501Spendry
337747501Spendryvol_tree    : @i{list(}vol_tree_attr@i{)} ;
337847501Spendry
337947501Spendryvol_tree_attr
338047501Spendry            :  @var{<string>} "@{" @i{list(}vol_tree_info@i{)} vol_tree "@}" ;
338147501Spendry
338247501Spendryvol_tree_info
338347501Spendry            : "exportfs" @var{<export-data>}
338447501Spendry            | "volname" @var{<volname>}
338547501Spendry            | "sel" @var{<selector-list>}
338647501Spendry            ;
338747501Spendry@end example
338847501Spendry
338947501SpendryExample:
339047501Spendry
339147501Spendry@example
339247501Spendrymount default @{
339347501Spendry    exportfs "dylan dougal florence zebedee"
339447501Spendry    volname /vol/andrew
339547501Spendry@}
339647501Spendry@end example
339747501Spendry
339847501SpendryIn the above example, the filesystem currently being declared will have
339947501Spendryan entry placed into the @file{exports} file allowing the filesystem to
340047501Spendrybe exported to the machines @code{dylan}, @code{dougal}, @code{florence}
340147501Spendryand @code{zebedee}.  The volume name by which the filesystem will be
340247501Spendryreferred to remotely, is @file{/vol/andrew}.  By declaring the
340347501Spendrymountpoint to be @code{default}, the filesystem will be mounted on the
340447501Spendrylocal machine in the automounter tree, where @i{Amd} will automatically
340547501Spendryinherit the mount as @file{/vol/andrew}.@refill
340647501Spendry
340747501Spendry@table @samp
340847501Spendry@item exportfs
340947501Spendrya string defining which machines the filesystem may be exported to.
341047501SpendryThis is copied, as is, into the @file{exports} file---no sanity checking
341147501Spendryis performed on this string.@refill
341247501Spendry
341347501Spendry@item volname
341447501Spendrya string which declares the remote name by which to reference the
341547501Spendryfilesystem.  The string is entered into a dictionary and allows you to
341647501Spendryrefer to this filesystem in other places by this volume name.@refill
341747501Spendry
341847501Spendry@item sel
341947501Spendrya string which is placed into the automounter maps as a selector for the
342047501Spendryfilesystem.@refill
342147501Spendry
342247501Spendry@end table
342347501Spendry
342447501Spendry@node FSinfo filesystems dumpset, FSinfo filesystems log, FSinfo filesystems mount, FSinfo filesystems
342547501Spendry@comment  node-name,  next,  previous,  up
342647501Spendry@subsection dumpset Option
342747501Spendry@cindex FSinfo dumpset filesystems option
342847501Spendry@cindex dumpset, FSinfo filesystems option
342947501Spendry
343047501SpendryThis provides support for Imperial College's local file backup tools and
343147501Spendryis not documented further here.
343247501Spendry
343347501Spendry@node FSinfo filesystems log, , FSinfo filesystems dumpset, FSinfo filesystems
343447501Spendry@comment  node-name,  next,  previous,  up
343547501Spendry@subsection log Option
343647501Spendry@cindex FSinfo log filesystems option
343747501Spendry@cindex log, FSinfo filesystems option
343847501Spendry
343947501SpendrySpecifies the log device for the current filesystem. This is ignored if
344047501Spendrynot required by the particular filesystem type.
344147501Spendry
344247501Spendry@node FSinfo static mounts, FSinfo automount definitions , FSinfo filesystems, FSinfo host definitions
344347501Spendry@comment  node-name,  next,  previous,  up
344447501Spendry@section @i{FSinfo} static mounts
344547501Spendry@cindex FSinfo static mounts
344647501Spendry@cindex Statically mounts filesystems, FSinfo
344747501Spendry
344847501SpendryEach host may also have a number of statically mounted filesystems.  For
344947501Spendryexample, the host may be a diskless workstation in which case it will
345047501Spendryhave no @code{fs} declarations.  In this case the @code{mount}
345147501Spendrydeclaration is used to determine from where its filesystems will be
345247501Spendrymounted.  In addition to being added to the @file{fstab} file, this
345347501Spendryinformation can also be used to generate a suitable @file{bootparams}
345447501Spendryfile.@refill
345547501Spendry
345647501Spendry@example
345747501Spendrymount       : "mount" @var{<volname>} @i{list(}localinfo@i{)} ;
345847501Spendry
345947501Spendrylocalinfo   : localinfo_attr @var{<string>} ;
346047501Spendry
346147501Spendrylocalinfo_attr
346247501Spendry            : "as"
346347501Spendry            | "from"
346447501Spendry            | "fstype"
346547501Spendry            | "opts"
346647501Spendry            ;
346747501Spendry@end example
346847501Spendry
346947501SpendryThe filesystem specified to be mounted will be searched for in the
347047501Spendrydictionary of volume names built when scanning the list of hosts'
347147501Spendrydefinitions.
347247501Spendry
347347501SpendryThe attributes have the following semantics:
347447501Spendry@table @samp
347547501Spendry@item from @var{machine}
347647501Spendrymount the filesystem from the machine with the hostname of
347747501Spendry@dfn{machine}.@refill
347847501Spendry
347947501Spendry@item as @var{mountpoint}
348047501Spendrymount the filesystem locally as the name given, in case this is
348147501Spendrydifferent from the advertised volume name of the filesystem.
348247501Spendry
348347501Spendry@item opts @var{options}
348447501Spendrynative @b{mount}(8) options.
348547501Spendry
348647501Spendry@item fstype @var{type}
348747501Spendrytype of filesystem to be mounted.
348847501Spendry@end table
348947501Spendry
349047501SpendryAn example:
349147501Spendry
349247501Spendry@example
349347501Spendrymount /export/exec/hp300/local as /usr/local
349447501Spendry@end example
349547501Spendry
349647501SpendryIf the mountpoint specified is either @file{/} or @file{swap}, the
349747501Spendrymachine will be considered to be booting off the net and this will be
349847501Spendrynoted for use in generating a @file{bootparams} file for the host which
349947501Spendryowns the filesystems.
350047501Spendry
350147501Spendry@node FSinfo automount definitions, FSinfo Command Line Options, FSinfo static mounts, FSinfo
350247501Spendry@comment  node-name,  next,  previous,  up
350347501Spendry@section Defining an @i{Amd} Mount Map in @i{FSinfo}
350447501Spendry@cindex FSinfo automount definitions
350547501Spendry@cindex Defining an Amd mount map, FSinfo
350647501Spendry
350747501SpendryThe maps used by @i{Amd} can be constructed from @i{FSinfo} by defining
350847501Spendryall the automount trees.  @i{FSinfo} takes all the definitions found and
350947501Spendrybuilds one map for each top level tree.
351047501Spendry
351147501SpendryThe automount tree is usually defined last.  A single automount
351247501Spendryconfiguration will usually apply to an entire management domain.  One
351347501Spendry@code{automount} declaration is needed for each @i{Amd} automount point.
351447501Spendry@i{FSinfo} determines whether the automount point is @dfn{direct}
351547501Spendry(@pxref{Direct Automount Filesystem}) or @dfn{indirect}
351647501Spendry(@pxref{Top-level Filesystem}).  Direct automount points are
351747501Spendrydistinguished by the fact that there is no underlying
351847501Spendry@dfn{automount_tree}.@refill
351947501Spendry
352047501Spendry@example
352147501Spendryautomount   : "automount" opt(auto_opts@i{)} automount_tree ;
352247501Spendry
352347501Spendryauto_opts   : "opts" @var{<mount-options>} ;
352447501Spendry
352547501Spendryautomount_tree
352647501Spendry            : @i{list(}automount_attr@i{)}
352747501Spendry            ;
352847501Spendry
352947501Spendryautomount_attr
353047501Spendry            : @var{<string>} "=" @var{<volname>}
353147501Spendry            | @var{<string>} "->" @var{<symlink>}
353247501Spendry            | @var{<string>} "@{" automount_tree "@}"
353347501Spendry            ;
353447501Spendry@end example
353547501Spendry
353647501SpendryIf @var{<mount-options>} is given, then it is the string to be placed in
353747501Spendrythe maps for @i{Amd} for the @code{opts} option.
353847501Spendry
353947501SpendryA @dfn{map} is typically a tree of filesystems, for example @file{home}
354047501Spendrynormally contains a tree of filesystems representing other machines in
354147501Spendrythe network.
354247501Spendry
354347501SpendryA map can either be given as a name representing an already defined
354447501Spendryvolume name, or it can be a tree.  A tree is represented by placing
354547501Spendrybraces after the name.  For example, to define a tree @file{/vol}, the
354647501Spendryfollowing map would be defined:
354747501Spendry
354847501Spendry@example
354947501Spendryautomount /vol @{ @}
355047501Spendry@end example
355147501Spendry
355247501SpendryWithin a tree, the only items that can appear are more maps.
355347501SpendryFor example:
355447501Spendry
355547501Spendry@example
355647501Spendryautomount /vol @{
355747501Spendry    andrew @{ @}
355847501Spendry    X11 @{ @}
355947501Spendry@}
356047501Spendry@end example
356147501Spendry
356247501SpendryIn this case, @i{FSinfo} will look for volumes named @file{/vol/andrew}
356347501Spendryand @file{/vol/X11} and a map entry will be generated for each.  If the
356447501Spendryvolumes are defined more than once, then @i{FSinfo} will generate
356547501Spendrya series of alternate entries for them in the maps.@refill
356647501Spendry
356747501SpendryInstead of a tree, either a link (@var{name} @code{->}
356847501Spendry@var{destination}) or a reference can be specified (@var{name} @code{=}
356947501Spendry@var{destination}).  A link creates a symbolic link to the string
357047501Spendryspecified, without further processing the entry.  A reference will
357147501Spendryexamine the destination filesystem and optimise the reference.  For
357247501Spendryexample, to create an entry for @code{njw} in the @file{/homes} map,
357347501Spendryeither of the two forms can be used:@refill
357447501Spendry
357547501Spendry@example
357647501Spendryautomount /homes @{
357747501Spendry    njw -> /home/dylan/njw
357847501Spendry@}
357947501Spendry@end example
358047501Spendry
358147501Spendryor
358247501Spendry
358347501Spendry@example
358447501Spendryautomount /homes @{
358547501Spendry    njw = /home/dylan/njw
358647501Spendry@}
358747501Spendry@end example
358847501Spendry
358947501SpendryIn the first example, when @file{/homes/njw} is referenced from @i{Amd},
359047501Spendrya link will be created leading to @file{/home/dylan/njw} and the
359147501Spendryautomounter will be referenced a second time to resolve this filename.
359247501SpendryThe map entry would be:
359347501Spendry
359447501Spendry@example
359547501Spendrynjw type:=link;fs:=/home/dylan/njw
359647501Spendry@end example
359747501Spendry
359847501SpendryIn the second example, the destination directory is analysed and found
359947501Spendryto be in the filesystem @file{/home/dylan} which has previously been
360047501Spendrydefined in the maps. Hence the map entry will look like:
360147501Spendry
360247501Spendry@example
360347501Spendrynjw rhost:=dylan;rfs:=/home/dylan;sublink:=njw
360447501Spendry@end example
360547501Spendry
360647501SpendryCreating only one symbolic link, and one access to @i{Amd}.
360747501Spendry
360847501Spendry@c ---------------------------------------------
360947501Spendry@node FSinfo Command Line Options, FSinfo errors, FSinfo automount definitions, FSinfo
361047501Spendry@comment  node-name,  next,  previous,  up
361147501Spendry@section @i{FSinfo} Command Line Options
361247501Spendry@cindex FSinfo command line options
361347501Spendry@cindex Command line options, FSinfo
361447501Spendry
361547501Spendry@i{FSinfo} is started from the command line by using the command:
361647501Spendry
361747501Spendry@example
361847501Spendryfsinfo [@i{options}] files ...
361947501Spendry@end example
362047501Spendry
362147501SpendryThe input to @i{FSinfo} is a single set of definitions of machines and
362247501Spendryautomount maps.  If multiple files are given on the command-line, then
362347501Spendrythe files are concatenated together to form the input source.  The files
362447501Spendryare passed individually through the C pre-processor before being parsed.
362547501Spendry
362647501SpendrySeveral options define a prefix for the name of an output file.  If the
362747501Spendryprefix is not specified no output of that type is produced.  The suffix
362847501Spendryused will correspond either to the hostname to which a file belongs, or
362947501Spendryto the type of output if only one file is produced.  Dumpsets and the
363047501Spendry@file{bootparams} file are in the latter class.  To put the output into
363147501Spendrya subdirectory simply put a @file{/} at the end of the prefix, making
363247501Spendrysure that the directory has already been made before running
363347501Spendry@samp{fsinfo}.
363447501Spendry
363547501Spendry@menu
363647501Spendry* -a FSinfo Option::	Amd automount directory:
363747501Spendry* -b FSinfo Option::	Prefix for bootparams files.
363847501Spendry* -d FSinfo Option::	Prefix for dumpset data files.
363947501Spendry* -e FSinfo Option::	Prefix for exports files.
364047501Spendry* -f FSinfo Option::	Prefix for fstab files.
364147501Spendry* -h FSinfo Option::	Local hostname.
364247501Spendry* -m FSinfo Option::	Prefix for automount maps.
364347501Spendry* -q FSinfo Option::	Ultra quiet mode.
364447501Spendry* -v FSinfo Option::	Verbose mode.
364547501Spendry* -I FSinfo Option::	Define new #include directory.
364652454Spendry* -D-FSinfo Option::	Define macro.
364747501Spendry* -U FSinfo Option::	Undefine macro.
364847501Spendry@end menu
364947501Spendry
365047501Spendry@node -a FSinfo Option, -b FSinfo Option, FSinfo Command Line Options, FSinfo Command Line Options
365147501Spendry@comment  node-name,  next,  previous,  up
365247501Spendry@subsection @code{-a} @var{autodir}
365347501Spendry
365447501SpendrySpecifies the directory name in which to place the automounter's
365547501Spendrymountpoints.  This defaults to @file{/a}.  Some sites have the autodir set
365647501Spendryto be @file{/amd}, and this would be achieved by:
365747501Spendry
365847501Spendry@example
365947501Spendryfsinfo -a /amd ...
366047501Spendry@end example
366147501Spendry
366247501Spendry@node -b FSinfo Option, -d FSinfo Option, -a FSinfo Option, FSinfo Command Line Options
366347501Spendry@comment  node-name,  next,  previous,  up
366447501Spendry@subsection @code{-b} @var{bootparams}
366547501Spendry@cindex bootparams, FSinfo prefix
366647501Spendry
366747501SpendryThis specifies the prefix for the @file{bootparams} filename.  If it is
366847501Spendrynot given, then the file will not be generated.  The @file{bootparams}
366947501Spendryfile will be constructed for the destination machine and will be placed
367047501Spendryinto a file named @file{bootparams} and prefixed by this string.  The
367147501Spendryfile generated contains a list of entries describing each diskless
367247501Spendryclient that can boot from the destination machine.
367347501Spendry
367447501SpendryAs an example, to create a @file{bootparams} file in the directory
367547501Spendry@file{generic}, the following would be used:
367647501Spendry
367747501Spendry@example
367847501Spendryfsinfo -b generic/ ...
367947501Spendry@end example
368047501Spendry
368147501Spendry@node -d FSinfo Option, -e FSinfo Option, -b FSinfo Option, FSinfo Command Line Options
368247501Spendry@comment  node-name,  next,  previous,  up
368347501Spendry@subsection @code{-d} @var{dumpsets}
368447501Spendry@cindex dumpset, FSinfo prefix
368547501Spendry
368647501SpendryThis specifies the prefix for the @file{dumpsets} file.  If it is not
368747501Spendryspecified, then the file will not be generated.  The file will be for
368847501Spendrythe destination machine and will be placed into a filename
368947501Spendry@file{dumpsets}, prefixed by this string.  The @file{dumpsets} file is
369047501Spendryfor use by Imperial College's local backup system.
369147501Spendry
369247501SpendryFor example, to create a dumpsets file in the directory @file{generic},
369347501Spendrythen you would use the following:
369447501Spendry
369547501Spendry@example
369647501Spendryfsinfo -d generic/ ...
369747501Spendry@end example
369847501Spendry
369947501Spendry@node -e FSinfo Option, -f FSinfo Option, -d FSinfo Option, FSinfo Command Line Options
370047501Spendry@comment  node-name,  next,  previous,  up
370147501Spendry@subsection @code{-e} @var{exportfs}
370247501Spendry@cindex exports, FSinfo prefix
370347501Spendry
370447501SpendryDefines the prefix for the @file{exports} files.  If it is not given,
370547501Spendrythen the file will not be generated.  For each machine defined in the
370647501Spendryconfiguration files as having disks, an @file{exports} file is
370747501Spendryconstructed and given a filename determined by the name of the machine,
370847501Spendryprefixed with this string.  If a machine is defined as diskless, then no
370947501Spendry@file{exports} file will be created for it.  The files contain entries
371047501Spendryfor directories on the machine that may be exported to clients.
371147501Spendry
371247501SpendryExample: To create the @file{exports} files for each diskful machine
371347501Spendryand place them into the directory @file{exports}:
371447501Spendry
371547501Spendry@example
371647501Spendryfsinfo -e exports/ ...
371747501Spendry@end example
371847501Spendry
371947501Spendry@node -f FSinfo Option, -h FSinfo Option, -e FSinfo Option, FSinfo Command Line Options
372047501Spendry@comment  node-name,  next,  previous,  up
372147501Spendry@subsection @code{-f} @var{fstab}
372247501Spendry@cindex fstab, FSinfo prefix
372347501Spendry
372447501SpendryThis defines the prefix for the @file{fstab} files.  The files will only
372547501Spendrybe created if this prefix is defined.  For each machine defined in the
372647501Spendryconfiguration files, a @file{fstab} file is created with the filename
372747501Spendrydetermined by prefixing this string with the name of the machine.  These
372847501Spendryfiles contain entries for filesystems and partitions to mount at boot
372947501Spendrytime.
373047501Spendry
373147501SpendryExample, to create the files in the directory @file{fstabs}:
373247501Spendry
373347501Spendry@example
373447501Spendryfsinfo -f fstabs/ ...
373547501Spendry@end example
373647501Spendry
373747501Spendry@node -h FSinfo Option, -m FSinfo Option, -f FSinfo Option, FSinfo Command Line Options
373847501Spendry@comment  node-name,  next,  previous,  up
373947501Spendry@subsection @code{-h} @var{hostname}
374047501Spendry@cindex hostname, FSinfo command line option
374147501Spendry
374247501SpendryDefines the hostname of the destination machine to process for.  If this
374347501Spendryis not specified, it defaults to the local machine name, as returned by
374447501Spendry@b{gethostname}(2).
374547501Spendry
374647501SpendryExample:
374747501Spendry
374847501Spendry@example
374947501Spendryfsinfo -h dylan.doc.ic.ac.uk ...
375047501Spendry@end example
375147501Spendry
375247501Spendry@node -m FSinfo Option, -q FSinfo Option, -h FSinfo Option, FSinfo Command Line Options
375347501Spendry@comment  node-name,  next,  previous,  up
375447501Spendry@subsection @code{-m} @var{mount-maps}
375547501Spendry@cindex maps, FSinfo command line option
375647501Spendry
375747501SpendryDefines the prefix for the automounter files.  The maps will only be
375847501Spendryproduced if this prefix is defined.  The mount maps suitable for the
375947501Spendrynetwork defined by the configuration files will be placed into files
376047501Spendrywith names calculated by prefixing this string to the name of each map.
376147501Spendry
376247501SpendryFor example, to create the automounter maps and place them in the
376347501Spendrydirectory @file{automaps}:
376447501Spendry
376547501Spendry@example
376647501Spendryfsinfo -m automaps/ ...
376747501Spendry@end example
376847501Spendry
376947501Spendry@node -q FSinfo Option, -v FSinfo Option, -m FSinfo Option, FSinfo Command Line Options
377047501Spendry@comment  node-name,  next,  previous,  up
377147501Spendry@subsection @code{-q}
377247501Spendry@cindex quiet, FSinfo command line option
377347501Spendry
377447501SpendrySelects quiet mode.  @i{FSinfo} suppress the ``running commentary'' and
377547501Spendryonly outputs any error messages which are generated.
377647501Spendry
377747501Spendry@node -v FSinfo Option, -D-FSinfo Option, -q FSinfo Option, FSinfo Command Line Options
377847501Spendry@comment  node-name,  next,  previous,  up
377947501Spendry@subsection @code{-v}
378047501Spendry@cindex verbose, FSinfo command line option
378147501Spendry
378247501SpendrySelects verbose mode.  When this is activated, the program will display
378347501Spendrymore messages, and display all the information discovered when
378447501Spendryperforming the semantic analysis phase.  Each verbose message is output
378547501Spendryto @file{stdout} on a line starting with a @samp{#} character.
378647501Spendry
378747501Spendry@node -D-FSinfo Option, -I FSinfo Option, -v FSinfo Option, FSinfo Command Line Options
378847501Spendry@comment  node-name,  next,  previous,  up
378947501Spendry@subsection @code{-D} @var{name[=defn]}
379047501Spendry
379147501SpendryDefines a symbol @dfn{name} for the preprocessor when reading the
379247501Spendryconfiguration files.  Equivalent to @code{#define} directive.
379347501Spendry
379447501Spendry@node -I FSinfo Option, -U FSinfo Option, -D-FSinfo Option, FSinfo Command Line Options
379547501Spendry@comment  node-name,  next,  previous,  up
379647501Spendry@subsection @code{-I} @var{directory}
379747501Spendry
379847501SpendryThis option is passed into the preprocessor for the configuration files.
379947501SpendryIt specifies directories in which to find include files
380047501Spendry
380147501Spendry@node -U FSinfo Option, , -I FSinfo Option, FSinfo Command Line Options
380247501Spendry@comment  node-name,  next,  previous,  up
380347501Spendry@subsection @code{-U} @var{name}
380447501Spendry
380547501SpendryRemoves any initial definition of the symbol @dfn{name}.  Inverse of the
380647501Spendry@code{-D} option.
380747501Spendry
380847501Spendry@node FSinfo errors, , FSinfo command line options, FSinfo
380947501Spendry@comment  node-name,  next,  previous,  up
381047501Spendry@section Errors produced by @i{FSinfo}
381147501Spendry@cindex FSinfo error messages
381247501Spendry
381347501SpendryThe following table documents the errors and warnings which @i{FSinfo} may produce.
381447501Spendry
381547501Spendry@table @t
381647501Spendry
381747501Spendry@item can't open @var{filename} for writing
381847501SpendryOccurs if any errors are encountered when opening an output file.@refill
381947501Spendry
382047501Spendry@item unknown host attribute
382147501SpendryOccurs if an unrecognised keyword is used when defining a host.@refill
382247501Spendry
382347501Spendry@item unknown filesystem attribute
382447501SpendryOccurs if an unrecognised keyword is used when defining a host's
382547501Spendryfilesystems.@refill
382647501Spendry
382747501Spendry@item not allowed '/' in a directory name
382847501SpendryWhen reading the configuration input, if there is a filesystem
382947501Spendrydefinition which contains a pathname with multiple directories for any
383047501Spendrypart of the mountpoint element, and it is not a single absolute path,
383147501Spendrythen this message will be produced by the parser.@refill
383247501Spendry
383347501Spendry@item unknown directory attribute
383447501SpendryIf an unknown keyword is found while reading the definition of a hosts's
383547501Spendryfilesystem mount option.
383647501Spendry
383747501Spendry@item unknown mount attribute
383847501SpendryOccurs if an unrecognised keyword is found while parsing the list of
383947501Spendrystatic mounts.@refill
384047501Spendry
384147501Spendry@item " expected
384247501SpendryOccurs if an unescaped newline is found in a quoted string.
384347501Spendry
384447501Spendry@item unknown \ sequence
384547501SpendryOccurs if an unknown escape sequence is found inside a string.  Within a
384647501Spendrystring, you can give the standard C escape sequences for strings, such
384747501Spendryas newlines and tab characters.@refill
384847501Spendry
384947501Spendry@item @var{filename}: cannot open for reading
385047501SpendryIf a file specified on the command line as containing configuration data
385147501Spendrycould not be opened.@refill
385247501Spendry
385347501Spendry@item end of file within comment
385447501SpendryA comment was unterminated before the end of one of the configuration
385547501Spendryfiles.
385647501Spendry
385747501Spendry@item host field "@var{field-name}" already set
385847501SpendryIf duplicate definitions are given for any of the fields with a host
385947501Spendrydefinition.
386047501Spendry
386147501Spendry@item duplicate host @var{hostname}!
386247501SpendryIf a host has more than one definition.
386347501Spendry
386447501Spendry@item netif field @var{field-name} already set
386547501SpendryOccurs if you attempt to define an attribute of an interface more than
386647501Spendryonce.
386747501Spendry
386847501Spendry@item malformed IP dotted quad: @var{address}
386947501SpendryIf the Internet address of an interface is incorrectly specified.  An
387047501SpendryInternet address definition is handled to @b{inet_addr}(3N) to see if it
387147501Spendrycan cope.  If not, then this message will be displayed.
387247501Spendry
387347501Spendry@item malformed netmask: @var{netmask}
387447501SpendryIf the netmask cannot be decoded as though it were a hexadecimal number,
387547501Spendrythen this message will be displayed.  It will typically be caused by
387647501Spendryincorrect characters in the @var{netmask} value.@refill
387747501Spendry
387847501Spendry@item fs field "@var{field-name}" already set
387947501SpendryOccurs when multiple definitions are given for one of the attributes of a
388047501Spendryhost's filesystem.
388147501Spendry
388247501Spendry@item mount tree field "@var{field-name}" already set
388347501SpendryOccurs when the @var{field-name} is defined more than once during the
388447501Spendrydefinition of a filesystems mountpoint.
388547501Spendry
388647501Spendry@item mount field "@var{field-name}" already set
388747501SpendryOccurs when a static mount has multiple definitions of the same field.
388847501Spendry
388947501Spendry@item no disk mounts on @var{hostname}
389047501SpendryIf there are no static mounts, nor local disk mounts specified for a
389147501Spendrymachine, this message will be displayed.
389247501Spendry
389347501Spendry@item @var{host}:@var{device} needs field "@var{field-name}"
389447501SpendryOccurs when a filesystem is missing a required field. @var{field-name} could
389547501Spendrybe one of @code{fstype}, @code{opts}, @code{passno} or
389647501Spendry@code{mount}.@refill
389747501Spendry
389847501Spendry@item @var{filesystem} has a volname but no exportfs data
389947501SpendryOccurs when a volume name is declared for a file system, but the string
390047501Spendryspecifying what machines the filesystem can be exported to is
390147501Spendrymissing.
390247501Spendry
390347501Spendry@item sub-directory @var{directory} of @var{directory-tree} starts with '/'
390447501SpendryWithin the filesystem specification for a host, if an element
390547501Spendry@var{directory} of the mountpoint begins with a @samp{/} and it is not
390647501Spendrythe start of the tree.@refill
390747501Spendry
390847501Spendry@item @var{host}:@var{device} has no mount point
390947501SpendryOccurs if the @samp{mount} option is not specified for a host's
391047501Spendryfilesystem.@refill
391147501Spendry
391247501Spendry@item @var{host}:@var{device} has more than one mount point
391347501SpendryOccurs if the mount option for a host's filesystem specifies multiple
391447501Spendrytrees at which to place the mountpoint.@refill
391547501Spendry
391647501Spendry@item no volname given for @var{host}:@var{device}
391747501SpendryOccurs when a filesystem is defined to be mounted on @file{default}, but
391847501Spendryno volume name is given for the file system, then the mountpoint cannot
391947501Spendrybe determined.@refill
392047501Spendry
392147501Spendry@item @var{host}:mount field specified for swap partition
392247501SpendryOccurs if a mountpoint is given for a filesystem whose type is declared
392347501Spendryto be @code{swap}.@refill
392447501Spendry
392547501Spendry@item ambiguous mount: @var{volume} is a replicated filesystem
392647501SpendryIf several filesystems are declared as having the same volume name, they
392747501Spendrywill be considered replicated filesystems.  To mount a replicated
392847501Spendryfilesystem statically, a specific host will need to be named, to say
392947501Spendrywhich particular copy to try and mount, else this error will
393047501Spendryresult.@refill
393147501Spendry
393247501Spendry@item cannot determine localname since volname @var{volume} is not uniquely defined
393347501SpendryIf a volume is replicated and an attempt is made to mount the filesystem
393447501Spendrystatically without specifying a local mountpoint, @i{FSinfo} cannot
393547501Spendrycalculate a mountpoint, as the desired pathname would be
393647501Spendryambiguous.@refill
393747501Spendry
393847501Spendry@item volname @var{volume} is unknown
393947501SpendryOccurs if an attempt is made to mount or reference a volume name which
394047501Spendryhas not been declared during the host filesystem definitions.@refill
394147501Spendry
394247501Spendry@item volname @var{volume} not exported from @var{machine}
394347501SpendryOccurs if you attempt to mount the volume @var{volume} from a machine
394447501Spendrywhich has not declared itself to have such a filesystem
394547501Spendryavailable.@refill
394647501Spendry
394747501Spendry@item network booting requires both root and swap areas
394847501SpendryOccurs if a machine has mount declarations for either the root partition
394947501Spendryor the swap area, but not both.  You cannot define a machine to only
395047501Spendrypartially boot via the network.@refill
395147501Spendry
395247501Spendry@item unknown volname @var{volume} automounted @i{[} on <name> @i{]}
395347501SpendryOccurs if @var{volume} is used in a definition of an automount map but the volume
395447501Spendryname has not been declared during the host filesystem definitions.@refill
395547501Spendry
395647501Spendry@item not allowed '/' in a directory name
395747501SpendryOccurs when a pathname with multiple directory elements is specified as
395847501Spendrythe name for an automounter tree.  A tree should only have one name at
395947501Spendryeach level.
396047501Spendry
396147501Spendry@item @var{device} has duplicate exportfs data
396247501SpendryProduced if the @samp{exportfs} option is used multiple times within the
396347501Spendrysame branch of a filesytem definition. For example, if you attempt to
396447501Spendryset the @samp{exportfs} data at different levels of the mountpoint
396547501Spendrydirectory tree.@refill
396647501Spendry
396747501Spendry@item sub-directory of @var{directory-tree} is named "default"
396847501Spendry@samp{default} is a keyword used to specify if a mountpoint should be
396947501Spendryautomatically calculated by @i{FSinfo}.  If you attempt to specify a
397047501Spendrydirectory name as this, it will use the filename of @file{default} but
397147501Spendrywill produce this warning.@refill
397247501Spendry
397347501Spendry@item pass number for @var{host}:@var{device} is non-zero
397447501SpendryOccurs if @var{device} has its @samp{fstype} declared to be @samp{swap}
397547501Spendryor @samp{export} and the @b{fsck}(8) pass number is set. Swap devices should not be
397647501Spendryfsck'd.  @xref{FSinfo filesystems fstype}@refill
397747501Spendry
397847501Spendry@item dump frequency for @var{host}:@var{device} is non-zero
397947501SpendryOccurs if @var{device} has its @samp{fstype} declared to be @samp{swap}
398047501Spendryor @samp{export} and the @samp{dump} option is set to a value greater
398147501Spendrythan zero.  Swap devices should not be dumped.@refill
398247501Spendry
398347501Spendry@end table
398447501Spendry
398547501Spendry@node     Examples, Internals, FSinfo, Top
398647501Spendry@comment  node-name,  next,  previous,  up
398747501Spendry@chapter Examples
398847501Spendry
398947501Spendry@menu
399047501Spendry* User Filesystems::
399147501Spendry* Home Directories::
399247501Spendry* Architecture Sharing::
399347501Spendry* Wildcard names::
399447501Spendry* rwho servers::
399547501Spendry* /vol::
399647501Spendry@end menu
399747501Spendry
399852454Spendry@node     User Filesystems, Home Directories, Examples, Examples
399947501Spendry@comment  node-name,  next,  previous,  up
400047501Spendry@section User Filesystems
400147501Spendry@cindex User filesystems
400247501Spendry@cindex Mounting user filesystems
400347501Spendry
400447501SpendryWith more than one fileserver, the directories most frequently
400547501Spendrycross-mounted are those containing user home directories.  A common
400647501Spendryconvention used at Imperial College is to mount the user disks under
400747501Spendry@t{/home/}@i{machine}.
400847501Spendry
400947501SpendryTypically, the @samp{/etc/fstab} file contained a long list of entries
401047501Spendrysuch as:
401147501Spendry
401247501Spendry@example
401347501Spendry@i{machine}:/home/@i{machine} /home/@i{machine} nfs ...
401447501Spendry@end example
401547501Spendry
401647501Spendryfor each fileserver on the network.
401747501Spendry
401847501SpendryThere are numerous problems with this system.  The mount list can become
401947501Spendryquite large and some of the machines may be down when a system is
402047501Spendrybooted.  When a new fileserver is installed, @samp{/etc/fstab} must be
402147501Spendryupdated on every machine, the mount directory created and the filesystem
402247501Spendrymounted.
402347501Spendry
402447501SpendryIn many environments most people use the same few workstations, but
402547501Spendryit is convenient to go to a colleague's machine and access your own
402647501Spendryfiles.  When a server goes down, it can cause a process on a client
402747501Spendrymachine to hang.  By minimising the mounted filesystems to only include
402847501Spendrythose actively being used, there is less chance that a filesystem will
402947501Spendrybe mounted when a server goes down.
403047501Spendry
403147501SpendryThe following is a short extract from a map taken from a research fileserver
403247501Spendryat Imperial College.
403347501Spendry
403447501SpendryNote the entry for @samp{localhost} which is used for users such as
403547501Spendrythe operator (@samp{opr}) who have a home directory on most machine as
403647501Spendry@samp{/home/localhost/opr}.
403747501Spendry
403847501Spendry@example
403947501Spendry/defaults       opts:=rw,intr,grpid,nosuid
404047501Spendrycharm           host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \
404147501Spendry                host==$@{key@};type:=ufs;dev:=/dev/xd0g
404247501Spendry#
404347501Spendry...
404447501Spendry
404547501Spendry#
404647501Spendrylocalhost       type:=link;fs:=$@{host@}
404747501Spendry...
404847501Spendry#
404947501Spendry# dylan has two user disks so have a
405047501Spendry# top directory in which to mount them.
405147501Spendry#
405247501Spendrydylan           type:=auto;fs:=$@{map@};pref:=$@{key@}/
405347501Spendry#
405447501Spendrydylan/dk2       host!=dylan;type:=nfs;rhost:=dylan;rfs:=/home/$@{key@} \
405547501Spendry                host==dylan;type:=ufs;dev:=/dev/dsk/2s0
405647501Spendry#
405747501Spendrydylan/dk5       host!=dylan;type:=nfs;rhost:=dylan;rfs:=/home/$@{key@} \
405847501Spendry                host==dylan;type:=ufs;dev:=/dev/dsk/5s0
405947501Spendry...
406047501Spendry#
406147501Spendrytoytown         host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \
406247501Spendry                host==$@{key@};type:=ufs;dev:=/dev/xy1g
406347501Spendry...
406447501Spendry#
406547501Spendryzebedee         host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \
406647501Spendry                host==$@{key@};type:=ufs;dev:=/dev/dsk/1s0
406747501Spendry#
406847501Spendry# Just for access...
406947501Spendry#
407047501Spendrygould           type:=auto;fs:=$@{map@};pref:=$@{key@}/
407147501Spendrygould/staff     host!=gould;type:=nfs;rhost:=gould;rfs:=/home/$@{key@}
407247501Spendry#
407347501Spendrygummo           host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@}
407447501Spendry...
407547501Spendry@end example
407647501Spendry
407747501SpendryThis map is shared by most of the machines listed so on those
407847501Spendrysystems any of the user disks is accessible via a consistent name.
407947501Spendry@i{Amd} is started with the following command
408047501Spendry
408147501Spendry@example
408247501Spendryamd /home amd.home
408347501Spendry@end example
408447501Spendry
408547501SpendryNote that when mounting a remote filesystem, the @dfn{automounted}
408647501Spendrymount point is referenced, so that the filesystem will be mounted if
408747501Spendryit is not yet (at the time the remote @samp{mountd} obtains the file handle).
408847501Spendry
408947501Spendry@node     Home Directories, Architecture Sharing, User Filesystems, Examples
409047501Spendry@comment  node-name,  next,  previous,  up
409147501Spendry@section Home Directories
409247501Spendry@cindex Home directories
409347501Spendry@cindex Example of mounting home directories
409447501Spendry@cindex Mount home directories
409547501Spendry
409647501SpendryOne convention for home directories is to locate them in @samp{/homes}
409747501Spendryso user @samp{jsp}'s home directory is @samp{/homes/jsp}.  With more
409847501Spendrythan a single fileserver it is convenient to spread user files across
409947501Spendryseveral machines.  All that is required is a mount-map which converts
410047501Spendrylogin names to an automounted directory.
410147501Spendry
410247501SpendrySuch a map might be started by the command:
410347501Spendry
410447501Spendry@example
410547501Spendryamd /homes amd.homes
410647501Spendry@end example
410747501Spendry
410847501Spendrywhere the map @samp{amd.homes} contained the entries:
410947501Spendry
411047501Spendry@example
411147501Spendry/defaults   type:=link   # All the entries are of type:=link
411247501Spendryjsp         fs:=/home/charm/jsp
411347501Spendrynjw         fs:=/home/dylan/dk5/njw
411447501Spendry...
411547501Spendryphjk        fs:=/home/toytown/ai/phjk
411647501Spendrysjv         fs:=/home/ganymede/sjv
411747501Spendry@end example
411847501Spendry
411947501SpendryWhenever a login name is accessed in @samp{/homes} a symbolic link
412047501Spendryappears pointing to the real location of that user's home directory.  In
412147501Spendrythis example, @samp{/homes/jsp} would appear to be a symbolic link
412247501Spendrypointing to @samp{/home/charm/jsp}.  Of course, @samp{/home} would also
412347501Spendrybe an automount point.
412447501Spendry
412547501SpendryThis system causes an extra level of symbolic links to be used.
412647501SpendryAlthough that turns out to be relatively inexpensive, an alternative is
412747501Spendryto directly mount the required filesystems in the @samp{/homes}
412847501Spendrymap.  The required map is simple, but long, and its creation is best automated.
412947501SpendryThe entry for @samp{jsp} could be:
413047501Spendry
413147501Spendry@example
413247501Spendryjsp   -sublink:=$@{key@};rfs:=/home/charm \
413347501Spendry               host==charm;type:=ufs;dev:=/dev/xd0g \
413447501Spendry               host!=charm;type:=nfs;rhost:=charm
413547501Spendry@end example
413647501Spendry
413747501SpendryThis map can become quite big if it contains a large number of entries.
413847501SpendryBy combining two other features of @i{Amd} it can be greatly simplified.
413947501Spendry
414047501SpendryFirst the UFS partitions should be mounted under the control of
414147501Spendry@samp{/etc/fstab}, taking care that they are mounted in the same place
414247501Spendrythat @i{Amd} would have automounted them.  In most cases this would be
414347501Spendrysomething like @samp{/a/@dfn{host}/home/@dfn{host}} and
414447501Spendry@samp{/etc/fstab} on host @samp{charm} would have a line:@refill
414547501Spendry
414647501Spendry@example
414747501Spendry/dev/xy0g /a/charm/home/charm 4.2 rw,nosuid,grpid 1 5
414847501Spendry@end example
414947501Spendry
415047501SpendryThe map can then be changed to:
415147501Spendry
415247501Spendry@example
415347501Spendry/defaults    type:=nfs;sublink:=$@{key@};opts:=rw,intr,nosuid,grpid
415447501Spendryjsp          rhost:=charm;rfs:=/home/charm
415547501Spendrynjw          rhost:=dylan;rfs:=/home/dylan/dk5
415647501Spendry...
415747501Spendryphjk         rhost:=toytown;rfs:=/home/toytown;sublink:=ai/$@{key@}
415847501Spendrysjv          rhost:=ganymede;rfs:=/home/ganymede
415947501Spendry@end example
416047501Spendry
416147501SpendryThis map operates as usual on a remote machine (@i{ie} @code{$@{host@}}
416247501Spendrynot equal to @code{$@{rhost@}}).  On the machine where the filesystem is
416347501Spendrystored (@i{ie} @code{$@{host@}} equal to @code{$@{rhost@}}), @i{Amd}
416447501Spendrywill construct a local filesystem mount point which corresponds to the
416547501Spendryname of the locally mounted UFS partition.  If @i{Amd} is started with
416647501Spendrythe ``-r'' option then instead of attempting an NFS mount, @i{Amd} will
416747501Spendrysimply inherit the UFS mount (@pxref{Inheritance Filesystem}).  If
416847501Spendry``-r'' is not used then a loopback NFS mount will be made.  This type of
416947501Spendrymount is known to cause a deadlock on many systems.
417047501Spendry
417147501Spendry@node     Architecture Sharing, Wildcard Names, Home Directories, Examples
417247501Spendry@comment  node-name,  next,  previous,  up
417347501Spendry@section Architecture Sharing
417447501Spendry@cindex Architecture sharing
417547501Spendry@cindex Sharing a fileserver between architectures
417647501Spendry@cindex Architecture dependent volumes
417747501Spendry
417847501Spendry@c %At the moment some of the research machines have sets of software
417947501Spendry@c %mounted in @samp{/vol}.  This contains subdirectories for \TeX,
418047501Spendry@c %system sources, local sources, prolog libraries and so on.
418147501SpendryOften a filesystem will be shared by machines of different architectures.
418247501SpendrySeparate trees can be maintained for the executable images for each
418347501Spendryarchitecture, but it may be more convenient to have a shared tree,
418447501Spendrywith distinct subdirectories.
418547501Spendry
418647501SpendryA shared tree might have the following structure on the fileserver (called
418747501Spendry@samp{fserver} in the example):
418847501Spendry
418947501Spendry@example
419047501Spendrylocal/tex
419147501Spendrylocal/tex/fonts
419247501Spendrylocal/tex/lib
419347501Spendrylocal/tex/bin
419447501Spendrylocal/tex/bin/sun3
419547501Spendrylocal/tex/bin/sun4
419647501Spendrylocal/tex/bin/hp9000
419747501Spendry...
419847501Spendry@end example
419947501Spendry
420047501SpendryIn this example, the subdirectories of @samp{local/tex/bin} should be
420147501Spendryhidden when accessed via the automount point (conventionally @samp{/vol}).
420247501SpendryA mount-map for @samp{/vol} to achieve this would look like:
420347501Spendry
420447501Spendry@example
420549684Spendry/defaults   sublink:=$@{/key@};rhost:=fserver;type:=link
420647501Spendrytex         type:=auto;fs:=$@{map@};pref:=$@{key@}/
420749684Spendrytex/fonts   host!=fserver;type:=nfs;rfs:=/vol/tex \
420849684Spendry            host==fserver;fs:=/usr/local/tex
420949684Spendrytex/lib     host!=fserver;type:=nfs;rfs:=/vol/tex \
421049684Spendry            host==fserver;fs:=/usr/local/tex
421149684Spendrytex/bin     -sublink:=$@{/key@}/$@{arch@} host!=fserver;type:=nfs;rfs:=/vol/tex \
421249684Spendry            host:=fserver;fs:=/usr/local/tex
421347501Spendry@end example
421447501Spendry
421547501SpendryWhen @samp{/vol/tex/bin} is referenced, the current machine architecture
421647501Spendryis automatically appended to the path by the @code{$@{sublink@}}
421747501Spendryvariable.  This means that users can have @samp{/vol/tex/bin} in their
421847501Spendry@samp{PATH} without concern for architecture dependencies.
421947501Spendry
422047501Spendry@node     Wildcard Names, rwho servers, Architecture Sharing, Examples
422147501Spendry@comment  node-name,  next,  previous,  up
422247501Spendry@section Wildcard names & Replicated Servers
422347501Spendry
422447501SpendryBy using the wildcard facility, @i{Amd} can @dfn{overlay} an existing
422547501Spendrydirectory with additional entries.
422647501SpendryThe system files are usually mounted under @samp{/usr}.  If instead
422747501Spendry@i{Amd} is mounted on @samp{/usr}, additional
422847501Spendrynames can be overlayed to augment or replace names in the ``master'' @samp{/usr}.
422947501SpendryA map to do this would have the form:
423047501Spendry
423147501Spendry@example
423247501Spendrylocal  type:=auto;fs:=local-map
423347501Spendryshare  type:=auto;fs:=share-map
423447501Spendry*      -type:=nfs;rfs:=/export/exec/$@{arch@};sublink:="$@{key@}" \
423547501Spendry        rhost:=fserv1  rhost:=fserv2  rhost:=fserv3
423647501Spendry@end example
423747501Spendry
423847501SpendryNote that the assignment to @code{$@{sublink@}} is surrounded by double
423947501Spendryquotes to prevent the incoming key from causing the map to be
424047501Spendrymisinterpreted.  This map has the effect of directing any access to
424147501Spendry@samp{/usr/local} or @samp{/usr/share} to another automount point.
424247501Spendry
424347501SpendryIn this example, it is assumed that the @samp{/usr} files are replicated
424447501Spendryon three fileservers: @samp{fserv1}, @samp{fserv2} and @samp{fserv3}.
424547501SpendryFor any references other than to @samp{local} and @samp{share} one of
424647501Spendrythe servers is used and a symbolic link to
424747501Spendry@t{$@{autodir@}/$@{rhost@}/export/exec/$@{arch@}/@i{whatever}} is
424847501Spendryreturned once an appropriate filesystem has been mounted.@refill
424947501Spendry
425047501Spendry@node     rwho servers, /vol, Wildcard Names, Examples
425147501Spendry@comment  node-name,  next,  previous,  up
425247501Spendry@section @samp{rwho} servers
425347501Spendry@cindex rwho servers
425447501Spendry@cindex Architecture specific mounts
425547501Spendry@cindex Example of architecture specific mounts
425647501Spendry
425747501SpendryThe @samp{/usr/spool/rwho} directory is a good candidate for automounting.
425847501SpendryFor efficiency reasons it is best to capture the rwho data on a small
425947501Spendrynumber of machines and then mount that information onto a large number
426047501Spendryof clients.  The data written into the rwho files is byte order dependent
426147501Spendryso only servers with the correct byte ordering can be used by a client:
426247501Spendry
426347501Spendry@example
426447501Spendry/defaults         type:=nfs
426547501Spendryusr/spool/rwho    -byte==little;rfs:=/usr/spool/rwho \
426647501Spendry                      rhost:=vaxA  rhost:=vaxB \
426747501Spendry                  || -rfs:=/usr/spool/rwho \
426847501Spendry                      rhost:=sun4  rhost:=hp300
426947501Spendry@end example
427047501Spendry
427147501Spendry@node     /vol, , rwho servers, Examples
427247501Spendry@comment  node-name,  next,  previous,  up
427347501Spendry@section @samp{/vol}
427447501Spendry@cindex /vol
427547501Spendry@cindex Catch-all mount point
427647501Spendry@cindex Generic volume name
427747501Spendry
427847501Spendry@samp{/vol} is used as a catch-all for volumes which do not have other
427947501Spendryconventional names.
428047501Spendry
428147501SpendryBelow is part of the @samp{/vol} map for the domain @samp{doc.ic.ac.uk}.
428247501SpendryThe @samp{r+d} tree is used for new or experimental software that needs
428347501Spendryto be available everywhere without installing it on all the fileservers.
428447501SpendryUsers wishing to try out the new software then simply include
428552454Spendry@samp{/vol/r+d/@{bin,ucb@}} in their path.@refill
428647501Spendry
428747501SpendryThe main tree resides on one host @samp{gould.doc.ic.ac.uk}, which has
428847501Spendrydifferent @samp{bin}, @samp{etc}, @samp{lib} and @samp{ucb}
428947501Spendrysub-directories for each machine architecture.  For example,
429047501Spendry@samp{/vol/r+d/bin} for a Sun-4 would be stored in the sub-directory
429147501Spendry@samp{bin/sun4} of the filesystem @samp{/usr/r+d}.  When it was accessed
429247501Spendrya symbolic link pointing to @samp{/a/gould/usr/r+d/bin/sun4} would be
429347501Spendryreturned.@refill
429447501Spendry
429547501Spendry@example
429647501Spendry/defaults    type:=nfs;opts:=rw,grpid,nosuid,intr,soft
429747501Spendrywp           -opts:=rw,grpid,nosuid;rhost:=charm \
429847501Spendry             host==charm;type:=link;fs:=/usr/local/wp \
429947501Spendry             host!=charm;type:=nfs;rfs:=/vol/wp
430047501Spendry...
430147501Spendry#
430247501Spendrysrc          -opts:=rw,grpid,nosuid;rhost:=charm \
430347501Spendry             host==charm;type:=link;fs:=/usr/src \
430447501Spendry             host!=charm;type:=nfs;rfs:=/vol/src
430547501Spendry#
430647501Spendryr+d          type:=auto;fs:=$@{map@};pref:=r+d/
430747501Spendry# per architecture bin,etc,lib&ucb...
430847501Spendryr+d/bin      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
430947501Spendryr+d/etc      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
431047501Spendryr+d/include  rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}
431147501Spendryr+d/lib      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
431247501Spendryr+d/man      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}
431347501Spendryr+d/src      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}
431447501Spendryr+d/ucb      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
431547501Spendry# hades pictures
431647501Spendrypictures     -opts:=rw,grpid,nosuid;rhost:=thpfs \
431747501Spendry             host==thpfs;type:=link;fs:=/nbsd/pictures \
431847501Spendry             host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=pictures
431947501Spendry# hades tools
432047501Spendryhades        -opts:=rw,grpid,nosuid;rhost:=thpfs \
432147501Spendry             host==thpfs;type:=link;fs:=/nbsd/hades \
432247501Spendry             host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=hades
432347501Spendry# bsd tools for hp.
432447501Spendrybsd          -opts:=rw,grpid,nosuid;arch==hp9000;rhost:=thpfs \
432547501Spendry             host==thpfs;type:=link;fs:=/nbsd/bsd \
432647501Spendry             host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=bsd
432747501Spendry@end example
432847501Spendry
432947501Spendry@node     Internals, Acknowledgements & Trademarks, Examples, Top
433047501Spendry@comment  node-name,  next,  previous,  up
433147501Spendry@chapter Internals
433247501Spendry
433347501Spendry@menu
433447501Spendry* Log Messages::
433547501Spendry@end menu
433647501Spendry
433747501Spendry@node     Log Messages, , Internals, Internals
433847501Spendry@comment  node-name,  next,  previous,  up
433947501Spendry@section Log Messages
434047501Spendry
434147501SpendryIn the following sections a brief explanation is given of some of the
434247501Spendrylog messages made by @i{Amd}.  Where the message is in @samp{typewriter}
434347501Spendryfont, it corresponds exactly to the message produced by @i{Amd}.  Words
434447501Spendryin @dfn{italic} are replaced by an appropriate string.  Variables,
434547501Spendry@code{$@{var@}}, indicate that the value of the appropriate variable is
434647501Spendryoutput.
434747501Spendry
434847501SpendryLog messages are either sent direct to a file,
434947501Spendryor logged via the @b{syslog}(3) mechanism.
435047501SpendryMessages are logged with facility @samp{LOG_DAEMON} when using @b{syslog}(3).
435147501SpendryIn either case, entries in the file are of the form:
435247501Spendry@example
435347501Spendry@i{date-string}  @i{hostname} @t{amd[}@i{pid}@t{]}  @i{message}
435447501Spendry@end example
435547501Spendry
435647501Spendry@menu
435747501Spendry* Fatal errors::
435847501Spendry* Info messages::
435947501Spendry@end menu
436047501Spendry
436147501Spendry@node     Fatal errors, Info messages, Log Messages, Log Messages
436247501Spendry@comment  node-name,  next,  previous,  up
436347501Spendry@subsection Fatal errors
436447501Spendry
436547501Spendry@i{Amd} attempts to deal with unusual events.  Whenever it is not
436647501Spendrypossible to deal with such an error, @i{Amd} will log an appropriate
436747501Spendrymessage and, if it cannot possibly continue, will either exit or abort.
436847501SpendryThese messages are selected by @samp{-x fatal} on the command line.
436947501SpendryWhen @b{syslog}(3) is being used, they are logged with level
437047501Spendry@samp{LOG_FATAL}.  Even if @i{Amd} continues to operate it is likely to
437147501Spendryremain in a precarious state and should be restarted at the earliest
437247501Spendryopportunity.
437347501Spendry
437447501Spendry@table @asis
437547501Spendry@item @t{Attempting to inherit not-a-filesystem}
437647501SpendryThe prototype mount point created during a filesystem restart did not
437747501Spendrycontain a reference to the restarted filesystem.  This erorr ``should
437847501Spendrynever happen''.
437947501Spendry
438047501Spendry@item @t{Can't bind to domain "@i{NIS-domain}"}
438147501SpendryA specific NIS domain was requested on the command line, but no server
438247501Spendryfor that domain is available on the local net.
438347501Spendry
438447501Spendry@item @t{Can't determine IP address of this host (@i{hostname})}
438547501SpendryWhen @i{Amd} starts it determines its own IP address.  If this lookup
438647501Spendryfails then @i{Amd} cannot continue.  The hostname it looks up is that
438747501Spendryobtained returned by @b{gethostname}(2) system call.
438847501Spendry
438947501Spendry@item @t{Can't find root file handle for @i{automount point}}
439047501Spendry@i{Amd} creates its own file handles for the automount points.  When it
439147501Spendrymounts itself as a server, it must pass these file handles to the local
439247501Spendrykernel.  If the filehandle is not obtainable the mount point is ignored.
439347501SpendryThis error ``should never happen''.
439447501Spendry
439547501Spendry@item @t{Must be root to mount filesystems (euid = @i{euid})}
439647501SpendryTo prevent embarrassment, @i{Amd} makes sure it has appropriate system
439747501Spendryprivileges.  This amounts to having an euid of 0.  The check is made
439847501Spendryafter argument processing complete to give non-root users a chance to
439947501Spendryaccess the ``-v'' option.
440047501Spendry
440147501Spendry@item @t{No work to do - quitting}
440247501SpendryNo automount points were given on the command line and so there is no
440347501Spendrywork to do.
440447501Spendry
440547501Spendry@item @t{Out of memory in realloc}
440647501SpendryWhile attempting to realloc some memory, the memory space available to
440747501Spendry@i{Amd} was exhausted.  This is an unrecoverable error.
440847501Spendry
440947501Spendry@item @t{Out of memory}
441047501SpendryWhile attempting to malloc some memory, the memory space available to
441147501Spendry@i{Amd} was exhausted.  This is an unrecoverable error.
441247501Spendry
441347501Spendry@item @t{cannot create rpc/udp service}
441447501SpendryEither the NFS or AMQ endpoint could not be created.
441547501Spendry
441647501Spendry@item @t{gethostname:} @i{description}
441747501SpendryThe @b{gethostname}(2) system call failed during startup.
441847501Spendry
441947501Spendry@item @t{host name is not set}
442047501SpendryThe @b{gethostname}(2) system call returned a zero length host name.
442147501SpendryThis can happen if @i{Amd} is started in single user mode just after
442247501Spendrybooting the system.
442347501Spendry
442447501Spendry@item @t{ifs_match called!}
442547501SpendryAn internal error occurred while restarting a pre-mounted filesystem.
442647501SpendryThis error ``should never happen''.
442747501Spendry
442847501Spendry@item @t{mount_afs:} @i{description}
442947501SpendryAn error occured while @i{Amd} was mounting itself.
443047501Spendry
443147501Spendry@item @t{run_rpc failed}
443247501SpendrySomehow the main NFS server loop failed.  This error ``should never
443347501Spendryhappen''.
443447501Spendry
443547501Spendry@item @t{unable to free rpc arguments in amqprog_1}
443647501SpendryThe incoming arguments to the AMQ server could not be free'ed.
443747501Spendry
443847501Spendry@item @t{unable to free rpc arguments in nfs_program_1}
443947501SpendryThe incoming arguments to the NFS server could not be free'ed.
444047501Spendry
444147501Spendry@item @t{unable to register (AMQ_PROGRAM, AMQ_VERSION, udp)}
444247501SpendryThe AMQ server could not be registered with the local portmapper or the
444347501Spendryinternal RPC dispatcher.
444447501Spendry
444547501Spendry@item @t{unable to register (NFS_PROGRAM, NFS_VERSION, 0)}
444647501SpendryThe NFS server could not be registered with the internal RPC dispatcher.
444747501Spendry
444847501Spendry@end table
444947501Spendry
445047501Spendry@node     Info messages, , Fatal errors, Log Messages
445147501Spendry@comment  node-name,  next,  previous,  up
445247501Spendry@subsection Info messages
445347501Spendry
445447501Spendry@i{Amd} generates information messages to record state changes.  These
445547501Spendrymessages are selected by @samp{-x info} on the command line.  When
445647501Spendry@b{syslog}(3) is being used, they are logged with level @samp{LOG_INFO}.
445747501Spendry
445847501SpendryThe messages listed below can be generated and are in a format suitable
445947501Spendryfor simple statistical analysis.  @dfn{mount-info} is the string
446047501Spendrythat is displayed by @dfn{Amq} in its mount information column and
446147501Spendryplaced in the system mount table.
446247501Spendry
446347501Spendry@table @asis
446447501Spendry@item @t{mount of "@t{$@{@i{path}@}}" on @t{$@{@i{fs}@}} timed out}
446547501SpendryAttempts to mount a filesystem for the given automount point have failed
446647501Spendryto complete within 30 seconds.
446747501Spendry
446847501Spendry@item @t{"@t{$@{@i{path}@}}" forcibly timed out}
446947501SpendryAn automount point has been timed out by the @i{Amq} command.
447047501Spendry
447147501Spendry@item @t{restarting @i{mount-info} on @t{$@{@i{fs}@}}}
447247501SpendryA pre-mounted file system has been noted.
447347501Spendry
447447501Spendry@item @t{"@t{$@{@i{path}@}}" has timed out}
447547501SpendryNo access to the automount point has been made within the timeout
447647501Spendryperiod.
447747501Spendry
447847501Spendry@item @t{file server @t{$@{@i{rhost}@}} is down - timeout of "@t{$@{@i{path}@}}" ignored}
447947501SpendryAn automount point has timed out, but the corresponding file server is
448047501Spendryknown to be down.  This message is only produced once for each mount
448147501Spendrypoint for which the server is down.
448247501Spendry
448347501Spendry@item @t{Re-synchronizing cache for map @t{$@{@i{map}@}}}
448447501SpendryThe named map has been modified and the internal cache is being re-synchronized.
448547501Spendry
448647501Spendry@item @t{Filehandle denied for "@t{$@{@i{rhost}@}}:@t{$@{@i{rfs}@}}"}
448747501SpendryThe mount daemon refused to return a file handle for the requested filesystem.
448847501Spendry
448947501Spendry@item @t{Filehandle error for "$@{@i{rhost}@}:$@{@i{rfs}@}":} @i{description}
449047501SpendryThe mount daemon gave some other error for the requested filesystem.
449147501Spendry
449247501Spendry@item @t{file server @t{$@{@i{rhost}@}} type nfs starts up}
449347501SpendryA new NFS file server has been referenced and is known to be up.
449447501Spendry
449547501Spendry@item @t{file server @t{$@{@i{rhost}@}} type nfs starts down}
449647501SpendryA new NFS file server has been referenced and is known to be down.
449747501Spendry
449847501Spendry@item @t{file server @t{$@{@i{rhost}@}} type nfs is up}
449947501SpendryAn NFS file server that was previously down is now up.
450047501Spendry
450147501Spendry@item @t{file server @t{$@{@i{rhost}@}} type nfs is down}
450247501SpendryAn NFS file server that was previously up is now down.
450347501Spendry
450447501Spendry@item @t{Finishing with status @i{exit-status}}
450547501Spendry@i{Amd} is about to exit with the given exit status.
450647501Spendry
450747501Spendry@item @t{@i{mount-info} mounted fstype @t{$@{@i{type}@}} on @t{$@{@i{fs}@}}}
450847501SpendryA new file system has been mounted.
450947501Spendry
451047501Spendry@item @t{@i{mount-info} restarted fstype @t{$@{@i{type}@}} on @t{$@{@i{fs}@}}}
451147501Spendry@i{Amd} is using a pre-mounted filesystem to satisfy a mount request.
451247501Spendry
451347501Spendry@item @t{@i{mount-info} unmounted fstype @t{$@{@i{type}@}} from @t{$@{@i{fs}@}}}
451447501SpendryA file system has been unmounted.
451547501Spendry
451647501Spendry@item @t{@i{mount-info} unmounted fstype @t{$@{@i{type}@}} from @t{$@{@i{fs}@}} link @t{$@{@i{fs}@}}/@t{$@{@i{sublink}@}}}
451747501SpendryA file system of which only a sub-directory was in use has been unmounted.
451847501Spendry
451947501Spendry@end table
452047501Spendry
452147501Spendry@node     Acknowledgements & Trademarks, Index, Internals, Top
452247501Spendry@comment  node-name,  next,  previous,  up
452347501Spendry@unnumbered Acknowledgements & Trademarks
452447501Spendry
452547501SpendryThanks to the Formal Methods Group at Imperial College for
452647501Spendrysuffering patiently while @i{Amd} was being developed on their machines.
452747501Spendry
452847501SpendryThanks to the many people who have helped with the development of
452947501Spendry@i{Amd}, especially Piete Brooks at the Cambridge University Computing
453047501SpendryLab for many hours of testing, experimentation and discussion.
453147501Spendry
453247501Spendry@itemize @bullet
453347501Spendry@item
453447501Spendry@b{DEC}, @b{VAX} and @b{Ultrix} are registered trademarks of Digital
453547501SpendryEquipment Corporation.
453647501Spendry@item
453747501Spendry@b{AIX} and @b{IBM} are registered trademarks of International Business
453847501SpendryMachines Corporation.
453947501Spendry@item
454047501Spendry@b{Sun}, @b{NFS} and @b{SunOS} are registered trademarks of Sun
454147501SpendryMicrosystems, Inc.
454247501Spendry@item
454352454Spendry@b{Unix} is a registered trademark of AT&T Unix Systems Laboratories
454452454Spendryin the USA and other countries.
454547501Spendry@end itemize
454647501Spendry
454752454Spendry@node Index, Intro, Acknowledgements & Trademarks, Top
454852454Spendry@comment  node-name,  next,  previous,  up
454947501Spendry@unnumbered Index
455047501Spendry
455147501Spendry@printindex cp
455247501Spendry
455347501Spendry@contents
455447501Spendry@bye
4555