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