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