1*47501Spendry\input texinfo		@c -*-texinfo-*-
2*47501Spendry@c
3*47501Spendry@c $Id: amdref.texinfo,v 5.2.1.4 91/03/03 20:15:58 jsp Alpha Locker: jsp $
4*47501Spendry@c
5*47501Spendry@c Copyright (c) 1989 Jan-Simon Pendry
6*47501Spendry@c Copyright (c) 1989 Imperial College of Science, Technology & Medicine
7*47501Spendry@c Copyright (c) 1989 The Regents of the University of California.
8*47501Spendry@c All rights reserved.
9*47501Spendry@c
10*47501Spendry@c This code is derived from software contributed to Berkeley by
11*47501Spendry@c Jan-Simon Pendry at Imperial College, London.
12*47501Spendry@c
13*47501Spendry@c Redistribution and use in source and binary forms are permitted provided
14*47501Spendry@c that: (1) source distributions retain this entire copyright notice and
15*47501Spendry@c comment, and (2) distributions including binaries display the following
16*47501Spendry@c acknowledgement:  ``This product includes software developed by the
17*47501Spendry@c University of California, Berkeley and its contributors'' in the
18*47501Spendry@c documentation or other materials provided with the distribution and in
19*47501Spendry@c all advertising materials mentioning features or use of this software.
20*47501Spendry@c Neither the name of the University nor the names of its contributors may
21*47501Spendry@c be used to endorse or promote products derived from this software without
22*47501Spendry@c specific prior written permission.
23*47501Spendry@c THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
24*47501Spendry@c WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
25*47501Spendry@c MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
26*47501Spendry@c
27*47501Spendry@c	@(#)amdref.texinfo	1.1 (Berkeley) 03/17/91
28*47501Spendry@c
29*47501Spendry@c
30*47501Spendry@c @setfilename ../info/amd
31*47501Spendry@setfilename /usr/local/emacs/info/amd
32*47501Spendry@c @smallbook
33*47501Spendry@tex
34*47501Spendry\overfullrule=0pt
35*47501Spendry@end tex
36*47501Spendry
37*47501Spendry@settitle 4.4 BSD Automounter Reference Manual
38*47501Spendry@c
39*47501Spendry@titlepage
40*47501Spendry@sp 6
41*47501Spendry@center @titlefont{Amd}
42*47501Spendry@sp 2
43*47501Spendry@center @titlefont{The 4.4 BSD Automounter}
44*47501Spendry@sp 2
45*47501Spendry@center @titlefont{Reference Manual}
46*47501Spendry@sp 2
47*47501Spendry@center @authorfont{Jan-Simon Pendry}
48*47501Spendry@sp
49*47501Spendry@center @i{and}
50*47501Spendry@sp
51*47501Spendry@center @authorfont{Nick Williams}
52*47501Spendry@sp 4
53*47501Spendry@center Last updated March 1991
54*47501Spendry@center Documentation for software revision 5.3 Alpha
55*47501Spendry@page
56*47501Spendry@c
57*47501SpendryCopyright @copyright{} 1989 Jan-Simon Pendry
58*47501Spendry@sp -1
59*47501SpendryCopyright @copyright{} 1989 Imperial College of Science, Technology & Medicine
60*47501Spendry@sp -1
61*47501SpendryCopyright @copyright{} 1989 The Regents of the University of California.
62*47501Spendry@sp 0
63*47501SpendryAll Rights Reserved.
64*47501Spendry@vskip 1ex
65*47501SpendryPermission to copy this document, or any portion of it, as
66*47501Spendrynecessary for use of this software is granted provided this
67*47501Spendrycopyright notice and statement of permission are included.
68*47501Spendry@end titlepage
69*47501Spendry@page
70*47501Spendry@ifinfo
71*47501Spendry@node Top, License, , (DIR)
72*47501Spendry
73*47501SpendryAmd - The 4.4 BSD Automounter
74*47501Spendry*****************************
75*47501Spendry
76*47501SpendryAmd is the 4.4 BSD Automounter.  This Info file describes how
77*47501Spendryto use and understand Amd.
78*47501Spendry@end ifinfo
79*47501Spendry
80*47501Spendry@menu
81*47501Spendry* License::                  Explains the terms and conditions for using
82*47501Spendry                             and distributing Amd.
83*47501Spendry* Distrib::                  How to get the latest Amd distribution.
84*47501Spendry* Overview::                 An introduction to Automounting concepts.
85*47501Spendry* Supported Platforms::      Machines and Systems supported by Amd.
86*47501Spendry* Mount Maps::               Details of mount maps
87*47501Spendry* Amd Command Line Options:: All the Amd command line options explained.
88*47501Spendry* Filesystem Types::         The different mount types supported by Amd.
89*47501Spendry* Run-time Administration::  How to start, stop and control Amd.
90*47501Spendry* FSinfo::                   The FSinfo filesystem management tool.
91*47501Spendry* Examples::                 Some examples showing how Amd might be used.
92*47501Spendry
93*47501SpendryIndexes
94*47501Spendry* Index::                    An item for each concept.
95*47501Spendry@end menu
96*47501Spendry
97*47501Spendry@iftex
98*47501Spendry@unnumbered Preface
99*47501Spendry
100*47501SpendryThis manual documents the use of the 4.4 BSD automounter---@i{Amd}.
101*47501SpendryThis is primarily a reference manual.  Unfortunately, no tutorial
102*47501Spendryexists.
103*47501Spendry
104*47501SpendryThis manual comes in two forms: the published form and the Info form.
105*47501SpendryThe Info form is for on-line perusal with the INFO program which is
106*47501Spendrydistributed along with GNU Emacs.  Both forms contain substantially the
107*47501Spendrysame text and are generated from a common source file, which is
108*47501Spendrydistributed with the @i{Amd} source.
109*47501Spendry@end iftex
110*47501Spendry
111*47501Spendry@node License, Distrib, Top, Top
112*47501Spendry@unnumbered License
113*47501Spendry@cindex License Information
114*47501Spendry
115*47501Spendry@i{Amd} is not in the public domain; it is copyrighted and there are
116*47501Spendryrestrictions on its distribution.
117*47501Spendry
118*47501SpendryRedistribution and use in source and binary forms are permitted provided
119*47501Spendrythat: (1) source distributions  retain this entire  copyright notice and
120*47501Spendrycomment, and (2) distributions including  binaries display the following
121*47501Spendryacknowledgement: ``This product  includes  software  developed  by   The
122*47501SpendryUniversity  of California,   Berkeley  and its  Contributors''  in   the
123*47501Spendrydocumentation  or other materials provided with  the distribution and in
124*47501Spendryall advertising materials mentioning  features  or use of this software.
125*47501Spendryneither the name of the University nor the names of its Contributors may
126*47501Spendrybe  used   to endorse or promote   products  derived from  this software
127*47501Spendrywithout specific prior written permission.
128*47501Spendry
129*47501SpendryTHIS SOFTWARE IS  PROVIDED ``AS IS''  AND WITHOUT ANY EXPRESS OR IMPLIED
130*47501SpendryWARRANTIES, INCLUDING,  WITHOUT  LIMITATION,  THE IMPLIED  WARRANTIES OF
131*47501SpendryMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
132*47501Spendry
133*47501Spendry@node Distrib, Overview, License, Top
134*47501Spendry@unnumbered Source Distribution
135*47501Spendry@cindex Source code distribution
136*47501Spendry@cindex Obtaining the source code
137*47501Spendry
138*47501SpendryIf you have access to the Internet, you can get the latest distribution
139*47501Spendryversion of @i{Amd} from host @file{usc.edu} using anonymous FTP.  Move to
140*47501Spendrythe directory @file{/pub/amd} on that host and fetch the file @file{amd.tar.Z}.
141*47501Spendry
142*47501SpendryIf you are in the UK, you can get the latest distribution version of
143*47501Spendry@i{Amd} from the UKnet info-server.  Start by sending email to
144*47501Spendry@file{info-server@@doc.ic.ac.uk}.
145*47501Spendry
146*47501SpendrySites on the UK JANET network can get the latest distribution by using
147*47501Spendryanonymous NIFTP to fetch the file @samp{<AMD>amd.tar.Z} from host
148*47501Spendry@samp{uk.ac.imperial.doc.src}.
149*47501Spendry
150*47501SpendryRevision 5.2 was part of the 4.3 BSD Reno distribution.
151*47501Spendry
152*47501Spendry@unnumberedsec Bug Reports
153*47501Spendry@cindex Bug reports
154*47501Spendry
155*47501SpendrySend all bug reports to @file{jsp@@doc.ic.ac.uk} quoting the details of
156*47501Spendrythe release and your configuration.  These can be obtained by running
157*47501Spendrythe command @samp{amd -v}.
158*47501Spendry
159*47501Spendry@unnumberedsec Mailing List
160*47501Spendry@cindex Mailing list
161*47501Spendry
162*47501SpendryThere is a mailing list for people interested in keeping uptodate with
163*47501Spendrydevelopments.  To subscribe, send a note to @file{amd-workers-request@@acl.lanl.gov}.
164*47501Spendry
165*47501Spendry@node Intro, Index, Distrib, Top
166*47501Spendry@unnumbered Introduction
167*47501Spendry@cindex Introduction
168*47501Spendry
169*47501SpendryAn @dfn{automounter} maintains a cache of mounted filesystems.
170*47501SpendryFilesystems are mounted on demand when they are first referenced,
171*47501Spendryand unmounted after a period of inactivity.
172*47501Spendry
173*47501Spendry@i{Amd} may be used as a replacement for Sun's automounter.  The choice
174*47501Spendryof which filesystem to mount can be controlled dynamically with
175*47501Spendry@dfn{selectors}.  Selectors allow decisions of the form ``hostname is
176*47501Spendry@var{this},'' or ``architecture is not @var{that}.''  Selectors may be
177*47501Spendrycombined arbitrarily.  @i{Amd} also supports a variety of filesystem
178*47501Spendrytypes, including NFS, UFS and the novel @dfn{program} filesystem.  The
179*47501Spendrycombination of selectors and multiple filesystem types allows identical
180*47501Spendryconfiguration files to be used on all machines so reducing the
181*47501Spendryadministrative overhead.
182*47501Spendry
183*47501Spendry@i{Amd} ensures that it will not hang if a remote server goes down.
184*47501SpendryMoreover, @i{Amd} can determine when a remote server has become
185*47501Spendryinaccessible and then mount replacement filesystems as and when they
186*47501Spendrybecome available.
187*47501Spendry
188*47501Spendry@i{Amd} contains no proprietary source code and has been ported to
189*47501Spendrynumerous flavours of Unix.
190*47501Spendry
191*47501Spendry@node Overview, Supported Platforms, Distrib, Top
192*47501Spendry@chapter Overview
193*47501Spendry
194*47501Spendry@i{Amd} maintains a cache of mounted filesystems.  Filesystems are
195*47501Spendry@dfn{demand-mounted} when they are first referenced, and unmounted after
196*47501Spendrya period of inactivity.  @i{Amd} may be used as a replacement for Sun's
197*47501Spendry@b{automount}(8) program.  It contains no proprietary source code and
198*47501Spendryhas been ported to numerous flavours of Unix.  @xref{Supported Operating
199*47501SpendrySystems}.@refill
200*47501Spendry
201*47501Spendry@i{Amd} was designed as the basis for experimenting with filesystem
202*47501Spendrylayout and management.  Although @i{Amd} has many direct applications it
203*47501Spendryis loaded with additional features which have little practical use.  At
204*47501Spendrysome point the infrequently used components may be removed to streamline
205*47501Spendrythe production system.
206*47501Spendry
207*47501Spendry@c @i{Amd} supports the notion of @dfn{replicated} filesystems by evaluating
208*47501Spendry@c each member of a list of possible filesystem locations in parallel.
209*47501Spendry@c @i{Amd} checks that each cached mapping remains valid.  Should a mapping be
210*47501Spendry@c lost -- such as happens when a fileserver goes down -- @i{Amd} automatically
211*47501Spendry@c selects a replacement should one be available.
212*47501Spendry@c
213*47501Spendry@menu
214*47501Spendry* Fundamentals::
215*47501Spendry* Filesystems and Volumes::
216*47501Spendry* Volume Naming::
217*47501Spendry* Volume Binding::
218*47501Spendry* Operational Principles::
219*47501Spendry* Mounting a Volume::
220*47501Spendry* Automatic Unmounting::
221*47501Spendry* Keep-alives::
222*47501Spendry* Non-blocking Operation::
223*47501Spendry@end menu
224*47501Spendry
225*47501Spendry@node     Fundamentals, Filesystems and Volumes, Overview, Overview
226*47501Spendry@comment  node-name,  next,  previous,  up
227*47501Spendry@section Fundamentals
228*47501Spendry@cindex Automounter fundamentals
229*47501Spendry
230*47501SpendryThe fundamental concept behind @i{Amd} is the ability to separate the
231*47501Spendryname used to refer to a file from the name used to refer to its physical
232*47501Spendrystorage location.  This allows the same files to be accessed with the
233*47501Spendrysame name regardless of where in the network the name is used.  This is
234*47501Spendryvery different from placing @file{/n/hostname} in front of the pathname
235*47501Spendrysince that includes location dependent information which may change if
236*47501Spendryfiles are moved to another machine.
237*47501Spendry
238*47501SpendryBy placing the required mappings in a centrally administered database,
239*47501Spendryfilesystems can be re-organised without requiring changes to
240*47501Spendryconfiguration files, shell scripts and so on.
241*47501Spendry
242*47501Spendry@node     Filesystems and Volumes, Volume Naming, Fundamentals, Overview
243*47501Spendry@comment  node-name,  next,  previous,  up
244*47501Spendry@section Filesystems and Volumes
245*47501Spendry@cindex Filesystem
246*47501Spendry@cindex Volume
247*47501Spendry@cindex Fileserver
248*47501Spendry@cindex sublink
249*47501Spendry
250*47501Spendry@i{Amd} views the world as a set of fileservers, each containg one or
251*47501Spendrymore filesystems where each filesystem contains one or more
252*47501Spendry@dfn{volumes}.  Here the term @dfn{volume} is used to refer to a
253*47501Spendrycoherent set of files such as a user's home directory or a @TeX{}
254*47501Spendrydistribution.@refill
255*47501Spendry
256*47501SpendryIn order to access the contents of a volume, @i{Amd} must be told in
257*47501Spendrywhich filesystem the volume resides and which host owns the filesystem.
258*47501SpendryBy default the host is assumed to be local and the volume is assumed to
259*47501Spendrybe the entire filesystem.  If a filesystem contains more than one
260*47501Spendryvolume, then a @dfn{sublink} is used to refer to the sub-directory
261*47501Spendrywithin the filesystem where the volume can be found.
262*47501Spendry
263*47501Spendry@node     Volume Naming, Volume Binding, Filesystems and Volumes, Overview
264*47501Spendry@comment  node-name,  next,  previous,  up
265*47501Spendry@section Volume Naming
266*47501Spendry@cindex Volume names
267*47501Spendry@cindex Network-wide naming
268*47501Spendry@cindex Replicated volumes
269*47501Spendry@cindex Duplicated volumes
270*47501Spendry@cindex Replacement volumes
271*47501Spendry
272*47501SpendryVolume names are defined to be unique across the entire network.  A
273*47501Spendryvolume name is the pathname to the volume's root as known by the users
274*47501Spendryof that volume.  Since this name uniquely identifies the volume
275*47501Spendrycontents, all volumes can be named and accessed from each host, subject
276*47501Spendryto administrative controls.
277*47501Spendry
278*47501SpendryVolumes may be replicated or duplicated.  Replicated volumes contain
279*47501Spendryidentical copies of the same data and reside at two or more locations in
280*47501Spendrythe network.  Each of the replicated volumes can be used
281*47501Spendryinterchangeably.  Duplicated volumes each have the same name but contain
282*47501Spendrydifferent, though functionally identical, data.  For example,
283*47501Spendry@samp{/vol/tex} might be the name of a @TeX{} distribution which varied
284*47501Spendryfor each machine architecture.@refill
285*47501Spendry
286*47501Spendry@i{Amd} provides facilities to take advantage of both replicated and
287*47501Spendryduplicated volumes.  Configuration options allow a single set of
288*47501Spendryconfiguration data to be shared across an entire network by taking
289*47501Spendryadvantage of replicated and duplicated volumes.
290*47501Spendry
291*47501Spendry@i{Amd} can take advantage of replacement volumes by mounting them as
292*47501Spendryrequired should an active fileserver become unavailable.
293*47501Spendry
294*47501Spendry@node     Volume Binding, Operational Principles, Volume Naming, Overview
295*47501Spendry@comment  node-name,  next,  previous,  up
296*47501Spendry@section Volume Binding
297*47501Spendry@cindex Volume binding
298*47501Spendry@cindex Unix namespace
299*47501Spendry@cindex Namespace
300*47501Spendry@cindex Binding names to filesystems
301*47501Spendry
302*47501SpendryUnix implements a namespace of hierarchically mounted filesystems.  Two
303*47501Spendryforms of binding between names and files are provided.  A @dfn{hard
304*47501Spendrylink} completes the binding when the name is added to the filesystem.  A
305*47501Spendry@dfn{soft link} delays the binding until the name is accessed.  An
306*47501Spendry@dfn{automounter} adds a further form in which the binding of name to
307*47501Spendryfilesystem is delayed until the name is accessed.@refill
308*47501Spendry
309*47501SpendryThe target volume, in its general form, is a tuple (host, filesystem,
310*47501Spendrysublink) which can be used to name the physical location of any volume
311*47501Spendryin the network.
312*47501Spendry
313*47501SpendryWhen a target is referenced, @i{Amd} ignores the sublink element and
314*47501Spendrydetermines whether the required filesystem is already mounted.  This is
315*47501Spendrydone by computing the local mount point for the filesystem and checking
316*47501Spendryfor an existing filesystem mounted at the same place.  If such a
317*47501Spendryfilesystem already exists then it is assumed to be functionally
318*47501Spendryidentical to the target filesystem.  By default there is a one-to-one
319*47501Spendrymapping between the pair (host, filesystem) and the local mount point so
320*47501Spendrythis assumption is valid.
321*47501Spendry
322*47501Spendry@node     Operational Principles, Mounting a Volume, Volume Binding, Overview
323*47501Spendry@comment  node-name,  next,  previous,  up
324*47501Spendry@section Operational Principles
325*47501Spendry@cindex Operational principles
326*47501Spendry
327*47501Spendry@i{Amd} operates by introducing new mount points into the namespace.
328*47501SpendryThese are called @dfn{automount} points.  The kernel sees these
329*47501Spendryautomount points as NFS filesystems being served by @i{Amd}.  Having
330*47501Spendryattached itself to the namespace, @i{Amd} is now able to control the
331*47501Spendryview the rest of the system has of those mount points.  RPC calls are
332*47501Spendryreceived from the kernel one at a time.
333*47501Spendry
334*47501SpendryWhen a @dfn{lookup} call is received @i{Amd} checks whether the name is
335*47501Spendryalready known.  If it is not, the required volume is mounted.  A
336*47501Spendrysymbolic link pointing to the volume root is then returned.  Once the
337*47501Spendrysymbolic link is returned, the kernel will send all other requests
338*47501Spendrydirect to the mounted filesystem.
339*47501Spendry
340*47501SpendryIf a volume is not yet mounted, @i{Amd} consults a configuration
341*47501Spendry@dfn{mount-map} corresponding to the automount point.  @i{Amd} then
342*47501Spendrymakes a runtime decision on what and where to mount a filesystem based
343*47501Spendryon the information obtained from the map.
344*47501Spendry
345*47501Spendry@i{Amd} does not implement all the NFS requests; only those relevant
346*47501Spendryto name binding such as @dfn{lookup}, @dfn{readlink} and @dfn{readdir}.
347*47501SpendrySome other calls are also implemented but most simply return an error
348*47501Spendrycode; for example @dfn{mkdir} always returns ``read-only filesystem''.
349*47501Spendry
350*47501Spendry@node     Mounting a Volume, Automatic Unmounting, Operational Principles, Overview
351*47501Spendry@comment  node-name,  next,  previous,  up
352*47501Spendry@section Mounting a Volume
353*47501Spendry@cindex Mounting a volume
354*47501Spendry@cindex Location lists
355*47501Spendry@cindex Alternate locations
356*47501Spendry@cindex Mount retries
357*47501Spendry@cindex Background mounts
358*47501Spendry
359*47501SpendryEach automount point has a corresponding mount map.  The mount map
360*47501Spendrycontains a list of key--value pairs.  The key is the name of the volume
361*47501Spendryto be mounted.  The value is a list of locations describing where the
362*47501Spendryfilesystem is stored in the network.  In the source for the map the
363*47501Spendryvalue would look like
364*47501Spendry
365*47501Spendry@display
366*47501Spendrylocation1  location2  @dots{}  locationN
367*47501Spendry@end display
368*47501Spendry
369*47501Spendry@i{Amd} examines each location in turn.  Each location may contain
370*47501Spendry@dfn{selectors} which control whether @i{Amd} can use that location.
371*47501SpendryFor example, the location may be restricted to use by certain hosts.
372*47501SpendryThose locations which cannot be used are ignored.
373*47501Spendry
374*47501Spendry@i{Amd} attempts to mount the filesystem described by each remaining
375*47501Spendrylocation until a mount succeeds or @i{Amd} can no longer proceed.  The
376*47501Spendrylatter can occur in three ways:
377*47501Spendry
378*47501Spendry@itemize @bullet
379*47501Spendry@item
380*47501SpendryIf none of the locations could be used, or if all of the locations
381*47501Spendrycaused an error, then the last error is returned.
382*47501Spendry
383*47501Spendry@item
384*47501SpendryIf a location could be used but was being mounted in the background then
385*47501Spendry@i{Amd} marks that mount as being ``in progress'' and continues with
386*47501Spendrythe next request; no reply is sent to the kernel.
387*47501Spendry
388*47501Spendry@item
389*47501SpendryLastly, one or more of the mounts may have been @dfn{deferred}.  A mount
390*47501Spendryis deferred if extra information is required before the mount can
391*47501Spendryproceed.  When the information becomes available the mount will take
392*47501Spendryplace, but in the mean time no reply is sent to the kernel.  If the
393*47501Spendrymount is deferred, @i{Amd} continues to try any remaining locations.
394*47501Spendry@end itemize
395*47501Spendry
396*47501SpendryOnce a volume has been mounted, @i{Amd} establishes a @dfn{volume
397*47501Spendrymapping} which is used to satisfy subsequent requests.@refill
398*47501Spendry
399*47501Spendry@node     Automatic Unmounting, Keep-alives, Mounting a Volume, Overview
400*47501Spendry@comment  node-name,  next,  previous,  up
401*47501Spendry@section Automatic Unmounting
402*47501Spendry
403*47501SpendryTo avoid an ever increasing number of filesystem mounts, @i{Amd} removes
404*47501Spendryvolume mappings which have not been used recently.  A time-to-live
405*47501Spendryinterval is associated with each mapping and when that expires the
406*47501Spendrymapping is removed.  When the last reference to a filesystem is removed,
407*47501Spendrythat filesystem is unmounted.  If the unmount fails, for example the
408*47501Spendryfilesystem is still busy, the mapping is re-instated and its
409*47501Spendrytime-to-live interval is extended.  The global default for this grace
410*47501Spendryperiod is controlled by the ``-w'' command-line option (@pxref{-w
411*47501SpendryOption, -w}).  It is also possible to set this value on a per-mount
412*47501Spendrybasis (@pxref{opts Option, opts, opts}).@refill
413*47501Spendry
414*47501SpendryFilesystems can be forcefully timed out using the @i{Amq} command.
415*47501Spendry@xref{Run-time Administration}.
416*47501Spendry
417*47501Spendry@node     Keep-alives, Non-blocking Operation, Automatic Unmounting, Overview
418*47501Spendry@comment  node-name,  next,  previous,  up
419*47501Spendry@section Keep-alives
420*47501Spendry@cindex Keep-alives
421*47501Spendry@cindex Server crashes
422*47501Spendry@cindex NFS ping
423*47501Spendry
424*47501SpendryUse of some filesystem types requires the presence of a server on
425*47501Spendryanother machine.  If a machine crashes then it is of no concern to
426*47501Spendryprocesses on that machine that the filesystem is unavailable.  However,
427*47501Spendryto processes on a remote host using that machine as a fileserver this
428*47501Spendryevent is important.  This situation is most widely recognised when an
429*47501SpendryNFS server crashes and the behaviour observed on client machines is that
430*47501Spendrymore and more processes hang.  In order to provide the possibility of
431*47501Spendryrecovery, @i{Amd} implements a @dfn{keep-alive} interval timer for some
432*47501Spendryfilesystem types.  Currently only NFS makes use of this service.
433*47501Spendry
434*47501SpendryThe basis of the NFS keep-alive implementation is the observation that
435*47501Spendrymost sites maintain replicated copies of common system data such as
436*47501Spendrymanual pages, most or all programs, system source code and so on.  If
437*47501Spendryone of those servers goes down it would be reasonable to mount one of
438*47501Spendrythe others as a replacement.
439*47501Spendry
440*47501SpendryThe first part of the process is to keep track of which fileservers are
441*47501Spendryup and which are down.  @i{Amd} does this by sending RPC requests to the
442*47501Spendryservers' NFS @code{NullProc} and checking whether a reply is returned.
443*47501SpendryWhile the server state is uncertain the requests are re-transmitted at
444*47501Spendrythree second intervals and if no reply is received after four attempts
445*47501Spendrythe server is marked down.  If a reply is received the fileserver is
446*47501Spendrymarked up and stays in that state for 30 seconds at which time another
447*47501SpendryNFS ping is sent.
448*47501Spendry
449*47501SpendryOnce a fileserver is marked down, requests continue to be sent every 30
450*47501Spendryseconds in order to determine when the fileserver comes back up.  During
451*47501Spendrythis time any reference through @i{Amd} to the filesystems on that
452*47501Spendryserver fail with the error ``Operation would block''.  If a replacement
453*47501Spendryvolume is available then it will be mounted, otherwise the error is
454*47501Spendryreturned to the user.
455*47501Spendry
456*47501Spendry@c @i{Amd} keeps track of which servers are up and which are down.
457*47501Spendry@c It does this by sending RPC requests to the servers' NFS {\sc NullProc} and
458*47501Spendry@c checking whether a reply is returned.  If no replies are received after a
459*47501Spendry@c short period, @i{Amd} marks the fileserver @dfn{down}.
460*47501Spendry@c RPC requests continue to be sent so that it will notice when a fileserver
461*47501Spendry@c comes back up.
462*47501Spendry@c ICMP echo packets \cite{rfc:icmp} are not used because it is the availability
463*47501Spendry@c of the NFS service that is important, not the existence of a base kernel.
464*47501Spendry@c Whenever a reference to a fileserver which is down is made via @i{Amd}, an alternate
465*47501Spendry@c filesystem is mounted if one is available.
466*47501Spendry@c
467*47501SpendryAlthough this action does not protect user files, which are unique on
468*47501Spendrythe network, or processes which do not access files via @i{Amd} or
469*47501Spendryalready have open files on the hung filesystem, it can prevent most new
470*47501Spendryprocesses from hanging.
471*47501Spendry
472*47501SpendryBy default, fileserver state is not maintained for NFS/TCP mounts.  The
473*47501Spendryremote fileserver is always assumed to be up.
474*47501Spendry@c
475*47501Spendry@c With a suitable combination of filesystem management and mount-maps,
476*47501Spendry@c machines can be protected against most server downtime.  This can be
477*47501Spendry@c enhanced by allocating boot-servers dynamically which allows a diskless
478*47501Spendry@c workstation to be quickly restarted if necessary.  Once the root filesystem
479*47501Spendry@c is mounted, @i{Amd} can be started and allowed to mount the remainder of
480*47501Spendry@c the filesystem from whichever fileservers are available.
481*47501Spendry
482*47501Spendry@node     Non-blocking Operation, , Keep-alives, Overview
483*47501Spendry@comment  node-name,  next,  previous,  up
484*47501Spendry@section Non-blocking Operation
485*47501Spendry@cindex Non-blocking operation
486*47501Spendry@cindex Multiple-threaded server
487*47501Spendry@cindex RPC retries
488*47501Spendry
489*47501SpendrySince there is only one instance of @i{Amd} for each automount point,
490*47501Spendryand usually only one instance on each machine, it is important that it
491*47501Spendryis always available to service kernel calls.  @i{Amd} goes to great
492*47501Spendrylengths to ensure that it does not block in a system call.  As a last
493*47501Spendryresort @i{Amd} will fork before it attempts a system call that may block
494*47501Spendryindefinitely, such as mounting an NFS filesystem.  Other tasks such as
495*47501Spendryobtaining filehandle information for an NFS filesystem, are done using a
496*47501Spendrypurpose built non-blocking RPC library which is integrated with
497*47501Spendry@i{Amd}'s task scheduler.  This library is also used to implement NFS
498*47501Spendrykeep-alives (@pxref{Keep-alives}).
499*47501Spendry
500*47501SpendryWhenever a mount is deferred or backgrounded, @i{Amd} must wait for it
501*47501Spendryto complete before replying to the kernel.  However, this would cause
502*47501Spendry@i{Amd} to block waiting for a reply to be constructed.  Rather than do
503*47501Spendrythis, @i{Amd} simply @dfn{drops} the call under the assumption that the
504*47501Spendrykernel RPC mechanism will automatically retry the request.
505*47501Spendry
506*47501Spendry@node     Supported Platforms, Mount Maps, Overview, Top
507*47501Spendry@comment  node-name,  next,  previous,  up
508*47501Spendry@chapter Supported Platforms
509*47501Spendry
510*47501Spendry@i{Amd} has been ported to a wide variety of machines and operating systems.
511*47501SpendryThe table below lists those platforms supported by the current release.
512*47501Spendry
513*47501Spendry@menu
514*47501Spendry* Supported Operating Systems::
515*47501Spendry* Supported Machine Architectures::
516*47501Spendry@end menu
517*47501Spendry
518*47501Spendry@node     Supported Operating Systems, Supported Machine Architectures, Supported Platforms, Supported Platforms
519*47501Spendry@comment  node-name,  next,  previous,  up
520*47501Spendry@section Supported Operating Systems
521*47501Spendry@cindex Operating system names
522*47501Spendry@cindex Operating systems supported by Amd
523*47501Spendry@cindex Supported operating systems
524*47501Spendry
525*47501SpendryThe following operating systems are currently supported by @i{Amd}.
526*47501Spendry@i{Amd}'s conventional name for each system is given.
527*47501Spendry
528*47501Spendry@table @code
529*47501Spendry@item acis43
530*47501Spendry4.3 BSD for IBM RT.  Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>}
531*47501Spendry@item aix3
532*47501SpendryAIX 3.1.  Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>}
533*47501Spendry@item aux
534*47501SpendrySystem V for Mac-II.  Contributed by Julian Onions @t{<jpo@@cs.nott.ac.uk>}
535*47501Spendry@item bsd44
536*47501Spendry4.4 BSD.  Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>}
537*47501Spendry@item concentrix
538*47501SpendryConcentrix 5.0.  Contributed by Sjoerd Mullender @t{<sjoerd@@cwi.nl>}
539*47501Spendry@item convex
540*47501SpendryConvex OS 7.1.  Contributed by Eitan Mizrotsky @t{<eitan@@shumuji.ac.il>}
541*47501Spendry@item dgux
542*47501SpendryData General DG/UX.  Contributed by Mark Davies @t{<mark@@comp.vuw.ac.nz>}
543*47501Spendry@item fpx4
544*47501SpendryCelerity FPX 4.1/2.  Contributed by Stephen Pope @t{<scp@@grizzly.acl.lanl.gov>}
545*47501Spendry@item hcx
546*47501SpendryHarris HCX/UX.  Contributed by Chris Metcalf @t{<metcalf@@masala.lcs.mit.edu>}
547*47501Spendry@item hlh42
548*47501SpendryHLH OTS 1.@i{x} (4.2 BSD).  Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>}
549*47501Spendry@item hpux
550*47501SpendryHP-UX 6.@i{x} or 7.0.  Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>}
551*47501Spendry@item irix
552*47501SpendrySGI Irix.  Contributed by Scott R. Presnell @t{<srp@@cgl.ucsf.edu>}
553*47501Spendry@item next
554*47501SpendryMach for NeXT.  Contributed by Bill Trost @t{<trost%reed@@cse.ogi.edu>}
555*47501Spendry@item pyrOSx
556*47501SpendryPyramid OSx.  Contributed by Stefan Petri @t{<petri@@tubsibr.UUCP>}
557*47501Spendry@item riscix
558*47501SpendryAcorn RISC iX.  Contributed by Piete Brooks @t{<pb@@cam.cl.ac.uk>}
559*47501Spendry@item sos3
560*47501SpendrySunOS 3.4 & 3.5.  Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>}
561*47501Spendry@item sos4
562*47501SpendrySunOS 4.@i{x}.  Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>}
563*47501Spendry@item u2_2
564*47501SpendryUltrix 2.2.  Contributed by Piete Brooks @t{<pb@@cam.cl.ac.uk>}
565*47501Spendry@item u3_0
566*47501SpendryUltrix 3.  Contributed by Piete Brooks @t{<pb@@cam.cl.ac.uk>}
567*47501Spendry@item u4_0
568*47501SpendryUltrix 4.0.  Contributed by Chris Lindblad @t{<cjl@@ai.mit.edu>}
569*47501Spendry@item umax43
570*47501SpendryUmax 4.3 BSD.  Contributed by Sjoerd Mullender @t{<sjoerd@@cwi.nl>}
571*47501Spendry@item utek
572*47501SpendryUtek 4.0.  Contributed by Bill Trost @t{<trost%reed@@cse.ogi.edu>}
573*47501Spendry@item xinu43
574*47501Spendrymt Xinu MORE/bsd.  Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>}
575*47501Spendry@end table
576*47501Spendry
577*47501Spendry@node     Supported Machine Architectures, , Supported Operating Systems, Supported Platforms
578*47501Spendry@comment  node-name,  next,  previous,  up
579*47501Spendry@section Supported Machine Architectures
580*47501Spendry@cindex Supported machine architectures
581*47501Spendry@cindex Machine architecture names
582*47501Spendry@cindex Machine architectures supported by Amd
583*47501Spendry
584*47501Spendry@table @code
585*47501Spendry@item alliant
586*47501SpendryAlliant FX/4
587*47501Spendry@item arm
588*47501SpendryAcorn ARM
589*47501Spendry@item aviion
590*47501SpendryData General AViiON
591*47501Spendry@item encore
592*47501SpendryEncore
593*47501Spendry@item fps500
594*47501SpendryFPS Model 500
595*47501Spendry@item hp9000
596*47501SpendryHP 9000/300 family
597*47501Spendry@item hp9k8
598*47501SpendryHP 9000/800 family
599*47501Spendry@item ibm032
600*47501SpendryIBM RT
601*47501Spendry@item ibm6000
602*47501SpendryIBM RISC System/6000
603*47501Spendry@item iris4d
604*47501SpendrySGI Iris 4D
605*47501Spendry@item macII
606*47501SpendryApple Mac II
607*47501Spendry@item mips
608*47501SpendryMIPS RISC
609*47501Spendry@item multimax
610*47501SpendryEncore Multimax
611*47501Spendry@item orion105
612*47501SpendryHLH Orion 1/05
613*47501Spendry@item sun3
614*47501SpendrySun-3 family
615*47501Spendry@item sun4
616*47501SpendrySun-4 family
617*47501Spendry@item tahoe
618*47501SpendryTahoe family
619*47501Spendry@item vax
620*47501SpendryDEC Vax
621*47501Spendry@end table
622*47501Spendry
623*47501Spendry@node     Mount Maps, Amd Command Line Options, Supported Platforms, Top
624*47501Spendry@comment  node-name,  next,  previous,  up
625*47501Spendry@chapter Mount Maps
626*47501Spendry@cindex Mount maps
627*47501Spendry@cindex Automounter configuration maps
628*47501Spendry@cindex Mount information
629*47501Spendry
630*47501Spendry@i{Amd} has no built-in knowledge of machines or filesystems.
631*47501SpendryExternal @dfn{mount-maps} are used to provide the required information.
632*47501SpendrySpecifically, @i{Amd} needs to know when and under what conditions it
633*47501Spendryshould mount filesystems.
634*47501Spendry
635*47501SpendryThe map entry corresponding to the requested name contains a list of
636*47501Spendrypossible locations from which to resolve the request.  Each location
637*47501Spendryspecifies filesystem type, information required by that filesystem (for
638*47501Spendryexample the block special device in the case of UFS), and some
639*47501Spendryinformation describing where to mount the filesystem (@pxref{fs Option}).  A
640*47501Spendrylocation may also contain @dfn{selectors} (@pxref{Selectors}).@refill
641*47501Spendry
642*47501Spendry@menu
643*47501Spendry* Map Types::
644*47501Spendry* Key Lookup::
645*47501Spendry* Location Format::
646*47501Spendry@end menu
647*47501Spendry
648*47501Spendry@node     Map Types, Key Lookup, Mount Maps, Mount Maps
649*47501Spendry@comment  node-name,  next,  previous,  up
650*47501Spendry@section Map Types
651*47501Spendry@cindex Mount map types
652*47501Spendry@cindex Map types
653*47501Spendry@cindex Configuration map types
654*47501Spendry@cindex Types of mount map
655*47501Spendry@cindex Types of configuration map
656*47501Spendry@cindex Determining the map type
657*47501Spendry
658*47501SpendryA mount-map provides the run-time configuration information to @i{Amd}.
659*47501SpendryMaps can be implemented in many ways.  Some of the forms supported by
660*47501Spendry@i{Amd} are regular files, ndbm databases, NIS maps the @dfn{Hesiod}
661*47501Spendryname server and even the password file.
662*47501Spendry
663*47501SpendryA mount-map @dfn{name} is a sequence of characters.  When an automount
664*47501Spendrypoint is created a handle on the mount-map is obtained.  For each map
665*47501Spendrytype configured @i{Amd} attempts to reference the a map of the
666*47501Spendryappropriate type.  If a map is found, @i{Amd} notes the type for future
667*47501Spendryuse and deletes the reference, for example closing any open file
668*47501Spendrydescriptors.  The available maps are configure when @i{Amd} is built and
669*47501Spendrycan be displayed by running the command @samp{amd -v}.
670*47501Spendry
671*47501SpendryBy default, @i{Amd} caches data in a mode dependent on the type of map.
672*47501SpendryThis is the same as specifying @samp{cache:=mapdefault} and selects a
673*47501Spendrysuitable default cache mode depending on the map type.  The individual
674*47501Spendrydefaults are described below.  The @var{cache} option can be specified
675*47501Spendryon automount points to alter the caching behaviour (@pxref{Automount
676*47501SpendryFilesystem}).@refill
677*47501Spendry
678*47501SpendryThe following map types have been implemented, though some are not
679*47501Spendryavailable on all machines.  Run the command @samp{amd -v} to obtain a
680*47501Spendrylist of map types configured on your machine.
681*47501Spendry
682*47501Spendry@menu
683*47501Spendry* File maps::
684*47501Spendry* ndbm maps::
685*47501Spendry* NIS maps::
686*47501Spendry* Hesiod maps::
687*47501Spendry* Password maps::
688*47501Spendry* Union maps::
689*47501Spendry@end menu
690*47501Spendry
691*47501Spendry@node     File maps, ndbm maps, Map Types, Map Types
692*47501Spendry@comment  node-name,  next,  previous,  up
693*47501Spendry@subsection File maps
694*47501Spendry@cindex File maps
695*47501Spendry@cindex Flat file maps
696*47501Spendry@cindex File map syntactic conventions
697*47501Spendry
698*47501SpendryWhen @i{Amd} searches a file for a map entry it does a simple scan of
699*47501Spendrythe file and supports both comments and continuation lines.
700*47501Spendry
701*47501SpendryContinuation lines are indicated by a backslash character (@samp{\}) as
702*47501Spendrythe last character of a line in the file.  The backslash, newline character
703*47501Spendry@emph{and any leading white space on the following line} are discarded.  A maximum
704*47501Spendryline length of 2047 characters is enforced after continuation lines are read
705*47501Spendrybut before comments are stripped.  Each line must end with
706*47501Spendrya newline character; that is newlines are terminators, not separators.
707*47501SpendryThe following examples illustrate this:
708*47501Spendry
709*47501Spendry@example
710*47501Spendrykey     valA   valB;   \
711*47501Spendry          valC
712*47501Spendry@end example
713*47501Spendry
714*47501Spendryspecifies @emph{three} locations, and is identical to
715*47501Spendry
716*47501Spendry@example
717*47501Spendrykey     valA   valB;   valC
718*47501Spendry@end example
719*47501Spendry
720*47501SpendryHowever,
721*47501Spendry
722*47501Spendry@example
723*47501Spendrykey     valA   valB;\
724*47501Spendry          valC
725*47501Spendry@end example
726*47501Spendry
727*47501Spendryspecifies only @emph{two} locations, and is identical to
728*47501Spendry
729*47501Spendry@example
730*47501Spendrykey     valA   valB;valC
731*47501Spendry@end example
732*47501Spendry
733*47501SpendryAfter a complete line has been read from the file, including
734*47501Spendrycontinuations, @i{Amd} determines whether there is a comment on the
735*47501Spendryline.  A comment begins with a hash (``@samp{#}'') character and
736*47501Spendrycontinues to the end of the line.  There is no way to escape or change
737*47501Spendrythe comment lead-in character.
738*47501Spendry
739*47501SpendryNote that continuation lines and comment support @dfn{only} apply to
740*47501Spendryfile maps, or ndbm maps built with the @code{mk-amd-map} program.
741*47501Spendry
742*47501SpendryWhen caching is enabled, file maps have a default cache mode of
743*47501Spendry@code{all} (@pxref{Automount Filesystem}).
744*47501Spendry
745*47501Spendry@node     ndbm maps, NIS maps, File maps, Map Types
746*47501Spendry@comment  node-name,  next,  previous,  up
747*47501Spendry@subsection ndbm maps
748*47501Spendry@cindex ndbm maps
749*47501Spendry
750*47501SpendryAn ndbm map may be used as a fast access form of a file map.  The program,
751*47501Spendry@code{mk-amd-map}, converts a normal map file into an ndbm database.
752*47501SpendryThis program supports the same continuation and comment conventions that
753*47501Spendryare provided for file maps.  Note that ndbm format files may @emph{not}
754*47501Spendrybe sharable across machine architectures.  The notion of speed generally
755*47501Spendryonly applies to large maps; a small map, less than a single disk block,
756*47501Spendryis almost certainly better implemented as a file map.
757*47501Spendry
758*47501Spendryndbm maps do not support cache mode @samp{all} and, when caching is
759*47501Spendryenabled, have a default cache mode of @samp{inc} (@pxref{Automount Filesystem}).
760*47501Spendry
761*47501Spendry@node     NIS maps, Hesiod maps, ndbm maps, Map Types
762*47501Spendry@comment  node-name,  next,  previous,  up
763*47501Spendry@subsection NIS maps
764*47501Spendry@cindex NIS (YP) maps
765*47501Spendry
766*47501SpendryWhen using NIS (formerly YP), an @i{Amd} map is implemented directly
767*47501Spendryby the underlying NIS map.  Comments and continuation lines are
768*47501Spendry@emph{not} supported in the automounter and must be stripped when
769*47501Spendryconstructing the NIS server's database.
770*47501Spendry
771*47501SpendryNIS maps do not support cache mode @code{all} and, when caching is
772*47501Spendryenabled, have a default cache mode of @code{inc} (@pxref{Automount Filesystem}).
773*47501Spendry
774*47501SpendryThe following rule illustrates what could be added to your NIS @file{Makefile},
775*47501Spendryin this case causing the @file{amd.home} map to be rebuilt:
776*47501Spendry@example
777*47501Spendry$(YPTSDIR)/amd.home.time: $(ETCDIR)/amd.home
778*47501Spendry        -@@sed -e "s/#.*$$//" -e "/^$$/d" $(ETCDIR)/amd.home | \
779*47501Spendry          awk '{  \
780*47501Spendry                 for (i = 1; i <= NF; i++) \
781*47501Spendry                     if (i == NF) { \
782*47501Spendry                         if (substr($$i, length($$i), 1) == "\\") \
783*47501Spendry                             printf("%s", substr($$i, 1, length($$i) - 1)); \
784*47501Spendry                         else \
785*47501Spendry                             printf("%s\n", $$i); \
786*47501Spendry                     } \
787*47501Spendry                     else \
788*47501Spendry                         printf("%s ", $$i); \
789*47501Spendry             }' | \
790*47501Spendry        $(MAKEDBM) - $(YPDBDIR)/amd.home; \
791*47501Spendry        touch $(YPTSDIR)/amd.home.time; \
792*47501Spendry        echo "updated amd.home"; \
793*47501Spendry        if [ ! $(NOPUSH) ]; then \
794*47501Spendry                $(YPPUSH) amd.home; \
795*47501Spendry                echo "pushed amd.home"; \
796*47501Spendry        else \
797*47501Spendry                : ; \
798*47501Spendry        fi
799*47501Spendry@end example
800*47501Spendry
801*47501SpendryHere @code{$(YPTSDIR)} contains the time stamp files, and @code{$(YPDBDIR)} contains
802*47501Spendrythe dbm format NIS files.
803*47501Spendry
804*47501Spendry@node     Hesiod maps, Password maps, NIS maps, Map Types
805*47501Spendry@comment  node-name,  next,  previous,  up
806*47501Spendry@subsection Hesiod maps
807*47501Spendry@cindex Hesiod maps
808*47501Spendry
809*47501SpendryWhen the map name begins with the string @samp{hesiod.} lookups are made
810*47501Spendryusing the @dfn{Hesiod} name server.  The string following the dot is
811*47501Spendryused as a name qualifier and is prepended with the key being located.
812*47501SpendryThe entire string is then resolved in the @code{automount} context.  For
813*47501Spendryexample, if the the key is @samp{jsp} and map name is
814*47501Spendry@samp{hesiod.homes} then @dfn{Hesiod} is asked to resolve
815*47501Spendry@samp{jsp.homes.automount}.
816*47501Spendry
817*47501SpendryHesiod maps do not support cache mode @samp{all} and, when caching is
818*47501Spendryenabled, have a default cache mode of @samp{inc} (@pxref{Automount Filesystem}).
819*47501Spendry
820*47501SpendryThe following is an example of a @dfn{Hesiod} map entry:
821*47501Spendry
822*47501Spendry@example
823*47501Spendryjsp.homes.automount HS TXT "rfs:=/home/charm;rhost:=charm;sublink:=jsp"
824*47501Spendrynjw.homes.automount HS TXT "rfs:=/home/dylan/dk2;rhost:=dylan;sublink:=njw"
825*47501Spendry@end example
826*47501Spendry
827*47501Spendry@node     Password maps, Union maps, Hesiod maps, Map Types
828*47501Spendry@comment  node-name,  next,  previous,  up
829*47501Spendry@subsection Password maps
830*47501Spendry@cindex Password file maps
831*47501Spendry@cindex /etc/passwd maps
832*47501Spendry@cindex User maps, automatic generation
833*47501Spendry@cindex Automatic generation of user maps
834*47501Spendry@cindex Using the password file as a map
835*47501Spendry
836*47501SpendryThe password map support is unlike the four previous map types.  When
837*47501Spendrythe map name is the string @file{/etc/passwd} @i{Amd} can lookup a user
838*47501Spendryname in the password file and re-arrange the home directory field to
839*47501Spendryproduce a usable map entry.
840*47501Spendry
841*47501Spendry@i{Amd} assumes the home directory has the format
842*47501Spendry`@t{/}@i{anydir}@t{/}@i{dom1}@t{/../}@i{domN}@t{/}@i{login}'.
843*47501Spendry@c @footnote{This interpretation is not necessarily exactly what you want.}
844*47501SpendryIt breaks this string into a map entry where @code{$@{rfs@}} has the
845*47501Spendryvalue `@t{/}@i{anydir}@t{/}@i{domN}', @code{$@{rhost@}} has the value
846*47501Spendry`@i{domN}@t{.}@i{...}@t{.}@i{dom1}', and @code{$@{sublink@}} has the
847*47501Spendryvalue @samp{login}.@refill
848*47501Spendry
849*47501SpendryThus if the password file entry was
850*47501Spendry
851*47501Spendry@example
852*47501Spendry/home/achilles/jsp
853*47501Spendry@end example
854*47501Spendry
855*47501Spendrythe map entry used by @i{Amd} would be
856*47501Spendry
857*47501Spendry@example
858*47501Spendryrfs:=/home/achilles;rhost:=achilles;sublink:=jsp
859*47501Spendry@end example
860*47501Spendry
861*47501SpendrySimilarly, if the password file entry was
862*47501Spendry
863*47501Spendry@example
864*47501Spendry/home/cc/sugar/mjh
865*47501Spendry@end example
866*47501Spendry
867*47501Spendrythe map entry used by @i{Amd} would be
868*47501Spendry
869*47501Spendry@example
870*47501Spendryrfs:=/home/sugar;rhost:=sugar.cc;sublink:=jsp
871*47501Spendry@end example
872*47501Spendry
873*47501Spendry@node     Union maps, Map Types, Password maps, Map Types
874*47501Spendry@comment  node-name,  next,  previous,  up
875*47501Spendry@subsection Union maps
876*47501Spendry@cindex Union file maps
877*47501Spendry
878*47501SpendryThe union map support is provided specifically for use with the union
879*47501Spendryfilesystem, @pxref{Union Filesystem}.
880*47501Spendry
881*47501SpendryIt is identified by the string @samp{union:} which is followed by a
882*47501Spendrycolon separated list of directories.  The directories are read in order,
883*47501Spendryand the names of all entries are recorded in the map cache.  Later
884*47501Spendrydirectories take precedence over earlier ones.  The union filesystem
885*47501Spendrytype then uses the map cache to determine the union of the names in all
886*47501Spendrythe directories.
887*47501Spendry
888*47501Spendry@c subsection Gdbm
889*47501Spendry
890*47501Spendry@node     Key Lookup, Location Format, Map Types, Mount Maps
891*47501Spendry@comment  node-name,  next,  previous,  up
892*47501Spendry@section How keys are looked up
893*47501Spendry@cindex Key lookup
894*47501Spendry@cindex Map lookup
895*47501Spendry@cindex Looking up keys
896*47501Spendry@cindex How keys are looked up
897*47501Spendry@cindex Wildcards in maps
898*47501Spendry
899*47501SpendryThe key is located in the map whose type was determined when the
900*47501Spendryautomount point was first created.  In general the key is a pathname
901*47501Spendrycomponent.  In some circumstances this may be modified by variable
902*47501Spendryexpansion (@pxref{Variable Expansion}) and prefixing.  If the automount
903*47501Spendrypoint has a prefix, specified by the @var{pref} option, then that is
904*47501Spendryprepended to the search key before the map is searched.
905*47501Spendry
906*47501SpendryIf the map cache is a @samp{regexp} cache then the key is treated as an
907*47501Spendryegrep-style regular expression, otherwise a normal string comparison is
908*47501Spendrymade.
909*47501Spendry
910*47501SpendryIf the key cannot be found then a @dfn{wildcard} match is attempted.
911*47501Spendry@i{Amd} repeatedly strips the basename from the key, appends @samp{/*} and
912*47501Spendryattempts a lookup.  Finally, @i{Amd} attempts to locate the special key @samp{*}.
913*47501Spendry
914*47501Spendry@group
915*47501SpendryFor example, the following sequence would be checked if @file{home/dylan/dk2} was
916*47501Spendrybeing located:
917*47501Spendry
918*47501Spendry@example
919*47501Spendry   home/dylan/dk2
920*47501Spendry   home/dylan/*
921*47501Spendry   home/*
922*47501Spendry   *
923*47501Spendry@end example
924*47501Spendry@end group
925*47501Spendry
926*47501SpendryAt any point when a wildcard is found, @i{Amd} proceeds as if an exact
927*47501Spendrymatch had been found and the value field is then used to resolve the
928*47501Spendrymount request, otherwise an error code is propagated back to the kernel.
929*47501Spendry(@pxref{Filesystem Types}).@refill
930*47501Spendry
931*47501Spendry@node     Location Format, , Key Lookup, Mount Maps
932*47501Spendry@comment  node-name,  next,  previous,  up
933*47501Spendry@section Location Format
934*47501Spendry@cindex Location format
935*47501Spendry@cindex Map entry format
936*47501Spendry@cindex How locations are parsed
937*47501Spendry
938*47501SpendryThe value field from the lookup provides the information required to
939*47501Spendrymount a filesystem.  The information is parsed according to the syntax
940*47501Spendryshown below.
941*47501Spendry
942*47501Spendry@display
943*47501Spendry@i{location-list}:
944*47501Spendry                  @i{location-selection}
945*47501Spendry                  @i{location-list} @i{white-space} @t{||} @i{white-space} @i{location-selection}
946*47501Spendry@i{location-selection}:
947*47501Spendry                  @i{location}
948*47501Spendry                  @i{location-selection} @i{white-space} @i{location}
949*47501Spendry@i{location}:
950*47501Spendry                  @i{location-info}
951*47501Spendry                  @t{-}@i{location-info}
952*47501Spendry                  @t{-}
953*47501Spendry@i{location-info}:
954*47501Spendry                  @i{sel-or-opt}
955*47501Spendry                  @i{location-info}@t{;}@i{sel-or-opt}
956*47501Spendry                  @t{;}
957*47501Spendry@i{sel-or-opt}:
958*47501Spendry                  @i{selection}
959*47501Spendry                  @i{opt-ass}
960*47501Spendry@i{selection}:
961*47501Spendry                  selector@t{==}@i{value}
962*47501Spendry                  selector@t{!=}@i{value}
963*47501Spendry@i{opt-ass}:
964*47501Spendry                  option@t{:=}@i{value}
965*47501Spendry@i{white-space}:
966*47501Spendry                  space
967*47501Spendry                  tab
968*47501Spendry@end display
969*47501Spendry
970*47501SpendryNote that unquoted whitespace is not allowed in a location description.
971*47501SpendryWhite space is only allowed, and is mandatory, where shown with non-terminal
972*47501Spendry@samp{white-space}.
973*47501Spendry
974*47501SpendryA @dfn{location-selection} is a list of possible volumes with which to
975*47501Spendrysatisfy the request.  @dfn{location-selection}s are separated by the
976*47501Spendry@samp{||} operator.  The effect of this operator is to prevent use of
977*47501Spendrylocation-selections to its right if any of the location-selections on
978*47501Spendryits left were selected whether or not any of them were successfully
979*47501Spendrymounted (@pxref{Selectors}).@refill
980*47501Spendry
981*47501SpendryThe location-selection, and singleton @dfn{location-list},
982*47501Spendry@samp{type:=ufs;dev:=/dev/xd1g} would inform @i{Amd} to mount a UFS
983*47501Spendryfilesystem from the block special device @file{/dev/xd1g}.
984*47501Spendry
985*47501SpendryThe @dfn{sel-or-opt} component is either the name of an option required
986*47501Spendryby a specific filesystem, or it is the name of a built-in, predefined
987*47501Spendryselector such as the architecture type.  The value may be quoted with
988*47501Spendrydouble quotes @samp{"}, for example
989*47501Spendry@samp{type:="ufs";dev:="/dev/xd1g"}.  These quotes are stripped when the
990*47501Spendryvalue is parsed and there is no way to get a double quote into a value
991*47501Spendryfield.  Double quotes are used to get white space into a value field,
992*47501Spendrywhich is needed for the program filesystem (@pxref{Program Filesystem}).@refill
993*47501Spendry
994*47501Spendry@menu
995*47501Spendry* Map Defaults::
996*47501Spendry* Variable Expansion::
997*47501Spendry* Selectors::
998*47501Spendry* Map Options::
999*47501Spendry@end menu
1000*47501Spendry
1001*47501Spendry@node     Map Defaults, Variable Expansion, Location Format, Location Format
1002*47501Spendry@comment  node-name,  next,  previous,  up
1003*47501Spendry@subsection Map Defaults
1004*47501Spendry@cindex Map defaults
1005*47501Spendry@cindex How to set default map parameters
1006*47501Spendry@cindex Setting default map parameters
1007*47501Spendry
1008*47501SpendryA location beginning with a dash @samp{-} is used to specify default
1009*47501Spendryvalues for subsequent locations.  Any previously specified defaults in
1010*47501Spendrythe location-list are discarded.  The default string can be empty in
1011*47501Spendrywhich case no defaults apply.
1012*47501Spendry
1013*47501SpendryThe location @samp{-fs:=/mnt;opts:=ro} would set the local mount point
1014*47501Spendryto @file{/mnt} and cause mounts to be read-only by default.  Defaults
1015*47501Spendryspecified this way are appended to, and so override, any global map
1016*47501Spendrydefaults given with @samp{/defaults}).
1017*47501Spendry@c
1018*47501Spendry@c A @samp{/defaults} value @dfn{gdef} and a location list
1019*47501Spendry@c \begin{quote}
1020*47501Spendry@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$
1021*47501Spendry@c \end{quote}
1022*47501Spendry@c is equivalent to
1023*47501Spendry@c \begin{quote}
1024*47501Spendry@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$
1025*47501Spendry@c \end{quote}
1026*47501Spendry@c which is equivalent to
1027*47501Spendry@c \begin{quote}
1028*47501Spendry@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$
1029*47501Spendry@c\end{quote}
1030*47501Spendry
1031*47501Spendry@node     Variable Expansion, Selectors, Map Defaults, Location Format
1032*47501Spendry@comment  node-name,  next,  previous,  up
1033*47501Spendry@subsection Variable Expansion
1034*47501Spendry@cindex Variable expansion
1035*47501Spendry@cindex How variables are expanded
1036*47501Spendry@cindex Pathname operators
1037*47501Spendry@cindex Domain stripping
1038*47501Spendry@cindex Domainname operators
1039*47501Spendry@cindex Stripping the local domain name
1040*47501Spendry@cindex Environment variables
1041*47501Spendry@cindex How to access environment variables in maps
1042*47501Spendry
1043*47501SpendryTo allow generic location specifications @i{Amd} does variable expansion
1044*47501Spendryon each location and also on some of the option strings.  Any option or
1045*47501Spendryselector appearing in the form @code{$@dfn{var}} is replaced by the
1046*47501Spendrycurrent value of that option or selector.  For example, if the value of
1047*47501Spendry@code{$@{key@}} was @samp{bin}, @code{$@{autodir@}} was @samp{/a} and
1048*47501Spendry@code{$@{fs@}} was `@t{$@{autodir@}}@t{/local/}@t{$@{key@}}' then
1049*47501Spendryafter expansion @code{$@{fs@}} would have the value @samp{/a/local/bin}.
1050*47501SpendryAny environment variable can be accessed in a similar way.@refill
1051*47501Spendry
1052*47501SpendryTwo pathname operators are available when expanding a variable.  If the
1053*47501Spendryvariable name begins with @samp{/} then only the last component of
1054*47501Spendrythen pathname is substituted.  For example, if @code{$@{path@}} was
1055*47501Spendry@samp{/foo/bar} then @code{$@{/path@}} would be expanded to @samp{bar}.
1056*47501SpendrySimilarly, if the variable name ends with @samp{/} then all but the
1057*47501Spendrylast component of the pathname is substituted.  In the previous example,
1058*47501Spendry@code{$@{path/@}} would be expanded to @samp{/foo}.@refill
1059*47501Spendry
1060*47501SpendryTwo domain name operators are also provided.  If the variable name
1061*47501Spendrybegins with @samp{.} then only the domain part of the name is
1062*47501Spendrysubstituted.  For example, if @code{$@{rhost@}} was
1063*47501Spendry@samp{swan.doc.ic.ac.uk} then @code{$@{.rhost@}} would be expanded to
1064*47501Spendry@samp{doc.ic.ac.uk}.  Similarly, if the variable name ends with @samp{.}
1065*47501Spendrythen only the host component is substituted.  In the previous example,
1066*47501Spendry@code{$@{rhost.@}} would be expanded to @samp{swan}.@refill
1067*47501Spendry
1068*47501SpendryVariable expansion is a two phase process.  Before a location is parsed,
1069*47501Spendryall references to selectors, @i{eg} @code{$@{path@}}, are expanded.  The
1070*47501Spendrylocation is then parsed, selections are evaluated and option assignments
1071*47501Spendryrecorded.  If there were no selections or they all succeeded the
1072*47501Spendrylocation is used and the values of the following options are expanded in
1073*47501Spendrythe order given: @var{sublink}, @var{rfs}, @var{fs}, @var{opts},
1074*47501Spendry@var{mount} and @var{unmount}.
1075*47501Spendry
1076*47501SpendryNote that expansion of option values is done after @dfn{all} assignments
1077*47501Spendryhave been completed and not in a purely left to right order as is done
1078*47501Spendryby the shell.  This generally has the desired effect but care must be
1079*47501Spendrytaken if one of the options references another, in which case the
1080*47501Spendryordering can become significant.
1081*47501Spendry
1082*47501SpendryThere are two special cases concerning variable expansion:
1083*47501Spendry
1084*47501Spendry@enumerate
1085*47501Spendry@item
1086*47501Spendrybefore a map is consulted, any selectors in the name received
1087*47501Spendryfrom the kernel are expanded.  For example, if the request from the
1088*47501Spendrykernel was for `@t{$@{arch@}}@t{.bin}' and the machine architecture
1089*47501Spendrywas @samp{vax}, the value given to @code{$@{key@}} would be
1090*47501Spendry@samp{vax.bin}.@refill
1091*47501Spendry
1092*47501Spendry@item
1093*47501Spendrythe value of @code{$@{rhost@}} is expanded and normalized before the
1094*47501Spendryother options are expanded.  The normalization process strips any local
1095*47501Spendrysub-domain components.  For example, if @code{$@{domain@}} was
1096*47501Spendry@samp{Berkeley.EDU} and @code{$@{rhost@}} was initially
1097*47501Spendry@samp{snow.Berkeley.EDU}, after the normalization it would simply be
1098*47501Spendry@samp{snow}.  Hostname normalization is currently done in a
1099*47501Spendry@emph{case-dependent} manner.@refill
1100*47501Spendry@end enumerate
1101*47501Spendry
1102*47501Spendry@node     Selectors, Map Options, Variable Expansion, Location Format
1103*47501Spendry@comment  node-name,  next,  previous,  up
1104*47501Spendry@subsection Selectors
1105*47501Spendry@cindex Selectors
1106*47501Spendry
1107*47501SpendrySelectors are used to control the use of a location.  It is possible to
1108*47501Spendryshare a mount map between many machines in such a way that filesystem
1109*47501Spendrylocation, architecture and operating system differences are hidden from
1110*47501Spendrythe users.  A selector of the form @samp{arch==sun3;os==sos4} would only
1111*47501Spendryapply on Sun-3s running SunOS 4.x.
1112*47501Spendry
1113*47501SpendrySelectors are evaluated left to right.  If a selector fails then that
1114*47501Spendrylocation is ignored.  Thus the selectors form a conjunction and the
1115*47501Spendrylocations form a disjunction.  If all the locations are ignored or
1116*47501Spendryotherwise fail then @i{Amd} uses the @dfn{error} filesystem
1117*47501Spendry(@pxref{Error Filesystem}).  This is equivalent to having a location
1118*47501Spendry@samp{type:=error} at the end of each mount-map entry.@refill
1119*47501Spendry
1120*47501SpendryThe selectors currently implemented are:
1121*47501Spendry
1122*47501Spendry@table @samp
1123*47501Spendry@cindex arch, mount selector
1124*47501Spendry@cindex Mount selector; arch
1125*47501Spendry@cindex Selector; arch
1126*47501Spendry@item arch
1127*47501Spendrythe machine architecture which was automatically determined at compile
1128*47501Spendrytime.  The architecture type can be displayed by running the command
1129*47501Spendry@samp{amd -v}.  @xref{Supported Machine Architectures}.@refill
1130*47501Spendry
1131*47501Spendry@item autodir
1132*47501Spendry@cindex autodir, mount selector
1133*47501Spendry@cindex Mount selector; autodir
1134*47501Spendry@cindex Selector; autodir
1135*47501Spendrythe default directory under which to mount filesystems.  This may be
1136*47501Spendrychanged by the ``-a'' command line option.  See the @var{fs} option.
1137*47501Spendry
1138*47501Spendry@item byte
1139*47501Spendry@cindex byte, mount selector
1140*47501Spendry@cindex Mount selector; byte
1141*47501Spendry@cindex Selector; byte
1142*47501Spendrythe machine's byte ordering.  This is either @samp{little}, indicating
1143*47501Spendrylittle-endian, or @samp{big}, indicating big-endian.  One possible use
1144*47501Spendryis to share @samp{rwho} databases (@pxref{rwho servers}).  Another is to
1145*47501Spendryshare ndbm databases, however this use can be considered a courageous
1146*47501Spendryjuggling act.
1147*47501Spendry
1148*47501Spendry@item cluster
1149*47501Spendry@cindex cluster, mount selector
1150*47501Spendry@cindex Mount selector; cluster
1151*47501Spendry@cindex Selector; cluster
1152*47501Spendryis provided as a hook for the name of the local cluster.  This can be
1153*47501Spendryused to decide which servers to use for copies of replicated
1154*47501Spendryfilesystems.  @code{$@{cluster@}} defaults to the value of
1155*47501Spendry@code{$@{domain@}} unless a different value is set with the ``-C''
1156*47501Spendrycommand line option.
1157*47501Spendry
1158*47501Spendry@item domain
1159*47501Spendry@cindex domain, mount selector
1160*47501Spendry@cindex Mount selector; domain
1161*47501Spendry@cindex Selector; domain
1162*47501Spendrythe local domain name as specified by the ``-d'' command line option.
1163*47501SpendrySee @samp{host}.
1164*47501Spendry
1165*47501Spendry@item host
1166*47501Spendry@cindex host, mount selector
1167*47501Spendry@cindex Mount selector; host
1168*47501Spendry@cindex Selector; host
1169*47501Spendrythe local hostname as determined by @b{gethostname}(2).  If no domain
1170*47501Spendryname was specified on the command line and the hostname contains a
1171*47501Spendryperiod @samp{.} then the string before the period is used as the
1172*47501Spendryhost name, and the string after the period is assigned to
1173*47501Spendry@code{$@{domain@}}.  For example, if the hostname is
1174*47501Spendry@samp{styx.doc.ic.ac.uk} then @code{host} would be @samp{styx} and
1175*47501Spendry@code{domain} would be @samp{doc.ic.ac.uk}.  @code{hostd} would be
1176*47501Spendry@samp{styx.doc.ic.ac.uk}.@refill
1177*47501Spendry
1178*47501Spendry@item hostd
1179*47501Spendry@cindex hostd, mount selector
1180*47501Spendry@cindex Mount selector; hostd
1181*47501Spendry@cindex Selector; hostd
1182*47501Spendryis @code{$@{host@}} and @code{$@{domain@}} concatenated with a
1183*47501Spendry@samp{.} inserted between them if required.  If @code{$@{domain@}}
1184*47501Spendryis an empty string then @code{$@{host@}} and @code{$@{hostd@}} will be
1185*47501Spendryidentical.
1186*47501Spendry
1187*47501Spendry@item karch
1188*47501Spendry@cindex karch, mount selector
1189*47501Spendry@cindex Mount selector; karch
1190*47501Spendry@cindex Selector; karch
1191*47501Spendryis provided as a hook for the kernel architecture.  This is used on
1192*47501SpendrySunOS 4, for example, to distinguish between different @samp{/usr/kvm}
1193*47501Spendryvolumes.  @code{$@{karch@}} defaults to the value of @code{$@{arch@}}
1194*47501Spendryunless a different value is set with the ``-k'' command line option.
1195*47501Spendry
1196*47501Spendry@item os
1197*47501Spendry@cindex os, mount selector
1198*47501Spendry@cindex Mount selector; os
1199*47501Spendry@cindex Selector; os
1200*47501Spendrythe operating system.  Like the machine architecture, this is
1201*47501Spendryautomatically determined at compile time.  The operating system name can
1202*47501Spendrybe displayed by running the command @samp{amd -v}.  @xref{Supported
1203*47501SpendryOperating Systems}.@refill
1204*47501Spendry
1205*47501Spendry@end table
1206*47501Spendry
1207*47501SpendryThe following selectors are also provided.  Unlike the other selectors,
1208*47501Spendrythey vary for each lookup.  Note that when the name from the kernel is
1209*47501Spendryexpanded prior to a map lookup, these selectors are all defined as empty
1210*47501Spendrystrings.
1211*47501Spendry
1212*47501Spendry@table @samp
1213*47501Spendry@item key
1214*47501Spendry@cindex key, mount selector
1215*47501Spendry@cindex Mount selector; key
1216*47501Spendry@cindex Selector; key
1217*47501Spendrythe name being resolved.  For example, if @file{/home} is an automount
1218*47501Spendrypoint, then accessing @file{/home/foo} would set @code{$@{key@}} to the
1219*47501Spendrystring @samp{foo}.  The key is prefixed by the @var{pref} option set in
1220*47501Spendrythe parent mount point.  The default prefix is an empty string.  If the
1221*47501Spendryprefix was @file{blah/} then @code{$@{key@}} would be set to
1222*47501Spendry@file{blah/foo}.@refill
1223*47501Spendry
1224*47501Spendry@item map
1225*47501Spendry@cindex map, mount selector
1226*47501Spendry@cindex Mount selector; map
1227*47501Spendry@cindex Selector; map
1228*47501Spendrythe name of the mount map being used.
1229*47501Spendry
1230*47501Spendry@item path
1231*47501Spendry@cindex path, mount selector
1232*47501Spendry@cindex Mount selector; path
1233*47501Spendry@cindex Selector; path
1234*47501Spendrythe full pathname of the name being resolved.  For example
1235*47501Spendry@file{/home/foo} in the example above.
1236*47501Spendry
1237*47501Spendry@item wire
1238*47501Spendry@cindex wire, mount selector
1239*47501Spendry@cindex Mount selector; wire
1240*47501Spendry@cindex Selector; wire
1241*47501Spendrythe name of the network to which the primary network interface is
1242*47501Spendryattached.  If a symbolic name cannot be found in the networks or hosts
1243*47501Spendrydatabase then dotted IP address format is used.  This value is also
1244*47501Spendryoutput by the ``-v'' option.
1245*47501Spendry
1246*47501Spendry@end table
1247*47501Spendry
1248*47501SpendrySelectors can be negated by using @samp{!=} instead of @samp{==}.  For
1249*47501Spendryexample to select a location on all non-Vax machines the selector
1250*47501Spendry@samp{arch!=vax} would be used.
1251*47501Spendry
1252*47501Spendry@node     Map Options,  , Selectors, Location Format
1253*47501Spendry@comment  node-name,  next,  previous,  up
1254*47501Spendry@subsection Map Options
1255*47501Spendry@cindex Map options
1256*47501Spendry@cindex Setting map options
1257*47501Spendry
1258*47501SpendryOptions are parsed concurrently with selectors.  The difference is that
1259*47501Spendrywhen an option is seen the string following the @samp{:=} is
1260*47501Spendryrecorded for later use.  As a minimum the @var{type} option must be
1261*47501Spendryspecified.  Each filesystem type has other options which must also be
1262*47501Spendryspecified.  @xref{Filesystem Types}, for details on the filesystem
1263*47501Spendryspecific options.@refill
1264*47501Spendry
1265*47501SpendrySuperfluous option specifications are ignored and are not reported
1266*47501Spendryas errors.
1267*47501Spendry
1268*47501SpendryThe following options apply to more than one filesystem type.
1269*47501Spendry
1270*47501Spendry@menu
1271*47501Spendry* delay Option::
1272*47501Spendry* fs Option::
1273*47501Spendry* opts Option::
1274*47501Spendry* sublink Option::
1275*47501Spendry* type Option::
1276*47501Spendry@end menu
1277*47501Spendry
1278*47501Spendry@node     delay Option, fs Option, Map Options, Map Options
1279*47501Spendry@comment  node-name,  next,  previous,  up
1280*47501Spendry@subsubsection delay Option
1281*47501Spendry@cindex Setting a delay on a mount location
1282*47501Spendry@cindex Delaying mounts from specific locations
1283*47501Spendry@cindex Primary server
1284*47501Spendry@cindex Secondary server
1285*47501Spendry@cindex delay, mount option
1286*47501Spendry@cindex Mount option; delay
1287*47501Spendry
1288*47501SpendryThe delay, in seconds, before an attempt will be made to mount from the current location.
1289*47501SpendryAuxilliary data, such as network address, file handles and so on are computed
1290*47501Spendryregardless of this value.
1291*47501Spendry
1292*47501SpendryA delay can be used to implement the notion of primary and secondary file servers.
1293*47501SpendryThe secondary servers would have a delay of a few seconds,
1294*47501Spendrythus giving the primary servers a chance to respond first.
1295*47501Spendry
1296*47501Spendry@node     fs Option, opts Option, delay Option, Map Options
1297*47501Spendry@comment  node-name,  next,  previous,  up
1298*47501Spendry@subsubsection fs Option
1299*47501Spendry@cindex Setting the local mount point
1300*47501Spendry@cindex Overriding the default mount point
1301*47501Spendry@cindex fs, mount option
1302*47501Spendry@cindex Mount option; fs
1303*47501Spendry
1304*47501SpendryThe local mount point.  The semantics of this option vary between
1305*47501Spendryfilesystems.
1306*47501Spendry
1307*47501SpendryFor NFS and UFS filesystems the value of @code{$@{fs@}} is used as the
1308*47501Spendrylocal mount point.  For other filesystem types it has other meanings
1309*47501Spendrywhich are described in the section describing the respective filesystem
1310*47501Spendrytype.  It is important that this string uniquely identifies the
1311*47501Spendryfilesystem being mounted.  To satisfy this requirement, it should
1312*47501Spendrycontain the name of the host on which the filesystem is resident and the
1313*47501Spendrypathname of the filesystem on the local or remote host.
1314*47501Spendry
1315*47501SpendryThe reason for requiring the hostname is clear if replicated filesystems
1316*47501Spendryare considered.  If a fileserver goes down and a replacement filesystem
1317*47501Spendryis mounted then the @dfn{local} mount point @dfn{must} be different from
1318*47501Spendrythat of the filesystem which is hung.  Some encoding of the filesystem
1319*47501Spendryname is required if more than one filesystem is to be mounted from any
1320*47501Spendrygiven host.
1321*47501Spendry
1322*47501SpendryIf the hostname is first in the path then all mounts from a particular
1323*47501Spendryhost will be gathered below a single directory.  If that server goes
1324*47501Spendrydown then the hung mount points are less likely to be accidentally
1325*47501Spendryreferenced, for example when @b{getwd}(3) traverses the namespace to
1326*47501Spendryfind the pathname of the current directory.
1327*47501Spendry
1328*47501SpendryThe @samp{fs} option defaults to
1329*47501Spendry@code{$@{autodir@}/$@{rhost@}$@{rfs@}}.  In addition,
1330*47501Spendry@samp{rhost} defaults to the local host name (@code{$@{host@}}) and
1331*47501Spendry@samp{rfs} defaults to the value of @code{$@{path@}}, which is the full
1332*47501Spendrypath of the requested file; @samp{/home/foo} in the example above
1333*47501Spendry(@pxref{Selectors}).  @code{$@{autodir@}} defaults to @samp{/a} but may
1334*47501Spendrybe changed with the ``-a'' command line option.  Sun's automounter
1335*47501Spendrydefaults to @samp{/tmp_mnt}.  Note that there is no @samp{/} between
1336*47501Spendrythe @code{$@{rhost@}} and @code{$@{rfs@}} since @code{$@{rfs@}} begins
1337*47501Spendrywith a @samp{/}.@refill
1338*47501Spendry
1339*47501Spendry@node     opts Option, sublink Option, fs Option, Map Options
1340*47501Spendry@comment  node-name,  next,  previous,  up
1341*47501Spendry@subsubsection opts Option
1342*47501Spendry@cindex Setting system mount options
1343*47501Spendry@cindex Passing parameters to the mount system call
1344*47501Spendry@cindex mount system call
1345*47501Spendry@cindex mount system call flags
1346*47501Spendry@cindex The mount system call
1347*47501Spendry@cindex opts, mount option
1348*47501Spendry@cindex Mount option; opts
1349*47501Spendry
1350*47501SpendryThe options to pass to the mount system call.  A leading @samp{-} is
1351*47501Spendrysilently ignored.  The mount options supported generally correspond to
1352*47501Spendrythose used by @b{mount}(8) and are listed below.  Some additional
1353*47501Spendrypseudo-options are interpreted by @i{Amd} and are also listed.
1354*47501Spendry
1355*47501SpendryUnless specifically overridden, each of the system default mount options
1356*47501Spendryapplies.  Any options not recognised are ignored.  If no options list is
1357*47501Spendrysupplied the string @samp{rw,defaults} is used and all the system
1358*47501Spendrydefault mount options apply.  Options which are not applicable for a
1359*47501Spendryparticular operating system are silently ignored.  For example, only 4.4
1360*47501SpendryBSD is known to implement the @code{compress} and @code{spongy} options.
1361*47501Spendry
1362*47501Spendry@table @code
1363*47501Spendry@item compress
1364*47501SpendryUse NFS compression protocol.
1365*47501Spendry@item grpid
1366*47501SpendryUse BSD directory group-id semantics.
1367*47501Spendry@item intr
1368*47501SpendryAllow keyboard interrupts on hard mounts.
1369*47501Spendry@item noconn
1370*47501SpendryDon't make a connection on datagram transports.
1371*47501Spendry@item nocto
1372*47501SpendryNo close-to-open consistency.
1373*47501Spendry@item nodevs
1374*47501SpendryDon't allow local special devices on this filesystem.
1375*47501Spendry@item nosuid
1376*47501SpendryDon't allow set-uid or set-gid executables on this filesystem.
1377*47501Spendry@item quota
1378*47501SpendryEnable quota checking on this mount.
1379*47501Spendry@item retrans=@i{n}
1380*47501SpendryThe number of NFS retransmits made before a user error is generated by a
1381*47501Spendry@samp{soft} mounted filesystem, and before a @samp{hard} mounted
1382*47501Spendryfilesystem reports @samp{NFS server @dfn{yoyo} not responding still
1383*47501Spendrytrying}.
1384*47501Spendry@item ro
1385*47501SpendryMount this filesystem readonly.
1386*47501Spendry@item rsize=@var{n}
1387*47501SpendryThe NFS read packet size.  You may need to set this if you are using
1388*47501SpendryNFS/UDP through a gateway.
1389*47501Spendry@item soft
1390*47501SpendryGive up after @dfn{retrans} retransmissions.
1391*47501Spendry@item spongy
1392*47501SpendryLike @samp{soft} for status requests, and @samp{hard} for data transfers.
1393*47501Spendry@item tcp
1394*47501SpendryUse TCP/IP instead of UDP/IP, ignored if the NFS implementation does not
1395*47501Spendrysupport TCP/IP mounts.
1396*47501Spendry@item timeo=@var{n}
1397*47501SpendryThe NFS timeout, in tenth-seconds, before a request is retransmitted.
1398*47501Spendry@item wsize=@var{n}
1399*47501SpendryThe NFS write packet size.  You may need to set this if you are using
1400*47501SpendryNFS/UDP through a gateway.
1401*47501Spendry@end table
1402*47501Spendry
1403*47501SpendryThe following options are implemented by @i{Amd}, rather than being
1404*47501Spendrypassed to the kernel.
1405*47501Spendry
1406*47501Spendry@table @code
1407*47501Spendry@item nounmount
1408*47501SpendryConfigures the mount so that its time-to-live will
1409*47501Spendrynever expire.  This is also the default for some filesystem types.
1410*47501Spendry@c
1411*47501Spendry@c Implementation broken:
1412*47501Spendry@item ping=@var{n}
1413*47501SpendryThe interval, in seconds, between keep-alive pings.  When four
1414*47501Spendryconsecutive pings have failed the mount point is marked as hung.  This
1415*47501Spendryinterval defaults to 30 seconds.  If the ping interval is less then or
1416*47501Spendryequal to zero, no pings are sent and the host is assumed to be always
1417*47501Spendryup.  By default, pings are not sent for an NFS/TCP mount.
1418*47501Spendry@item retry=@var{n}
1419*47501SpendryThe number of times to retry the mount system call.
1420*47501Spendry@item utimeout=@var{n}
1421*47501SpendryThe interval, in seconds, by which the mount's
1422*47501Spendrytime-to-live is extended after an unmount attempt
1423*47501Spendryhas failed.  In fact the interval is extended before the unmount is
1424*47501Spendryattempted to avoid thrashing.  The default value is 120 seconds (two
1425*47501Spendryminutes) or as set by the ``-w'' command line option.
1426*47501Spendry@end table
1427*47501Spendry
1428*47501Spendry@node     sublink Option, type Option, opts Option, Map Options
1429*47501Spendry@comment  node-name,  next,  previous,  up
1430*47501Spendry@subsubsection sublink Option
1431*47501Spendry@cindex Setting the sublink option
1432*47501Spendry@cindex sublink, mount option
1433*47501Spendry@cindex Mount option; sublink
1434*47501Spendry
1435*47501SpendryThe subdirectory within the mounted filesystem to which the reference
1436*47501Spendryshould point.  This can be used to prevent duplicate mounts in cases
1437*47501Spendrywhere multiple directories in the same mounted filesystem are used.
1438*47501Spendry
1439*47501Spendry@node     type Option, Map Options, sublink Option, Map Options
1440*47501Spendry@comment  node-name,  next,  previous,  up
1441*47501Spendry@subsubsection type Option
1442*47501Spendry@cindex Setting the filesystem type option
1443*47501Spendry@cindex type, mount option
1444*47501Spendry@cindex Mount option; type
1445*47501Spendry
1446*47501SpendryThe filesystem type to be used.  @xref{Filesystem Types}, for a full
1447*47501Spendrydescription of each type.@refill
1448*47501Spendry
1449*47501Spendry@node     Amd Command Line Options, Filesystem Types, Mount Maps, Top
1450*47501Spendry@comment  node-name,  next,  previous,  up
1451*47501Spendry@chapter @i{Amd} Command Line Options
1452*47501Spendry@cindex Command line options, Amd
1453*47501Spendry@cindex Amd command line options
1454*47501Spendry@cindex Overriding defaults on the command line
1455*47501Spendry
1456*47501SpendryMany of @i{Amd}'s parameters can be set from the command line.  The
1457*47501Spendrycommand line is also used to specify automount points and maps.
1458*47501Spendry
1459*47501SpendryThe general format of a command line is
1460*47501Spendry
1461*47501Spendry@example
1462*47501Spendryamd [@i{options}] { @i{directory} @i{map-name} [-@i{map-options}] } ...
1463*47501Spendry@end example
1464*47501Spendry
1465*47501SpendryFor each directory and map-name given, @i{Amd} establishes an
1466*47501Spendryautomount point.  The @dfn{map-options} may be any sequence of options
1467*47501Spendryor selectors---@pxref{Location Format}.  The @dfn{map-options}
1468*47501Spendryapply only to @i{Amd}'s mount point.
1469*47501Spendry
1470*47501Spendry@samp{type:=toplvl;cache:=mapdefault;fs:=$@{map@}} is the default value for the
1471*47501Spendrymap options.  Default options for a map are read from a special entry in
1472*47501Spendrythe map whose key is the string @samp{/defaults}.  When default options
1473*47501Spendryare given they are prepended to any options specified in the mount-map
1474*47501Spendrylocations as explained in.  @xref{Map Defaults}, for more details.
1475*47501Spendry
1476*47501SpendryThe @dfn{options} are any combination of those listed below.
1477*47501Spendry
1478*47501SpendryOnce the command line has been parsed, the automount points are mounted.
1479*47501SpendryThe mount points are created if they do not already exist, in which case they
1480*47501Spendrywill be removed when @i{Amd} exits.
1481*47501SpendryFinally, @i{Amd} disassociates itself from its controlling terminal and
1482*47501Spendryforks into the background.
1483*47501Spendry
1484*47501SpendryNote: Even if @i{Amd} has been built with @samp{-DDEBUG} it will still
1485*47501Spendrybackground itself and disassociate itself from the controlling terminal.
1486*47501SpendryTo use a debugger it is necessary to specify @samp{-D nodaemon} on the
1487*47501Spendrycommand line.
1488*47501Spendry
1489*47501Spendry@menu
1490*47501Spendry* -a Option::	Automount directory.
1491*47501Spendry* -c Option::	Cache timeout interval.
1492*47501Spendry* -d Option::	Domain name.
1493*47501Spendry* -k Option::	Kernel architecture.
1494*47501Spendry* -l Option::	Log file.
1495*47501Spendry* -n Option::	Hostname normalisation.
1496*47501Spendry* -p Option::	Output process id.
1497*47501Spendry* -r Option::	Restart existing mounts.
1498*47501Spendry* -t Option::	Kernel RPC timeout.
1499*47501Spendry* -v Option::	Version information.
1500*47501Spendry* -w Option::	Wait interval after failed unmount.
1501*47501Spendry* -x Option::	Log options.
1502*47501Spendry* -y Option::	NIS domain.
1503*47501Spendry* -C-Option::	Cluster name.
1504*47501Spendry* -D-Option::	Debug flags.
1505*47501Spendry@end menu
1506*47501Spendry
1507*47501Spendry@node     -a Option, -c Option, Amd Command Line Options, Amd Command Line Options
1508*47501Spendry@comment  node-name,  next,  previous,  up
1509*47501Spendry@section @code{-a} @var{directory}
1510*47501Spendry@cindex Automount directory
1511*47501Spendry@cindex Setting the default mount directory
1512*47501Spendry
1513*47501SpendrySpecifies the default mount directory.  This option changes the variable
1514*47501Spendry@code{$@{autodir@}} which otherwise defaults to @file{/a}.  For example,
1515*47501Spendrysome sites prefer @file{/amd}.
1516*47501Spendry
1517*47501Spendry@example
1518*47501Spendryamd -a /amd ...
1519*47501Spendry@end example
1520*47501Spendry
1521*47501Spendry@node     -c Option, -d Option, -a Option, Amd Command Line Options
1522*47501Spendry@comment  node-name,  next,  previous,  up
1523*47501Spendry@section @code{-c} @var{cache-interval}
1524*47501Spendry@cindex Cache interval
1525*47501Spendry@cindex Interval before a filesystem times out
1526*47501Spendry@cindex Setting the interval before a filesystem times out
1527*47501Spendry@cindex Changing the interval before a filesystem times out
1528*47501Spendry
1529*47501SpendrySelects the period, in seconds, for which a name is cached by @i{Amd}.
1530*47501SpendryIf no reference is made to the volume in this period, @i{Amd} discards
1531*47501Spendrythe volume name to filesystem mapping.
1532*47501Spendry
1533*47501SpendryOnce the last reference to a filesystem has been removed, @i{Amd}
1534*47501Spendryattempts to unmount the filesystem.  If the unmount fails the interval
1535*47501Spendryis extended by a further period as specified by the @samp{-w} command
1536*47501Spendryline option or by the @samp{utimeout} mount option.
1537*47501Spendry
1538*47501SpendryThe default @dfn{cache-interval} is 300 seconds (five minutes).
1539*47501Spendry
1540*47501Spendry@node     -d Option, -k Option, -a Option, Amd Command Line Options
1541*47501Spendry@comment  node-name,  next,  previous,  up
1542*47501Spendry@section @code{-d} @var{domain}
1543*47501Spendry@cindex Domain name
1544*47501Spendry@cindex Setting the local domain name
1545*47501Spendry@cindex Overriding the local domain name
1546*47501Spendry
1547*47501SpendrySpecifies the host's domain.  This sets the internal variable
1548*47501Spendry@code{$@{domain@}} and affects the @code{$@{hostd@}} variable.
1549*47501Spendry
1550*47501SpendryIf this option is not specified and the hostname already contains the
1551*47501Spendrylocal domain then that is used, otherwise the default value of
1552*47501Spendry@code{$@{domain@}} is @samp{unknown.domain}.
1553*47501Spendry
1554*47501SpendryFor example, if the local domain was @samp{doc.ic.ac.uk}, @i{Amd} could
1555*47501Spendrybe started as follows:
1556*47501Spendry
1557*47501Spendry@example
1558*47501Spendryamd -d doc.ic.ac.uk ...
1559*47501Spendry@end example
1560*47501Spendry
1561*47501Spendry@node     -k Option, -l Option, -d Option, Amd Command Line Options
1562*47501Spendry@comment  node-name,  next,  previous,  up
1563*47501Spendry@section @code{-k} @var{kernel-architecture}
1564*47501Spendry@cindex Setting the Kernel architecture
1565*47501Spendry
1566*47501SpendrySpecifies the kernel architecture of the system.  This is usually the
1567*47501Spendryoutput of @samp{arch -k} and its only effect is to set the variable
1568*47501Spendry@code{$@{karch@}}.  If this option is not given, @code{$@{karch@}} has
1569*47501Spendrythe same value as @code{$@{arch@}}.
1570*47501Spendry
1571*47501SpendryThis would be used as follows:
1572*47501Spendry
1573*47501Spendry@example
1574*47501Spendryamd -k `arch -k` ...
1575*47501Spendry@end example
1576*47501Spendry
1577*47501Spendry@node     -l Option, -n Option, -k Option, Amd Command Line Options
1578*47501Spendry@comment  node-name,  next,  previous,  up
1579*47501Spendry@section @code{-l} @var{log-option}
1580*47501Spendry@cindex Log filename
1581*47501Spendry@cindex Setting the log file
1582*47501Spendry@cindex Using syslog to log errors
1583*47501Spendry@cindex syslog
1584*47501Spendry
1585*47501SpendrySelects the form of logging to be made.  Two special @dfn{log-options}
1586*47501Spendryare recognised.
1587*47501Spendry
1588*47501Spendry@enumerate
1589*47501Spendry@item
1590*47501SpendryIf @dfn{log-option} is the string @samp{syslog}, @i{Amd} will use the
1591*47501Spendry@b{syslog}(3) mechanism.@refill
1592*47501Spendry
1593*47501Spendry@item
1594*47501SpendryIf @dfn{log-option} is the string @samp{/dev/stderr}, @i{Amd} will use
1595*47501Spendrystandard error, which is also the default target for log messages.  To
1596*47501Spendryimplement this, @i{Amd} simulates the effect of the @samp{/dev/fd}
1597*47501Spendrydriver.
1598*47501Spendry@end enumerate
1599*47501Spendry
1600*47501SpendryAny other string is taken as a filename to use for logging.  Log
1601*47501Spendrymessages are appended to the file if it already exists, otherwise a new
1602*47501Spendryfile is created.  The file is opened once and then held open, rather
1603*47501Spendrythan being re-opened for each message.
1604*47501Spendry
1605*47501SpendryIf the @samp{syslog} option is specified but the system does not support
1606*47501Spendrysyslog or if the named file cannot be opened or created, @i{Amd} will
1607*47501Spendryuse standard error.  Error messages generated before @i{Amd} has
1608*47501Spendryfinished parsing the command line are printed on standard error.
1609*47501Spendry
1610*47501SpendryUsing @samp{syslog} is usually best, in which case @i{Amd} would be
1611*47501Spendrystarted as follows:
1612*47501Spendry
1613*47501Spendry@example
1614*47501Spendryamd -l syslog ...
1615*47501Spendry@end example
1616*47501Spendry
1617*47501Spendry@node     -n Option, -p Option, -l Option, Amd Command Line Options
1618*47501Spendry@comment  node-name,  next,  previous,  up
1619*47501Spendry@section @code{-n}
1620*47501Spendry@cindex Hostname normalisation
1621*47501Spendry@cindex Aliased hostnames
1622*47501Spendry@cindex Resolving aliased hostnames
1623*47501Spendry@cindex Normalising hostnames
1624*47501Spendry
1625*47501SpendryNormalises the remote hostname before using it.  Normalisation is done
1626*47501Spendryby replacing the value of @code{$@{rhost@}} with the primary name
1627*47501Spendryreturned by a hostname lookup.
1628*47501Spendry
1629*47501SpendryThis option should be used if several names are used to refer to a
1630*47501Spendrysingle host in a mount map.
1631*47501Spendry
1632*47501Spendry@node     -p Option, -t Option, -n Option, Amd Command Line Options
1633*47501Spendry@comment  node-name,  next,  previous,  up
1634*47501Spendry@section @code{-p}
1635*47501Spendry@cindex Process id
1636*47501Spendry@cindex Displaying the process id
1637*47501Spendry@cindex process id of Amd daemon
1638*47501Spendry@cindex pid file, creating with -p option
1639*47501Spendry@cindex Creating a pid file
1640*47501Spendry
1641*47501SpendryCauses @i{Amd}'s process id to be printed on standard output.
1642*47501SpendryThis can be redirected to a suitable file for use with kill:
1643*47501Spendry
1644*47501Spendry@example
1645*47501Spendryamd -p > /var/run/amd.pid ...
1646*47501Spendry@end example
1647*47501Spendry
1648*47501SpendryThis option only has an affect if @i{Amd} is running in daemon mode.
1649*47501SpendryIf @i{Amd} is started with the @code{-D nodaemon} debug flag, this
1650*47501Spendryoption is ignored.
1651*47501Spendry
1652*47501Spendry@node     -r Option, -t Option, -p Option, Amd Command Line Options
1653*47501Spendry@comment  node-name,  next,  previous,  up
1654*47501Spendry@section @code{-r}
1655*47501Spendry@cindex Restarting existing mounts
1656*47501Spendry@cindex Picking up existing mounts
1657*47501Spendry
1658*47501SpendryTells @i{Amd} to restart existing mounts (@pxref{Inheritance Filesystem}).
1659*47501Spendry@c @dfn{This option will be made the default in the next release.}
1660*47501Spendry
1661*47501Spendry@node     -t Option, -v Option, -r Option, Amd Command Line Options
1662*47501Spendry@comment  node-name,  next,  previous,  up
1663*47501Spendry@section @code{-t} @var{timeout.retransmit}
1664*47501Spendry@cindex Setting Amd's RPC parameters
1665*47501Spendry
1666*47501SpendrySpecifies the RPC @dfn{timeout} and @dfn{retransmit} intervals used by
1667*47501Spendrythe kernel to communicate to @i{Amd}.  These are used to set the
1668*47501Spendry@samp{timeo} and @samp{retrans} mount options.
1669*47501Spendry
1670*47501Spendry@i{Amd} relies on the kernel RPC retransmit mechanism to trigger mount
1671*47501Spendryretries.  The value of this parameter changes the retry interval.  Too
1672*47501Spendrylong an interval gives poor interactive response, too short an interval
1673*47501Spendrycauses excessive retries.
1674*47501Spendry
1675*47501Spendry@node     -v Option, -w Option, -t Option, Amd Command Line Options
1676*47501Spendry@comment  node-name,  next,  previous,  up
1677*47501Spendry@section @code{-v}
1678*47501Spendry@cindex Version information
1679*47501Spendry@cindex Discovering version information
1680*47501Spendry@cindex How to discover your version of Amd
1681*47501Spendry
1682*47501SpendryPrint version information on standard error and then exit.  The output
1683*47501Spendryis of the form:
1684*47501Spendry
1685*47501Spendry@example
1686*47501Spendryamd 5.2.1.11 of 91/03/17 18:04:05 5.3Alpha11 #0: Sun Mar 17 18:07:28 GMT 1991
1687*47501SpendryBuilt by pendry@@vangogh.Berkeley.EDU for a hp300 running bsd44 (big-endian).
1688*47501SpendryMap support for: root, passwd, union, file, error.
1689*47501SpendryFS: ufs, nfs, nfsx, host, link, program, union, auto, direct, toplvl, error.
1690*47501SpendryPrimary network is 128.32.130.0.
1691*47501Spendry@end example
1692*47501Spendry
1693*47501SpendryThe information includes the version number, release date and name of
1694*47501Spendrythe release.  The architecture (@pxref{Supported Machine Architectures}),
1695*47501Spendryoperating system (@pxref{Supported Operating Systems})
1696*47501Spendryand byte ordering are also printed as they appear in the @code{$@{os@}},
1697*47501Spendry@code{$@{arch@}} and @code{$@{byte@}} variables.@refill
1698*47501Spendry
1699*47501Spendry@node     -w Option, -x Option, -v Option, Amd Command Line Options
1700*47501Spendry@comment  node-name,  next,  previous,  up
1701*47501Spendry@section @code{-w} @var{wait-timeout}
1702*47501Spendry@cindex Setting the interval between unmount attempts
1703*47501Spendry@cindex unmount attempt backoff interval
1704*47501Spendry
1705*47501SpendrySelects the interval in seconds between unmount attempts after the
1706*47501Spendryinitial time-to-live has expired.
1707*47501Spendry
1708*47501SpendryThis defaults to 120 seconds (two minutes).
1709*47501Spendry
1710*47501Spendry@node     -x Option, -y Option, -w Option, Amd Command Line Options
1711*47501Spendry@comment  node-name,  next,  previous,  up
1712*47501Spendry@section @code{-x} @var{opts}
1713*47501Spendry@cindex Log message selection
1714*47501Spendry@cindex Selecting specific log messages
1715*47501Spendry@cindex How to select log messages
1716*47501Spendry@cindex syslog priorities
1717*47501Spendry
1718*47501SpendrySpecifies the type and verbosity of log messages.  @dfn{opts} is
1719*47501Spendrya comma separated list selected from the following options:
1720*47501Spendry
1721*47501Spendry@table @code
1722*47501Spendry@item fatal
1723*47501SpendryFatal errors
1724*47501Spendry@item error
1725*47501SpendryNon-fatal errors
1726*47501Spendry@item user
1727*47501SpendryNon-fatal user errors
1728*47501Spendry@item warn
1729*47501SpendryRecoverable errors
1730*47501Spendry@item warning
1731*47501SpendryAlias for @code{warn}
1732*47501Spendry@item info
1733*47501SpendryInformation messages
1734*47501Spendry@item map
1735*47501SpendryMount map usage
1736*47501Spendry@item stats
1737*47501SpendryAdditional statistics
1738*47501Spendry@item all
1739*47501SpendryAll of the above
1740*47501Spendry@end table
1741*47501Spendry
1742*47501SpendryInitially a set of default logging flags is enabled.  This is as if
1743*47501Spendry@samp{-x all,nomap,nostats} had been selected.  The command line is
1744*47501Spendryparsed and logging is controlled by the ``-x'' option.  The very first
1745*47501Spendryset of logging flags is saved and can not be subsequently disabled using
1746*47501Spendry@i{Amq}.  This default set of options is useful for general production
1747*47501Spendryuse.@refill
1748*47501Spendry
1749*47501SpendryThe @samp{info} messages include details of what is mounted and
1750*47501Spendryunmounted and when filesystems have timed out.  If you want to have the
1751*47501Spendrydefault set of messages without the @samp{info} messages then you simply
1752*47501Spendryneed @samp{-x noinfo}.  The messages given by @samp{user} relate to
1753*47501Spendryerrors in the mount maps, so these are useful when new maps are
1754*47501Spendryinstalled.  The following table lists the syslog priorites used for each
1755*47501Spendryof the message types.@refill
1756*47501Spendry
1757*47501Spendry@table @code
1758*47501Spendry@item fatal
1759*47501SpendryLOG_CRIT
1760*47501Spendry@item error
1761*47501SpendryLOG_ERR
1762*47501Spendry@item user
1763*47501SpendryLOG_WARNING
1764*47501Spendry@item warning
1765*47501SpendryLOG_WARNING
1766*47501Spendry@item info
1767*47501SpendryLOG_INFO
1768*47501Spendry@item debug
1769*47501SpendryLOG_DEBUG
1770*47501Spendry@item map
1771*47501SpendryLOG_DEBUG
1772*47501Spendry@item stats
1773*47501SpendryLOG_INFO
1774*47501Spendry@end table
1775*47501Spendry
1776*47501Spendry
1777*47501SpendryThe options can be prefixed by the string @samp{no} to indicate
1778*47501Spendrythat this option should be turned off.  For example, to obtain all
1779*47501Spendrybut @samp{info} messages the option @samp{-x all,noinfo} would be used.
1780*47501Spendry
1781*47501SpendryIf @i{Amd} was built with debugging enabled the @code{debug} option is
1782*47501Spendryautomatically enabled regardless of the command line options.
1783*47501Spendry
1784*47501Spendry@node     -y Option, -C-Option, -x Option, Amd Command Line Options
1785*47501Spendry@comment  node-name,  next,  previous,  up
1786*47501Spendry@section @code{-y} @var{NIS-domain}
1787*47501Spendry@cindex NIS (YP) domain name
1788*47501Spendry@cindex Overriding the NIS (YP) domain name
1789*47501Spendry@cindex Setting the NIS (YP) domain name
1790*47501Spendry@cindex YP domain name
1791*47501Spendry
1792*47501SpendrySelects an alternate NIS domain.  This is useful for debugging and
1793*47501Spendrycross-domain shared mounting.  If this flag is specified, @i{Amd}
1794*47501Spendryimmediately attempts to bind to a server for this domain.
1795*47501Spendry@c @i{Amd} refers to NIS maps when it starts, unless the ``-m'' option
1796*47501Spendry@c is specified, and whenever required in a mount map.
1797*47501Spendry
1798*47501Spendry@node     -C-Option, -D-Option, -y Option, Amd Command Line Options
1799*47501Spendry@comment  node-name,  next,  previous,  up
1800*47501Spendry@section @code{-C} @var{cluster-name}
1801*47501Spendry@cindex Cluster names
1802*47501Spendry@cindex Setting the cluster name
1803*47501Spendry
1804*47501SpendrySpecifies the name of the cluster of which the local machine is a member.
1805*47501SpendryThe only effect is to set the variable @code{$@{cluster@}}.
1806*47501SpendryThe @dfn{cluster-name} is will usually obtained by running another command which uses
1807*47501Spendrya database to map the local hostname into a cluster name.
1808*47501Spendry@code{$@{cluster@}} can then be used as a selector to restrict mounting of
1809*47501Spendryreplicated data.
1810*47501SpendryIf this option is not given, @code{$@{cluster@}} has the same value as @code{$@{domain@}}.
1811*47501SpendryThis would be used as follows:
1812*47501Spendry
1813*47501Spendry@example
1814*47501Spendryamd -C `clustername` ...
1815*47501Spendry@end example
1816*47501Spendry
1817*47501Spendry@node     -D-Option, , -C-Option, Amd Command Line Options
1818*47501Spendry@comment  node-name,  next,  previous,  up
1819*47501Spendry@section @code{-D} @var{opts}
1820*47501Spendry@cindex Debug options
1821*47501Spendry@cindex Setting debug flags
1822*47501Spendry
1823*47501SpendryControls the verbosity and coverage of the debugging trace; @dfn{opts}
1824*47501Spendryis a comma separated list of debugging options.  The ``-D'' option is
1825*47501Spendryonly available if @i{Amd} was compiled with @samp{-DDEBUG}.  The memory
1826*47501Spendrydebugging facilities are only available if @i{Amd} was compiled with
1827*47501Spendry@samp{-DDEBUG_MEM} (in addition to @samp{-DDEBUG}).
1828*47501Spendry
1829*47501SpendryThe most common options to use are @samp{-D trace} and @samp{-D test}
1830*47501Spendry(which turns on all the useful debug options).  See the program source
1831*47501Spendryfor a more detailed explanation of the available options.
1832*47501Spendry
1833*47501Spendry@node     Filesystem Types, Run-time Administration, Amd Command Line Options, Top
1834*47501Spendry@comment  node-name,  next,  previous,  up
1835*47501Spendry@chapter Filesystem Types
1836*47501Spendry@cindex Filesystem types
1837*47501Spendry@cindex Mount types
1838*47501Spendry@cindex Types of filesystem
1839*47501Spendry
1840*47501SpendryTo mount a volume, @i{Amd} must be told the type of filesystem to be
1841*47501Spendryused.  Each filesystem type typically requires additional information
1842*47501Spendrysuch as the fileserver name for NFS.
1843*47501Spendry
1844*47501SpendryFrom the point of view of @i{Amd}, a @dfn{filesystem} is anything that
1845*47501Spendrycan resolve an incoming name lookup.  An important feature is support
1846*47501Spendryfor multiple filesystem types.  Some of these filesystems are
1847*47501Spendryimplemented in the local kernel and some on remote fileservers, whilst
1848*47501Spendrythe others are implemented internally by @i{Amd}.@refill
1849*47501Spendry
1850*47501SpendryThe two common filesystem types are UFS and NFS.  Four other user
1851*47501Spendryaccessible filesystems (@samp{link}, @samp{program}, @samp{auto} and
1852*47501Spendry@samp{direct}) are also implemented internally by @i{Amd} and these are
1853*47501Spendrydescribed below.  There are two additional filesystem types internal to
1854*47501Spendry@i{Amd} which are not directly accessible to the user (@samp{inherit}
1855*47501Spendryand @samp{error}).  Their use is described since they may still have an
1856*47501Spendryeffect visible to the user.@refill
1857*47501Spendry
1858*47501Spendry@menu
1859*47501Spendry* Network Filesystem::		A single NFS filesystem.
1860*47501Spendry* Network Host Filesystem::	NFS mount a host's entire export tree.
1861*47501Spendry* Network Filesystem Group::	An atomic group of NFS filesystems.
1862*47501Spendry* Unix Filesystem::		Native disk filesystem.
1863*47501Spendry* Program Filesystem::		Generic Program mounts.
1864*47501Spendry* Symbolic Link Filesystem::	Local link referencing existing filesystem.
1865*47501Spendry* Automount Filesystem::
1866*47501Spendry* Direct Automount Filesystem::
1867*47501Spendry* Union Filesystem::
1868*47501Spendry* Error Filesystem::
1869*47501Spendry* Top-level Filesystem::
1870*47501Spendry* Root Filesystem::
1871*47501Spendry* Inheritance Filesystem::
1872*47501Spendry@end menu
1873*47501Spendry
1874*47501Spendry@node     Network Filesystem, Network Host Filesystem, Filesystem Types, Filesystem Types
1875*47501Spendry@comment  node-name,  next,  previous,  up
1876*47501Spendry@section Network Filesystem (@samp{type:=nfs})
1877*47501Spendry@cindex NFS
1878*47501Spendry@cindex Mounting an NFS filesystem
1879*47501Spendry@cindex How to mount and NFS filesystem
1880*47501Spendry@cindex nfs, filesystem type
1881*47501Spendry@cindex Filesystem type; nfs
1882*47501Spendry
1883*47501SpendryThe @dfn{nfs} filesystem type provides access to Sun's NFS.
1884*47501Spendry
1885*47501Spendry@noindent
1886*47501SpendryThe following options must be specified:
1887*47501Spendry
1888*47501Spendry@table @code
1889*47501Spendry@cindex rhost, mount option
1890*47501Spendry@cindex Mount option; rhost
1891*47501Spendry@item rhost
1892*47501Spendrythe remote fileserver.  This must be an entry in the hosts database.  IP
1893*47501Spendryaddresses are not accepted.  The default value is taken
1894*47501Spendryfrom the local host name (@code{$@{host@}}) if no other value is
1895*47501Spendryspecified.
1896*47501Spendry
1897*47501Spendry@cindex rfs, mount option
1898*47501Spendry@cindex Mount option; rfs
1899*47501Spendry@item rfs
1900*47501Spendrythe remote filesystem.
1901*47501SpendryIf no value is specified for this option, an internal default of
1902*47501Spendry@code{$@{path@}} is used.
1903*47501Spendry@end table
1904*47501Spendry
1905*47501SpendryNFS mounts require a two stage process.  First, the @dfn{file handle} of
1906*47501Spendrythe remote file system must be obtained from the server.  Then a mount
1907*47501Spendrysystem call must be done on the local system.  @i{Amd} keeps a cache
1908*47501Spendryof file handles for remote file systems.  The cache entries have a
1909*47501Spendrylifetime of a few minutes.
1910*47501Spendry
1911*47501SpendryIf a required file handle is not in the cache, @i{Amd} sends a request
1912*47501Spendryto the remote server to obtain it.  @i{Amd} @dfn{does not} wait for
1913*47501Spendrya response; it notes that one of the locations needs retrying, but
1914*47501Spendrycontinues with any remaining locations.  When the file handle becomes
1915*47501Spendryavailable, and assuming none of the other locations was successfully
1916*47501Spendrymounted, @i{Amd} will retry the mount.  This mechanism allows several
1917*47501SpendryNFS filesystems to be mounted in parallel.
1918*47501Spendry@c @footnote{The mechanism
1919*47501Spendry@c is general, however NFS is the only filesystem
1920*47501Spendry@c for which the required hooks have been written.}
1921*47501SpendryThe first one which responds with a valid file handle will be used.
1922*47501Spendry
1923*47501Spendry@noindent
1924*47501SpendryAn NFS entry might be:
1925*47501Spendry
1926*47501Spendry@example
1927*47501Spendryjsp  host!=charm;type:=nfs;rhost:=charm;rfs:=/home/charm;sublink:=jsp
1928*47501Spendry@end example
1929*47501Spendry
1930*47501SpendryThe mount system call and any unmount attempts are always done
1931*47501Spendryin a new task to avoid the possibilty of blocking @i{Amd}.
1932*47501Spendry
1933*47501Spendry@node     Network Host Filesystem, Network Filesystem Group, Network Filesystem, Filesystem Types
1934*47501Spendry@comment  node-name,  next,  previous,  up
1935*47501Spendry@section Network Host Filesystem (@samp{type:=host})
1936*47501Spendry@cindex Network host filesystem
1937*47501Spendry@cindex Mounting entire export trees
1938*47501Spendry@cindex How to mount all NFS exported filesystems
1939*47501Spendry@cindex host, filesystem type
1940*47501Spendry@cindex Filesystem type; host
1941*47501Spendry
1942*47501Spendry@c NOTE: the current implementation of the @dfn{host} filesystem type
1943*47501Spendry@c sometimes fails to maintain a consistent view of the remote mount tree.
1944*47501Spendry@c This happens when the mount times out and only some of the remote mounts
1945*47501Spendry@c are successfully unmounted.  To prevent this from occuring, use the
1946*47501Spendry@c @samp{nounmount} mount option.
1947*47501Spendry
1948*47501SpendryThe @dfn{host} filesystem allows access to the entire export tree of an
1949*47501SpendryNFS server.  The implementation is layered above the @samp{nfs}
1950*47501Spendryimplementation so keep-alives work in the same way.  The only option
1951*47501Spendrywhich needs to specified is @samp{rhost} which is the name of the
1952*47501Spendryfileserver to mount.
1953*47501Spendry
1954*47501SpendryThe @samp{host} filesystem type works by querying the mount daemon on
1955*47501Spendrythe given fileserver to obtain its export list.  @i{Amd} then obtains
1956*47501Spendryfilehandles for each of the exported filesystems.  Any errors at this
1957*47501Spendrystage cause that particular filesystem to be ignored.  Finally each
1958*47501Spendryfilesystem is mounted.  Again, errors are logged but ignored.  One
1959*47501Spendrycommon reason for mounts to fail is that the mount point does not exist.
1960*47501SpendryAlthough @i{Amd} attempts to automatically create the mount point, it
1961*47501Spendrymay be on a remote filesystem to which @i{Amd} does not have write
1962*47501Spendrypermission.
1963*47501Spendry
1964*47501SpendryWhen an attempt to unmount a @samp{host} filesystem mount fails, @i{Amd}
1965*47501Spendryremounts any filesystems which had succesfully been unmounted.  To do
1966*47501Spendrythis @i{Amd} queries the mount daemon again and obtains a fresh copy of
1967*47501Spendrythe export list.  @i{Amd} then tries to mount any exported filesystems
1968*47501Spendrywhich are not currently mounted.
1969*47501Spendry
1970*47501SpendrySun's automounter provides a special @samp{-hosts} map.  To achieve the
1971*47501Spendrysame effect with @i{Amd} requires two steps.  First a mount map must
1972*47501Spendrybe created as follows:
1973*47501Spendry
1974*47501Spendry@example
1975*47501Spendry/defaults  type:=host;fs:=$@{autodir@}/$@{rhost@}/root;rhost:=$@{key@}
1976*47501Spendry*          opts:=rw,nosuid,grpid
1977*47501Spendry@end example
1978*47501Spendry
1979*47501Spendry@noindent
1980*47501Spendryand then start @i{Amd} with the following command
1981*47501Spendry
1982*47501Spendry@example
1983*47501Spendryamd /n net.map
1984*47501Spendry@end example
1985*47501Spendry
1986*47501Spendry@noindent
1987*47501Spendrywhere @samp{net.map} is the name of map described above.  Note that the
1988*47501Spendryvalue of @code{$@{fs@}} is overridden in the map.  This is done to avoid
1989*47501Spendrya clash between the mount tree and any other filesystem already mounted
1990*47501Spendryfrom the same fileserver.
1991*47501Spendry
1992*47501SpendryIf different mount options are needed for different hosts then
1993*47501Spendryadditional entries can be added to the map, for example
1994*47501Spendry
1995*47501Spendry@example
1996*47501Spendryhost2       opts:=ro,nosuid,soft
1997*47501Spendry@end example
1998*47501Spendry
1999*47501Spendry@noindent
2000*47501Spendrywould soft mount @samp{host2} read-only.
2001*47501Spendry
2002*47501Spendry@node     Network Filesystem Group, Unix Filesystem, Network Host Filesystem, Filesystem Types
2003*47501Spendry@comment  node-name,  next,  previous,  up
2004*47501Spendry@section Network Filesystem Group (@samp{type:=nfsx})
2005*47501Spendry@cindex Network filesystem group
2006*47501Spendry@cindex Atomic NFS mounts
2007*47501Spendry@cindex Mounting an atomic group of NFS filesystems
2008*47501Spendry@cindex How to mount an atomic group of NFS filesystems
2009*47501Spendry@cindex nfsx, filesystem type
2010*47501Spendry@cindex Filesystem type; nfsx
2011*47501Spendry
2012*47501SpendryThe @dfn{nfsx} filesystem allows a group of filesystems to be mounted
2013*47501Spendryfrom a single NFS server.  The implementation is layered above the
2014*47501Spendry@samp{nfs} implementation so keep-alives work in the same way.
2015*47501Spendry
2016*47501SpendryThe options are the same as for the @samp{nfs} filesystem with one
2017*47501Spendrydifference.
2018*47501Spendry
2019*47501Spendry@noindent
2020*47501SpendryThe following options must be specified:
2021*47501Spendry
2022*47501Spendry@table @code
2023*47501Spendry@item rhost
2024*47501Spendrythe remote fileserver.  This must be an entry in the hosts database.  IP
2025*47501Spendryaddresses are not accepted.  The default value is taken from the local
2026*47501Spendryhost name (@code{$@{host@}}) if no other value is specified.
2027*47501Spendry
2028*47501Spendry@item rfs
2029*47501Spendryas a list of filesystems to mount.  The list is in the form of a comma
2030*47501Spendryseparated strings.
2031*47501Spendry@end table
2032*47501Spendry
2033*47501Spendry@noindent
2034*47501SpendryFor example:
2035*47501Spendry
2036*47501Spendry@example
2037*47501Spendrypub      type:=nfsx;rhost:=gould;rfs:=/public,/,graphics,usenet
2038*47501Spendry@end example
2039*47501Spendry
2040*47501SpendryThe first string defines the root of the tree, and is applied as a
2041*47501Spendryprefix to the remaining members of the list which define the individual
2042*47501Spendryfilesystems.  The first string is @emph{not} used as a filesystem name.
2043*47501SpendryA parallel operation is used to determine the local mount points to
2044*47501Spendryensure a consistent layout of a tree of mounts.
2045*47501Spendry
2046*47501SpendryHere, the @emph{three} filesystems, @samp{/public},
2047*47501Spendry@samp{/public/graphics} and @samp{/public/usenet}, would be mounted.@refill
2048*47501Spendry
2049*47501Spendry@node     Unix Filesystem, Program Filesystem, Network Filesystem Group, Filesystem Types
2050*47501Spendry@comment  node-name,  next,  previous,  up
2051*47501Spendry@section Unix Filesystem (@samp{type:=ufs})
2052*47501Spendry@cindex Unix filesystem
2053*47501Spendry@cindex UFS
2054*47501Spendry@cindex Mounting a UFS filesystem
2055*47501Spendry@cindex Mounting a local disk
2056*47501Spendry@cindex How to mount a UFS filesystems
2057*47501Spendry@cindex How to mount a local disk
2058*47501Spendry@cindex Disk filesystems
2059*47501Spendry@cindex ufs, filesystem type
2060*47501Spendry@cindex Filesystem type; ufs
2061*47501Spendry
2062*47501SpendryThe @dfn{ufs} filesystem type provides access to the system's
2063*47501Spendrystandard disk filesystem---usually a derivative of the Berkeley Fast Filesystem.
2064*47501Spendry
2065*47501Spendry@noindent
2066*47501SpendryThe following option must be specified:
2067*47501Spendry
2068*47501Spendry@table @code
2069*47501Spendry@cindex dev, mount option
2070*47501Spendry@cindex Mount option; dev
2071*47501Spendry@item dev
2072*47501Spendrythe block special device to be mounted.
2073*47501Spendry@end table
2074*47501Spendry
2075*47501SpendryA UFS entry might be:
2076*47501Spendry
2077*47501Spendry@example
2078*47501Spendryjsp   host==charm;type:=ufs;dev:=/dev/xd0g;sublink:=jsp
2079*47501Spendry@end example
2080*47501Spendry
2081*47501Spendry@node     Program Filesystem, Symbolic Link Filesystem, Unix Filesystem, Filesystem Types
2082*47501Spendry@comment  node-name,  next,  previous,  up
2083*47501Spendry@section Program Filesystem (@samp{type:=program})
2084*47501Spendry@cindex Program filesystem
2085*47501Spendry@cindex Mount a filesystem under program control
2086*47501Spendry@cindex program, filesystem type
2087*47501Spendry@cindex Filesystem type; program
2088*47501Spendry
2089*47501SpendryThe @dfn{program} filesystem type allows a program to be run whenever a
2090*47501Spendrymount or unmount is required.  This allows easy addition of support for
2091*47501Spendryother filesystem types, such as MIT's Remote Virtual Disk (RVD)
2092*47501Spendrywhich has a programmatic interface via the commands
2093*47501Spendry@samp{rvdmount} and @samp{rvdunmount}.
2094*47501Spendry
2095*47501Spendry@noindent
2096*47501SpendryThe following options must be specified:
2097*47501Spendry
2098*47501Spendry@table @code
2099*47501Spendry@cindex mount, mount option
2100*47501Spendry@cindex Mount option; mount
2101*47501Spendry@item mount
2102*47501Spendrythe program which will perform the mount.
2103*47501Spendry
2104*47501Spendry@cindex unmount, mount option
2105*47501Spendry@cindex Mount option; unmount
2106*47501Spendry@item unmount
2107*47501Spendrythe program which will perform the unmount.
2108*47501Spendry@end table
2109*47501Spendry
2110*47501SpendryThe exit code from these two programs is interpreted as a Unix error
2111*47501Spendrycode.  As usual, exit code zero indicates success.  To execute the
2112*47501Spendryprogram @i{Amd} splits the string on whitespace to create an array of
2113*47501Spendrysubstrings.  Single quotes @samp{'} can be used to quote whitespace
2114*47501Spendryif that is required in an argument.  There is no way to escape or change
2115*47501Spendrythe quote character.
2116*47501Spendry
2117*47501SpendryTo run the program @samp{rvdmount} with a host name and filesystem as
2118*47501Spendryarguments would be specified by @samp{mount:="/etc/rvdmount rvdmount
2119*47501Spendryfserver $@{path@}"}.
2120*47501Spendry
2121*47501SpendryThe first element in the array is taken as the pathname of the program
2122*47501Spendryto execute.  The other members of the array form the argument vector to
2123*47501Spendrybe passed to the program, @dfn{including argument zero}.  This means
2124*47501Spendrythat the split string must have at least two elements.  The program is
2125*47501Spendrydirectly executed by @i{Amd}, not via a shell.  This means that scripts
2126*47501Spendrymust begin with a @code{#!} interpreter specification.
2127*47501Spendry
2128*47501SpendryIf a filesystem type is to be heavily used, it may be worthwhile adding
2129*47501Spendrya new filesystem type into @i{Amd}, but for most uses the program
2130*47501Spendryfilesystem should suffice.
2131*47501Spendry
2132*47501SpendryWhen the program is run, standard input and standard error are inherited
2133*47501Spendryfrom the current values used by @i{Amd}.  Standard output is a
2134*47501Spendryduplicate of standard error.  The value specified with the ``-l''
2135*47501Spendrycommand line option has no effect on standard error.
2136*47501Spendry
2137*47501Spendry@node     Symbolic Link Filesystem, Automount Filesystem, Program Filesystem, Filesystem Types
2138*47501Spendry@comment  node-name,  next,  previous,  up
2139*47501Spendry@section Symbolic Link Filesystem (@samp{type:=link})
2140*47501Spendry@cindex Symbolic link filesystem
2141*47501Spendry@cindex Referencing part of the local name space
2142*47501Spendry@cindex Mounting part of the local name space
2143*47501Spendry@cindex How to reference part of the local name space
2144*47501Spendry@cindex link, filesystem type
2145*47501Spendry@cindex symlink, link filesystem type
2146*47501Spendry@cindex Filesystem type; link
2147*47501Spendry
2148*47501SpendryEach filesystem type creates a symbolic link to point from the volume
2149*47501Spendryname to the physical mount point.  The @samp{link} filesystem does the
2150*47501Spendrysame without any other side effects.  This allows any part of the
2151*47501Spendrymachines name space to be accessed via @i{Amd}.
2152*47501Spendry
2153*47501SpendryOne common use for the symlink filesystem is @file{/homes} which can be
2154*47501Spendrymade to contain an entry for each user which points to their
2155*47501Spendry(auto-mounted) home directory.  Although this may seem rather expensive,
2156*47501Spendryit provides a great deal of administrative flexibility.
2157*47501Spendry
2158*47501Spendry@noindent
2159*47501SpendryThe following option must be defined:
2160*47501Spendry
2161*47501Spendry@table @code
2162*47501Spendry@item fs
2163*47501SpendryThe value of @var{fs} option specifies the destination of the link, as
2164*47501Spendrymodified by the @var{sublink} option.  If @var{sublink} is non-null, it
2165*47501Spendryis appended to @code{$@{fs@}}@code{/} and the resulting string is used
2166*47501Spendryas the target.
2167*47501Spendry@end table
2168*47501Spendry
2169*47501SpendryThe @samp{link} filesystem can be though of as identical to the
2170*47501Spendry@samp{ufs} filesystem but without actually mounting anything.
2171*47501Spendry
2172*47501SpendryAn example entry might be:
2173*47501Spendry
2174*47501Spendry@example
2175*47501Spendryjsp   host==charm;type:=link;fs:=/home/charm;sublink:=jsp
2176*47501Spendry@end example
2177*47501Spendrywhich would return a symbolic link pointing to @file{/home/charm/jsp}.
2178*47501Spendry
2179*47501Spendry@node     Automount Filesystem, Direct Automount Filesystem, Symbolic Link Filesystem, Filesystem Types
2180*47501Spendry@comment  node-name,  next,  previous,  up
2181*47501Spendry@section Automount Filesystem (@samp{type:=auto})
2182*47501Spendry@cindex Automount filesystem
2183*47501Spendry@cindex Map cache types
2184*47501Spendry@cindex Setting map cache parameters
2185*47501Spendry@cindex How to set map cache parameters
2186*47501Spendry@cindex How to start an indirect automount point
2187*47501Spendry@cindex auto, filesystem type
2188*47501Spendry@cindex Filesystem type; auto
2189*47501Spendry@cindex SIGHUP signal
2190*47501Spendry@cindex Map cache synchronising
2191*47501Spendry@cindex Synchronising the map cache
2192*47501Spendry@cindex Map cache options
2193*47501Spendry@cindex Regular expressions in maps
2194*47501Spendry
2195*47501SpendryThe @dfn{auto} filesystem type creates a new automount point below an
2196*47501Spendryexisting automount point.  Top-level automount points appear as system
2197*47501Spendrymount points.  An automount mount point can also appear as a
2198*47501Spendrysub-directory of an existing automount point.  This allows some
2199*47501Spendryadditional structure to be added, for example to mimic the mount tree of
2200*47501Spendryanother machine.
2201*47501Spendry
2202*47501SpendryThe following options may be specified:
2203*47501Spendry
2204*47501Spendry@table @code
2205*47501Spendry@cindex cache, mount option
2206*47501Spendry@cindex Mount option; cache
2207*47501Spendry@item cache
2208*47501Spendryspecifies whether the data in this mount-map should be
2209*47501Spendrycached.  The default value is @samp{none}, in which case
2210*47501Spendryno caching is done in order to conserve memory.
2211*47501SpendryHowever, better performance and reliability can be obtained by caching
2212*47501Spendrysome or all of a mount-map.
2213*47501Spendry
2214*47501SpendryIf the cache option specifies @samp{all},
2215*47501Spendrythe entire map is enumerated when the mount point is created.
2216*47501Spendry
2217*47501SpendryIf the cache option specifies @samp{inc}, caching is done incrementally
2218*47501Spendryas and when data is required.
2219*47501SpendrySome map types do not support cache mode @samp{all}, in which case @samp{inc}
2220*47501Spendryis used whenever @samp{all} is requested.
2221*47501Spendry
2222*47501SpendryCaching can be entirely disabled by using cache mode @samp{none}.
2223*47501Spendry
2224*47501SpendryIf the cache option specifies @samp{regexp} then the entire map will be
2225*47501Spendryenumerated and each key will be treated as an egrep-style regular
2226*47501Spendryexpression.  The order in which a cached map is searched does not
2227*47501Spendrycorrespond to the ordering in the source map so the regular expressions
2228*47501Spendryshould be mutually exclusive to avoid confusion.
2229*47501Spendry
2230*47501SpendryEach mount map type has a default cache type, usually @samp{inc}, which
2231*47501Spendrycan be selected by specifying @samp{mapdefault}.
2232*47501Spendry
2233*47501SpendryThe cache mode for a mount map can only be selected on the command line.
2234*47501SpendryStarting @i{Amd} with the command:
2235*47501Spendry
2236*47501Spendry@example
2237*47501Spendryamd /homes hesiod.homes -cache:=inc
2238*47501Spendry@end example
2239*47501Spendry
2240*47501Spendrywill cause @samp{/homes} to be automounted using the @dfn{Hesiod} name
2241*47501Spendryserver with local incremental caching of all succesfully resolved names.
2242*47501Spendry
2243*47501SpendryAll cached data is forgotten whenever @i{Amd} receives a @samp{SIGHUP}
2244*47501Spendrysignal and, if cache @samp{all} mode was selected, the cache will be
2245*47501Spendryreloaded.  This can be used to inform @i{Amd} that a map has been
2246*47501Spendryupdated.  In addition, whenever a cache lookup fails and @i{Amd} needs
2247*47501Spendryto examine a map, the map's modify time is examined.  If the cache is
2248*47501Spendryout of date with respect to the map then it is flushed as if a
2249*47501Spendry@samp{SIGHUP} had been received.
2250*47501Spendry
2251*47501SpendryAn additional option (@samp{sync}) may be specified to force @i{Amd} to
2252*47501Spendrycheck the map's modify time whenever a cached entry is being used.  For
2253*47501Spendryexample, an incremental, synchronised cache would be created by the
2254*47501Spendryfollowing command:
2255*47501Spendry
2256*47501Spendry@example
2257*47501Spendryamd /homes hesiod.homes -cache:=inc,sync
2258*47501Spendry@end example
2259*47501Spendry
2260*47501Spendry@item fs
2261*47501Spendryspecifies the name of the mount map to use for the new mount point.
2262*47501Spendry
2263*47501SpendryArguably this should have been specified with the @code{$@{rfs@}} option but
2264*47501Spendrywe are now stuck with it due to historical accident.
2265*47501Spendry
2266*47501Spendry@c %If the string @samp{.} is used then the same map is used;
2267*47501Spendry@c %in addition the lookup prefix is set to the name of the mount point followed
2268*47501Spendry@c %by a slash @samp{/}.
2269*47501Spendry@c %This is the same as specifying @samp{fs:=\$\{map\};pref:=\$\{key\}/}.
2270*47501Spendry@c
2271*47501Spendry
2272*47501Spendry@item pref
2273*47501Spendryalters the name that is looked up in the mount map.  If
2274*47501Spendry@code{$@{pref@}}, the @dfn{prefix}, is non-null then it is prepended to
2275*47501Spendrythe name requested by the kernel @dfn{before} the map is searched.
2276*47501Spendry@end table
2277*47501Spendry
2278*47501SpendryThe server @samp{dylan.doc.ic.ac.uk} has two user disks:
2279*47501Spendry@samp{/dev/dsk/2s0} and @samp{/dev/dsk/5s0}.  These are accessed as
2280*47501Spendry@samp{/home/dylan/dk2} and @samp{/home/dylan/dk5} respectively.  Since
2281*47501Spendry@samp{/home} is already an automount point, this naming is achieved with
2282*47501Spendrythe following map entries:@refill
2283*47501Spendry
2284*47501Spendry@example
2285*47501Spendrydylan        type:=auto;fs:=$@{map@};pref:=$@{key@}/
2286*47501Spendrydylan/dk2    type:=ufs;dev:=/dev/dsk/2s0
2287*47501Spendrydylan/dk5    type:=ufs;dev:=/dev/dsk/5s0
2288*47501Spendry@end example
2289*47501Spendry
2290*47501Spendry@node     Direct Automount Filesystem, Union Filesystem, Automount Filesystem, Filesystem Types
2291*47501Spendry@comment  node-name,  next,  previous,  up
2292*47501Spendry@section Direct Automount Filesystem (@samp{type:=direct})
2293*47501Spendry@cindex Direct automount filesystem
2294*47501Spendry@cindex How to start a direct automount point
2295*47501Spendry@cindex direct, filesystem type
2296*47501Spendry@cindex Filesystem type; direct
2297*47501Spendry
2298*47501SpendryThe @dfn{direct} filesystem is almost identical to the automount
2299*47501Spendryfilesystem.  Instead of appearing to be a directory of mount points, it
2300*47501Spendryappears as a symbolic link to a mounted filesystem.  The mount is done
2301*47501Spendryat the time the link is accessed.  @xref{Automount Filesystem} for a
2302*47501Spendrylist of required options.
2303*47501Spendry
2304*47501SpendryDirect automount points are created by specifying the @samp{direct}
2305*47501Spendryfilesystem type on the command line:
2306*47501Spendry
2307*47501Spendry@example
2308*47501Spendryamd ... /usr/man auto.direct -type:=direct
2309*47501Spendry@end example
2310*47501Spendry
2311*47501Spendrywhere @samp{auto.direct} would contain an entry such as:
2312*47501Spendry
2313*47501Spendry@example
2314*47501Spendryusr/man    -type:=nfs;rfs:=/usr/man \
2315*47501Spendry           rhost:=man-server1  rhost:=man-server2
2316*47501Spendry@end example
2317*47501Spendry
2318*47501SpendryIn this example, @samp{man-server1} and @samp{man-server2} are file
2319*47501Spendryservers which export copies of the manual pages.  Note that the key
2320*47501Spendrywhich is looked up is the name of the automount point without the
2321*47501Spendryleading @samp{/}.
2322*47501Spendry
2323*47501Spendry@node     Union Filesystem, Error Filesystem, Direct Automount Filesystem, Filesystem Types
2324*47501Spendry@comment  node-name,  next,  previous,  up
2325*47501Spendry@section Union Filesystem (@samp{type:=union})
2326*47501Spendry@cindex Union filesystem
2327*47501Spendry@cindex union, filesystem type
2328*47501Spendry@cindex Filesystem type; union
2329*47501Spendry
2330*47501SpendryThe @dfn{union} filesystem type allows the contents of several
2331*47501Spendrydirectories to be merged and made visible in a single directory.  This
2332*47501Spendrycan be used to overcome one of the major limitations of the Unix mount
2333*47501Spendrymechanism which only allows complete directories to be mounted.
2334*47501Spendry
2335*47501SpendryFor example, supposing @file{/tmp} and @file{/var/tmp} were to be merged
2336*47501Spendryinto a new directory called @file{/mtmp}, with files in @file{/var/tmp}
2337*47501Spendrytaking precedence.  The following command could be used to achieve this
2338*47501Spendryeffect:
2339*47501Spendry
2340*47501Spendry@example
2341*47501Spendryamd ... /mtmp union:/tmp:/var/tmp -type:=union
2342*47501Spendry@end example
2343*47501Spendry
2344*47501SpendryCurrently, the unioned directories must @emph{not} be automounted.  That
2345*47501Spendrywould cause a deadlock.  This seriously limits the current usefulness of
2346*47501Spendrythis filesystem type and the problem will be addressed in a future
2347*47501Spendryrelease of @i{Amd}.
2348*47501Spendry
2349*47501SpendryFiles created in the union directory are actually created in the last
2350*47501Spendrynamed directory.  This is done by creating a wildcard entry which points
2351*47501Spendryto the correct directory.  The wildcard entry is visible if the union
2352*47501Spendrydirectory is listed, so allowing you to see which directory has
2353*47501Spendrypriority.
2354*47501Spendry
2355*47501SpendryThe files visible in the union directory are computed at the time
2356*47501Spendry@i{Amd} is started, and are not kept uptodate with respect to the
2357*47501Spendryunderlying directories.  Similarly, if a link is removed, for example
2358*47501Spendrywith the @samp{rm} command, it will be lost forever.
2359*47501Spendry
2360*47501Spendry@node     Error Filesystem, Top-level Filesystem, Direct Automount Filesystem, Filesystem Types
2361*47501Spendry@comment  node-name,  next,  previous,  up
2362*47501Spendry@section Error Filesystem (@samp{type:=error})
2363*47501Spendry@cindex Error filesystem
2364*47501Spendry@cindex error, filesystem type
2365*47501Spendry@cindex Filesystem type; error
2366*47501Spendry
2367*47501SpendryThe @dfn{error} filesystem type is used internally as a catch-all in
2368*47501Spendrythe case where none of the other filesystems was selected, or some other
2369*47501Spendryerror occurred.
2370*47501SpendryLookups and mounts always fail with ``No such file or directory''.
2371*47501SpendryAll other operations trivially succeed.
2372*47501Spendry
2373*47501SpendryThe error filesystem is not directly accessible.
2374*47501Spendry
2375*47501Spendry@node     Top-level Filesystem, Root Filesystem, Error Filesystem, Filesystem Types
2376*47501Spendry@comment  node-name,  next,  previous,  up
2377*47501Spendry@section Top-level Filesystem (@samp{type:=toplvl})
2378*47501Spendry@cindex Top level filesystem
2379*47501Spendry@cindex toplvl, filesystem type
2380*47501Spendry@cindex Filesystem type; toplvl
2381*47501Spendry
2382*47501SpendryThe @dfn{toplvl} filesystems is derived from the @samp{auto} filesystem
2383*47501Spendryand is used to mount the top-level automount nodes.  Requests of this
2384*47501Spendrytype are automatically generated from the command line arguments and
2385*47501Spendrycan also be passed in by using the ``-M'' option of the @dfn{Amq} command.
2386*47501Spendry
2387*47501Spendry@node     Root Filesystem, Inheritance Filesystem, Top-level Filesystem, Filesystem Types
2388*47501Spendry@comment  node-name,  next,  previous,  up
2389*47501Spendry@section Root Filesystem
2390*47501Spendry@cindex Root filesystem
2391*47501Spendry@cindex root, filesystem type
2392*47501Spendry@cindex Filesystem type; root
2393*47501Spendry
2394*47501SpendryThe @dfn{root} (@samp{type:=root}) filesystem type acts as an internal
2395*47501Spendryplaceholder onto which @i{Amd} can pin @samp{toplvl} mounts.  Only one
2396*47501Spendrynode of this type need ever exist and one is created automatically
2397*47501Spendryduring startup.  The effect of creating a second root node is undefined.
2398*47501Spendry
2399*47501Spendry@node     Inheritance Filesystem, , Root Filesystem, Filesystem Types
2400*47501Spendry@comment  node-name,  next,  previous,  up
2401*47501Spendry@section Inheritance Filesystem
2402*47501Spendry@cindex Inheritance filesystem
2403*47501Spendry@cindex Nodes generated on a restart
2404*47501Spendry@cindex inherit, filesystem type
2405*47501Spendry@cindex Filesystem type; inherit
2406*47501Spendry
2407*47501SpendryThe @dfn{inheritance} (@samp{type:=inherit}) filesystem is not directly
2408*47501Spendryaccessible.  Instead, internal mount nodes of this type are
2409*47501Spendryautomatically generated when @i{Amd} is started with the ``-r'' option.
2410*47501SpendryAt this time the system mount table is scanned to locate any filesystems
2411*47501Spendrywhich are already mounted.  If any reference to these filesystems is
2412*47501Spendrymade through @i{Amd} then instead of attempting to mount it, @i{Amd}
2413*47501Spendrysimulates the mount and @dfn{inherits} the filesystem.  This allows a
2414*47501Spendrynew version of @i{Amd} to be installed on a live system simply by
2415*47501Spendrykilling the old daemon with @code{SIGTERM} and starting the new one.@refill
2416*47501Spendry
2417*47501SpendryThis filesystem type is not generally visible externally, but it is
2418*47501Spendrypossible that the output from @samp{amq -m} may list @samp{inherit} as
2419*47501Spendrythe filesystem type.  This happens when an inherit operation cannot
2420*47501Spendrybe completed for some reason, usually because a fileserver is down.
2421*47501Spendry
2422*47501Spendry@node     Run-time Administration, Examples, Filesystem Types, Top
2423*47501Spendry@comment  node-name,  next,  previous,  up
2424*47501Spendry@chapter Run-time Administration
2425*47501Spendry@cindex Run-time administration
2426*47501Spendry@cindex Amq command
2427*47501Spendry
2428*47501Spendry@menu
2429*47501Spendry* Starting Amd::
2430*47501Spendry* Stopping Amd::
2431*47501Spendry* Controlling Amd::
2432*47501Spendry@end menu
2433*47501Spendry
2434*47501Spendry@node     Starting Amd, Stopping Amd, Run-time Administration, Run-time Administration
2435*47501Spendry@comment  node-name,  next,  previous,  up
2436*47501Spendry@section Starting @i{Amd}
2437*47501Spendry@cindex Starting Amd
2438*47501Spendry@cindex Additions to /etc/rc.local
2439*47501Spendry@cindex /etc/rc.local additions
2440*47501Spendry@cindex /etc/amd.start
2441*47501Spendry
2442*47501Spendry@i{Amd} is best started from @samp{/etc/rc.local}:
2443*47501Spendry
2444*47501Spendry@example
2445*47501Spendryif [ -f /etc/amd.start ]; then
2446*47501Spendry        sh /etc/amd.start; (echo -n ' amd')      >/dev/console
2447*47501Spendryfi
2448*47501Spendry@end example
2449*47501Spendry
2450*47501Spendry@noindent
2451*47501SpendryThe shell script, @samp{amd.start}, contains:
2452*47501Spendry
2453*47501Spendry@example
2454*47501Spendry#!/bin/sh -
2455*47501SpendryPATH=/etc:/bin:/usr/bin:/usr/ucb:$PATH export PATH
2456*47501Spendry
2457*47501Spendry#
2458*47501Spendry# Either name of logfile or "syslog"
2459*47501Spendry#
2460*47501SpendryLOGFILE=syslog
2461*47501Spendry#LOGFILE=/var/log/amd
2462*47501Spendry
2463*47501Spendry#
2464*47501Spendry# Figure out whether domain name is in host name
2465*47501Spendry# If the hostname is just the machine name then
2466*47501Spendry# pass in the name of the local domain so that the
2467*47501Spendry# hostnames in the map are domain stripped correctly.
2468*47501Spendry#
2469*47501Spendrycase `hostname` in
2470*47501Spendry*.*) dmn= ;;
2471*47501Spendry*) dmn='-d doc.ic.ac.uk'
2472*47501Spendryesac
2473*47501Spendry
2474*47501Spendry#
2475*47501Spendry# Zap earlier log file
2476*47501Spendry#
2477*47501Spendrycase "$LOGFILE" in
2478*47501Spendry*/*)
2479*47501Spendry        mv "$LOGFILE" "$LOGFILE"-
2480*47501Spendry        > "$LOGFILE"
2481*47501Spendry        ;;
2482*47501Spendrysyslog)
2483*47501Spendry        : nothing
2484*47501Spendry        ;;
2485*47501Spendryesac
2486*47501Spendry
2487*47501Spendrycd /usr/sbin
2488*47501Spendry#
2489*47501Spendry# -r            restart
2490*47501Spendry# -d dmn        local domain
2491*47501Spendry# -w wait       wait between unmount attempts
2492*47501Spendry# -l log        logfile or "syslog"
2493*47501Spendry#
2494*47501Spendryeval ./amd -r $dmn -w 240 -l "$LOGFILE" \
2495*47501Spendry        /homes amd.homes -cache:=inc \
2496*47501Spendry        /home amd.home -cache:=inc \
2497*47501Spendry        /vol amd.vol -cache:=inc \
2498*47501Spendry        /n amd.net -cache:=inc
2499*47501Spendry@end example
2500*47501Spendry
2501*47501SpendryIf the list of automount points and maps is contained in a file or NIS map
2502*47501Spendryit is easily incorporated onto the command line:
2503*47501Spendry
2504*47501Spendry@example
2505*47501Spendry...
2506*47501Spendryeval ./amd -r $dmn -w 240 -l "$LOGFILE" `ypcat -k auto.master`
2507*47501Spendry@end example
2508*47501Spendry
2509*47501Spendry@node     Stopping Amd, Controlling Amd, Starting Amd, Run-time Administration
2510*47501Spendry@comment  node-name,  next,  previous,  up
2511*47501Spendry@section Stopping @i{Amd}
2512*47501Spendry@cindex Stopping Amd
2513*47501Spendry@cindex SIGTERM signal
2514*47501Spendry@cindex SIGINT signal
2515*47501Spendry
2516*47501Spendry@i{Amd} stops in response to two signals.
2517*47501Spendry
2518*47501Spendry@table @samp
2519*47501Spendry@item SIGTERM
2520*47501Spendrycauses the top-level automount points to be unmounted and then @i{Amd}
2521*47501Spendryto exit.  Any automounted filesystems are left mounted.  They can be
2522*47501Spendryrecovered by restarting @i{Amd} with the ``-r'' command line option.@refill
2523*47501Spendry
2524*47501Spendry@item SIGINT
2525*47501Spendrycauses @i{Amd} to attempt to unmount any filesystems which it has
2526*47501Spendryautomounted, in addition to the actions of @samp{SIGTERM}.  This signal
2527*47501Spendryis primarly used for debugging.@refill
2528*47501Spendry@end table
2529*47501Spendry
2530*47501SpendryActions taken for other signals are undefined.
2531*47501Spendry
2532*47501Spendry@node     Controlling Amd, Run-time Administration, Stopping Amd, Run-time Administration
2533*47501Spendry@comment  node-name,  next,  previous,  up
2534*47501Spendry@section Controlling @i{Amd}
2535*47501Spendry@cindex Controlling Amd
2536*47501Spendry@cindex Discovering what is going on at run-time
2537*47501Spendry@cindex Listing currently mounted filesystems
2538*47501Spendry
2539*47501SpendryIt is sometimes desirable or necessary to exercise external control
2540*47501Spendryover some of @i{Amd}'s internal state.  To support this requirement,
2541*47501Spendry@i{Amd} implements an RPC interface which is used by the @dfn{Amq} program.
2542*47501SpendryA variety of information is available.
2543*47501Spendry
2544*47501Spendry@i{Amq} generally applies an operation, specified by a single letter option,
2545*47501Spendryto a list of mount points.  The default operation is to obtain statistics
2546*47501Spendryabout each mount point.  This is similar to the output shown above
2547*47501Spendrybut includes information about the number and type of accesses to each
2548*47501Spendrymount point.
2549*47501Spendry
2550*47501Spendry@menu
2551*47501Spendry* Amq default::    Default command behaviour.
2552*47501Spendry* Amq -f option::  Flusing the map cache.
2553*47501Spendry* Amq -h option::  Controlling a non-local host.
2554*47501Spendry* Amq -m option::  Obtaining mount statistics.
2555*47501Spendry* Amq -M-option::  Mounting a volume.
2556*47501Spendry* Amq -s option::  Obtaining global statistics.
2557*47501Spendry* Amq -u option::  Forcing volumes to time out.
2558*47501Spendry* Amq -v option::  Version information.
2559*47501Spendry@end menu
2560*47501Spendry
2561*47501Spendry@node     Amq default, Amq -f option, Controlling Amd, Controlling Amd
2562*47501Spendry@comment  node-name,  next,  previous,  up
2563*47501Spendry@subsection @i{Amq} default information
2564*47501Spendry
2565*47501SpendryWith no arguments, @dfn{Amq} obtains a brief list of all existing
2566*47501Spendrymounts created by @i{Amd}.  This is different from the list displayed by
2567*47501Spendry@b{df}(1) since the latter only includes system mount points.
2568*47501Spendry
2569*47501Spendry@noindent
2570*47501SpendryThe output from this option includes the following information:
2571*47501Spendry
2572*47501Spendry@itemize @bullet
2573*47501Spendry@item
2574*47501Spendrythe automount point,
2575*47501Spendry@item
2576*47501Spendrythe filesystem type,
2577*47501Spendry@item
2578*47501Spendrythe mount map or mount information,
2579*47501Spendry@item
2580*47501Spendrythe internal, or system mount point.
2581*47501Spendry@end itemize
2582*47501Spendry
2583*47501Spendry@noindent
2584*47501SpendryFor example:
2585*47501Spendry
2586*47501Spendry@example
2587*47501Spendry/            root   "root"                    sky:(pid75)
2588*47501Spendry/homes       toplvl /usr/local/etc/amd.homes  /homes
2589*47501Spendry/home        toplvl /usr/local/etc/amd.home   /home
2590*47501Spendry/homes/jsp   nfs    charm:/home/charm         /a/charm/home/charm/jsp
2591*47501Spendry/homes/phjk  nfs    toytown:/home/toytown     /a/toytown/home/toytown/ai/phjk
2592*47501Spendry@end example
2593*47501Spendry
2594*47501Spendry@noindent
2595*47501SpendryIf an argument is given then statistics for that volume name will
2596*47501Spendrybe output.  For example:
2597*47501Spendry
2598*47501Spendry@example
2599*47501SpendryWhat            Uid   Getattr Lookup RdDir   RdLnk   Statfs Mounted@@
2600*47501Spendry/homes          0     1196    512    22      0       30     90/09/14 12:32:55
2601*47501Spendry/homes/jsp      0     0       0      0       1180    0      90/10/13 12:56:58
2602*47501Spendry@end example
2603*47501Spendry
2604*47501Spendry@table @code
2605*47501Spendry@item What
2606*47501Spendrythe volume name.
2607*47501Spendry
2608*47501Spendry@item Uid
2609*47501Spendryignored.
2610*47501Spendry
2611*47501Spendry@item Getattr
2612*47501Spendrythe count of NFS @dfn{getattr} requests on this node.  This should only be
2613*47501Spendrynon-zero for directory nodes.
2614*47501Spendry
2615*47501Spendry@item Lookup
2616*47501Spendrythe count of NFS @dfn{lookup} requests on this node.  This should only be
2617*47501Spendrynon-zero for directory nodes.
2618*47501Spendry
2619*47501Spendry@item RdDir
2620*47501Spendrythe count of NFS @dfn{readdir} requests on this node.  This should only
2621*47501Spendrybe non-zero for directory nodes.
2622*47501Spendry
2623*47501Spendry@item RdLnk
2624*47501Spendrythe count of NFS @dfn{readlink} requests on this node.  This should be
2625*47501Spendryzero for directory nodes.
2626*47501Spendry
2627*47501Spendry@item Statfs
2628*47501Spendrythe could of NFS @dfn{statfs} requests on this node.  This should only
2629*47501Spendrybe non-zero for top-level automount points.
2630*47501Spendry
2631*47501Spendry@item Mounted@@
2632*47501Spendrythe date and time the volume name was first referenced.
2633*47501Spendry@end table
2634*47501Spendry
2635*47501Spendry@node     Amq -f option, Amq -h option, Amq default, Controlling Amd
2636*47501Spendry@comment  node-name,  next,  previous,  up
2637*47501Spendry@subsection @i{Amq} -f option
2638*47501Spendry@cindex Flushing the map cache
2639*47501Spendry@cindex Map cache, flushing
2640*47501Spendry
2641*47501SpendryThe ``-f'' option causes @i{Amd} to flush the internal mount map cache.
2642*47501SpendryThis is useful for Hesiod maps since @i{Amd} will not automatically
2643*47501Spendrynotice when they have been updated.  The map cache can also be
2644*47501Spendrysynchronised with the map source by using the @samp{sync} option
2645*47501Spendry(@pxref{Automount Filesystem}).@refill
2646*47501Spendry
2647*47501Spendry@node     Amq -h option, Amq -m option, Amq -f option, Controlling Amd
2648*47501Spendry@comment  node-name,  next,  previous,  up
2649*47501Spendry@subsection @i{Amq} -h option
2650*47501Spendry@cindex Querying an alternate host
2651*47501Spendry
2652*47501SpendryBy default the local host is used.  In an HP-UX cluster the root server
2653*47501Spendryis used since that is the only place in the cluster where @i{Amd} will
2654*47501Spendrybe running.  To query @i{Amd} on another host the ``-h'' option should
2655*47501Spendrybe used.
2656*47501Spendry
2657*47501Spendry@node     Amq -m option, Amq -M-option, Amq -h option, Controlling Amd
2658*47501Spendry@comment  node-name,  next,  previous,  up
2659*47501Spendry@subsection @i{Amq} -m option
2660*47501Spendry
2661*47501SpendryThe ``-m'' option displays similar information about mounted
2662*47501Spendryfilesystems, rather than automount points.  The output includes the
2663*47501Spendryfollowing information:
2664*47501Spendry
2665*47501Spendry@itemize @bullet
2666*47501Spendry@item
2667*47501Spendrythe mount information,
2668*47501Spendry@item
2669*47501Spendrythe mount point,
2670*47501Spendry@item
2671*47501Spendrythe filesystem type,
2672*47501Spendry@item
2673*47501Spendrythe number of references to this filesystem,
2674*47501Spendry@item
2675*47501Spendrythe server hostname,
2676*47501Spendry@item
2677*47501Spendrythe state of the file server,
2678*47501Spendry@item
2679*47501Spendryany error which has occured.
2680*47501Spendry@end itemize
2681*47501Spendry
2682*47501SpendryFor example:
2683*47501Spendry
2684*47501Spendry@example
2685*47501Spendry"root"           truth:(pid602)     root   1 localhost is up
2686*47501Spendryhesiod.home      /home              toplvl 1 localhost is up
2687*47501Spendryhesiod.vol       /vol               toplvl 1 localhost is up
2688*47501Spendryhesiod.homes     /homes             toplvl 1 localhost is up
2689*47501Spendryamy:/home/amy    /a/amy/home/amy    nfs    5 amy is up
2690*47501Spendryswan:/home/swan  /a/swan/home/swan  nfs    0 swan is up (Permission denied)
2691*47501Spendryex:/home/ex      /a/ex/home/ex      nfs    0 ex is down
2692*47501Spendry@end example
2693*47501Spendry
2694*47501SpendryWhen the reference count is zero the filesystem is not mounted but
2695*47501Spendrythe mount point and server information is still being maintained
2696*47501Spendryby @i{Amd}.
2697*47501Spendry
2698*47501Spendry@node     Amq -M-option, Amq -s option, Amq -m option, Controlling Amd
2699*47501Spendry@comment  node-name,  next,  previous,  up
2700*47501Spendry@subsection @i{Amq} -M option
2701*47501Spendry
2702*47501SpendryThe ``-M'' option passes a new map entry to @i{Amd} and waits for it to
2703*47501Spendrybe evaluated, possibly causing a mount.  For example, the following
2704*47501Spendrycommand would cause @samp{/home/toytown} on host @samp{toytown} to be
2705*47501Spendrymounted locally on @samp{/mnt/toytown}.
2706*47501Spendry
2707*47501Spendry@example
2708*47501Spendryamq -M '/mnt/toytown type:=nfs;rfs:=/home/toytown;rhost:=toytown;fs:=$@{key@}'
2709*47501Spendry@end example
2710*47501Spendry
2711*47501Spendry@i{Amd} applies some simple security checks before allowing this
2712*47501Spendryoperation.  The check tests whether the incoming request is from a
2713*47501Spendryprivileged UDP port on the local machine.  ``Permission denied'' is
2714*47501Spendryreturned if the check fails.
2715*47501Spendry
2716*47501SpendryA future release of @i{Amd} will include code to allow the @b{mount}(8)
2717*47501Spendrycommand to mount automount points:
2718*47501Spendry
2719*47501Spendry@example
2720*47501Spendrymount -t amd /vol hesiod.vol
2721*47501Spendry@end example
2722*47501Spendry
2723*47501SpendryThis will then allow @i{Amd} to be controlled from the standard system
2724*47501Spendryfilesystem mount list.
2725*47501Spendry
2726*47501Spendry@node     Amq -s option, Amq -u option, Amq -M-option, Controlling Amd
2727*47501Spendry@comment  node-name,  next,  previous,  up
2728*47501Spendry@subsection @i{Amq} -s option
2729*47501Spendry@cindex Global statistics
2730*47501Spendry@cindex Statistics
2731*47501Spendry
2732*47501SpendryThe ``-s'' option displays global statistics.  If any other options are specified
2733*47501Spendryor any filesystems named then this option is ignored.  For example:
2734*47501Spendry
2735*47501Spendry@example
2736*47501Spendryrequests  stale     mount     mount     unmount
2737*47501Spendrydeferred  fhandles  ok        failed    failed
2738*47501Spendry1054      1         487       290       7017
2739*47501Spendry@end example
2740*47501Spendry
2741*47501Spendry@table @samp
2742*47501Spendry@item Deferred requests
2743*47501Spendryare those for which an immediate reply could not be constructed.  For
2744*47501Spendryexample, this would happen if a background mount was required.
2745*47501Spendry
2746*47501Spendry@item Stale filehandles
2747*47501Spendrycounts the number of times the kernel passes a stale filehandle to @i{Amd}.
2748*47501SpendryLarge numbers indicate problems.
2749*47501Spendry
2750*47501Spendry@item Mount ok
2751*47501Spendrycounts the number of automounts which were successful.
2752*47501Spendry
2753*47501Spendry@item Mount failed
2754*47501Spendrycounts the number of automounts which failed.
2755*47501Spendry
2756*47501Spendry@item Unmount failed
2757*47501Spendrycounts the number of times a filesystem could not be unmounted.  Very
2758*47501Spendrylarge numbers here indicate that the time between unmount attempts
2759*47501Spendryshould be increased.
2760*47501Spendry@end table
2761*47501Spendry
2762*47501Spendry@node     Amq -u option, Amq -v option, Amq -s option, Controlling Amd
2763*47501Spendry@comment  node-name,  next,  previous,  up
2764*47501Spendry@subsection @i{Amq} -u option
2765*47501Spendry@cindex Forcing filesystem to time out
2766*47501Spendry@cindex Unmounting a filesystem
2767*47501Spendry
2768*47501SpendryThe ``-u'' option causes the time-to-live interval of the named mount
2769*47501Spendrypoints to be expired, thus causing an unmount attempt.  This is the only
2770*47501Spendrysafe way to unmount an automounted filesystem.  It is not possible to
2771*47501Spendryunmount a filesystem which has been mounted with the @samp{nounmount}
2772*47501Spendryflag.
2773*47501Spendry
2774*47501Spendry@c The ``-H'' option informs @i{Amd} that the specified mount point has hung -
2775*47501Spendry@c as if its keepalive timer had expired.
2776*47501Spendry
2777*47501Spendry@node     Amq -v option, Other Amq options, Amq -u option, Controlling Amd
2778*47501Spendry@comment  node-name,  next,  previous,  up
2779*47501Spendry@subsection @i{Amq} -v option
2780*47501Spendry@cindex Version information at run-time
2781*47501Spendry
2782*47501SpendryThe ``-v'' option displays the version of @i{Amd} in a similar way to
2783*47501Spendry@i{Amd}'s ``-v'' option.
2784*47501Spendry
2785*47501Spendry@node     Other Amq options, Controlling Amd, Amq -v option, Controlling Amd
2786*47501Spendry@comment  node-name,  next,  previous,  up
2787*47501Spendry@subsection Other @i{Amq} options
2788*47501Spendry
2789*47501SpendryThree other operations are implemented.  These modify the state of
2790*47501Spendry@i{Amd} as a whole, rather than any particular filesystem.  The ``-l'',
2791*47501Spendry``-x'' and ``-D'' options have exactly the same effect as @i{Amd}'s
2792*47501Spendrycorresponding command line options.  The ``-l'' option is rejected by
2793*47501Spendry@i{Amd} in the current version for obvious security reasons.  When
2794*47501Spendry@i{Amd} receives a ``-x''flag it limits the log options being modified
2795*47501Spendryto those which were not enabled at startup.  This prevents a user
2796*47501Spendryturning @emph{off} any logging option which was specified at startup,
2797*47501Spendrythough any which have been turned off since then can still be turned
2798*47501Spendryoff.  The ``-D'' option has a similar behaviour.
2799*47501Spendry
2800*47501Spendry@node     FSinfo, Examples, Run-time Administration, Top
2801*47501Spendry@comment  node-name,  next,  previous,  up
2802*47501Spendry@chapter FSinfo
2803*47501Spendry@cindex FSinfo
2804*47501Spendry@cindex Filesystem info package
2805*47501Spendry
2806*47501Spendry@menu
2807*47501Spendry* FSinfo Overview::                 Introduction to FSinfo.
2808*47501Spendry* Using FSinfo::                    Basic concepts.
2809*47501Spendry* FSinfo Grammar::                  Language syntax, semantics and examples.
2810*47501Spendry* FSinfo host definitions::         Defining a new host.
2811*47501Spendry* FSinfo host attributes::          Definable host attributes.
2812*47501Spendry* FSinfo filesystems::              Defining locally attached filesystems.
2813*47501Spendry* FSinfo static mounts::            Defining additional static mounts.
2814*47501Spendry* FSinfo automount definitions::
2815*47501Spendry* FSinfo command line options::
2816*47501Spendry* FSinfo errors::
2817*47501Spendry@end menu
2818*47501Spendry
2819*47501Spendry@node     FSinfo Overview, Using FSinfo, FSinfo, FSinfo
2820*47501Spendry@comment  node-name,  next,  previous,  up
2821*47501Spendry@section @i{FSinfo} overview
2822*47501Spendry@cindex FSinfo overview
2823*47501Spendry
2824*47501Spendry@i{FSinfo} is a filesystem management tool.  It has been designed to
2825*47501Spendrywork with @i{Amd} to help system administrators keep track of the ever
2826*47501Spendryincreasing filesystem namespace under their control.
2827*47501Spendry
2828*47501SpendryThe purpose of @i{FSinfo} is to generate all the important standard
2829*47501Spendryfilesystem data files from a single set of input data.  Starting with a
2830*47501Spendrysingle data source guarantees that all the generated files are
2831*47501Spendryself-consistent.  One of the possible output data formats is a set of
2832*47501Spendry@i{Amd} maps which can be used amongst the set of hosts described in the
2833*47501Spendryinput data.
2834*47501Spendry
2835*47501Spendry@i{FSinfo} implements a declarative language.  This language is
2836*47501Spendryspecifically designed for describing filesystem namespace and physical
2837*47501Spendrylayouts.  The basic declaration defines a mounted filesystem including
2838*47501Spendryits device name, mount point, and all the volumes and access
2839*47501Spendrypermissions.  @i{FSinfo} reads this information and builds an internal
2840*47501Spendrymap of the entire network of hosts.  Using this map, many different data
2841*47501Spendryformats can be produced including @file{/etc/fstab},
2842*47501Spendry@file{/etc/exports}, @i{Amd} mount maps and
2843*47501Spendry@file{/etc/bootparams}.@refill
2844*47501Spendry
2845*47501Spendry@node     Using FSinfo, FSinfo Grammar, FSinfo Overview, FSinfo
2846*47501Spendry@comment  node-name,  next,  previous,  up
2847*47501Spendry@section Using @i{FSinfo}
2848*47501Spendry@cindex Using FSinfo
2849*47501Spendry
2850*47501SpendryThe basic strategy when using @i{FSinfo} is to gather all the
2851*47501Spendryinformation about all disks on all machines into one set of
2852*47501Spendrydeclarations.  For each machine being managed, the following data is
2853*47501Spendryrequired:
2854*47501Spendry
2855*47501Spendry@itemize @bullet
2856*47501Spendry@item
2857*47501SpendryHostname
2858*47501Spendry@item
2859*47501SpendryList of all filesystems and, optionally, their mount points.
2860*47501Spendry@item
2861*47501SpendryNames of volumes stored on each filesystem.
2862*47501Spendry@item
2863*47501SpendryNFS export information for each volume.
2864*47501Spendry@item
2865*47501SpendryThe list of static filesystem mounts.
2866*47501Spendry@end itemize
2867*47501Spendry
2868*47501SpendryThe following information can also be entered into the same
2869*47501Spendryconfiguration files so that all data can be kept in one place.
2870*47501Spendry
2871*47501Spendry@itemize @bullet
2872*47501Spendry@item
2873*47501SpendryList of network interfaces
2874*47501Spendry@item
2875*47501SpendryIP address of each interface
2876*47501Spendry@item
2877*47501SpendryHardware address of each interface
2878*47501Spendry@item
2879*47501SpendryDumpset to which each filesystem belongs
2880*47501Spendry@item
2881*47501Spendryand more @dots{}
2882*47501Spendry@end itemize
2883*47501Spendry
2884*47501SpendryTo generate @i{Amd} mount maps, the automount tree must also be defined
2885*47501Spendry(@pxref{FSinfo automount definitions}).  This will have been designed at
2886*47501Spendrythe time the volume names were allocated.  Some volume names will not be
2887*47501Spendryautomounted, so @i{FSinfo} needs an explicit list of which volumes
2888*47501Spendryshould be automounted.@refill
2889*47501Spendry
2890*47501SpendryHostnames are required at several places in the @i{FSinfo} language.  It
2891*47501Spendryis important to stick to either fully qualified names or unqualified
2892*47501Spendrynames.  Using a mixture of the two will inevitably result in confusion.
2893*47501Spendry
2894*47501SpendrySometimes volumes need to be referenced which are not defined in the set
2895*47501Spendryof hosts being managed with @i{FSinfo}.  The required action is to add a
2896*47501Spendrydummy set of definitions for the host and volume names required.  Since
2897*47501Spendrythe files generated for those particular hosts will not be used on them,
2898*47501Spendrythe exact values used is not critical.
2899*47501Spendry
2900*47501Spendry@node     FSinfo Grammar, FSinfo, Using FSinfo, FSinfo
2901*47501Spendry@comment  node-name,  next,  previous,  up
2902*47501Spendry@section @i{FSinfo} grammar
2903*47501Spendry@cindex FSinfo grammar
2904*47501Spendry@cindex Grammar, FSinfo
2905*47501Spendry
2906*47501Spendry@i{FSinfo} has a relatively simple grammar.  Distinct syntactic
2907*47501Spendryconstructs exist for each of the different types of data, though they
2908*47501Spendryshare a common flavour.  Several conventions are used in the grammar
2909*47501Spendryfragments below.
2910*47501Spendry
2911*47501SpendryThe notation, @i{list(}@t{xxx}@i{)}, indicates a list of zero or more
2912*47501Spendry@t{xxx}'s.  The notation, @i{opt(}@t{xxx}@i{)}, indicates zero or one
2913*47501Spendry@t{xxx}.  Items in double quotes, @i{eg} @t{"host"}, represent input
2914*47501Spendrytokens.  Items in angle brackets, @i{eg} @var{<hostname>}, represent
2915*47501Spendrystrings in the input.  Strings need not be in double quotes, except to
2916*47501Spendrydifferentiate them from reserved words.  Quoted strings may include the
2917*47501Spendryusual set of C ``@t{\}'' escape sequences with one exception: a
2918*47501Spendrybackslash-newline-whitespace sequence is squashed into a single space
2919*47501Spendrycharacter.  To defeat this feature, put a further backslash at the start
2920*47501Spendryof the second line.
2921*47501Spendry
2922*47501SpendryAt the outermost level of the grammar, the input consists of a
2923*47501Spendrysequence of host and automount declarations.  These declarations are
2924*47501Spendryall parsed before they are analyzed.  This means they can appear in
2925*47501Spendryany order and cyclic host references are possible.
2926*47501Spendry
2927*47501Spendry@example
2928*47501Spendryfsinfo      : @i{list(}fsinfo_attr@i{)} ;
2929*47501Spendry
2930*47501Spendryfsinfo_attr : host | automount ;
2931*47501Spendry@end example
2932*47501Spendry
2933*47501Spendry@menu
2934*47501Spendry* FSinfo host definitions::
2935*47501Spendry* FSinfo automount definitions::
2936*47501Spendry@end menu
2937*47501Spendry
2938*47501Spendry@node FSinfo host definitions, FSinfo host attributes, FSinfo grammar, FSinfo
2939*47501Spendry@comment  node-name,  next,  previous,  up
2940*47501Spendry@section @i{FSinfo} host definitions
2941*47501Spendry@cindex FSinfo host definitions
2942*47501Spendry@cindex Defining a host, FSinfo
2943*47501Spendry
2944*47501SpendryA host declaration consists of three parts: a set of machine attribute
2945*47501Spendrydata, a list of filesystems physically attached to the machine, and a
2946*47501Spendrylist of additional statically mounted filesystems.
2947*47501Spendry
2948*47501Spendry@example
2949*47501Spendryhost        : "host" host_data @i{list(}filesystem@i{@i{)}} @i{list(}mount@i{@i{)}} ;
2950*47501Spendry@end example
2951*47501Spendry
2952*47501SpendryEach host must be declared in this way exactly once.  Such things as the
2953*47501Spendryhardware address, the architecture and operating system types and the
2954*47501Spendrycluster name are all specified within the @dfn{host data}.
2955*47501Spendry
2956*47501SpendryAll the disks the machine has should then be described in the @dfn{list
2957*47501Spendryof filesystems}.  When describing disks, you can specify what
2958*47501Spendry@dfn{volname} the disk/partition should have and all such entries are
2959*47501Spendrybuilt up into a dictionary which can then be used for building the
2960*47501Spendryautomounter maps.
2961*47501Spendry
2962*47501SpendryThe @dfn{list of mounts} specifies all the filesystems that should be
2963*47501Spendrystatically mounted on the machine.
2964*47501Spendry
2965*47501Spendry@menu
2966*47501Spendry* FSinfo host attributes::
2967*47501Spendry* FSinfo filesystems::
2968*47501Spendry* FSinfo static mounts::
2969*47501Spendry@end menu
2970*47501Spendry
2971*47501Spendry@node FSinfo host attributes, FSinfo filesystems, FSinfo host definitions , FSinfo host definitions
2972*47501Spendry@comment  node-name,  next,  previous,  up
2973*47501Spendry@section @i{FSinfo} host attributes
2974*47501Spendry@cindex FSinfo host attributes
2975*47501Spendry@cindex Defining host attributes, FSinfo
2976*47501Spendry
2977*47501SpendryThe host data, @dfn{host_data}, always includes the @dfn{hostname}.  In
2978*47501Spendryaddition, several other host attributes can be given.
2979*47501Spendry
2980*47501Spendry@example
2981*47501Spendryhost_data   : @var{<hostname>}
2982*47501Spendry            | "@{" @i{list(}host_attrs@i{)} "@}" @var{<hostname>}
2983*47501Spendry            ;
2984*47501Spendry
2985*47501Spendryhost_attrs  : host_attr "=" @var{<string>}
2986*47501Spendry            | netif
2987*47501Spendry            ;
2988*47501Spendry
2989*47501Spendryhost_attr   : "config"
2990*47501Spendry            | "arch"
2991*47501Spendry            | "os"
2992*47501Spendry            | "cluster"
2993*47501Spendry            ;
2994*47501Spendry@end example
2995*47501Spendry
2996*47501SpendryThe @dfn{hostname} is, typically, the fully qualified hostname of the
2997*47501Spendrymachine.
2998*47501Spendry
2999*47501SpendryExamples:
3000*47501Spendry
3001*47501Spendry@example
3002*47501Spendryhost dylan.doc.ic.ac.uk
3003*47501Spendry
3004*47501Spendryhost @{
3005*47501Spendry    os = hpux
3006*47501Spendry    arch = hp300
3007*47501Spendry@} dougal.doc.ic.ac.uk
3008*47501Spendry@end example
3009*47501Spendry
3010*47501SpendryThe options that can be given as host attributes are shown below.
3011*47501Spendry
3012*47501Spendry@menu
3013*47501Spendry* netif Option:		FSinfo host netif:
3014*47501Spendry* arch Option:		FSinfo host arch:
3015*47501Spendry* os Option:		FSinfo host os:
3016*47501Spendry* cluster Option:	FSinfo host cluster:
3017*47501Spendry@end menu
3018*47501Spendry
3019*47501Spendry@node FSinfo host netif, FSinfo host arch, , FSinfo host attributes
3020*47501Spendry@comment  node-name,  next,  previous,  up
3021*47501Spendry@subsection netif Option
3022*47501Spendry
3023*47501SpendryThis defines the set of network interfaces configured on the machine.
3024*47501SpendryThe interface attributes collected by @i{FSinfo} are the IP address,
3025*47501Spendrysubnet mask and hardware address.  Multiple interfaces may be defined
3026*47501Spendryfor hosts with several interfaces by an entry for each interface.  The
3027*47501Spendryvalues given are sanity checked, but are currently unused for anything
3028*47501Spendryelse.
3029*47501Spendry
3030*47501Spendry@example
3031*47501Spendrynetif       : "netif" @var{<string>} "@{" @i{list(}netif_attrs@i{)} "@}" ;
3032*47501Spendry
3033*47501Spendrynetif_attrs : netif_attr "=" @var{<string>} ;
3034*47501Spendry
3035*47501Spendrynetif_attr  : "inaddr" | "netmask" | "hwaddr" ;
3036*47501Spendry@end example
3037*47501Spendry
3038*47501SpendryExamples:
3039*47501Spendry
3040*47501Spendry@example
3041*47501Spendrynetif ie0 @{
3042*47501Spendry    inaddr  = 129.31.81.37
3043*47501Spendry    netmask = 0xfffffe00
3044*47501Spendry    hwaddr  = "08:00:20:01:a6:a5"
3045*47501Spendry@}
3046*47501Spendry
3047*47501Spendrynetif ec0 @{ @}
3048*47501Spendry@end example
3049*47501Spendry
3050*47501Spendry@node FSinfo host config, FSinfo host arch, FSinfo host netif, FSinfo host attributes
3051*47501Spendry@comment  node-name,  next,  previous,  up
3052*47501Spendry@subsection config Option
3053*47501Spendry@cindex FSinfo config host attribute
3054*47501Spendry@cindex config, FSinfo host attribute
3055*47501Spendry
3056*47501SpendryThis option allows you to specify configuration variables for the
3057*47501Spendrystartup scripts (@file{rc} scripts).  A simple string should immediately
3058*47501Spendryfollow the keyword.
3059*47501Spendry
3060*47501SpendryExample:
3061*47501Spendry
3062*47501Spendry@example
3063*47501Spendryconfig "NFS_SERVER=true"
3064*47501Spendryconfig "ZEPHYR=true"
3065*47501Spendry@end example
3066*47501Spendry
3067*47501SpendryThis option is currently unsupported.
3068*47501Spendry
3069*47501Spendry@node FSinfo host arch, FSinfo host os, FSinfo host config, FSinfo host attributes
3070*47501Spendry@comment  node-name,  next,  previous,  up
3071*47501Spendry@subsection arch Option
3072*47501Spendry@cindex FSinfo arch host attribute
3073*47501Spendry@cindex arch, FSinfo host attribute
3074*47501Spendry
3075*47501SpendryThis defines the architecture of the machine.  For example:
3076*47501Spendry
3077*47501Spendry@example
3078*47501Spendryarch = hp300
3079*47501Spendry@end example
3080*47501Spendry
3081*47501SpendryThis is intended to be of use when building architecture specific
3082*47501Spendrymountmaps, however, the option is currently unsupported.
3083*47501Spendry
3084*47501Spendry@node FSinfo host os, FSinfo host cluster, FSinfo host arch, FSinfo host attributes
3085*47501Spendry@comment  node-name,  next,  previous,  up
3086*47501Spendry@subsection os Option
3087*47501Spendry@cindex FSinfo os host attribute
3088*47501Spendry@cindex os, FSinfo host attribute
3089*47501Spendry
3090*47501SpendryThis defines the operating system type of the host.  For example:
3091*47501Spendry
3092*47501Spendry@example
3093*47501Spendryos = hpux
3094*47501Spendry@end example
3095*47501Spendry
3096*47501SpendryThis information is used when creating the @file{fstab} files, for
3097*47501Spendryexample in choosing which format to use for the @file{fstab} entries
3098*47501Spendrywithin the file.
3099*47501Spendry
3100*47501Spendry@node FSinfo host cluster, , FSinfo host os, FSinfo host attributes
3101*47501Spendry@comment  node-name,  next,  previous,  up
3102*47501Spendry@subsection cluster Option
3103*47501Spendry@cindex FSinfo cluster host attribute
3104*47501Spendry@cindex cluster, FSinfo host attribute
3105*47501Spendry
3106*47501SpendryThis is used for specifying in which cluster the machine belongs.  For
3107*47501Spendryexample:
3108*47501Spendry
3109*47501Spendry@example
3110*47501Spendrycluster = "theory"
3111*47501Spendry@end example
3112*47501Spendry
3113*47501SpendryThe cluster is intended to be used when generating the automount maps,
3114*47501Spendryalthough it is currently unsupported.
3115*47501Spendry
3116*47501Spendry@node FSinfo filesystems, FSinfo static mounts, FSinfo host attributes, FSinfo host definitions
3117*47501Spendry@comment  node-name,  next,  previous,  up
3118*47501Spendry@section @i{FSinfo} filesystems
3119*47501Spendry@cindex FSinfo filesystems
3120*47501Spendry
3121*47501SpendryThe list of physically attached filesystems follows the machine
3122*47501Spendryattributes.  These should define all the filesystems available from this
3123*47501Spendrymachine, whether exported or not.  In addition to the device name,
3124*47501Spendryfilesystems have several attributes, such as filesystem type, mount
3125*47501Spendryoptions, and @samp{fsck} pass number which are needed to generate
3126*47501Spendry@file{fstab} entries.
3127*47501Spendry
3128*47501Spendry@example
3129*47501Spendryfilesystem  : "fs" @var{<device>} "@{" @i{list(}fs_data@i{)} "@}" ;
3130*47501Spendry
3131*47501Spendryfs_data     : fs_data_attr "=" @var{<string>}
3132*47501Spendry            | mount
3133*47501Spendry            ;
3134*47501Spendry
3135*47501Spendryfs_data_attr
3136*47501Spendry            : "fstype" | "opts" | "passno"
3137*47501Spendry            | "freq" | "dumpset" | "log"
3138*47501Spendry            ;
3139*47501Spendry@end example
3140*47501Spendry
3141*47501SpendryHere, @var{<device>} is the device name of the disk (for example,
3142*47501Spendry@file{/dev/dsk/2s0}).  The device name is used for building the mount
3143*47501Spendrymaps and for the @file{fstab} file.  The attributes that can be
3144*47501Spendryspecified are shown in the following section.
3145*47501Spendry
3146*47501SpendryThe @i{FSinfo} configuration file for @code{dylan.doc.ic.ac.uk} is listed below.
3147*47501Spendry
3148*47501Spendry@example
3149*47501Spendryhost dylan.doc.ic.ac.uk
3150*47501Spendry
3151*47501Spendryfs /dev/dsk/0s0 {
3152*47501Spendry	fstype = swap
3153*47501Spendry}
3154*47501Spendry
3155*47501Spendryfs /dev/dsk/0s0 {
3156*47501Spendry	fstype = hfs
3157*47501Spendry	opts = rw,noquota,grpid
3158*47501Spendry	passno = 0;
3159*47501Spendry	freq = 1;
3160*47501Spendry	mount / { }
3161*47501Spendry}
3162*47501Spendry
3163*47501Spendryfs /dev/dsk/1s0 {
3164*47501Spendry	fstype = hfs
3165*47501Spendry	opts = defaults
3166*47501Spendry	passno = 1;
3167*47501Spendry	freq = 1;
3168*47501Spendry	mount /usr {
3169*47501Spendry		local {
3170*47501Spendry			exportfs "dougal eden dylan zebedee brian"
3171*47501Spendry			volname /nfs/hp300/local
3172*47501Spendry		}
3173*47501Spendry	}
3174*47501Spendry}
3175*47501Spendry
3176*47501Spendryfs /dev/dsk/2s0 {
3177*47501Spendry	fstype = hfs
3178*47501Spendry	opts = defaults
3179*47501Spendry	passno = 1;
3180*47501Spendry	freq = 1;
3181*47501Spendry	mount default {
3182*47501Spendry		exportfs "toytown_clients hangers_on"
3183*47501Spendry		volname /home/dylan/dk2
3184*47501Spendry	}
3185*47501Spendry}
3186*47501Spendry
3187*47501Spendryfs /dev/dsk/3s0 {
3188*47501Spendry	fstype = hfs
3189*47501Spendry	opts = defaults
3190*47501Spendry	passno = 1;
3191*47501Spendry	freq = 1;
3192*47501Spendry	mount default {
3193*47501Spendry		exportfs "toytown_clients hangers_on"
3194*47501Spendry		volname /home/dylan/dk3
3195*47501Spendry	}
3196*47501Spendry}
3197*47501Spendry
3198*47501Spendryfs /dev/dsk/5s0 {
3199*47501Spendry	fstype = hfs
3200*47501Spendry	opts = defaults
3201*47501Spendry	passno = 1;
3202*47501Spendry	freq = 1;
3203*47501Spendry	mount default {
3204*47501Spendry		exportfs "toytown_clients hangers_on"
3205*47501Spendry		volname /home/dylan/dk5
3206*47501Spendry	}
3207*47501Spendry}
3208*47501Spendry@end example
3209*47501Spendry
3210*47501Spendry@menu
3211*47501Spendry* fstype Option:	FSinfo filesystems fstype:
3212*47501Spendry* opts Option:		FSinfo filesystems opts:
3213*47501Spendry* passno Option:	FSinfo filesystems passno:
3214*47501Spendry* freq Option:		FSinfo filesystems freq:
3215*47501Spendry* mount Option:		FSinfo filesystems mount:
3216*47501Spendry* dumpset Option:	FSinfo filesystems dumpset:
3217*47501Spendry* log Option:		FSinfo filesystems log:
3218*47501Spendry@end menu
3219*47501Spendry
3220*47501Spendry@node FSinfo filesystems fstype, FSinfo filesystems opts, , FSinfo filesystems
3221*47501Spendry@comment  node-name,  next,  previous,  up
3222*47501Spendry@subsection fstype Option
3223*47501Spendry@cindex FSinfo fstype filesystems option
3224*47501Spendry@cindex fstype, FSinfo filesystems option
3225*47501Spendry@cindex export, FSinfo special fstype
3226*47501Spendry
3227*47501SpendryThis specifies the type of filesystem being declared and will be placed
3228*47501Spendryinto the @file{fstab} file as is.  The value of this option will be
3229*47501Spendryhanded to @code{mount} as the filesystem type---it should have such
3230*47501Spendryvalues as @code{4.2}, @code{nfs} or @code{swap}.  The value is not
3231*47501Spendryexamined for correctness.
3232*47501Spendry
3233*47501SpendryThere is one special case.  If the filesystem type is specified as
3234*47501Spendry@samp{export} then the filesystem information will not be added to the
3235*47501Spendryhost's @file{fstab} information, but it will still be visible on the
3236*47501Spendrynetwork.  This is useful for defining hosts which contain referenced
3237*47501Spendryvolumes but which are not under full control of @i{FSinfo}.
3238*47501Spendry
3239*47501SpendryExample:
3240*47501Spendry
3241*47501Spendry@example
3242*47501Spendryfstype = swap
3243*47501Spendry@end example
3244*47501Spendry
3245*47501Spendry@node FSinfo filesystems opts, FSinfo filesystems passno,FSinfo filesystems fstype, FSinfo filesystems
3246*47501Spendry@comment  node-name,  next,  previous,  up
3247*47501Spendry@subsection opts Option
3248*47501Spendry@cindex FSinfo opts filesystems option
3249*47501Spendry@cindex opts, FSinfo filesystems option
3250*47501Spendry
3251*47501SpendryThis defines any options that should be given to @b{mount}(8) in the
3252*47501Spendry@file{fstab} file.  For example:
3253*47501Spendry
3254*47501Spendry@example
3255*47501Spendryopts = rw,nosuid,grpid
3256*47501Spendry@end example
3257*47501Spendry
3258*47501Spendry@node FSinfo filesystems passno, FSinfo filesystems freq, FSinfo filesystems opts, FSinfo filesystems
3259*47501Spendry@comment  node-name,  next,  previous,  up
3260*47501Spendry@subsection passno Option
3261*47501Spendry@cindex FSinfo passno filesystems option
3262*47501Spendry@cindex passno, FSinfo filesystems option
3263*47501Spendry
3264*47501SpendryThis defines the @b{fsck}(8) pass number in which to check the
3265*47501Spendryfilesystem.  This value will be placed into the @file{fstab} file.
3266*47501Spendry
3267*47501SpendryExample:
3268*47501Spendry
3269*47501Spendry@example
3270*47501Spendrypassno = 1
3271*47501Spendry@end example
3272*47501Spendry
3273*47501Spendry@node FSinfo filesystems freq, FSinfo filesystems mount, FSinfo filesystems passno, FSinfo filesystems
3274*47501Spendry@comment  node-name,  next,  previous,  up
3275*47501Spendry@subsection freq Option
3276*47501Spendry@cindex FSinfo freq filesystems option
3277*47501Spendry@cindex freq, FSinfo filesystems option
3278*47501Spendry
3279*47501SpendryThis defines the interval (in days) between dumps.  The value is placed
3280*47501Spendryas is into the @file{fstab} file.
3281*47501Spendry
3282*47501SpendryExample:
3283*47501Spendry
3284*47501Spendry@example
3285*47501Spendryfreq = 3
3286*47501Spendry@end example
3287*47501Spendry
3288*47501Spendry@node FSinfo filesystems mount, FSinfo filesystems dumpset, FSinfo filesystems freq, FSinfo filesystems
3289*47501Spendry@comment  node-name,  next,  previous,  up
3290*47501Spendry@subsection mount Option
3291*47501Spendry@cindex FSinfo mount filesystems option
3292*47501Spendry@cindex mount, FSinfo filesystems option
3293*47501Spendry@cindex exportfs, FSinfo mount option
3294*47501Spendry@cindex volname, FSinfo mount option
3295*47501Spendry@cindex sel, FSinfo mount option
3296*47501Spendry
3297*47501SpendryThis defines the mountpoint at which to place the filesystem.  If the
3298*47501Spendrymountpoint of the filesystem is specified as @code{default}, then the
3299*47501Spendryfilesystem will be mounted in the automounter's tree under its volume
3300*47501Spendryname and the mount will automatically be inherited by the automounter.
3301*47501Spendry
3302*47501SpendryFollowing the mountpoint, namespace information for the filesystem may
3303*47501Spendrybe described.  The options that can be given here are @code{exportfs},
3304*47501Spendry@code{volname} and @code{sel}.
3305*47501Spendry
3306*47501SpendryThe format is:
3307*47501Spendry
3308*47501Spendry@example
3309*47501Spendrymount       : "mount" vol_tree ;
3310*47501Spendry
3311*47501Spendryvol_tree    : @i{list(}vol_tree_attr@i{)} ;
3312*47501Spendry
3313*47501Spendryvol_tree_attr
3314*47501Spendry            :  @var{<string>} "@{" @i{list(}vol_tree_info@i{)} vol_tree "@}" ;
3315*47501Spendry
3316*47501Spendryvol_tree_info
3317*47501Spendry            : "exportfs" @var{<export-data>}
3318*47501Spendry            | "volname" @var{<volname>}
3319*47501Spendry            | "sel" @var{<selector-list>}
3320*47501Spendry            ;
3321*47501Spendry@end example
3322*47501Spendry
3323*47501SpendryExample:
3324*47501Spendry
3325*47501Spendry@example
3326*47501Spendrymount default @{
3327*47501Spendry    exportfs "dylan dougal florence zebedee"
3328*47501Spendry    volname /vol/andrew
3329*47501Spendry@}
3330*47501Spendry@end example
3331*47501Spendry
3332*47501SpendryIn the above example, the filesystem currently being declared will have
3333*47501Spendryan entry placed into the @file{exports} file allowing the filesystem to
3334*47501Spendrybe exported to the machines @code{dylan}, @code{dougal}, @code{florence}
3335*47501Spendryand @code{zebedee}.  The volume name by which the filesystem will be
3336*47501Spendryreferred to remotely, is @file{/vol/andrew}.  By declaring the
3337*47501Spendrymountpoint to be @code{default}, the filesystem will be mounted on the
3338*47501Spendrylocal machine in the automounter tree, where @i{Amd} will automatically
3339*47501Spendryinherit the mount as @file{/vol/andrew}.@refill
3340*47501Spendry
3341*47501Spendry@table @samp
3342*47501Spendry@item exportfs
3343*47501Spendrya string defining which machines the filesystem may be exported to.
3344*47501SpendryThis is copied, as is, into the @file{exports} file---no sanity checking
3345*47501Spendryis performed on this string.@refill
3346*47501Spendry
3347*47501Spendry@item volname
3348*47501Spendrya string which declares the remote name by which to reference the
3349*47501Spendryfilesystem.  The string is entered into a dictionary and allows you to
3350*47501Spendryrefer to this filesystem in other places by this volume name.@refill
3351*47501Spendry
3352*47501Spendry@item sel
3353*47501Spendrya string which is placed into the automounter maps as a selector for the
3354*47501Spendryfilesystem.@refill
3355*47501Spendry
3356*47501Spendry@end table
3357*47501Spendry
3358*47501Spendry@node FSinfo filesystems dumpset, FSinfo filesystems log, FSinfo filesystems mount, FSinfo filesystems
3359*47501Spendry@comment  node-name,  next,  previous,  up
3360*47501Spendry@subsection dumpset Option
3361*47501Spendry@cindex FSinfo dumpset filesystems option
3362*47501Spendry@cindex dumpset, FSinfo filesystems option
3363*47501Spendry
3364*47501SpendryThis provides support for Imperial College's local file backup tools and
3365*47501Spendryis not documented further here.
3366*47501Spendry
3367*47501Spendry@node FSinfo filesystems log, , FSinfo filesystems dumpset, FSinfo filesystems
3368*47501Spendry@comment  node-name,  next,  previous,  up
3369*47501Spendry@subsection log Option
3370*47501Spendry@cindex FSinfo log filesystems option
3371*47501Spendry@cindex log, FSinfo filesystems option
3372*47501Spendry
3373*47501SpendrySpecifies the log device for the current filesystem. This is ignored if
3374*47501Spendrynot required by the particular filesystem type.
3375*47501Spendry
3376*47501Spendry@node FSinfo static mounts, FSinfo automount definitions , FSinfo filesystems, FSinfo host definitions
3377*47501Spendry@comment  node-name,  next,  previous,  up
3378*47501Spendry@section @i{FSinfo} static mounts
3379*47501Spendry@cindex FSinfo static mounts
3380*47501Spendry@cindex Statically mounts filesystems, FSinfo
3381*47501Spendry
3382*47501SpendryEach host may also have a number of statically mounted filesystems.  For
3383*47501Spendryexample, the host may be a diskless workstation in which case it will
3384*47501Spendryhave no @code{fs} declarations.  In this case the @code{mount}
3385*47501Spendrydeclaration is used to determine from where its filesystems will be
3386*47501Spendrymounted.  In addition to being added to the @file{fstab} file, this
3387*47501Spendryinformation can also be used to generate a suitable @file{bootparams}
3388*47501Spendryfile.@refill
3389*47501Spendry
3390*47501Spendry@example
3391*47501Spendrymount       : "mount" @var{<volname>} @i{list(}localinfo@i{)} ;
3392*47501Spendry
3393*47501Spendrylocalinfo   : localinfo_attr @var{<string>} ;
3394*47501Spendry
3395*47501Spendrylocalinfo_attr
3396*47501Spendry            : "as"
3397*47501Spendry            | "from"
3398*47501Spendry            | "fstype"
3399*47501Spendry            | "opts"
3400*47501Spendry            ;
3401*47501Spendry@end example
3402*47501Spendry
3403*47501SpendryThe filesystem specified to be mounted will be searched for in the
3404*47501Spendrydictionary of volume names built when scanning the list of hosts'
3405*47501Spendrydefinitions.
3406*47501Spendry
3407*47501SpendryThe attributes have the following semantics:
3408*47501Spendry@table @samp
3409*47501Spendry@item from @var{machine}
3410*47501Spendrymount the filesystem from the machine with the hostname of
3411*47501Spendry@dfn{machine}.@refill
3412*47501Spendry
3413*47501Spendry@item as @var{mountpoint}
3414*47501Spendrymount the filesystem locally as the name given, in case this is
3415*47501Spendrydifferent from the advertised volume name of the filesystem.
3416*47501Spendry
3417*47501Spendry@item opts @var{options}
3418*47501Spendrynative @b{mount}(8) options.
3419*47501Spendry
3420*47501Spendry@item fstype @var{type}
3421*47501Spendrytype of filesystem to be mounted.
3422*47501Spendry@end table
3423*47501Spendry
3424*47501SpendryAn example:
3425*47501Spendry
3426*47501Spendry@example
3427*47501Spendrymount /export/exec/hp300/local as /usr/local
3428*47501Spendry@end example
3429*47501Spendry
3430*47501SpendryIf the mountpoint specified is either @file{/} or @file{swap}, the
3431*47501Spendrymachine will be considered to be booting off the net and this will be
3432*47501Spendrynoted for use in generating a @file{bootparams} file for the host which
3433*47501Spendryowns the filesystems.
3434*47501Spendry
3435*47501Spendry@node FSinfo automount definitions, FSinfo Command Line Options, FSinfo static mounts, FSinfo
3436*47501Spendry@comment  node-name,  next,  previous,  up
3437*47501Spendry@section Defining an @i{Amd} Mount Map in @i{FSinfo}
3438*47501Spendry@cindex FSinfo automount definitions
3439*47501Spendry@cindex Defining an Amd mount map, FSinfo
3440*47501Spendry
3441*47501SpendryThe maps used by @i{Amd} can be constructed from @i{FSinfo} by defining
3442*47501Spendryall the automount trees.  @i{FSinfo} takes all the definitions found and
3443*47501Spendrybuilds one map for each top level tree.
3444*47501Spendry
3445*47501SpendryThe automount tree is usually defined last.  A single automount
3446*47501Spendryconfiguration will usually apply to an entire management domain.  One
3447*47501Spendry@code{automount} declaration is needed for each @i{Amd} automount point.
3448*47501Spendry@i{FSinfo} determines whether the automount point is @dfn{direct}
3449*47501Spendry(@pxref{Direct Automount Filesystem}) or @dfn{indirect}
3450*47501Spendry(@pxref{Top-level Filesystem}).  Direct automount points are
3451*47501Spendrydistinguished by the fact that there is no underlying
3452*47501Spendry@dfn{automount_tree}.@refill
3453*47501Spendry
3454*47501Spendry@example
3455*47501Spendryautomount   : "automount" opt(auto_opts@i{)} automount_tree ;
3456*47501Spendry
3457*47501Spendryauto_opts   : "opts" @var{<mount-options>} ;
3458*47501Spendry
3459*47501Spendryautomount_tree
3460*47501Spendry            : @i{list(}automount_attr@i{)}
3461*47501Spendry            ;
3462*47501Spendry
3463*47501Spendryautomount_attr
3464*47501Spendry            : @var{<string>} "=" @var{<volname>}
3465*47501Spendry            | @var{<string>} "->" @var{<symlink>}
3466*47501Spendry            | @var{<string>} "@{" automount_tree "@}"
3467*47501Spendry            ;
3468*47501Spendry@end example
3469*47501Spendry
3470*47501SpendryIf @var{<mount-options>} is given, then it is the string to be placed in
3471*47501Spendrythe maps for @i{Amd} for the @code{opts} option.
3472*47501Spendry
3473*47501SpendryA @dfn{map} is typically a tree of filesystems, for example @file{home}
3474*47501Spendrynormally contains a tree of filesystems representing other machines in
3475*47501Spendrythe network.
3476*47501Spendry
3477*47501SpendryA map can either be given as a name representing an already defined
3478*47501Spendryvolume name, or it can be a tree.  A tree is represented by placing
3479*47501Spendrybraces after the name.  For example, to define a tree @file{/vol}, the
3480*47501Spendryfollowing map would be defined:
3481*47501Spendry
3482*47501Spendry@example
3483*47501Spendryautomount /vol @{ @}
3484*47501Spendry@end example
3485*47501Spendry
3486*47501SpendryWithin a tree, the only items that can appear are more maps.
3487*47501SpendryFor example:
3488*47501Spendry
3489*47501Spendry@example
3490*47501Spendryautomount /vol @{
3491*47501Spendry    andrew @{ @}
3492*47501Spendry    X11 @{ @}
3493*47501Spendry@}
3494*47501Spendry@end example
3495*47501Spendry
3496*47501SpendryIn this case, @i{FSinfo} will look for volumes named @file{/vol/andrew}
3497*47501Spendryand @file{/vol/X11} and a map entry will be generated for each.  If the
3498*47501Spendryvolumes are defined more than once, then @i{FSinfo} will generate
3499*47501Spendrya series of alternate entries for them in the maps.@refill
3500*47501Spendry
3501*47501SpendryInstead of a tree, either a link (@var{name} @code{->}
3502*47501Spendry@var{destination}) or a reference can be specified (@var{name} @code{=}
3503*47501Spendry@var{destination}).  A link creates a symbolic link to the string
3504*47501Spendryspecified, without further processing the entry.  A reference will
3505*47501Spendryexamine the destination filesystem and optimise the reference.  For
3506*47501Spendryexample, to create an entry for @code{njw} in the @file{/homes} map,
3507*47501Spendryeither of the two forms can be used:@refill
3508*47501Spendry
3509*47501Spendry@example
3510*47501Spendryautomount /homes @{
3511*47501Spendry    njw -> /home/dylan/njw
3512*47501Spendry@}
3513*47501Spendry@end example
3514*47501Spendry
3515*47501Spendryor
3516*47501Spendry
3517*47501Spendry@example
3518*47501Spendryautomount /homes @{
3519*47501Spendry    njw = /home/dylan/njw
3520*47501Spendry@}
3521*47501Spendry@end example
3522*47501Spendry
3523*47501SpendryIn the first example, when @file{/homes/njw} is referenced from @i{Amd},
3524*47501Spendrya link will be created leading to @file{/home/dylan/njw} and the
3525*47501Spendryautomounter will be referenced a second time to resolve this filename.
3526*47501SpendryThe map entry would be:
3527*47501Spendry
3528*47501Spendry@example
3529*47501Spendrynjw type:=link;fs:=/home/dylan/njw
3530*47501Spendry@end example
3531*47501Spendry
3532*47501SpendryIn the second example, the destination directory is analysed and found
3533*47501Spendryto be in the filesystem @file{/home/dylan} which has previously been
3534*47501Spendrydefined in the maps. Hence the map entry will look like:
3535*47501Spendry
3536*47501Spendry@example
3537*47501Spendrynjw rhost:=dylan;rfs:=/home/dylan;sublink:=njw
3538*47501Spendry@end example
3539*47501Spendry
3540*47501SpendryCreating only one symbolic link, and one access to @i{Amd}.
3541*47501Spendry
3542*47501Spendry@c ---------------------------------------------
3543*47501Spendry@node FSinfo Command Line Options, FSinfo errors, FSinfo automount definitions, FSinfo
3544*47501Spendry@comment  node-name,  next,  previous,  up
3545*47501Spendry@section @i{FSinfo} Command Line Options
3546*47501Spendry@cindex FSinfo command line options
3547*47501Spendry@cindex Command line options, FSinfo
3548*47501Spendry
3549*47501Spendry@i{FSinfo} is started from the command line by using the command:
3550*47501Spendry
3551*47501Spendry@example
3552*47501Spendryfsinfo [@i{options}] files ...
3553*47501Spendry@end example
3554*47501Spendry
3555*47501SpendryThe input to @i{FSinfo} is a single set of definitions of machines and
3556*47501Spendryautomount maps.  If multiple files are given on the command-line, then
3557*47501Spendrythe files are concatenated together to form the input source.  The files
3558*47501Spendryare passed individually through the C pre-processor before being parsed.
3559*47501Spendry
3560*47501SpendrySeveral options define a prefix for the name of an output file.  If the
3561*47501Spendryprefix is not specified no output of that type is produced.  The suffix
3562*47501Spendryused will correspond either to the hostname to which a file belongs, or
3563*47501Spendryto the type of output if only one file is produced.  Dumpsets and the
3564*47501Spendry@file{bootparams} file are in the latter class.  To put the output into
3565*47501Spendrya subdirectory simply put a @file{/} at the end of the prefix, making
3566*47501Spendrysure that the directory has already been made before running
3567*47501Spendry@samp{fsinfo}.
3568*47501Spendry
3569*47501Spendry@menu
3570*47501Spendry* -a FSinfo Option::	Amd automount directory:
3571*47501Spendry* -b FSinfo Option::	Prefix for bootparams files.
3572*47501Spendry* -d FSinfo Option::	Prefix for dumpset data files.
3573*47501Spendry* -e FSinfo Option::	Prefix for exports files.
3574*47501Spendry* -f FSinfo Option::	Prefix for fstab files.
3575*47501Spendry* -h FSinfo Option::	Local hostname.
3576*47501Spendry* -m FSinfo Option::	Prefix for automount maps.
3577*47501Spendry* -q FSinfo Option::	Ultra quiet mode.
3578*47501Spendry* -v FSinfo Option::	Verbose mode.
3579*47501Spendry* -I FSinfo Option::	Define new #include directory.
3580*47501Spendry* -D FSinfo Option::	Define macro.
3581*47501Spendry* -U FSinfo Option::	Undefine macro.
3582*47501Spendry@end menu
3583*47501Spendry
3584*47501Spendry@node -a FSinfo Option, -b FSinfo Option, FSinfo Command Line Options, FSinfo Command Line Options
3585*47501Spendry@comment  node-name,  next,  previous,  up
3586*47501Spendry@subsection @code{-a} @var{autodir}
3587*47501Spendry
3588*47501SpendrySpecifies the directory name in which to place the automounter's
3589*47501Spendrymountpoints.  This defaults to @file{/a}.  Some sites have the autodir set
3590*47501Spendryto be @file{/amd}, and this would be achieved by:
3591*47501Spendry
3592*47501Spendry@example
3593*47501Spendryfsinfo -a /amd ...
3594*47501Spendry@end example
3595*47501Spendry
3596*47501Spendry@node -b FSinfo Option, -d FSinfo Option, -a FSinfo Option, FSinfo Command Line Options
3597*47501Spendry@comment  node-name,  next,  previous,  up
3598*47501Spendry@subsection @code{-b} @var{bootparams}
3599*47501Spendry@cindex bootparams, FSinfo prefix
3600*47501Spendry
3601*47501SpendryThis specifies the prefix for the @file{bootparams} filename.  If it is
3602*47501Spendrynot given, then the file will not be generated.  The @file{bootparams}
3603*47501Spendryfile will be constructed for the destination machine and will be placed
3604*47501Spendryinto a file named @file{bootparams} and prefixed by this string.  The
3605*47501Spendryfile generated contains a list of entries describing each diskless
3606*47501Spendryclient that can boot from the destination machine.
3607*47501Spendry
3608*47501SpendryAs an example, to create a @file{bootparams} file in the directory
3609*47501Spendry@file{generic}, the following would be used:
3610*47501Spendry
3611*47501Spendry@example
3612*47501Spendryfsinfo -b generic/ ...
3613*47501Spendry@end example
3614*47501Spendry
3615*47501Spendry@node -d FSinfo Option, -e FSinfo Option, -b FSinfo Option, FSinfo Command Line Options
3616*47501Spendry@comment  node-name,  next,  previous,  up
3617*47501Spendry@subsection @code{-d} @var{dumpsets}
3618*47501Spendry@cindex dumpset, FSinfo prefix
3619*47501Spendry
3620*47501SpendryThis specifies the prefix for the @file{dumpsets} file.  If it is not
3621*47501Spendryspecified, then the file will not be generated.  The file will be for
3622*47501Spendrythe destination machine and will be placed into a filename
3623*47501Spendry@file{dumpsets}, prefixed by this string.  The @file{dumpsets} file is
3624*47501Spendryfor use by Imperial College's local backup system.
3625*47501Spendry
3626*47501SpendryFor example, to create a dumpsets file in the directory @file{generic},
3627*47501Spendrythen you would use the following:
3628*47501Spendry
3629*47501Spendry@example
3630*47501Spendryfsinfo -d generic/ ...
3631*47501Spendry@end example
3632*47501Spendry
3633*47501Spendry@node -e FSinfo Option, -f FSinfo Option, -d FSinfo Option, FSinfo Command Line Options
3634*47501Spendry@comment  node-name,  next,  previous,  up
3635*47501Spendry@subsection @code{-e} @var{exportfs}
3636*47501Spendry@cindex exports, FSinfo prefix
3637*47501Spendry
3638*47501SpendryDefines the prefix for the @file{exports} files.  If it is not given,
3639*47501Spendrythen the file will not be generated.  For each machine defined in the
3640*47501Spendryconfiguration files as having disks, an @file{exports} file is
3641*47501Spendryconstructed and given a filename determined by the name of the machine,
3642*47501Spendryprefixed with this string.  If a machine is defined as diskless, then no
3643*47501Spendry@file{exports} file will be created for it.  The files contain entries
3644*47501Spendryfor directories on the machine that may be exported to clients.
3645*47501Spendry
3646*47501SpendryExample: To create the @file{exports} files for each diskful machine
3647*47501Spendryand place them into the directory @file{exports}:
3648*47501Spendry
3649*47501Spendry@example
3650*47501Spendryfsinfo -e exports/ ...
3651*47501Spendry@end example
3652*47501Spendry
3653*47501Spendry@node -f FSinfo Option, -h FSinfo Option, -e FSinfo Option, FSinfo Command Line Options
3654*47501Spendry@comment  node-name,  next,  previous,  up
3655*47501Spendry@subsection @code{-f} @var{fstab}
3656*47501Spendry@cindex fstab, FSinfo prefix
3657*47501Spendry
3658*47501SpendryThis defines the prefix for the @file{fstab} files.  The files will only
3659*47501Spendrybe created if this prefix is defined.  For each machine defined in the
3660*47501Spendryconfiguration files, a @file{fstab} file is created with the filename
3661*47501Spendrydetermined by prefixing this string with the name of the machine.  These
3662*47501Spendryfiles contain entries for filesystems and partitions to mount at boot
3663*47501Spendrytime.
3664*47501Spendry
3665*47501SpendryExample, to create the files in the directory @file{fstabs}:
3666*47501Spendry
3667*47501Spendry@example
3668*47501Spendryfsinfo -f fstabs/ ...
3669*47501Spendry@end example
3670*47501Spendry
3671*47501Spendry@node -h FSinfo Option, -m FSinfo Option, -f FSinfo Option, FSinfo Command Line Options
3672*47501Spendry@comment  node-name,  next,  previous,  up
3673*47501Spendry@subsection @code{-h} @var{hostname}
3674*47501Spendry@cindex hostname, FSinfo command line option
3675*47501Spendry
3676*47501SpendryDefines the hostname of the destination machine to process for.  If this
3677*47501Spendryis not specified, it defaults to the local machine name, as returned by
3678*47501Spendry@b{gethostname}(2).
3679*47501Spendry
3680*47501SpendryExample:
3681*47501Spendry
3682*47501Spendry@example
3683*47501Spendryfsinfo -h dylan.doc.ic.ac.uk ...
3684*47501Spendry@end example
3685*47501Spendry
3686*47501Spendry@node -m FSinfo Option, -q FSinfo Option, -h FSinfo Option, FSinfo Command Line Options
3687*47501Spendry@comment  node-name,  next,  previous,  up
3688*47501Spendry@subsection @code{-m} @var{mount-maps}
3689*47501Spendry@cindex maps, FSinfo command line option
3690*47501Spendry
3691*47501SpendryDefines the prefix for the automounter files.  The maps will only be
3692*47501Spendryproduced if this prefix is defined.  The mount maps suitable for the
3693*47501Spendrynetwork defined by the configuration files will be placed into files
3694*47501Spendrywith names calculated by prefixing this string to the name of each map.
3695*47501Spendry
3696*47501SpendryFor example, to create the automounter maps and place them in the
3697*47501Spendrydirectory @file{automaps}:
3698*47501Spendry
3699*47501Spendry@example
3700*47501Spendryfsinfo -m automaps/ ...
3701*47501Spendry@end example
3702*47501Spendry
3703*47501Spendry@node -q FSinfo Option, -v FSinfo Option, -m FSinfo Option, FSinfo Command Line Options
3704*47501Spendry@comment  node-name,  next,  previous,  up
3705*47501Spendry@subsection @code{-q}
3706*47501Spendry@cindex quiet, FSinfo command line option
3707*47501Spendry
3708*47501SpendrySelects quiet mode.  @i{FSinfo} suppress the ``running commentary'' and
3709*47501Spendryonly outputs any error messages which are generated.
3710*47501Spendry
3711*47501Spendry@node -v FSinfo Option, -D-FSinfo Option, -q FSinfo Option, FSinfo Command Line Options
3712*47501Spendry@comment  node-name,  next,  previous,  up
3713*47501Spendry@subsection @code{-v}
3714*47501Spendry@cindex verbose, FSinfo command line option
3715*47501Spendry
3716*47501SpendrySelects verbose mode.  When this is activated, the program will display
3717*47501Spendrymore messages, and display all the information discovered when
3718*47501Spendryperforming the semantic analysis phase.  Each verbose message is output
3719*47501Spendryto @file{stdout} on a line starting with a @samp{#} character.
3720*47501Spendry
3721*47501Spendry@node -D-FSinfo Option, -I FSinfo Option, -v FSinfo Option, FSinfo Command Line Options
3722*47501Spendry@comment  node-name,  next,  previous,  up
3723*47501Spendry@subsection @code{-D} @var{name[=defn]}
3724*47501Spendry
3725*47501SpendryDefines a symbol @dfn{name} for the preprocessor when reading the
3726*47501Spendryconfiguration files.  Equivalent to @code{#define} directive.
3727*47501Spendry
3728*47501Spendry@node -I FSinfo Option, -U FSinfo Option, -D-FSinfo Option, FSinfo Command Line Options
3729*47501Spendry@comment  node-name,  next,  previous,  up
3730*47501Spendry@subsection @code{-I} @var{directory}
3731*47501Spendry
3732*47501SpendryThis option is passed into the preprocessor for the configuration files.
3733*47501SpendryIt specifies directories in which to find include files
3734*47501Spendry
3735*47501Spendry@node -U FSinfo Option, , -I FSinfo Option, FSinfo Command Line Options
3736*47501Spendry@comment  node-name,  next,  previous,  up
3737*47501Spendry@subsection @code{-U} @var{name}
3738*47501Spendry
3739*47501SpendryRemoves any initial definition of the symbol @dfn{name}.  Inverse of the
3740*47501Spendry@code{-D} option.
3741*47501Spendry
3742*47501Spendry@node FSinfo errors, , FSinfo command line options, FSinfo
3743*47501Spendry@comment  node-name,  next,  previous,  up
3744*47501Spendry@section Errors produced by @i{FSinfo}
3745*47501Spendry@cindex FSinfo error messages
3746*47501Spendry
3747*47501SpendryThe following table documents the errors and warnings which @i{FSinfo} may produce.
3748*47501Spendry
3749*47501Spendry@table @t
3750*47501Spendry
3751*47501Spendry@item can't open @var{filename} for writing
3752*47501SpendryOccurs if any errors are encountered when opening an output file.@refill
3753*47501Spendry
3754*47501Spendry@item unknown host attribute
3755*47501SpendryOccurs if an unrecognised keyword is used when defining a host.@refill
3756*47501Spendry
3757*47501Spendry@item unknown filesystem attribute
3758*47501SpendryOccurs if an unrecognised keyword is used when defining a host's
3759*47501Spendryfilesystems.@refill
3760*47501Spendry
3761*47501Spendry@item not allowed '/' in a directory name
3762*47501SpendryWhen reading the configuration input, if there is a filesystem
3763*47501Spendrydefinition which contains a pathname with multiple directories for any
3764*47501Spendrypart of the mountpoint element, and it is not a single absolute path,
3765*47501Spendrythen this message will be produced by the parser.@refill
3766*47501Spendry
3767*47501Spendry@item unknown directory attribute
3768*47501SpendryIf an unknown keyword is found while reading the definition of a hosts's
3769*47501Spendryfilesystem mount option.
3770*47501Spendry
3771*47501Spendry@item unknown mount attribute
3772*47501SpendryOccurs if an unrecognised keyword is found while parsing the list of
3773*47501Spendrystatic mounts.@refill
3774*47501Spendry
3775*47501Spendry@item " expected
3776*47501SpendryOccurs if an unescaped newline is found in a quoted string.
3777*47501Spendry
3778*47501Spendry@item unknown \ sequence
3779*47501SpendryOccurs if an unknown escape sequence is found inside a string.  Within a
3780*47501Spendrystring, you can give the standard C escape sequences for strings, such
3781*47501Spendryas newlines and tab characters.@refill
3782*47501Spendry
3783*47501Spendry@item @var{filename}: cannot open for reading
3784*47501SpendryIf a file specified on the command line as containing configuration data
3785*47501Spendrycould not be opened.@refill
3786*47501Spendry
3787*47501Spendry@item end of file within comment
3788*47501SpendryA comment was unterminated before the end of one of the configuration
3789*47501Spendryfiles.
3790*47501Spendry
3791*47501Spendry@item host field "@var{field-name}" already set
3792*47501SpendryIf duplicate definitions are given for any of the fields with a host
3793*47501Spendrydefinition.
3794*47501Spendry
3795*47501Spendry@item duplicate host @var{hostname}!
3796*47501SpendryIf a host has more than one definition.
3797*47501Spendry
3798*47501Spendry@item netif field @var{field-name} already set
3799*47501SpendryOccurs if you attempt to define an attribute of an interface more than
3800*47501Spendryonce.
3801*47501Spendry
3802*47501Spendry@item malformed IP dotted quad: @var{address}
3803*47501SpendryIf the Internet address of an interface is incorrectly specified.  An
3804*47501SpendryInternet address definition is handled to @b{inet_addr}(3N) to see if it
3805*47501Spendrycan cope.  If not, then this message will be displayed.
3806*47501Spendry
3807*47501Spendry@item malformed netmask: @var{netmask}
3808*47501SpendryIf the netmask cannot be decoded as though it were a hexadecimal number,
3809*47501Spendrythen this message will be displayed.  It will typically be caused by
3810*47501Spendryincorrect characters in the @var{netmask} value.@refill
3811*47501Spendry
3812*47501Spendry@item fs field "@var{field-name}" already set
3813*47501SpendryOccurs when multiple definitions are given for one of the attributes of a
3814*47501Spendryhost's filesystem.
3815*47501Spendry
3816*47501Spendry@item mount tree field "@var{field-name}" already set
3817*47501SpendryOccurs when the @var{field-name} is defined more than once during the
3818*47501Spendrydefinition of a filesystems mountpoint.
3819*47501Spendry
3820*47501Spendry@item mount field "@var{field-name}" already set
3821*47501SpendryOccurs when a static mount has multiple definitions of the same field.
3822*47501Spendry
3823*47501Spendry@item no disk mounts on @var{hostname}
3824*47501SpendryIf there are no static mounts, nor local disk mounts specified for a
3825*47501Spendrymachine, this message will be displayed.
3826*47501Spendry
3827*47501Spendry@item @var{host}:@var{device} needs field "@var{field-name}"
3828*47501SpendryOccurs when a filesystem is missing a required field. @var{field-name} could
3829*47501Spendrybe one of @code{fstype}, @code{opts}, @code{passno} or
3830*47501Spendry@code{mount}.@refill
3831*47501Spendry
3832*47501Spendry@item @var{filesystem} has a volname but no exportfs data
3833*47501SpendryOccurs when a volume name is declared for a file system, but the string
3834*47501Spendryspecifying what machines the filesystem can be exported to is
3835*47501Spendrymissing.
3836*47501Spendry
3837*47501Spendry@item sub-directory @var{directory} of @var{directory-tree} starts with '/'
3838*47501SpendryWithin the filesystem specification for a host, if an element
3839*47501Spendry@var{directory} of the mountpoint begins with a @samp{/} and it is not
3840*47501Spendrythe start of the tree.@refill
3841*47501Spendry
3842*47501Spendry@item @var{host}:@var{device} has no mount point
3843*47501SpendryOccurs if the @samp{mount} option is not specified for a host's
3844*47501Spendryfilesystem.@refill
3845*47501Spendry
3846*47501Spendry@item @var{host}:@var{device} has more than one mount point
3847*47501SpendryOccurs if the mount option for a host's filesystem specifies multiple
3848*47501Spendrytrees at which to place the mountpoint.@refill
3849*47501Spendry
3850*47501Spendry@item no volname given for @var{host}:@var{device}
3851*47501SpendryOccurs when a filesystem is defined to be mounted on @file{default}, but
3852*47501Spendryno volume name is given for the file system, then the mountpoint cannot
3853*47501Spendrybe determined.@refill
3854*47501Spendry
3855*47501Spendry@item @var{host}:mount field specified for swap partition
3856*47501SpendryOccurs if a mountpoint is given for a filesystem whose type is declared
3857*47501Spendryto be @code{swap}.@refill
3858*47501Spendry
3859*47501Spendry@item ambiguous mount: @var{volume} is a replicated filesystem
3860*47501SpendryIf several filesystems are declared as having the same volume name, they
3861*47501Spendrywill be considered replicated filesystems.  To mount a replicated
3862*47501Spendryfilesystem statically, a specific host will need to be named, to say
3863*47501Spendrywhich particular copy to try and mount, else this error will
3864*47501Spendryresult.@refill
3865*47501Spendry
3866*47501Spendry@item cannot determine localname since volname @var{volume} is not uniquely defined
3867*47501SpendryIf a volume is replicated and an attempt is made to mount the filesystem
3868*47501Spendrystatically without specifying a local mountpoint, @i{FSinfo} cannot
3869*47501Spendrycalculate a mountpoint, as the desired pathname would be
3870*47501Spendryambiguous.@refill
3871*47501Spendry
3872*47501Spendry@item volname @var{volume} is unknown
3873*47501SpendryOccurs if an attempt is made to mount or reference a volume name which
3874*47501Spendryhas not been declared during the host filesystem definitions.@refill
3875*47501Spendry
3876*47501Spendry@item volname @var{volume} not exported from @var{machine}
3877*47501SpendryOccurs if you attempt to mount the volume @var{volume} from a machine
3878*47501Spendrywhich has not declared itself to have such a filesystem
3879*47501Spendryavailable.@refill
3880*47501Spendry
3881*47501Spendry@item network booting requires both root and swap areas
3882*47501SpendryOccurs if a machine has mount declarations for either the root partition
3883*47501Spendryor the swap area, but not both.  You cannot define a machine to only
3884*47501Spendrypartially boot via the network.@refill
3885*47501Spendry
3886*47501Spendry@item unknown volname @var{volume} automounted @i{[} on <name> @i{]}
3887*47501SpendryOccurs if @var{volume} is used in a definition of an automount map but the volume
3888*47501Spendryname has not been declared during the host filesystem definitions.@refill
3889*47501Spendry
3890*47501Spendry@item not allowed '/' in a directory name
3891*47501SpendryOccurs when a pathname with multiple directory elements is specified as
3892*47501Spendrythe name for an automounter tree.  A tree should only have one name at
3893*47501Spendryeach level.
3894*47501Spendry
3895*47501Spendry@item @var{device} has duplicate exportfs data
3896*47501SpendryProduced if the @samp{exportfs} option is used multiple times within the
3897*47501Spendrysame branch of a filesytem definition. For example, if you attempt to
3898*47501Spendryset the @samp{exportfs} data at different levels of the mountpoint
3899*47501Spendrydirectory tree.@refill
3900*47501Spendry
3901*47501Spendry@item sub-directory of @var{directory-tree} is named "default"
3902*47501Spendry@samp{default} is a keyword used to specify if a mountpoint should be
3903*47501Spendryautomatically calculated by @i{FSinfo}.  If you attempt to specify a
3904*47501Spendrydirectory name as this, it will use the filename of @file{default} but
3905*47501Spendrywill produce this warning.@refill
3906*47501Spendry
3907*47501Spendry@item pass number for @var{host}:@var{device} is non-zero
3908*47501SpendryOccurs if @var{device} has its @samp{fstype} declared to be @samp{swap}
3909*47501Spendryor @samp{export} and the @b{fsck}(8) pass number is set. Swap devices should not be
3910*47501Spendryfsck'd.  @xref{FSinfo filesystems fstype}@refill
3911*47501Spendry
3912*47501Spendry@item dump frequency for @var{host}:@var{device} is non-zero
3913*47501SpendryOccurs if @var{device} has its @samp{fstype} declared to be @samp{swap}
3914*47501Spendryor @samp{export} and the @samp{dump} option is set to a value greater
3915*47501Spendrythan zero.  Swap devices should not be dumped.@refill
3916*47501Spendry
3917*47501Spendry@end table
3918*47501Spendry
3919*47501Spendry@node     Examples, Internals, FSinfo, Top
3920*47501Spendry@comment  node-name,  next,  previous,  up
3921*47501Spendry@chapter Examples
3922*47501Spendry
3923*47501Spendry@menu
3924*47501Spendry* User Filesystems::
3925*47501Spendry* Home Directories::
3926*47501Spendry* Architecture Sharing::
3927*47501Spendry* Wildcard names::
3928*47501Spendry* rwho servers::
3929*47501Spendry* /vol::
3930*47501Spendry@end menu
3931*47501Spendry
3932*47501Spendry@node     User Filesystems, Home Directories, Starting Amd, Examples
3933*47501Spendry@comment  node-name,  next,  previous,  up
3934*47501Spendry@section User Filesystems
3935*47501Spendry@cindex User filesystems
3936*47501Spendry@cindex Mounting user filesystems
3937*47501Spendry
3938*47501SpendryWith more than one fileserver, the directories most frequently
3939*47501Spendrycross-mounted are those containing user home directories.  A common
3940*47501Spendryconvention used at Imperial College is to mount the user disks under
3941*47501Spendry@t{/home/}@i{machine}.
3942*47501Spendry
3943*47501SpendryTypically, the @samp{/etc/fstab} file contained a long list of entries
3944*47501Spendrysuch as:
3945*47501Spendry
3946*47501Spendry@example
3947*47501Spendry@i{machine}:/home/@i{machine} /home/@i{machine} nfs ...
3948*47501Spendry@end example
3949*47501Spendry
3950*47501Spendryfor each fileserver on the network.
3951*47501Spendry
3952*47501SpendryThere are numerous problems with this system.  The mount list can become
3953*47501Spendryquite large and some of the machines may be down when a system is
3954*47501Spendrybooted.  When a new fileserver is installed, @samp{/etc/fstab} must be
3955*47501Spendryupdated on every machine, the mount directory created and the filesystem
3956*47501Spendrymounted.
3957*47501Spendry
3958*47501SpendryIn many environments most people use the same few workstations, but
3959*47501Spendryit is convenient to go to a colleague's machine and access your own
3960*47501Spendryfiles.  When a server goes down, it can cause a process on a client
3961*47501Spendrymachine to hang.  By minimising the mounted filesystems to only include
3962*47501Spendrythose actively being used, there is less chance that a filesystem will
3963*47501Spendrybe mounted when a server goes down.
3964*47501Spendry
3965*47501SpendryThe following is a short extract from a map taken from a research fileserver
3966*47501Spendryat Imperial College.
3967*47501Spendry
3968*47501SpendryNote the entry for @samp{localhost} which is used for users such as
3969*47501Spendrythe operator (@samp{opr}) who have a home directory on most machine as
3970*47501Spendry@samp{/home/localhost/opr}.
3971*47501Spendry
3972*47501Spendry@example
3973*47501Spendry/defaults       opts:=rw,intr,grpid,nosuid
3974*47501Spendrycharm           host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \
3975*47501Spendry                host==$@{key@};type:=ufs;dev:=/dev/xd0g
3976*47501Spendry#
3977*47501Spendry...
3978*47501Spendry
3979*47501Spendry#
3980*47501Spendrylocalhost       type:=link;fs:=$@{host@}
3981*47501Spendry...
3982*47501Spendry#
3983*47501Spendry# dylan has two user disks so have a
3984*47501Spendry# top directory in which to mount them.
3985*47501Spendry#
3986*47501Spendrydylan           type:=auto;fs:=$@{map@};pref:=$@{key@}/
3987*47501Spendry#
3988*47501Spendrydylan/dk2       host!=dylan;type:=nfs;rhost:=dylan;rfs:=/home/$@{key@} \
3989*47501Spendry                host==dylan;type:=ufs;dev:=/dev/dsk/2s0
3990*47501Spendry#
3991*47501Spendrydylan/dk5       host!=dylan;type:=nfs;rhost:=dylan;rfs:=/home/$@{key@} \
3992*47501Spendry                host==dylan;type:=ufs;dev:=/dev/dsk/5s0
3993*47501Spendry...
3994*47501Spendry#
3995*47501Spendrytoytown         host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \
3996*47501Spendry                host==$@{key@};type:=ufs;dev:=/dev/xy1g
3997*47501Spendry...
3998*47501Spendry#
3999*47501Spendryzebedee         host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \
4000*47501Spendry                host==$@{key@};type:=ufs;dev:=/dev/dsk/1s0
4001*47501Spendry#
4002*47501Spendry# Just for access...
4003*47501Spendry#
4004*47501Spendrygould           type:=auto;fs:=$@{map@};pref:=$@{key@}/
4005*47501Spendrygould/staff     host!=gould;type:=nfs;rhost:=gould;rfs:=/home/$@{key@}
4006*47501Spendry#
4007*47501Spendrygummo           host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@}
4008*47501Spendry...
4009*47501Spendry@end example
4010*47501Spendry
4011*47501SpendryThis map is shared by most of the machines listed so on those
4012*47501Spendrysystems any of the user disks is accessible via a consistent name.
4013*47501Spendry@i{Amd} is started with the following command
4014*47501Spendry
4015*47501Spendry@example
4016*47501Spendryamd /home amd.home
4017*47501Spendry@end example
4018*47501Spendry
4019*47501SpendryNote that when mounting a remote filesystem, the @dfn{automounted}
4020*47501Spendrymount point is referenced, so that the filesystem will be mounted if
4021*47501Spendryit is not yet (at the time the remote @samp{mountd} obtains the file handle).
4022*47501Spendry
4023*47501Spendry@node     Home Directories, Architecture Sharing, User Filesystems, Examples
4024*47501Spendry@comment  node-name,  next,  previous,  up
4025*47501Spendry@section Home Directories
4026*47501Spendry@cindex Home directories
4027*47501Spendry@cindex Example of mounting home directories
4028*47501Spendry@cindex Mount home directories
4029*47501Spendry
4030*47501SpendryOne convention for home directories is to locate them in @samp{/homes}
4031*47501Spendryso user @samp{jsp}'s home directory is @samp{/homes/jsp}.  With more
4032*47501Spendrythan a single fileserver it is convenient to spread user files across
4033*47501Spendryseveral machines.  All that is required is a mount-map which converts
4034*47501Spendrylogin names to an automounted directory.
4035*47501Spendry
4036*47501SpendrySuch a map might be started by the command:
4037*47501Spendry
4038*47501Spendry@example
4039*47501Spendryamd /homes amd.homes
4040*47501Spendry@end example
4041*47501Spendry
4042*47501Spendrywhere the map @samp{amd.homes} contained the entries:
4043*47501Spendry
4044*47501Spendry@example
4045*47501Spendry/defaults   type:=link   # All the entries are of type:=link
4046*47501Spendryjsp         fs:=/home/charm/jsp
4047*47501Spendrynjw         fs:=/home/dylan/dk5/njw
4048*47501Spendry...
4049*47501Spendryphjk        fs:=/home/toytown/ai/phjk
4050*47501Spendrysjv         fs:=/home/ganymede/sjv
4051*47501Spendry@end example
4052*47501Spendry
4053*47501SpendryWhenever a login name is accessed in @samp{/homes} a symbolic link
4054*47501Spendryappears pointing to the real location of that user's home directory.  In
4055*47501Spendrythis example, @samp{/homes/jsp} would appear to be a symbolic link
4056*47501Spendrypointing to @samp{/home/charm/jsp}.  Of course, @samp{/home} would also
4057*47501Spendrybe an automount point.
4058*47501Spendry
4059*47501SpendryThis system causes an extra level of symbolic links to be used.
4060*47501SpendryAlthough that turns out to be relatively inexpensive, an alternative is
4061*47501Spendryto directly mount the required filesystems in the @samp{/homes}
4062*47501Spendrymap.  The required map is simple, but long, and its creation is best automated.
4063*47501SpendryThe entry for @samp{jsp} could be:
4064*47501Spendry
4065*47501Spendry@example
4066*47501Spendryjsp   -sublink:=$@{key@};rfs:=/home/charm \
4067*47501Spendry               host==charm;type:=ufs;dev:=/dev/xd0g \
4068*47501Spendry               host!=charm;type:=nfs;rhost:=charm
4069*47501Spendry@end example
4070*47501Spendry
4071*47501SpendryThis map can become quite big if it contains a large number of entries.
4072*47501SpendryBy combining two other features of @i{Amd} it can be greatly simplified.
4073*47501Spendry
4074*47501SpendryFirst the UFS partitions should be mounted under the control of
4075*47501Spendry@samp{/etc/fstab}, taking care that they are mounted in the same place
4076*47501Spendrythat @i{Amd} would have automounted them.  In most cases this would be
4077*47501Spendrysomething like @samp{/a/@dfn{host}/home/@dfn{host}} and
4078*47501Spendry@samp{/etc/fstab} on host @samp{charm} would have a line:@refill
4079*47501Spendry
4080*47501Spendry@example
4081*47501Spendry/dev/xy0g /a/charm/home/charm 4.2 rw,nosuid,grpid 1 5
4082*47501Spendry@end example
4083*47501Spendry
4084*47501SpendryThe map can then be changed to:
4085*47501Spendry
4086*47501Spendry@example
4087*47501Spendry/defaults    type:=nfs;sublink:=$@{key@};opts:=rw,intr,nosuid,grpid
4088*47501Spendryjsp          rhost:=charm;rfs:=/home/charm
4089*47501Spendrynjw          rhost:=dylan;rfs:=/home/dylan/dk5
4090*47501Spendry...
4091*47501Spendryphjk         rhost:=toytown;rfs:=/home/toytown;sublink:=ai/$@{key@}
4092*47501Spendrysjv          rhost:=ganymede;rfs:=/home/ganymede
4093*47501Spendry@end example
4094*47501Spendry
4095*47501SpendryThis map operates as usual on a remote machine (@i{ie} @code{$@{host@}}
4096*47501Spendrynot equal to @code{$@{rhost@}}).  On the machine where the filesystem is
4097*47501Spendrystored (@i{ie} @code{$@{host@}} equal to @code{$@{rhost@}}), @i{Amd}
4098*47501Spendrywill construct a local filesystem mount point which corresponds to the
4099*47501Spendryname of the locally mounted UFS partition.  If @i{Amd} is started with
4100*47501Spendrythe ``-r'' option then instead of attempting an NFS mount, @i{Amd} will
4101*47501Spendrysimply inherit the UFS mount (@pxref{Inheritance Filesystem}).  If
4102*47501Spendry``-r'' is not used then a loopback NFS mount will be made.  This type of
4103*47501Spendrymount is known to cause a deadlock on many systems.
4104*47501Spendry
4105*47501Spendry@node     Architecture Sharing, Wildcard Names, Home Directories, Examples
4106*47501Spendry@comment  node-name,  next,  previous,  up
4107*47501Spendry@section Architecture Sharing
4108*47501Spendry@cindex Architecture sharing
4109*47501Spendry@cindex Sharing a fileserver between architectures
4110*47501Spendry@cindex Architecture dependent volumes
4111*47501Spendry
4112*47501Spendry@c %At the moment some of the research machines have sets of software
4113*47501Spendry@c %mounted in @samp{/vol}.  This contains subdirectories for \TeX,
4114*47501Spendry@c %system sources, local sources, prolog libraries and so on.
4115*47501SpendryOften a filesystem will be shared by machines of different architectures.
4116*47501SpendrySeparate trees can be maintained for the executable images for each
4117*47501Spendryarchitecture, but it may be more convenient to have a shared tree,
4118*47501Spendrywith distinct subdirectories.
4119*47501Spendry
4120*47501SpendryA shared tree might have the following structure on the fileserver (called
4121*47501Spendry@samp{fserver} in the example):
4122*47501Spendry
4123*47501Spendry@example
4124*47501Spendrylocal/tex
4125*47501Spendrylocal/tex/fonts
4126*47501Spendrylocal/tex/lib
4127*47501Spendrylocal/tex/bin
4128*47501Spendrylocal/tex/bin/sun3
4129*47501Spendrylocal/tex/bin/sun4
4130*47501Spendrylocal/tex/bin/hp9000
4131*47501Spendry...
4132*47501Spendry@end example
4133*47501Spendry
4134*47501SpendryIn this example, the subdirectories of @samp{local/tex/bin} should be
4135*47501Spendryhidden when accessed via the automount point (conventionally @samp{/vol}).
4136*47501SpendryA mount-map for @samp{/vol} to achieve this would look like:
4137*47501Spendry
4138*47501Spendry@example
4139*47501Spendry/defaults   rfs:=/vol;sublink:=$@{key@};rhost:=fserver;type:=link
4140*47501Spendrytex         type:=auto;fs:=$@{map@};pref:=$@{key@}/
4141*47501Spendrytex/fonts   host!=fserver;type:=nfs \
4142*47501Spendry            host==fserver;fs:=/usr/local
4143*47501Spendrytex/lib     host!=fserver;type:=nfs \
4144*47501Spendry            host==fserver;fs:=/usr/local
4145*47501Spendrytex/bin     -sublink:=$@{key@}/$@{arch2@} host!=fserver;type:=nfs \
4146*47501Spendry            host:=fserver;fs:=/usr/local
4147*47501Spendry@end example
4148*47501Spendry
4149*47501SpendryWhen @samp{/vol/tex/bin} is referenced, the current machine architecture
4150*47501Spendryis automatically appended to the path by the @code{$@{sublink@}}
4151*47501Spendryvariable.  This means that users can have @samp{/vol/tex/bin} in their
4152*47501Spendry@samp{PATH} without concern for architecture dependencies.
4153*47501Spendry
4154*47501Spendry@node     Wildcard Names, rwho servers, Architecture Sharing, Examples
4155*47501Spendry@comment  node-name,  next,  previous,  up
4156*47501Spendry@section Wildcard names & Replicated Servers
4157*47501Spendry
4158*47501SpendryBy using the wildcard facility, @i{Amd} can @dfn{overlay} an existing
4159*47501Spendrydirectory with additional entries.
4160*47501SpendryThe system files are usually mounted under @samp{/usr}.  If instead
4161*47501Spendry@i{Amd} is mounted on @samp{/usr}, additional
4162*47501Spendrynames can be overlayed to augment or replace names in the ``master'' @samp{/usr}.
4163*47501SpendryA map to do this would have the form:
4164*47501Spendry
4165*47501Spendry@example
4166*47501Spendrylocal  type:=auto;fs:=local-map
4167*47501Spendryshare  type:=auto;fs:=share-map
4168*47501Spendry*      -type:=nfs;rfs:=/export/exec/$@{arch@};sublink:="$@{key@}" \
4169*47501Spendry        rhost:=fserv1  rhost:=fserv2  rhost:=fserv3
4170*47501Spendry@end example
4171*47501Spendry
4172*47501SpendryNote that the assignment to @code{$@{sublink@}} is surrounded by double
4173*47501Spendryquotes to prevent the incoming key from causing the map to be
4174*47501Spendrymisinterpreted.  This map has the effect of directing any access to
4175*47501Spendry@samp{/usr/local} or @samp{/usr/share} to another automount point.
4176*47501Spendry
4177*47501SpendryIn this example, it is assumed that the @samp{/usr} files are replicated
4178*47501Spendryon three fileservers: @samp{fserv1}, @samp{fserv2} and @samp{fserv3}.
4179*47501SpendryFor any references other than to @samp{local} and @samp{share} one of
4180*47501Spendrythe servers is used and a symbolic link to
4181*47501Spendry@t{$@{autodir@}/$@{rhost@}/export/exec/$@{arch@}/@i{whatever}} is
4182*47501Spendryreturned once an appropriate filesystem has been mounted.@refill
4183*47501Spendry
4184*47501Spendry@node     rwho servers, /vol, Wildcard Names, Examples
4185*47501Spendry@comment  node-name,  next,  previous,  up
4186*47501Spendry@section @samp{rwho} servers
4187*47501Spendry@cindex rwho servers
4188*47501Spendry@cindex Architecture specific mounts
4189*47501Spendry@cindex Example of architecture specific mounts
4190*47501Spendry
4191*47501SpendryThe @samp{/usr/spool/rwho} directory is a good candidate for automounting.
4192*47501SpendryFor efficiency reasons it is best to capture the rwho data on a small
4193*47501Spendrynumber of machines and then mount that information onto a large number
4194*47501Spendryof clients.  The data written into the rwho files is byte order dependent
4195*47501Spendryso only servers with the correct byte ordering can be used by a client:
4196*47501Spendry
4197*47501Spendry@example
4198*47501Spendry/defaults         type:=nfs
4199*47501Spendryusr/spool/rwho    -byte==little;rfs:=/usr/spool/rwho \
4200*47501Spendry                      rhost:=vaxA  rhost:=vaxB \
4201*47501Spendry                  || -rfs:=/usr/spool/rwho \
4202*47501Spendry                      rhost:=sun4  rhost:=hp300
4203*47501Spendry@end example
4204*47501Spendry
4205*47501Spendry@node     /vol, , rwho servers, Examples
4206*47501Spendry@comment  node-name,  next,  previous,  up
4207*47501Spendry@section @samp{/vol}
4208*47501Spendry@cindex /vol
4209*47501Spendry@cindex Catch-all mount point
4210*47501Spendry@cindex Generic volume name
4211*47501Spendry
4212*47501Spendry@samp{/vol} is used as a catch-all for volumes which do not have other
4213*47501Spendryconventional names.
4214*47501Spendry
4215*47501SpendryBelow is part of the @samp{/vol} map for the domain @samp{doc.ic.ac.uk}.
4216*47501SpendryThe @samp{r+d} tree is used for new or experimental software that needs
4217*47501Spendryto be available everywhere without installing it on all the fileservers.
4218*47501SpendryUsers wishing to try out the new software then simply include
4219*47501Spendry@samp{/vol/r+d/{bin,ucb}} in their path.@refill
4220*47501Spendry
4221*47501SpendryThe main tree resides on one host @samp{gould.doc.ic.ac.uk}, which has
4222*47501Spendrydifferent @samp{bin}, @samp{etc}, @samp{lib} and @samp{ucb}
4223*47501Spendrysub-directories for each machine architecture.  For example,
4224*47501Spendry@samp{/vol/r+d/bin} for a Sun-4 would be stored in the sub-directory
4225*47501Spendry@samp{bin/sun4} of the filesystem @samp{/usr/r+d}.  When it was accessed
4226*47501Spendrya symbolic link pointing to @samp{/a/gould/usr/r+d/bin/sun4} would be
4227*47501Spendryreturned.@refill
4228*47501Spendry
4229*47501Spendry@example
4230*47501Spendry/defaults    type:=nfs;opts:=rw,grpid,nosuid,intr,soft
4231*47501Spendrywp           -opts:=rw,grpid,nosuid;rhost:=charm \
4232*47501Spendry             host==charm;type:=link;fs:=/usr/local/wp \
4233*47501Spendry             host!=charm;type:=nfs;rfs:=/vol/wp
4234*47501Spendry...
4235*47501Spendry#
4236*47501Spendrysrc          -opts:=rw,grpid,nosuid;rhost:=charm \
4237*47501Spendry             host==charm;type:=link;fs:=/usr/src \
4238*47501Spendry             host!=charm;type:=nfs;rfs:=/vol/src
4239*47501Spendry#
4240*47501Spendryr+d          type:=auto;fs:=$@{map@};pref:=r+d/
4241*47501Spendry# per architecture bin,etc,lib&ucb...
4242*47501Spendryr+d/bin      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
4243*47501Spendryr+d/etc      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
4244*47501Spendryr+d/include  rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}
4245*47501Spendryr+d/lib      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
4246*47501Spendryr+d/man      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}
4247*47501Spendryr+d/src      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}
4248*47501Spendryr+d/ucb      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
4249*47501Spendry# hades pictures
4250*47501Spendrypictures     -opts:=rw,grpid,nosuid;rhost:=thpfs \
4251*47501Spendry             host==thpfs;type:=link;fs:=/nbsd/pictures \
4252*47501Spendry             host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=pictures
4253*47501Spendry# hades tools
4254*47501Spendryhades        -opts:=rw,grpid,nosuid;rhost:=thpfs \
4255*47501Spendry             host==thpfs;type:=link;fs:=/nbsd/hades \
4256*47501Spendry             host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=hades
4257*47501Spendry# bsd tools for hp.
4258*47501Spendrybsd          -opts:=rw,grpid,nosuid;arch==hp9000;rhost:=thpfs \
4259*47501Spendry             host==thpfs;type:=link;fs:=/nbsd/bsd \
4260*47501Spendry             host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=bsd
4261*47501Spendry@end example
4262*47501Spendry
4263*47501Spendry@node     Internals, Acknowledgements & Trademarks, Examples, Top
4264*47501Spendry@comment  node-name,  next,  previous,  up
4265*47501Spendry@chapter Internals
4266*47501Spendry
4267*47501Spendry@menu
4268*47501Spendry* Log Messages::
4269*47501Spendry@end menu
4270*47501Spendry
4271*47501Spendry@node     Log Messages, , Internals, Internals
4272*47501Spendry@comment  node-name,  next,  previous,  up
4273*47501Spendry@section Log Messages
4274*47501Spendry
4275*47501SpendryIn the following sections a brief explanation is given of some of the
4276*47501Spendrylog messages made by @i{Amd}.  Where the message is in @samp{typewriter}
4277*47501Spendryfont, it corresponds exactly to the message produced by @i{Amd}.  Words
4278*47501Spendryin @dfn{italic} are replaced by an appropriate string.  Variables,
4279*47501Spendry@code{$@{var@}}, indicate that the value of the appropriate variable is
4280*47501Spendryoutput.
4281*47501Spendry
4282*47501SpendryLog messages are either sent direct to a file,
4283*47501Spendryor logged via the @b{syslog}(3) mechanism.
4284*47501SpendryMessages are logged with facility @samp{LOG_DAEMON} when using @b{syslog}(3).
4285*47501SpendryIn either case, entries in the file are of the form:
4286*47501Spendry@example
4287*47501Spendry@i{date-string}  @i{hostname} @t{amd[}@i{pid}@t{]}  @i{message}
4288*47501Spendry@end example
4289*47501Spendry
4290*47501Spendry@menu
4291*47501Spendry* Fatal errors::
4292*47501Spendry* Info messages::
4293*47501Spendry@end menu
4294*47501Spendry
4295*47501Spendry@node     Fatal errors, Info messages, Log Messages, Log Messages
4296*47501Spendry@comment  node-name,  next,  previous,  up
4297*47501Spendry@subsection Fatal errors
4298*47501Spendry
4299*47501Spendry@i{Amd} attempts to deal with unusual events.  Whenever it is not
4300*47501Spendrypossible to deal with such an error, @i{Amd} will log an appropriate
4301*47501Spendrymessage and, if it cannot possibly continue, will either exit or abort.
4302*47501SpendryThese messages are selected by @samp{-x fatal} on the command line.
4303*47501SpendryWhen @b{syslog}(3) is being used, they are logged with level
4304*47501Spendry@samp{LOG_FATAL}.  Even if @i{Amd} continues to operate it is likely to
4305*47501Spendryremain in a precarious state and should be restarted at the earliest
4306*47501Spendryopportunity.
4307*47501Spendry
4308*47501Spendry@table @asis
4309*47501Spendry@item @t{Attempting to inherit not-a-filesystem}
4310*47501SpendryThe prototype mount point created during a filesystem restart did not
4311*47501Spendrycontain a reference to the restarted filesystem.  This erorr ``should
4312*47501Spendrynever happen''.
4313*47501Spendry
4314*47501Spendry@item @t{Can't bind to domain "@i{NIS-domain}"}
4315*47501SpendryA specific NIS domain was requested on the command line, but no server
4316*47501Spendryfor that domain is available on the local net.
4317*47501Spendry
4318*47501Spendry@item @t{Can't determine IP address of this host (@i{hostname})}
4319*47501SpendryWhen @i{Amd} starts it determines its own IP address.  If this lookup
4320*47501Spendryfails then @i{Amd} cannot continue.  The hostname it looks up is that
4321*47501Spendryobtained returned by @b{gethostname}(2) system call.
4322*47501Spendry
4323*47501Spendry@item @t{Can't find root file handle for @i{automount point}}
4324*47501Spendry@i{Amd} creates its own file handles for the automount points.  When it
4325*47501Spendrymounts itself as a server, it must pass these file handles to the local
4326*47501Spendrykernel.  If the filehandle is not obtainable the mount point is ignored.
4327*47501SpendryThis error ``should never happen''.
4328*47501Spendry
4329*47501Spendry@item @t{Must be root to mount filesystems (euid = @i{euid})}
4330*47501SpendryTo prevent embarrassment, @i{Amd} makes sure it has appropriate system
4331*47501Spendryprivileges.  This amounts to having an euid of 0.  The check is made
4332*47501Spendryafter argument processing complete to give non-root users a chance to
4333*47501Spendryaccess the ``-v'' option.
4334*47501Spendry
4335*47501Spendry@item @t{No work to do - quitting}
4336*47501SpendryNo automount points were given on the command line and so there is no
4337*47501Spendrywork to do.
4338*47501Spendry
4339*47501Spendry@item @t{Out of memory in realloc}
4340*47501SpendryWhile attempting to realloc some memory, the memory space available to
4341*47501Spendry@i{Amd} was exhausted.  This is an unrecoverable error.
4342*47501Spendry
4343*47501Spendry@item @t{Out of memory}
4344*47501SpendryWhile attempting to malloc some memory, the memory space available to
4345*47501Spendry@i{Amd} was exhausted.  This is an unrecoverable error.
4346*47501Spendry
4347*47501Spendry@item @t{cannot create rpc/udp service}
4348*47501SpendryEither the NFS or AMQ endpoint could not be created.
4349*47501Spendry
4350*47501Spendry@item @t{gethostname:} @i{description}
4351*47501SpendryThe @b{gethostname}(2) system call failed during startup.
4352*47501Spendry
4353*47501Spendry@item @t{host name is not set}
4354*47501SpendryThe @b{gethostname}(2) system call returned a zero length host name.
4355*47501SpendryThis can happen if @i{Amd} is started in single user mode just after
4356*47501Spendrybooting the system.
4357*47501Spendry
4358*47501Spendry@item @t{ifs_match called!}
4359*47501SpendryAn internal error occurred while restarting a pre-mounted filesystem.
4360*47501SpendryThis error ``should never happen''.
4361*47501Spendry
4362*47501Spendry@item @t{mount_afs:} @i{description}
4363*47501SpendryAn error occured while @i{Amd} was mounting itself.
4364*47501Spendry
4365*47501Spendry@item @t{run_rpc failed}
4366*47501SpendrySomehow the main NFS server loop failed.  This error ``should never
4367*47501Spendryhappen''.
4368*47501Spendry
4369*47501Spendry@item @t{unable to free rpc arguments in amqprog_1}
4370*47501SpendryThe incoming arguments to the AMQ server could not be free'ed.
4371*47501Spendry
4372*47501Spendry@item @t{unable to free rpc arguments in nfs_program_1}
4373*47501SpendryThe incoming arguments to the NFS server could not be free'ed.
4374*47501Spendry
4375*47501Spendry@item @t{unable to register (AMQ_PROGRAM, AMQ_VERSION, udp)}
4376*47501SpendryThe AMQ server could not be registered with the local portmapper or the
4377*47501Spendryinternal RPC dispatcher.
4378*47501Spendry
4379*47501Spendry@item @t{unable to register (NFS_PROGRAM, NFS_VERSION, 0)}
4380*47501SpendryThe NFS server could not be registered with the internal RPC dispatcher.
4381*47501Spendry
4382*47501Spendry@end table
4383*47501Spendry
4384*47501Spendry@node     Info messages, , Fatal errors, Log Messages
4385*47501Spendry@comment  node-name,  next,  previous,  up
4386*47501Spendry@subsection Info messages
4387*47501Spendry
4388*47501Spendry@i{Amd} generates information messages to record state changes.  These
4389*47501Spendrymessages are selected by @samp{-x info} on the command line.  When
4390*47501Spendry@b{syslog}(3) is being used, they are logged with level @samp{LOG_INFO}.
4391*47501Spendry
4392*47501SpendryThe messages listed below can be generated and are in a format suitable
4393*47501Spendryfor simple statistical analysis.  @dfn{mount-info} is the string
4394*47501Spendrythat is displayed by @dfn{Amq} in its mount information column and
4395*47501Spendryplaced in the system mount table.
4396*47501Spendry
4397*47501Spendry@table @asis
4398*47501Spendry@item @t{mount of "@t{$@{@i{path}@}}" on @t{$@{@i{fs}@}} timed out}
4399*47501SpendryAttempts to mount a filesystem for the given automount point have failed
4400*47501Spendryto complete within 30 seconds.
4401*47501Spendry
4402*47501Spendry@item @t{"@t{$@{@i{path}@}}" forcibly timed out}
4403*47501SpendryAn automount point has been timed out by the @i{Amq} command.
4404*47501Spendry
4405*47501Spendry@item @t{restarting @i{mount-info} on @t{$@{@i{fs}@}}}
4406*47501SpendryA pre-mounted file system has been noted.
4407*47501Spendry
4408*47501Spendry@item @t{"@t{$@{@i{path}@}}" has timed out}
4409*47501SpendryNo access to the automount point has been made within the timeout
4410*47501Spendryperiod.
4411*47501Spendry
4412*47501Spendry@item @t{file server @t{$@{@i{rhost}@}} is down - timeout of "@t{$@{@i{path}@}}" ignored}
4413*47501SpendryAn automount point has timed out, but the corresponding file server is
4414*47501Spendryknown to be down.  This message is only produced once for each mount
4415*47501Spendrypoint for which the server is down.
4416*47501Spendry
4417*47501Spendry@item @t{Re-synchronizing cache for map @t{$@{@i{map}@}}}
4418*47501SpendryThe named map has been modified and the internal cache is being re-synchronized.
4419*47501Spendry
4420*47501Spendry@item @t{Filehandle denied for "@t{$@{@i{rhost}@}}:@t{$@{@i{rfs}@}}"}
4421*47501SpendryThe mount daemon refused to return a file handle for the requested filesystem.
4422*47501Spendry
4423*47501Spendry@item @t{Filehandle error for "$@{@i{rhost}@}:$@{@i{rfs}@}":} @i{description}
4424*47501SpendryThe mount daemon gave some other error for the requested filesystem.
4425*47501Spendry
4426*47501Spendry@item @t{file server @t{$@{@i{rhost}@}} type nfs starts up}
4427*47501SpendryA new NFS file server has been referenced and is known to be up.
4428*47501Spendry
4429*47501Spendry@item @t{file server @t{$@{@i{rhost}@}} type nfs starts down}
4430*47501SpendryA new NFS file server has been referenced and is known to be down.
4431*47501Spendry
4432*47501Spendry@item @t{file server @t{$@{@i{rhost}@}} type nfs is up}
4433*47501SpendryAn NFS file server that was previously down is now up.
4434*47501Spendry
4435*47501Spendry@item @t{file server @t{$@{@i{rhost}@}} type nfs is down}
4436*47501SpendryAn NFS file server that was previously up is now down.
4437*47501Spendry
4438*47501Spendry@item @t{Finishing with status @i{exit-status}}
4439*47501Spendry@i{Amd} is about to exit with the given exit status.
4440*47501Spendry
4441*47501Spendry@item @t{@i{mount-info} mounted fstype @t{$@{@i{type}@}} on @t{$@{@i{fs}@}}}
4442*47501SpendryA new file system has been mounted.
4443*47501Spendry
4444*47501Spendry@item @t{@i{mount-info} restarted fstype @t{$@{@i{type}@}} on @t{$@{@i{fs}@}}}
4445*47501Spendry@i{Amd} is using a pre-mounted filesystem to satisfy a mount request.
4446*47501Spendry
4447*47501Spendry@item @t{@i{mount-info} unmounted fstype @t{$@{@i{type}@}} from @t{$@{@i{fs}@}}}
4448*47501SpendryA file system has been unmounted.
4449*47501Spendry
4450*47501Spendry@item @t{@i{mount-info} unmounted fstype @t{$@{@i{type}@}} from @t{$@{@i{fs}@}} link @t{$@{@i{fs}@}}/@t{$@{@i{sublink}@}}}
4451*47501SpendryA file system of which only a sub-directory was in use has been unmounted.
4452*47501Spendry
4453*47501Spendry@end table
4454*47501Spendry
4455*47501Spendry@node     Acknowledgements & Trademarks, Index, Internals, Top
4456*47501Spendry@comment  node-name,  next,  previous,  up
4457*47501Spendry@unnumbered Acknowledgements & Trademarks
4458*47501Spendry
4459*47501SpendryThanks to the Formal Methods Group at Imperial College for
4460*47501Spendrysuffering patiently while @i{Amd} was being developed on their machines.
4461*47501Spendry
4462*47501SpendryThanks to the many people who have helped with the development of
4463*47501Spendry@i{Amd}, especially Piete Brooks at the Cambridge University Computing
4464*47501SpendryLab for many hours of testing, experimentation and discussion.
4465*47501Spendry
4466*47501Spendry@itemize @bullet
4467*47501Spendry@item
4468*47501Spendry@b{DEC}, @b{VAX} and @b{Ultrix} are registered trademarks of Digital
4469*47501SpendryEquipment Corporation.
4470*47501Spendry@item
4471*47501Spendry@b{AIX} and @b{IBM} are registered trademarks of International Business
4472*47501SpendryMachines Corporation.
4473*47501Spendry@item
4474*47501Spendry@b{Sun}, @b{NFS} and @b{SunOS} are registered trademarks of Sun
4475*47501SpendryMicrosystems, Inc.
4476*47501Spendry@item
4477*47501Spendry@b{Unix} is a registered trademark of AT&T Bell Laboratories in the USA
4478*47501Spendryand other countries.
4479*47501Spendry@end itemize
4480*47501Spendry
4481*47501Spendry@node Index, , Acknowledgements & Trademarks, Top
4482*47501Spendry@unnumbered Index
4483*47501Spendry
4484*47501Spendry@printindex cp
4485*47501Spendry
4486*47501Spendry@contents
4487*47501Spendry@bye
4488