dma: move sender into queue
[dragonfly.git] / contrib / amd / doc / am-utils.texi
blob12bda8f31a48b6952016b822c5272f476a7cb8db
1 \input texinfo          @c -*-texinfo-*-
2 @c
3 @c Copyright (c) 1997-1999 Erez Zadok
4 @c Copyright (c) 1989 Jan-Simon Pendry
5 @c Copyright (c) 1989 Imperial College of Science, Technology & Medicine
6 @c Copyright (c) 1989 The Regents of the University of California.
7 @c All rights reserved.
8 @c
9 @c This code is derived from software contributed to Berkeley by
10 @c Jan-Simon Pendry at Imperial College, London.
12 @c Redistribution and use in source and binary forms, with or without
13 @c modification, are permitted provided that the following conditions
14 @c are met:
15 @c 1. Redistributions of source code must retain the above copyright
16 @c    notice, this list of conditions and the following disclaimer.
17 @c 2. Redistributions in binary form must reproduce the above copyright
18 @c    notice, this list of conditions and the following disclaimer in the
19 @c    documentation and/or other materials provided with the distribution.
20 @c 3. All advertising materials mentioning features or use of this software
21 @c    must display the following acknowledgment:
22 @c      This product includes software developed by the University of
23 @c      California, Berkeley and its contributors.
24 @c 4. Neither the name of the University nor the names of its contributors
25 @c    may be used to endorse or promote products derived from this software
26 @c    without specific prior written permission.
28 @c THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
29 @c ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30 @c IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 @c ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
32 @c FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 @c DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 @c OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 @c HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 @c LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 @c OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 @c      %W% (Berkeley) %G%
41 @c $Id: am-utils.texi,v 1.12 1999/09/30 21:01:39 ezk Exp $
43 @setfilename am-utils.info
45 @include version.texi
47 @c info directory entry
48 @direntry
49 * Am-utils: (am-utils).          The Amd automounter suite of utilities
50 @end direntry
52 @settitle
53 @setchapternewpage odd
55 @titlepage
56 @title Am-utils (4.4BSD Automounter Utilities)
57 @subtitle For version @value{VERSION}, @value{UPDATED}
59 @author Erez Zadok
60 (Originally by Jan-Simon Pendry and Nick Williams)
62 @page
63 Copyright @copyright{} 1997-1999 Erez Zadok
65 Copyright @copyright{} 1989 Jan-Simon Pendry
67 Copyright @copyright{} 1989 Imperial College of Science, Technology & Medicine
69 Copyright @copyright{} 1989 The Regents of the University of California.
70 @sp
71 All Rights Reserved.
72 @vskip 1ex
73 Permission to copy this document, or any portion of it, as
74 necessary for use of this software is granted provided this
75 copyright notice and statement of permission are included.
76 @end titlepage
77 @page
79 @c Define a new index for options.
80 @syncodeindex pg cp
81 @syncodeindex vr cp
83 @ifinfo
85 @c ################################################################
86 @node Top, License, , (DIR)
87 Am-utils - The 4.4BSD Automounter Tool Suite
88 *********************************************
90 Am-utils is the 4.4BSD Automounter Tool Suite, which includes the Amd
91 automounter, the Amq query and control program, the Hlfsd daemon, and
92 other tools.  This Info file describes how to use and understand the
93 tools within Am-utils.
94 @end ifinfo
96 @menu
97 * License::                  Explains the terms and conditions for using
98                              and distributing Am-utils.
99 * Distrib::                  How to get the latest Am-utils distribution.
100 * Intro::                    An introduction to Automounting concepts.
101 * History::                  History of am-utils' development.
102 * Overview::                 An overview of Amd.
103 * Supported Platforms::      Machines and Systems supported by Amd.
104 * Mount Maps::               Details of mount maps
105 * Amd Command Line Options:: All the Amd command line options explained. 
106 * Filesystem Types::         The different mount types supported by Amd.
107 * Amd Configuration File::   The amd.conf file syntax and meaning.
108 * Run-time Administration::  How to start, stop and control Amd.
109 * FSinfo::                   The FSinfo filesystem management tool.
110 * Hlfsd::                    The Home-Link Filesystem server.
111 * Assorted Tools::           Other tools which come with am-utils.
112 * Examples::                 Some examples showing how Amd might be used.
113 * Internals::                Implementation details.
114 * Acknowledgments & Trademarks:: Legal Notes
116 Indexes
117 * Index::                    An item for each concept.
118 @end menu
120 @iftex
121 @unnumbered Preface
123 This manual documents the use of the 4.4BSD automounter tool suite,
124 which includes @i{Amd}, @i{Amq}, @i{Hlfsd}, and other programs.  This is
125 primarily a reference manual.  While no tutorial exists, there are
126 examples available.  @xref{Examples}.
128 This manual comes in two forms: the published form and the Info form.
129 The Info form is for on-line perusal with the INFO program which is
130 distributed along with GNU texinfo package (a version of which is
131 available for GNU Emacs).@footnote{GNU packages can be found in
132 @url{ftp://ftp.gnu.org/pub/gnu/}.}  Both forms contain substantially
133 the same text and are generated from a common source file, which is
134 distributed with the @i{Am-utils} source.
135 @end iftex
137 @c ################################################################
138 @node License, Distrib, Top, Top
139 @unnumbered License
140 @cindex License Information
142 @i{Am-utils} is not in the public domain; it is copyrighted and there are
143 restrictions on its distribution.
145 Redistribution and use in source and binary forms, with or without
146 modification, are permitted provided that the following conditions are
147 met:
149 @enumerate
151 @item
152 Redistributions of source code must retain the above copyright notice,
153 this list of conditions and the following disclaimer.
155 @item
156 Redistributions in binary form must reproduce the above copyright
157 notice, this list of conditions and the following disclaimer in the
158 documentation and/or other materials provided with the distribution.
160 @item
161 All advertising materials mentioning features or use of this software
162 must display the following acknowledgment:
164 @cartouche
165 ``This product includes software developed by the University of
166 California, Berkeley and its contributors, as well as the Trustees of
167 Columbia University.''
168 @end cartouche
170 @item
171 Neither the name of the University nor the names of its contributors may
172 be used to endorse or promote products derived from this software
173 without specific prior written permission.
175 @end enumerate
177 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
178 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
179 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
180 PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
181 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
182 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
183 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
184 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
185 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
186 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
187 THE POSSIBILITY OF SUCH DAMAGE.
189 @c ################################################################
190 @node Distrib, Intro, License, Top
191 @unnumbered Source Distribution
192 @cindex Source code distribution
193 @cindex Obtaining the source code
195 The @i{Am-utils} home page is located in
196 @example
197 @url{http://www.cs.columbia.edu/~ezk/am-utils/}
198 @end example
200 You can get the latest distribution version of @i{Am-utils} from
201 @example
202 @url{ftp://shekel.mcl.cs.columbia.edu/pub/am-utils/am-utils.tar.gz}
203 @end example
205 Alpha and beta distributions are available in
206 @example
207 @url{ftp://shekel.mcl.cs.columbia.edu/pub/am-utils/}.
208 @end example
210 Revision 5.2 was part of the 4.3BSD Reno distribution.
212 Revision 5.3bsdnet, a late alpha version of 5.3, was part
213 of the BSD network version 2 distribution
215 Revision 6.0 was made independently by @email{ezk@@cs.columbia.edu,Erez
216 Zadok} at the @uref{http://www.cs.columbia.edu/,Computer Science
217 Department} of @uref{http://www.columbia.edu/,Columbia University}, as
218 part of his @uref{http://www.cs.columbia.edu/~ezk/research/tp/thesis_proposal.html,PhD thesis work}. @xref{History}, for more details.
220 @unnumberedsec Bug Reports
221 @cindex Bug reports
223 Before reporting a bug, see if it is a known one in the
224 @uref{http://www.cs.columbia.edu/~ezk/am-utils/BUGS.txt,bugs} file.
225 Send all bug reports to @email{amd-dev@@majordomo.cs.columbia.edu}
226 quoting the details of the release and your configuration.  These can be
227 obtained by running the command @samp{amd -v}.  It would greatly help if
228 you could provide a reproducible procedure for detecting the bug you are
229 reporting.
231 Providing working patches is highly encouraged.  Every patch
232 incorporated, however small, will get its author an honorable mention in
233 the @uref{http://www.cs.columbia.edu/~ezk/am-utils/AUTHORS.txt,authors
234 file}.
236 @unnumberedsec Mailing List
237 @cindex Mailing list
239 There are two mailing lists for people interested in keeping up-to-date
240 with developments.
242 @c ###############
244 @enumerate
246 @item
247 The older list, @samp{amd-workers} is for general "how to" questions and
248 announcements.  To subscribe, send a note to
249 @email{amd-workers-request@@majordomo.glue.umd.edu}.@footnote{Note that
250 the older address, @email{amd-workers-request@@acl.lanl.gov}, is
251 defunct.}  To post a message to this list, send mail to
252 @email{amd-workers@@majordomo.glue.umd.edu}.
254 @item
255 The developers only list, @samp{amd-dev} is for
257 @itemize @minus
258 @item
259 announcements of alpha and beta releases of am-utils
260 @item
261 reporting of bugs and patches
262 @item
263 discussions of new features for am-utils
264 @item
265 implementation and porting issues
266 @end itemize
268 To subscribe, send a note to @email{majordomo@@majordomo.cs.columbia.edu}
269 with the single body text line @samp{subscribe amd-dev}.  To post a
270 message to this list, send mail to
271 @email{amd-dev@@majordomo.cs.columbia.edu}.  To avoid as much spam as
272 possible, only subscribers to this list may post to it.
274 Subscribers of @samp{amd-dev} are most suitable if they have the time
275 and resources to test new and buggy versions of amd, on as many
276 different platforms as possible.  They should also be prepared to learn
277 and use the GNU Autoconf, Automake, and Libtool packages, and of course,
278 be very familiar with the complex code in the am-utils package.  In
279 other words, subscribers on this list should be able to contribute
280 meaningfully to the development of amd.
282 @end enumerate
284 @c ################################################################
285 @node Intro, History, Distrib, Top
286 @unnumbered Introduction
287 @cindex Introduction
289 An @dfn{automounter} maintains a cache of mounted filesystems.
290 Filesystems are mounted on demand when they are first referenced,
291 and unmounted after a period of inactivity.
293 @i{Amd} may be used as a replacement for Sun's automounter.  The choice
294 of which filesystem to mount can be controlled dynamically with
295 @dfn{selectors}.  Selectors allow decisions of the form ``hostname is
296 @var{this},'' or ``architecture is not @var{that}.''  Selectors may be
297 combined arbitrarily.  @i{Amd} also supports a variety of filesystem
298 types, including NFS, UFS and the novel @dfn{program} filesystem.  The
299 combination of selectors and multiple filesystem types allows identical
300 configuration files to be used on all machines thus reducing the
301 administrative overhead.
303 @i{Amd} ensures that it will not hang if a remote server goes down.
304 Moreover, @i{Amd} can determine when a remote server has become
305 inaccessible and then mount replacement filesystems as and when they
306 become available.
308 @i{Amd} contains no proprietary source code and has been ported to
309 numerous flavors of Unix.
311 @c ################################################################
312 @node History, Overview, Intro, Top
313 @unnumbered History
314 @cindex History
316 The @i{Amd} package has been without an official maintainer since 1992.
317 Several people have stepped in to maintain it unofficially.  Most
318 notable were the `upl' (Unofficial Patch Level) releases of @i{Amd},
319 created by me (@email{ezk@@cs.columbia.edu,Erez Zadok}), and available from
320 @url{ftp://ftp.cs.columbia.edu/pub/amd/}.  The last such unofficial
321 release was `upl102'.
323 Through the process of patching and aging, it was becoming more and more
324 apparent that @i{Amd} was in much need of revitalizing.  Maintaining
325 @i{Amd} had become a difficult task.  I took it upon myself to cleanup
326 the code, so that it would be easier to port to new platforms, add new
327 features, keep up with the many new feature requests, and deal with the
328 never ending stream of bug reports.
330 I have been working on such a release of @i{Amd} on and off since
331 January of 1996.  The new suite of tools is currently named "am-utils"
332 (AutoMounter Utilities), in line with GNU naming conventions, befitting
333 the contents of the package.  In October of 1996 I had received enough
334 offers to help me with this task that I decided to make a mailing list
335 for this group of people.  Around the same time, @i{Amd} had become a
336 necessary part of my PhD thesis work, resulting in more work performed
337 on am-utils.
339 Am-utils version 6.0 was numbered with a major new release number to
340 distinguish it from the last official release of @i{Amd} (5.x).  Many
341 new features have been added such as a GNU @code{configure} system, NFS
342 Version 3, Autofs support, a run-time configuration file (`amd.conf'),
343 many new ports, more scripts and programs, as well as numerous bug
344 fixes.  Another reason for the new major release number was to alert
345 users of am-utils that user-visible interfaces may have changed.  In
346 order to make @i{Amd} work well for the next 10 years, and be easier to
347 maintain, it was necessary to remove old or unused features, change
348 various syntax files, etc.  However, great care was taken to ensure the
349 maximum possible backwards compatibility.
351 @c ################################################################
352 @node Overview, Supported Platforms, History, Top
353 @chapter Overview
355 @i{Amd} maintains a cache of mounted filesystems.  Filesystems are
356 @dfn{demand-mounted} when they are first referenced, and unmounted after
357 a period of inactivity.  @i{Amd} may be used as a replacement for Sun's
358 @b{automount}(8) program.  It contains no proprietary source code and
359 has been ported to numerous flavors of Unix.  @xref{Supported
360 Platforms}.@refill
362 @i{Amd} was designed as the basis for experimenting with filesystem
363 layout and management.  Although @i{Amd} has many direct applications it
364 is loaded with additional features which have little practical use.  At
365 some point the infrequently used components may be removed to streamline
366 the production system.
368 @c @i{Amd} supports the notion of @dfn{replicated} filesystems by evaluating
369 @c each member of a list of possible filesystem locations in parallel.
370 @c @i{Amd} checks that each cached mapping remains valid.  Should a mapping be
371 @c lost -- such as happens when a fileserver goes down -- @i{Amd} automatically
372 @c selects a replacement should one be available.
374 @menu
375 * Fundamentals::
376 * Filesystems and Volumes::
377 * Volume Naming::
378 * Volume Binding::
379 * Operational Principles::
380 * Mounting a Volume::
381 * Automatic Unmounting::
382 * Keep-alives::
383 * Non-blocking Operation::
384 @end menu
386 @node Fundamentals, Filesystems and Volumes, Overview, Overview
387 @comment  node-name,  next,  previous,  up
388 @section Fundamentals
389 @cindex Automounter fundamentals
391 The fundamental concept behind @i{Amd} is the ability to separate the
392 name used to refer to a file from the name used to refer to its physical
393 storage location.  This allows the same files to be accessed with the
394 same name regardless of where in the network the name is used.  This is
395 very different from placing @file{/n/hostname} in front of the pathname
396 since that includes location dependent information which may change if
397 files are moved to another machine.
399 By placing the required mappings in a centrally administered database,
400 filesystems can be re-organized without requiring changes to
401 configuration files, shell scripts and so on.
403 @node Filesystems and Volumes, Volume Naming, Fundamentals, Overview
404 @comment  node-name,  next,  previous,  up
405 @section Filesystems and Volumes
406 @cindex Filesystem
407 @cindex Volume
408 @cindex Fileserver
409 @cindex sublink
411 @i{Amd} views the world as a set of fileservers, each containing one or
412 more filesystems where each filesystem contains one or more
413 @dfn{volumes}.  Here the term @dfn{volume} is used to refer to a
414 coherent set of files such as a user's home directory or a @TeX{}
415 distribution.@refill
417 In order to access the contents of a volume, @i{Amd} must be told in
418 which filesystem the volume resides and which host owns the filesystem.
419 By default the host is assumed to be local and the volume is assumed to
420 be the entire filesystem.  If a filesystem contains more than one
421 volume, then a @dfn{sublink} is used to refer to the sub-directory
422 within the filesystem where the volume can be found.
424 @node Volume Naming, Volume Binding, Filesystems and Volumes, Overview
425 @comment  node-name,  next,  previous,  up
426 @section Volume Naming
427 @cindex Volume names
428 @cindex Network-wide naming
429 @cindex Replicated volumes
430 @cindex Duplicated volumes
431 @cindex Replacement volumes
433 Volume names are defined to be unique across the entire network.  A
434 volume name is the pathname to the volume's root as known by the users
435 of that volume.  Since this name uniquely identifies the volume
436 contents, all volumes can be named and accessed from each host, subject
437 to administrative controls.
439 Volumes may be replicated or duplicated.  Replicated volumes contain
440 identical copies of the same data and reside at two or more locations in
441 the network.  Each of the replicated volumes can be used
442 interchangeably.  Duplicated volumes each have the same name but contain
443 different, though functionally identical, data.  For example,
444 @samp{/vol/tex} might be the name of a @TeX{} distribution which varied
445 for each machine architecture.@refill
447 @i{Amd} provides facilities to take advantage of both replicated and
448 duplicated volumes.  Configuration options allow a single set of
449 configuration data to be shared across an entire network by taking
450 advantage of replicated and duplicated volumes.
452 @i{Amd} can take advantage of replacement volumes by mounting them as
453 required should an active fileserver become unavailable.
455 @node Volume Binding, Operational Principles, Volume Naming, Overview
456 @comment  node-name,  next,  previous,  up
457 @section Volume Binding
458 @cindex Volume binding
459 @cindex Unix namespace
460 @cindex Namespace
461 @cindex Binding names to filesystems
463 Unix implements a namespace of hierarchically mounted filesystems.  Two
464 forms of binding between names and files are provided.  A @dfn{hard
465 link} completes the binding when the name is added to the filesystem.  A
466 @dfn{soft link} delays the binding until the name is accessed.  An
467 @dfn{automounter} adds a further form in which the binding of name to
468 filesystem is delayed until the name is accessed.@refill
470 The target volume, in its general form, is a tuple (host, filesystem,
471 sublink) which can be used to name the physical location of any volume
472 in the network.
474 When a target is referenced, @i{Amd} ignores the sublink element and
475 determines whether the required filesystem is already mounted.  This is
476 done by computing the local mount point for the filesystem and checking
477 for an existing filesystem mounted at the same place.  If such a
478 filesystem already exists then it is assumed to be functionally
479 identical to the target filesystem.  By default there is a one-to-one
480 mapping between the pair (host, filesystem) and the local mount point so
481 this assumption is valid.
483 @node Operational Principles, Mounting a Volume, Volume Binding, Overview
484 @comment  node-name,  next,  previous,  up
485 @section Operational Principles
486 @cindex Operational principles
488 @i{Amd} operates by introducing new mount points into the namespace.
489 These are called @dfn{automount} points.  The kernel sees these
490 automount points as NFS filesystems being served by @i{Amd}.  Having
491 attached itself to the namespace, @i{Amd} is now able to control the
492 view the rest of the system has of those mount points.  RPC calls are
493 received from the kernel one at a time.
495 When a @dfn{lookup} call is received @i{Amd} checks whether the name is
496 already known.  If it is not, the required volume is mounted.  A
497 symbolic link pointing to the volume root is then returned.  Once the
498 symbolic link is returned, the kernel will send all other requests
499 direct to the mounted filesystem.
501 If a volume is not yet mounted, @i{Amd} consults a configuration
502 @dfn{mount-map} corresponding to the automount point.  @i{Amd} then
503 makes a runtime decision on what and where to mount a filesystem based
504 on the information obtained from the map.
506 @i{Amd} does not implement all the NFS requests; only those relevant
507 to name binding such as @dfn{lookup}, @dfn{readlink} and @dfn{readdir}.
508 Some other calls are also implemented but most simply return an error
509 code; for example @dfn{mkdir} always returns ``read-only filesystem''.
511 @node Mounting a Volume, Automatic Unmounting, Operational Principles, Overview
512 @comment  node-name,  next,  previous,  up
513 @section Mounting a Volume
514 @cindex Mounting a volume
515 @cindex Location lists
516 @cindex Alternate locations
517 @cindex Mount retries
518 @cindex Background mounts
520 Each automount point has a corresponding mount map.  The mount map
521 contains a list of key--value pairs.  The key is the name of the volume
522 to be mounted.  The value is a list of locations describing where the
523 filesystem is stored in the network.  In the source for the map the
524 value would look like
526 @display
527 location1  location2  @dots{}  locationN
528 @end display
530 @i{Amd} examines each location in turn.  Each location may contain
531 @dfn{selectors} which control whether @i{Amd} can use that location.
532 For example, the location may be restricted to use by certain hosts.
533 Those locations which cannot be used are ignored.
535 @i{Amd} attempts to mount the filesystem described by each remaining
536 location until a mount succeeds or @i{Amd} can no longer proceed.  The
537 latter can occur in three ways:
539 @itemize @bullet
540 @item
541 If none of the locations could be used, or if all of the locations
542 caused an error, then the last error is returned.
544 @item
545 If a location could be used but was being mounted in the background then
546 @i{Amd} marks that mount as being ``in progress'' and continues with
547 the next request; no reply is sent to the kernel.
549 @item
550 Lastly, one or more of the mounts may have been @dfn{deferred}.  A mount
551 is deferred if extra information is required before the mount can
552 proceed.  When the information becomes available the mount will take
553 place, but in the mean time no reply is sent to the kernel.  If the
554 mount is deferred, @i{Amd} continues to try any remaining locations.
555 @end itemize
557 Once a volume has been mounted, @i{Amd} establishes a @dfn{volume
558 mapping} which is used to satisfy subsequent requests.@refill
560 @node Automatic Unmounting, Keep-alives, Mounting a Volume, Overview
561 @comment  node-name,  next,  previous,  up
562 @section Automatic Unmounting
564 To avoid an ever increasing number of filesystem mounts, @i{Amd} removes
565 volume mappings which have not been used recently.  A time-to-live
566 interval is associated with each mapping and when that expires the
567 mapping is removed.  When the last reference to a filesystem is removed,
568 that filesystem is unmounted.  If the unmount fails, for example the
569 filesystem is still busy, the mapping is re-instated and its
570 time-to-live interval is extended.  The global default for this grace
571 period is controlled by the @code{-w} command-line option (@pxref{-w
572 Option, -w}) or the @i{amd.conf} parameter @samp{dismount_interval}
573 (@pxref{dismount_interval Parameter}).  It is also possible to set this
574 value on a per-mount basis (@pxref{opts Option, opts, opts}).
576 Filesystems can be forcefully timed out using the @i{Amq} command.
577 @xref{Run-time Administration}.
579 @node Keep-alives, Non-blocking Operation, Automatic Unmounting, Overview
580 @comment  node-name,  next,  previous,  up
581 @section Keep-alives
582 @cindex Keep-alives
583 @cindex Server crashes
584 @cindex NFS ping
586 Use of some filesystem types requires the presence of a server on
587 another machine.  If a machine crashes then it is of no concern to
588 processes on that machine that the filesystem is unavailable.  However,
589 to processes on a remote host using that machine as a fileserver this
590 event is important.  This situation is most widely recognized when an
591 NFS server crashes and the behavior observed on client machines is that
592 more and more processes hang.  In order to provide the possibility of
593 recovery, @i{Amd} implements a @dfn{keep-alive} interval timer for some
594 filesystem types.  Currently only NFS makes use of this service.
596 The basis of the NFS keep-alive implementation is the observation that
597 most sites maintain replicated copies of common system data such as
598 manual pages, most or all programs, system source code and so on.  If
599 one of those servers goes down it would be reasonable to mount one of
600 the others as a replacement.
602 The first part of the process is to keep track of which fileservers are
603 up and which are down.  @i{Amd} does this by sending RPC requests to the
604 servers' NFS @code{NullProc} and checking whether a reply is returned.
605 While the server state is uncertain the requests are re-transmitted at
606 three second intervals and if no reply is received after four attempts
607 the server is marked down.  If a reply is received the fileserver is
608 marked up and stays in that state for 30 seconds at which time another
609 NFS ping is sent.
611 Once a fileserver is marked down, requests continue to be sent every 30
612 seconds in order to determine when the fileserver comes back up.  During
613 this time any reference through @i{Amd} to the filesystems on that
614 server fail with the error ``Operation would block''.  If a replacement
615 volume is available then it will be mounted, otherwise the error is
616 returned to the user.
618 @c @i{Amd} keeps track of which servers are up and which are down.
619 @c It does this by sending RPC requests to the servers' NFS {\sc NullProc} and
620 @c checking whether a reply is returned.  If no replies are received after a
621 @c short period, @i{Amd} marks the fileserver @dfn{down}.
622 @c RPC requests continue to be sent so that it will notice when a fileserver
623 @c comes back up.
624 @c ICMP echo packets \cite{rfc:icmp} are not used because it is the availability
625 @c of the NFS service that is important, not the existence of a base kernel.
626 @c Whenever a reference to a fileserver which is down is made via @i{Amd}, an alternate
627 @c filesystem is mounted if one is available.
629 Although this action does not protect user files, which are unique on
630 the network, or processes which do not access files via @i{Amd} or
631 already have open files on the hung filesystem, it can prevent most new
632 processes from hanging.
634 By default, fileserver state is not maintained for NFS/TCP mounts.  The
635 remote fileserver is always assumed to be up.
637 @c With a suitable combination of filesystem management and mount-maps,
638 @c machines can be protected against most server downtime.  This can be
639 @c enhanced by allocating boot-servers dynamically which allows a diskless
640 @c workstation to be quickly restarted if necessary.  Once the root filesystem
641 @c is mounted, @i{Amd} can be started and allowed to mount the remainder of
642 @c the filesystem from whichever fileservers are available.
644 @node Non-blocking Operation, , Keep-alives, Overview
645 @comment  node-name,  next,  previous,  up
646 @section Non-blocking Operation
647 @cindex Non-blocking operation
648 @cindex Multiple-threaded server
649 @cindex RPC retries
651 Since there is only one instance of @i{Amd} for each automount point,
652 and usually only one instance on each machine, it is important that it
653 is always available to service kernel calls.  @i{Amd} goes to great
654 lengths to ensure that it does not block in a system call.  As a last
655 resort @i{Amd} will fork before it attempts a system call that may block
656 indefinitely, such as mounting an NFS filesystem.  Other tasks such as
657 obtaining filehandle information for an NFS filesystem, are done using a
658 purpose built non-blocking RPC library which is integrated with
659 @i{Amd}'s task scheduler.  This library is also used to implement NFS
660 keep-alives (@pxref{Keep-alives}).
662 Whenever a mount is deferred or backgrounded, @i{Amd} must wait for it
663 to complete before replying to the kernel.  However, this would cause
664 @i{Amd} to block waiting for a reply to be constructed.  Rather than do
665 this, @i{Amd} simply @dfn{drops} the call under the assumption that the
666 kernel RPC mechanism will automatically retry the request.
668 @c ################################################################
669 @node Supported Platforms, Mount Maps, Overview, Top
670 @comment  node-name,  next,  previous,  up
671 @chapter Supported Platforms
672 @cindex Supported Platforms
673 @cindex shared libraries
674 @cindex NFS V.3 support
676 @i{Am-utils} has been ported to a wide variety of machines and operating
677 systems.  @i{Am-utils}'s code works for little-endian and big-endian
678 machines, as well as 32 bit and 64 bit architectures.  Furthermore, when
679 @i{Am-utils} ports to an Operating System on one architecture, it is generally
680 readily portable to the same Operating System on all platforms on which
681 it is available.
683 The table below lists those platforms supported by the latest release.
684 The listing is based on the standard output from GNU's
685 @code{config.guess} script.  Since significant changes have been made to
686 am-utils, not all systems listed here have been verified working for all
687 features.
689 @multitable {Auto-Configured System Name} {Config} {Compile} {Amd} {NFS3} {Shlib} {Hlfsd}
690 @c @multitable @columnfractions .5 .1 .1 .1 .1 .1
692 @item @b{Auto-Configured System Name}
693 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
694 @tab @b{Config} @tab @b{Compile} @tab @b{Amd} @tab @b{NFS3} @tab @b{Shlib} @tab @b{Hlfsd}
696 @item @b{alpha-dec-osf2.1}
697 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
698 @tab yes     @tab yes   @tab yes  @tab ?     @tab no   @tab ?
700 @item @b{alpha-dec-osf4.0}
701 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
702 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
704 @item @b{alphaev5-unknown-linux-gnu}
705 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
706 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
708 @item @b{alphaev5-unknown-linux-gnu-rh5.2}
709 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
710 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
712 @item @b{hppa1.0-hp-hpux11.00}
713 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
714 @tab yes     @tab yes   @tab yes  @tab no    @tab yes  @tab ?
716 @item @b{hppa1.1-hp-hpux10.10}
717 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
718 @tab yes     @tab yes   @tab yes  @tab n/a   @tab no   @tab ?
720 @item @b{hppa1.1-hp-hpux10.20}
721 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
722 @tab yes     @tab yes   @tab yes  @tab no    @tab no   @tab ?
724 @item @b{hppa1.1-hp-hpux9.01}
725 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
726 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
728 @item @b{hppa1.1-hp-hpux9.05}
729 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
730 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
732 @item @b{hppa1.1-hp-hpux9.07}
733 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
734 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
736 @item @b{hppa2.0w-hp-hpux11.00}
737 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
738 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
740 @item @b{i386-pc-bsdi2.1}
741 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
742 @tab yes     @tab yes   @tab yes  @tab n/a   @tab no   @tab ?
744 @item @b{i386-pc-bsdi3.0}
745 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
746 @tab yes     @tab yes   @tab yes  @tab yes   @tab no   @tab ?
748 @item @b{i386-pc-bsdi3.1}
749 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
750 @tab yes     @tab yes   @tab yes  @tab yes   @tab no   @tab ?
752 @item @b{i386-pc-bsdi4.0}
753 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
754 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
756 @item @b{i386-pc-bsdi4.0.1}
757 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
758 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
760 @item @b{i386-pc-solaris2.5.1}
761 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
762 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab yes
764 @item @b{i386-pc-solaris2.6}
765 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
766 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab yes
768 @item @b{i386-pc-solaris2.7}
769 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
770 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab yes
772 @item @b{i386-unknown-freebsd2.1.0}
773 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
774 @tab yes     @tab yes   @tab yes  @tab n/a   @tab ?    @tab ?
776 @item @b{i386-unknown-freebsd2.2.1}
777 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
778 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
780 @item @b{i386-unknown-freebsd2.2.6}
781 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
782 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
784 @item @b{i386-unknown-freebsd2.2.7}
785 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
786 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
788 @item @b{i386-unknown-freebsd2.2.8}
789 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
790 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
792 @item @b{i386-unknown-freebsd3.0}
793 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
794 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
796 @item @b{i386-unknown-freebsdelf3.0}
797 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
798 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
800 @item @b{i386-unknown-freebsdelf3.1}
801 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
802 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
804 @item @b{i386-unknown-freebsdelf3.2}
805 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
806 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
808 @item @b{i386-unknown-freebsdelf3.3}
809 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
810 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
812 @item @b{i386-unknown-freebsdelf4.0}
813 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
814 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
816 @item @b{i386-unknown-netbsd1.2.1}
817 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
818 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
820 @item @b{i386-unknown-netbsd1.3}
821 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
822 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
824 @item @b{i386-unknown-netbsd1.3.1}
825 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
826 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
828 @item @b{i386-unknown-netbsd1.3.2}
829 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
830 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
832 @item @b{i386-unknown-netbsd1.3.3}
833 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
834 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
836 @item @b{i386-unknown-netbsd1.4}
837 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
838 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
840 @item @b{i386-unknown-openbsd2.1}
841 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
842 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
844 @item @b{i386-unknown-openbsd2.2}
845 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
846 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
848 @item @b{i386-unknown-openbsd2.3}
849 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
850 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
852 @item @b{i386-unknown-openbsd2.4}
853 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
854 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
856 @item @b{i386-unknown-openbsd2.5}
857 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
858 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
860 @item @b{i486-ncr-sysv4.3.03}
861 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
862 @tab yes     @tab yes   @tab ?    @tab yes   @tab yes  @tab ?
864 @item @b{i486-pc-linux-gnu-rh6.0}
865 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
866 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
868 @item @b{i486-pc-linux-gnulibc1}
869 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
870 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
872 @item @b{i486-pc-linux-gnulibc1-rh4.2}
873 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
874 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
876 @item @b{i486-pc-linux-gnuoldld}
877 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
878 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
880 @item @b{i586-pc-linux-gnu}
881 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
882 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
884 @item @b{i586-pc-linux-gnu-rh5.2}
885 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
886 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
888 @item @b{i586-pc-linux-gnu-rh6.0}
889 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
890 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
892 @item @b{i586-pc-linux-gnu-rh6.1}
893 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
894 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
896 @item @b{i586-pc-linux-gnulibc1}
897 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
898 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
900 @item @b{i586-pc-linux-gnulibc1-rh4.2}
901 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
902 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
905 @item @b{i686-pc-linux-gnu}
906 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
907 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
909 @item @b{i686-pc-linux-gnu-rh5.2}
910 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
911 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
913 @item @b{i686-pc-linux-gnu-rh6.0}
914 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
915 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
917 @item @b{i686-pc-linux-gnulibc}
918 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
919 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
921 @item @b{i686-pc-linux-gnulibc1}
922 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
923 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
925 @item @b{m68k-hp-hpux9.00}
926 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
927 @tab yes     @tab yes   @tab yes  @tab n/a   @tab ?    @tab ?
929 @item @b{m68k-sun-sunos4.1.1}
930 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
931 @tab yes     @tab yes   @tab yes  @tab n/a   @tab no   @tab ?
933 @item @b{m68k-next-nextstep3}
934 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
935 @tab yes     @tab yes   @tab yes  @tab n/a   @tab no   @tab ?
937 @item @b{mips-dec-ultrix4.3}
938 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
939 @tab yes     @tab yes   @tab yes  @tab n/a   @tab ?    @tab ?
941 @item @b{mips-sgi-irix5.2}
942 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
943 @tab ?       @tab ?     @tab ?    @tab ?     @tab ?    @tab ?
945 @item @b{mips-sgi-irix5.3}
946 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
947 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
949 @item @b{mips-sgi-irix6.2}
950 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
951 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
953 @item @b{mips-sgi-irix6.4}
954 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
955 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
957 @item @b{mips-sgi-irix6.5}
958 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
959 @tab yes     @tab yes   @tab ?    @tab yes   @tab yes  @tab ?
961 @item @b{powerpc-ibm-aix4.1.5.0}
962 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
963 @tab yes     @tab yes   @tab yes  @tab n/a   @tab no/broken @tab ?
965 @item @b{powerpc-ibm-aix4.2.1.0}
966 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
967 @tab yes     @tab yes   @tab yes  @tab yes   @tab no/broken @tab ?
969 @item @b{powerpc-ibm-aix4.3.1.0}
970 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
971 @tab yes     @tab yes   @tab ?    @tab yes   @tab ?    @tab ?
973 @item @b{powerpc-unknown-linux-gnu}
974 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
975 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
977 @item @b{rs6000-ibm-aix3.2}
978 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
979 @tab yes     @tab yes   @tab yes  @tab n/a   @tab ?    @tab ?
981 @item @b{rs6000-ibm-aix3.2.5}
982 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
983 @tab yes     @tab yes   @tab yes  @tab n/a   @tab ?    @tab ?
985 @item @b{rs6000-ibm-aix4.1.4.0}
986 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
987 @tab yes     @tab yes   @tab yes  @tab n/a   @tab no/broken @tab ?
989 @item @b{rs6000-ibm-aix4.1.5.0}
990 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
991 @tab yes     @tab yes   @tab yes  @tab n/a   @tab no/broken @tab ?
993 @item @b{sparc-sun-solaris2.3}
994 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
995 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
997 @item @b{sparc-sun-solaris2.4}
998 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
999 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
1001 @item @b{sparc-sun-solaris2.5}
1002 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
1003 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab ?
1005 @item @b{sparc-sun-solaris2.5.1}
1006 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
1007 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab yes
1009 @item @b{sparc-sun-solaris2.6}
1010 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
1011 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab yes
1013 @item @b{sparc-sun-solaris2.7}
1014 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
1015 @tab yes     @tab yes   @tab yes  @tab yes   @tab yes  @tab yes
1017 @item @b{sparc-sun-sunos4.1.1}
1018 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
1019 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
1021 @item @b{sparc-sun-sunos4.1.3}
1022 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
1023 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
1025 @item @b{sparc-sun-sunos4.1.3C}
1026 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
1027 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
1029 @item @b{sparc-sun-sunos4.1.3_U1}
1030 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
1031 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
1033 @item @b{sparc-sun-sunos4.1.4}
1034 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
1035 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
1037 @item @b{sparc-unknown-linux-gnulibc1}
1038 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
1039 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
1041 @item @b{sparc-unknown-netbsd1.2E}
1042 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
1043 @tab yes     @tab yes   @tab yes  @tab ?     @tab ?    @tab ?
1045 @item @b{sparc-unknown-netbsd1.2G}
1046 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
1047 @tab yes     @tab yes   @tab yes  @tab ?     @tab ?    @tab ?
1049 @item @b{sparc64-unknown-linux-gnu}
1050 @c {Config}  {Compile}  {Amd}     {NFS V.3}  {Shlib}   {Hlfsd}
1051 @tab yes     @tab yes   @tab yes  @tab n/a   @tab yes  @tab ?
1053 @end multitable
1055 See the @file{INSTALL} in the distribution for more specific details on
1056 building and/or configuring for some systems.
1058 @c ################################################################
1059 @node Mount Maps, Amd Command Line Options, Supported Platforms, Top
1060 @comment  node-name,  next,  previous,  up
1061 @chapter Mount Maps
1062 @cindex Mount maps
1063 @cindex Automounter configuration maps
1064 @cindex Mount information
1066 @i{Amd} has no built-in knowledge of machines or filesystems.
1067 External @dfn{mount-maps} are used to provide the required information.
1068 Specifically, @i{Amd} needs to know when and under what conditions it
1069 should mount filesystems.
1071 The map entry corresponding to the requested name contains a list of
1072 possible locations from which to resolve the request.  Each location
1073 specifies filesystem type, information required by that filesystem (for
1074 example the block special device in the case of UFS), and some
1075 information describing where to mount the filesystem (@pxref{fs Option}).  A
1076 location may also contain @dfn{selectors} (@pxref{Selectors}).@refill
1078 @menu
1079 * Map Types::
1080 * Key Lookup::
1081 * Location Format::
1082 @end menu
1084 @node Map Types, Key Lookup, Mount Maps, Mount Maps
1085 @comment  node-name,  next,  previous,  up
1086 @section Map Types
1087 @cindex Mount map types
1088 @cindex Map types
1089 @cindex Configuration map types
1090 @cindex Types of mount map
1091 @cindex Types of configuration map
1092 @cindex Determining the map type
1094 A mount-map provides the run-time configuration information to @i{Amd}.
1095 Maps can be implemented in many ways.  Some of the forms supported by
1096 @i{Amd} are regular files, ndbm databases, NIS maps, the @dfn{Hesiod}
1097 name server, and even the password file.
1099 A mount-map @dfn{name} is a sequence of characters.  When an automount
1100 point is created a handle on the mount-map is obtained.  For each map
1101 type configured, @i{Amd} attempts to reference the map of the
1102 appropriate type.  If a map is found, @i{Amd} notes the type for future
1103 use and deletes the reference, for example closing any open file
1104 descriptors.  The available maps are configured when @i{Amd} is built
1105 and can be displayed by running the command @samp{amd -v}.
1107 When using an @i{Amd} configuration file (@pxref{Amd Configuration File})
1108 and the keyword @samp{map_type} (@pxref{map_type Parameter}), you may
1109 force the map used to any type.
1111 By default, @i{Amd} caches data in a mode dependent on the type of map.
1112 This is the same as specifying @samp{cache:=mapdefault} and selects a
1113 suitable default cache mode depending on the map type.  The individual
1114 defaults are described below.  The @var{cache} option can be specified
1115 on automount points to alter the caching behavior (@pxref{Automount
1116 Filesystem}).@refill
1118 The following map types have been implemented, though some are not
1119 available on all machines.  Run the command @samp{amd -v} to obtain a
1120 list of map types configured on your machine.
1122 @menu
1123 * File maps::
1124 * ndbm maps::
1125 * NIS maps::
1126 * NIS+ maps::
1127 * Hesiod maps::
1128 * Password maps::
1129 * Union maps::
1130 * LDAP maps::
1131 @end menu
1133 @node File maps, ndbm maps, Map Types, Map Types
1134 @comment  node-name,  next,  previous,  up
1135 @subsection File maps
1136 @cindex File maps
1137 @cindex Flat file maps
1138 @cindex File map syntactic conventions
1140 When @i{Amd} searches a file for a map entry it does a simple scan of
1141 the file and supports both comments and continuation lines.
1143 Continuation lines are indicated by a backslash character (@samp{\}) as
1144 the last character of a line in the file.  The backslash, newline character
1145 @emph{and any leading white space on the following line} are discarded.  A maximum
1146 line length of 2047 characters is enforced after continuation lines are read
1147 but before comments are stripped.  Each line must end with
1148 a newline character; that is newlines are terminators, not separators.
1149 The following examples illustrate this:
1151 @example
1152 key     valA   valB;   \
1153           valC
1154 @end example
1156 specifies @emph{three} locations, and is identical to
1158 @example
1159 key     valA   valB;   valC
1160 @end example
1162 However,
1164 @example
1165 key     valA   valB;\
1166           valC
1167 @end example
1169 specifies only @emph{two} locations, and is identical to
1171 @example
1172 key     valA   valB;valC
1173 @end example
1175 After a complete line has been read from the file, including
1176 continuations, @i{Amd} determines whether there is a comment on the
1177 line.  A comment begins with a hash (``@samp{#}'') character and
1178 continues to the end of the line.  There is no way to escape or change
1179 the comment lead-in character.
1181 Note that continuation lines and comment support @dfn{only} apply to
1182 file maps, or ndbm maps built with the @code{mk-amd-map} program.
1184 When caching is enabled, file maps have a default cache mode of
1185 @code{all} (@pxref{Automount Filesystem}).
1187 @node ndbm maps, NIS maps, File maps, Map Types
1188 @comment  node-name,  next,  previous,  up
1189 @subsection ndbm maps
1190 @cindex ndbm maps
1192 An ndbm map may be used as a fast access form of a file map.  The program,
1193 @code{mk-amd-map}, converts a normal map file into an ndbm database.
1194 This program supports the same continuation and comment conventions that
1195 are provided for file maps.  Note that ndbm format files may @emph{not}
1196 be sharable across machine architectures.  The notion of speed generally
1197 only applies to large maps; a small map, less than a single disk block,
1198 is almost certainly better implemented as a file map.
1200 ndbm maps have a default cache mode of @samp{all} (@pxref{Automount Filesystem}).
1202 @node NIS maps, NIS+ maps, ndbm maps, Map Types
1203 @comment  node-name,  next,  previous,  up
1204 @subsection NIS maps
1205 @cindex NIS (YP) maps
1207 When using NIS (formerly YP), an @i{Amd} map is implemented directly
1208 by the underlying NIS map.  Comments and continuation lines are
1209 @emph{not} supported in the automounter and must be stripped when
1210 constructing the NIS server's database.
1212 NIS maps have a default cache mode of @code{all} (@pxref{Automount
1213 Filesystem}).
1215 The following rule illustrates what could be added to your NIS @file{Makefile},
1216 in this case causing the @file{amd.home} map to be rebuilt:
1217 @example
1218 $(YPTSDIR)/amd.home.time: $(ETCDIR)/amd.home
1219     -@@sed -e "s/#.*$$//" -e "/^$$/d" $(ETCDIR)/amd.home | \
1220       awk '@{  \
1221          for (i = 1; i <= NF; i++) \
1222              if (i == NF) @{ \
1223              if (substr($$i, length($$i), 1) == "\\") \
1224                  printf("%s", substr($$i, 1, length($$i) - 1)); \
1225              else \
1226                  printf("%s\n", $$i); \
1227              @} \
1228              else \
1229              printf("%s ", $$i); \
1230          @}' | \
1231     $(MAKEDBM) - $(YPDBDIR)/amd.home; \
1232     touch $(YPTSDIR)/amd.home.time; \
1233     echo "updated amd.home"; \
1234     if [ ! $(NOPUSH) ]; then \
1235         $(YPPUSH) amd.home; \
1236         echo "pushed amd.home"; \
1237     else \
1238         : ; \
1239     fi
1240 @end example
1242 Here @code{$(YPTSDIR)} contains the time stamp files, and @code{$(YPDBDIR)} contains
1243 the dbm format NIS files.
1245 @node NIS+ maps, Hesiod maps, NIS maps, Map Types
1246 @comment  node-name,  next,  previous,  up
1247 @subsection NIS+ maps
1248 @cindex NIS+ maps
1250 NIS+ maps do not support cache mode @samp{all} and, when caching is
1251 enabled, have a default cache mode of @samp{inc}.
1253 XXX: FILL IN WITH AN EXAMPLE.
1255 @node Hesiod maps, Password maps, NIS+ maps, Map Types
1256 @comment  node-name,  next,  previous,  up
1257 @subsection Hesiod maps
1258 @cindex Hesiod maps
1260 When the map name begins with the string @samp{hesiod.} lookups are made
1261 using the @dfn{Hesiod} name server.  The string following the dot is
1262 used as a name qualifier and is prepended with the key being located.
1263 The entire string is then resolved in the @code{automount} context, or
1264 the @i{amd.conf} parameter @samp{hesiod_base} (@pxref{hesiod_base
1265 Parameter}).  For example, if the the key is @samp{jsp} and map name is
1266 @samp{hesiod.homes} then @dfn{Hesiod} is asked to resolve
1267 @samp{jsp.homes.automount}.
1269 Hesiod maps do not support cache mode @samp{all} and, when caching is
1270 enabled, have a default cache mode of @samp{inc} (@pxref{Automount
1271 Filesystem}).
1273 The following is an example of a @dfn{Hesiod} map entry:
1275 @example
1276 jsp.homes.automount HS TXT "rfs:=/home/charm;rhost:=charm;sublink:=jsp"
1277 njw.homes.automount HS TXT "rfs:=/home/dylan/dk2;rhost:=dylan;sublink:=njw"
1278 @end example
1280 @node Password maps, Union maps, Hesiod maps, Map Types
1281 @comment  node-name,  next,  previous,  up
1282 @subsection Password maps
1283 @cindex Password file maps
1284 @cindex /etc/passwd maps
1285 @cindex User maps, automatic generation
1286 @cindex Automatic generation of user maps
1287 @cindex Using the password file as a map
1289 The password map support is unlike the four previous map types.  When
1290 the map name is the string @file{/etc/passwd} @i{Amd} can lookup a user
1291 name in the password file and re-arrange the home directory field to
1292 produce a usable map entry.
1294 @i{Amd} assumes the home directory has the format
1295 `@t{/}@i{anydir}@t{/}@i{dom1}@t{/../}@i{domN}@t{/}@i{login}'.
1296 @c @footnote{This interpretation is not necessarily exactly what you want.}
1297 It breaks this string into a map entry where @code{$@{rfs@}} has the
1298 value `@t{/}@i{anydir}@t{/}@i{domN}', @code{$@{rhost@}} has the value
1299 `@i{domN}@t{.}@i{...}@t{.}@i{dom1}', and @code{$@{sublink@}} has the
1300 value @i{login}.@refill
1302 Thus if the password file entry was
1304 @example
1305 /home/achilles/jsp
1306 @end example
1308 the map entry used by @i{Amd} would be
1310 @example
1311 rfs:=/home/achilles;rhost:=achilles;sublink:=jsp
1312 @end example
1314 Similarly, if the password file entry was
1316 @example
1317 /home/cc/sugar/mjh
1318 @end example
1320 the map entry used by @i{Amd} would be 
1322 @example
1323 rfs:=/home/sugar;rhost:=sugar.cc;sublink:=jsp
1324 @end example
1326 @node Union maps, LDAP maps , Password maps, Map Types
1327 @comment  node-name,  next,  previous,  up
1328 @subsection Union maps
1329 @cindex Union file maps
1331 The union map support is provided specifically for use with the union
1332 filesystem, @pxref{Union Filesystem}.
1334 It is identified by the string @samp{union:} which is followed by a
1335 colon separated list of directories.  The directories are read in order,
1336 and the names of all entries are recorded in the map cache.  Later
1337 directories take precedence over earlier ones.  The union filesystem
1338 type then uses the map cache to determine the union of the names in all
1339 the directories.
1341 @node LDAP maps, , Union maps, Map Types
1342 @comment  node-name,  next,  previous,  up
1343 @subsection LDAP maps
1344 @cindex LDAP maps
1345 @cindex Lightweight Directory Access Protocol
1347 LDAP (Lightweight Directory Access Protocol) maps do not support cache
1348 mode @samp{all} and, when caching is enabled, have a default cache mode
1349 of @samp{inc}.
1351 For example, an @i{Amd} map @samp{amd.home} that looks as follows:
1353 @example
1354 /defaults    opts:=rw,intr;type:=link
1356 zing         -rhost:=shekel \
1357              host==shekel \
1358              host!=shekel;type:=nfs
1359 @end example
1360 @noindent
1361 when converted to LDAP (@pxref{amd2ldif}), will result in the following
1362 LDAP database:
1363 @example
1364 $ amd2ldif amd.home CUCS < amd.home
1365 dn: cn=amdmap timestamp, CUCS
1366 cn             : amdmap timestamp
1367 objectClass    : amdmapTimestamp
1368 amdmapTimestamp: 873071363
1370 dn: cn=amdmap amd.home[/defaults], CUCS
1371 cn          : amdmap amd.home[/defaults]
1372 objectClass : amdmap
1373 amdmapName  : amd.home
1374 amdmapKey   : /defaults
1375 amdmapValue : opts:=rw,intr;type:=link
1377 dn: cn=amdmap amd.home[], CUCS
1378 cn          : amdmap amd.home[]
1379 objectClass : amdmap
1380 amdmapName  : amd.home
1381 amdmapKey   : 
1382 amdmapValue : 
1384 dn: cn=amdmap amd.home[zing], CUCS
1385 cn          : amdmap amd.home[zing]
1386 objectClass : amdmap
1387 amdmapName  : amd.home
1388 amdmapKey   : zing
1389 amdmapValue : -rhost:=shekel host==shekel host!=shekel;type:=nfs
1390 @end example
1392 @c subsection Gdbm
1394 @node Key Lookup, Location Format, Map Types, Mount Maps
1395 @comment  node-name,  next,  previous,  up
1396 @section How keys are looked up
1397 @cindex Key lookup
1398 @cindex Map lookup
1399 @cindex Looking up keys
1400 @cindex How keys are looked up
1401 @cindex Wildcards in maps
1403 The key is located in the map whose type was determined when the
1404 automount point was first created.  In general the key is a pathname
1405 component.  In some circumstances this may be modified by variable
1406 expansion (@pxref{Variable Expansion}) and prefixing.  If the automount
1407 point has a prefix, specified by the @var{pref} option, then that is
1408 prepended to the search key before the map is searched.
1410 If the map cache is a @samp{regexp} cache then the key is treated as an
1411 egrep-style regular expression, otherwise a normal string comparison is
1412 made.
1414 If the key cannot be found then a @dfn{wildcard} match is attempted.
1415 @i{Amd} repeatedly strips the basename from the key, appends @samp{/*} and
1416 attempts a lookup.  Finally, @i{Amd} attempts to locate the special key @samp{*}.
1418 For example, the following sequence would be checked if @file{home/dylan/dk2} was
1419 being located:
1421 @example
1422    home/dylan/dk2
1423    home/dylan/*
1424    home/*
1425    *
1426 @end example
1428 At any point when a wildcard is found, @i{Amd} proceeds as if an exact
1429 match had been found and the value field is then used to resolve the
1430 mount request, otherwise an error code is propagated back to the kernel.
1431 (@pxref{Filesystem Types}).@refill
1433 @node Location Format, , Key Lookup, Mount Maps
1434 @comment  node-name,  next,  previous,  up
1435 @section Location Format
1436 @cindex Location format
1437 @cindex Map entry format
1438 @cindex How locations are parsed
1440 The value field from the lookup provides the information required to
1441 mount a filesystem.  The information is parsed according to the syntax
1442 shown below.
1444 @display
1445 @i{location-list}:
1446                   @i{location-selection}
1447                   @i{location-list} @i{white-space} @t{||} @i{white-space} @i{location-selection}
1448 @i{location-selection}:
1449                   @i{location}
1450                   @i{location-selection} @i{white-space} @i{location}
1451 @i{location}:
1452                   @i{location-info}
1453                   @t{-}@i{location-info}
1454                   @t{-}
1455 @i{location-info}:
1456                   @i{sel-or-opt}
1457                   @i{location-info}@t{;}@i{sel-or-opt}
1458                   @t{;}
1459 @i{sel-or-opt}:
1460                   @i{selection}
1461                   @i{opt-ass}
1462 @i{selection}:
1463                   selector@t{==}@i{value}
1464                   selector@t{!=}@i{value}
1465 @i{opt-ass}:
1466                   option@t{:=}@i{value}
1467 @i{white-space}:
1468                   space
1469                   tab
1470 @end display
1472 Note that unquoted whitespace is not allowed in a location description.
1473 White space is only allowed, and is mandatory, where shown with non-terminal
1474 @i{white-space}.
1476 A @dfn{location-selection} is a list of possible volumes with which to
1477 satisfy the request.  @dfn{location-selection}s are separated by the
1478 @samp{||} operator.  The effect of this operator is to prevent use of
1479 location-selections to its right if any of the location-selections on
1480 its left were selected whether or not any of them were successfully
1481 mounted (@pxref{Selectors}).@refill
1483 The location-selection, and singleton @dfn{location-list},
1484 @samp{type:=ufs;dev:=/dev/xd1g} would inform @i{Amd} to mount a UFS
1485 filesystem from the block special device @file{/dev/xd1g}.
1487 The @dfn{sel-or-opt} component is either the name of an option required
1488 by a specific filesystem, or it is the name of a built-in, predefined
1489 selector such as the architecture type.  The value may be quoted with
1490 double quotes @samp{"}, for example
1491 @samp{type:="ufs";dev:="/dev/xd1g"}.  These quotes are stripped when the
1492 value is parsed and there is no way to get a double quote into a value
1493 field.  Double quotes are used to get white space into a value field,
1494 which is needed for the program filesystem (@pxref{Program Filesystem}).@refill
1496 @menu
1497 * Map Defaults::
1498 * Variable Expansion::
1499 * Selectors::
1500 * Map Options::
1501 @end menu
1503 @node Map Defaults, Variable Expansion, Location Format, Location Format
1504 @comment  node-name,  next,  previous,  up
1505 @subsection Map Defaults
1506 @cindex Map defaults
1507 @cindex How to set default map parameters
1508 @cindex Setting default map parameters
1510 A location beginning with a dash @samp{-} is used to specify default
1511 values for subsequent locations.  Any previously specified defaults in
1512 the location-list are discarded.  The default string can be empty in
1513 which case no defaults apply.
1515 The location @samp{-fs:=/mnt;opts:=ro} would set the local mount point
1516 to @file{/mnt} and cause mounts to be read-only by default.  Defaults
1517 specified this way are appended to, and so override, any global map
1518 defaults given with @samp{/defaults}).
1521 @c A @samp{/defaults} value @dfn{gdef} and a location list
1522 @c \begin{quote}
1523 @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$
1524 @c \end{quote}
1525 @c is equivalent to
1526 @c \begin{quote}
1527 @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$
1528 @c \end{quote}
1529 @c which is equivalent to
1530 @c \begin{quote}
1531 @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$
1532 @c \end{quote}
1534 @node Variable Expansion, Selectors, Map Defaults, Location Format
1535 @comment  node-name,  next,  previous,  up
1536 @subsection Variable Expansion
1537 @cindex Variable expansion
1538 @cindex How variables are expanded
1539 @cindex Pathname operators
1540 @cindex Domain stripping
1541 @cindex Domainname operators
1542 @cindex Stripping the local domain name
1543 @cindex Environment variables
1544 @cindex How to access environment variables in maps
1546 To allow generic location specifications @i{Amd} does variable expansion
1547 on each location and also on some of the option strings.  Any option or
1548 selector appearing in the form @code{$@dfn{var}} is replaced by the
1549 current value of that option or selector.  For example, if the value of
1550 @code{$@{key@}} was @samp{bin}, @code{$@{autodir@}} was @samp{/a} and
1551 @code{$@{fs@}} was `@t{$@{autodir@}}@t{/local/}@t{$@{key@}}' then
1552 after expansion @code{$@{fs@}} would have the value @samp{/a/local/bin}.
1553 Any environment variable can be accessed in a similar way.@refill
1555 Two pathname operators are available when expanding a variable.  If the
1556 variable name begins with @samp{/} then only the last component of the
1557 pathname is substituted.  For example, if @code{$@{path@}} was
1558 @samp{/foo/bar} then @code{$@{/path@}} would be expanded to @samp{bar}.
1559 Similarly, if the variable name ends with @samp{/} then all but the last
1560 component of the pathname is substituted.  In the previous example,
1561 @code{$@{path/@}} would be expanded to @samp{/foo}.@refill
1563 Two domain name operators are also provided.  If the variable name
1564 begins with @samp{.} then only the domain part of the name is
1565 substituted.  For example, if @code{$@{rhost@}} was
1566 @samp{swan.doc.ic.ac.uk} then @code{$@{.rhost@}} would be expanded to
1567 @samp{doc.ic.ac.uk}.  Similarly, if the variable name ends with @samp{.}
1568 then only the host component is substituted.  In the previous example,
1569 @code{$@{rhost.@}} would be expanded to @samp{swan}.@refill
1571 Variable expansion is a two phase process.  Before a location is parsed,
1572 all references to selectors, @i{eg} @code{$@{path@}}, are expanded.  The
1573 location is then parsed, selections are evaluated and option assignments
1574 recorded.  If there were no selections or they all succeeded the
1575 location is used and the values of the following options are expanded in
1576 the order given: @var{sublink}, @var{rfs}, @var{fs}, @var{opts},
1577 @var{remopts}, @var{mount} and @var{unmount}.
1579 Note that expansion of option values is done after @dfn{all} assignments
1580 have been completed and not in a purely left to right order as is done
1581 by the shell.  This generally has the desired effect but care must be
1582 taken if one of the options references another, in which case the
1583 ordering can become significant.
1585 There are two special cases concerning variable expansion:
1587 @enumerate
1588 @item
1589 before a map is consulted, any selectors in the name received
1590 from the kernel are expanded.  For example, if the request from the
1591 kernel was for `@t{$@{arch@}}@t{.bin}' and the machine architecture
1592 was @samp{vax}, the value given to @code{$@{key@}} would be
1593 @samp{vax.bin}.@refill
1595 @item
1596 the value of @code{$@{rhost@}} is expanded and normalized before the
1597 other options are expanded.  The normalization process strips any local
1598 sub-domain components.  For example, if @code{$@{domain@}} was
1599 @samp{Berkeley.EDU} and @code{$@{rhost@}} was initially
1600 @samp{snow.Berkeley.EDU}, after the normalization it would simply be
1601 @samp{snow}.  Hostname normalization is currently done in a
1602 @emph{case-dependent} manner.@refill
1603 @end enumerate
1605 @c======================================================================
1606 @node Selectors, Map Options, Variable Expansion, Location Format
1607 @comment  node-name,  next,  previous,  up
1608 @subsection Selectors
1609 @cindex Selectors
1611 Selectors are used to control the use of a location.  It is possible to
1612 share a mount map between many machines in such a way that filesystem
1613 location, architecture and operating system differences are hidden from
1614 the users.  A selector of the form @samp{arch==sun3;os==sunos4} would only
1615 apply on Sun-3s running SunOS 4.x.
1617 Selectors can be negated by using @samp{!=} instead of @samp{==}.  For
1618 example to select a location on all non-Vax machines the selector
1619 @samp{arch!=vax} would be used.
1621 Selectors are evaluated left to right.  If a selector fails then that
1622 location is ignored.  Thus the selectors form a conjunction and the
1623 locations form a disjunction.  If all the locations are ignored or
1624 otherwise fail then @i{Amd} uses the @dfn{error} filesystem
1625 (@pxref{Error Filesystem}).  This is equivalent to having a location
1626 @samp{type:=error} at the end of each mount-map entry.@refill
1628 The default value of many of the selectors listed here can be overridden
1629 by an @i{Amd} command line switch or in an @i{Amd} configuration file.
1630 @xref{Amd Configuration File}.
1632 These are the selectors currently implemented.
1634 @menu
1635 * arch Selector Variable::
1636 * autodir Selector Variable::
1637 * byte Selector Variable::
1638 * cluster Selector Variable::
1639 * domain Selector Variable::
1640 * host Selector Variable::
1641 * hostd Selector Variable::
1642 * karch Selector Variable::
1643 * os Selector Variable::
1644 * osver Selector Variable::
1645 * full_os Selector Variable::
1646 * vendor Selector Variable::
1648 * key Selector Variable::
1649 * map Selector Variable::
1650 * netnumber Selector Variable::
1651 * network Selector Variable::
1652 * path Selector Variable::
1653 * wire Selector Variable::
1655 * exists Selector Function::
1656 * false Selector Function::
1657 * netgrp Selector Function::
1658 * netgrpd Selector Function::
1659 * in_network Selector Function::
1660 * true Selector Function::
1661 @end menu
1663 @c ----------------------------------------------------------------
1664 @node arch Selector Variable, autodir Selector Variable, Selectors, Selectors
1665 @comment  node-name,  next,  previous,  up
1666 @subsubsection arch Selector Variable
1667 @cindex arch Selector Variable
1668 @cindex arch, mount selector
1669 @cindex Mount selector; arch
1670 @cindex Selector; arch
1672 The machine architecture which was automatically determined at compile
1673 time.  The architecture type can be displayed by running the command
1674 @samp{amd -v}.  @xref{Supported Platforms}.@refill
1676 @c ----------------------------------------------------------------
1677 @node autodir Selector Variable, byte Selector Variable, arch Selector Variable, Selectors
1678 @comment  node-name,  next,  previous,  up
1679 @subsubsection autodir Selector Variable
1680 @cindex autodir Selector Variable
1681 @cindex autodir, mount selector
1682 @cindex Mount selector; autodir
1683 @cindex Selector; autodir
1685 The default directory under which to mount filesystems.  This may be
1686 changed by the @code{-a} command line option.  @xref{fs Option}.
1688 @c ----------------------------------------------------------------
1689 @node byte Selector Variable, cluster Selector Variable, autodir Selector Variable, Selectors
1690 @comment  node-name,  next,  previous,  up
1691 @subsubsection byte Selector Variable
1692 @cindex byte Selector Variable
1693 @cindex byte, mount selector
1694 @cindex Mount selector; byte
1695 @cindex Selector; byte
1697 The machine's byte ordering.  This is either @samp{little}, indicating
1698 little-endian, or @samp{big}, indicating big-endian.  One possible use
1699 is to share @samp{rwho} databases (@pxref{rwho servers}).  Another is to
1700 share ndbm databases, however this use can be considered a courageous
1701 juggling act.
1703 @c ----------------------------------------------------------------
1704 @node cluster Selector Variable, domain Selector Variable, byte Selector Variable, Selectors
1705 @comment  node-name,  next,  previous,  up
1706 @subsubsection cluster Selector Variable
1707 @cindex cluster Selector Variable
1708 @cindex cluster, mount selector
1709 @cindex Mount selector; cluster
1710 @cindex Selector; cluster
1712 This is provided as a hook for the name of the local cluster.  This can
1713 be used to decide which servers to use for copies of replicated
1714 filesystems.  @code{$@{cluster@}} defaults to the value of
1715 @code{$@{domain@}} unless a different value is set with the @code{-C}
1716 command line option.
1718 @c ----------------------------------------------------------------
1719 @node domain Selector Variable, host Selector Variable, cluster Selector Variable, Selectors
1720 @comment  node-name,  next,  previous,  up
1721 @subsubsection domain Selector Variable
1722 @cindex domain Selector Variable
1723 @cindex domain, mount selector
1724 @cindex Mount selector; domain
1725 @cindex Selector; domain
1727 The local domain name as specified by the @code{-d} command line option.
1728 @xref{host Selector Variable}.
1730 @c ----------------------------------------------------------------
1731 @node host Selector Variable, hostd Selector Variable, domain Selector Variable, Selectors
1732 @comment  node-name,  next,  previous,  up
1733 @subsubsection host Selector Variable
1734 @cindex host Selector Variable
1735 @cindex host, mount selector
1736 @cindex Mount selector; host
1737 @cindex Selector; host
1739 The local hostname as determined by @b{gethostname}(2).  If no domain
1740 name was specified on the command line and the hostname contains a
1741 period @samp{.} then the string before the period is used as the host
1742 name, and the string after the period is assigned to @code{$@{domain@}}.
1743 For example, if the hostname is @samp{styx.doc.ic.ac.uk} then
1744 @code{host} would be @samp{styx} and @code{domain} would be
1745 @samp{doc.ic.ac.uk}.  @code{hostd} would be
1746 @samp{styx.doc.ic.ac.uk}.@refill
1748 @c ----------------------------------------------------------------
1749 @node hostd Selector Variable, karch Selector Variable, host Selector Variable, Selectors
1750 @comment  node-name,  next,  previous,  up
1751 @subsubsection hostd Selector Variable
1752 @cindex hostd Selector Variable
1753 @cindex hostd, mount selector
1754 @cindex Mount selector; hostd
1755 @cindex Selector; hostd
1757 This resolves to the @code{$@{host@}} and @code{$@{domain@}}
1758 concatenated with a @samp{.} inserted between them if required.  If
1759 @code{$@{domain@}} is an empty string then @code{$@{host@}} and
1760 @code{$@{hostd@}} will be identical.
1762 @c ----------------------------------------------------------------
1763 @node karch Selector Variable, os Selector Variable, hostd Selector Variable, Selectors
1764 @comment  node-name,  next,  previous,  up
1765 @subsubsection karch Selector Variable
1766 @cindex karch Selector Variable
1767 @cindex karch, mount selector
1768 @cindex Mount selector; karch
1769 @cindex Selector; karch
1771 This is provided as a hook for the kernel architecture.  This is used on
1772 SunOS 4 and SunOS 5, for example, to distinguish between different
1773 @samp{/usr/kvm} volumes.  @code{$@{karch@}} defaults to the ``machine''
1774 value gotten from @b{uname}(2).  If the @b{uname}(2) system call is not
1775 available, the value of @code{$@{karch@}} defaults to that of
1776 @code{$@{arch@}}.  Finally, a different value can be set with the @code{-k}
1777 command line option.
1779 @c ----------------------------------------------------------------
1780 @node os Selector Variable, osver Selector Variable, karch Selector Variable, Selectors
1781 @comment  node-name,  next,  previous,  up
1782 @subsubsection os Selector Variable
1783 @cindex os Selector Variable
1784 @cindex os, mount selector
1785 @cindex Mount selector; os
1786 @cindex Selector; os
1788 The operating system.  Like the machine architecture, this is
1789 automatically determined at compile time.  The operating system name can
1790 be displayed by running the command @samp{amd -v}.  @xref{Supported
1791 Platforms}.@refill
1793 @c ----------------------------------------------------------------
1794 @node osver Selector Variable, full_os Selector Variable, os Selector Variable, Selectors
1795 @comment  node-name,  next,  previous,  up
1796 @subsubsection osver Selector Variable
1797 @cindex osver Selector Variable
1798 @cindex osver, mount selector
1799 @cindex Mount selector; osver
1800 @cindex Selector; osver
1802 The operating system version.  Like the machine architecture, this is
1803 automatically determined at compile time.  The operating system name can
1804 be displayed by running the command @samp{amd -v}.  @xref{Supported
1805 Platforms}.@refill
1807 @c ----------------------------------------------------------------
1808 @node full_os Selector Variable, vendor Selector Variable, osver Selector Variable, Selectors
1809 @comment  node-name,  next,  previous,  up
1810 @subsubsection full_os Selector Variable
1811 @cindex full_os Selector Variable
1812 @cindex full_os, mount selector
1813 @cindex Mount selector; full_os
1814 @cindex Selector; full_os
1816 The full name of the operating system, including its version.  This
1817 value is automatically determined at compile time.  The full operating
1818 system name and version can be displayed by running the command
1819 @samp{amd -v}.  @xref{Supported Platforms}.@refill
1821 @c ----------------------------------------------------------------
1822 @node vendor Selector Variable, key Selector Variable, full_os Selector Variable, Selectors
1823 @comment  node-name,  next,  previous,  up
1824 @subsubsection vendor Selector Variable
1825 @cindex vendor Selector Variable
1826 @cindex vendor, mount selector
1827 @cindex Mount selector; vendor
1828 @cindex Selector; vendor
1830 The name of the vendor of the operating system.  This value is
1831 automatically determined at compile time.  The name of the vendor can be
1832 displayed by running the command @samp{amd -v}.  @xref{Supported
1833 Platforms}.@refill
1835 @c ----------------------------------------------------------------
1836 @ifhtml
1837 <HR>
1838 @end ifhtml
1839 @sp 3
1840 The following selectors are also provided.  Unlike the other selectors,
1841 they vary for each lookup.  Note that when the name from the kernel is
1842 expanded prior to a map lookup, these selectors are all defined as empty
1843 strings.
1845 @c ----------------------------------------------------------------
1846 @node key Selector Variable, map Selector Variable, vendor Selector Variable, Selectors
1847 @comment  node-name,  next,  previous,  up
1848 @subsubsection key Selector Variable
1849 @cindex key Selector Variable
1850 @cindex key, mount selector
1851 @cindex Mount selector; key
1852 @cindex Selector; key
1854 The name being resolved.  For example, if @file{/home} is an automount
1855 point, then accessing @file{/home/foo} would set @code{$@{key@}} to the
1856 string @samp{foo}.  The key is prefixed by the @var{pref} option set in
1857 the parent mount point.  The default prefix is an empty string.  If the
1858 prefix was @file{blah/} then @code{$@{key@}} would be set to
1859 @file{blah/foo}.@refill
1861 @c ----------------------------------------------------------------
1862 @node map Selector Variable, netnumber Selector Variable, key Selector Variable, Selectors
1863 @comment  node-name,  next,  previous,  up
1864 @subsubsection map Selector Variable
1865 @cindex map Selector Variable
1866 @cindex map, mount selector
1867 @cindex Mount selector; map
1868 @cindex Selector; map
1870 The name of the mount map being used.
1872 @c ----------------------------------------------------------------
1873 @node netnumber Selector Variable, network Selector Variable, map Selector Variable, Selectors
1874 @comment  node-name,  next,  previous,  up
1875 @subsubsection netnumber Selector Variable
1876 @cindex netnumber Selector Variable
1877 @cindex netnumber, mount selector
1878 @cindex Mount selector; netnumber
1879 @cindex Selector; netnumber
1881 This selector is identical to the @samp{in_network} selector function,
1882 see @ref{in_network Selector Function}.  It will match either the name
1883 or number of @i{any} network interface on which this host is connected
1884 to.  The names and numbers of all attached interfaces are available from
1885 the output of @samp{amd -v}.
1887 @c ----------------------------------------------------------------
1888 @node network Selector Variable, path Selector Variable, netnumber Selector Variable, Selectors
1889 @comment  node-name,  next,  previous,  up
1890 @subsubsection network Selector Variable
1891 @cindex network Selector Variable
1892 @cindex network, mount selector
1893 @cindex Mount selector; network
1894 @cindex Selector; network
1896 This selector is identical to the @samp{in_network} selector function,
1897 see @ref{in_network Selector Function}.  It will match either the name
1898 or number of @i{any} network interface on which this host is connected
1899 to.  The names and numbers of all attached interfaces are available from
1900 the output of @samp{amd -v}.
1902 @c ----------------------------------------------------------------
1903 @node path Selector Variable, wire Selector Variable, network Selector Variable, Selectors
1904 @comment  node-name,  next,  previous,  up
1905 @subsubsection path Selector Variable
1906 @cindex path Selector Variable
1907 @cindex path, mount selector
1908 @cindex Mount selector; path
1909 @cindex Selector; path
1911 The full pathname of the name being resolved.  For example
1912 @file{/home/foo} in the example above.
1914 @c ----------------------------------------------------------------
1915 @node wire Selector Variable, exists Selector Function, path Selector Variable, Selectors
1916 @comment  node-name,  next,  previous,  up
1917 @subsubsection wire Selector Variable
1918 @cindex wire Selector Variable
1919 @cindex wire, mount selector
1920 @cindex Mount selector; wire
1921 @cindex Selector; wire
1923 This selector is identical to the @samp{in_network} selector function,
1924 see @ref{in_network Selector Function}.  It will match either the name
1925 or number of @i{any} network interface on which this host is connected
1926 to.  The names and numbers of all attached interfaces are available from
1927 the output of @samp{amd -v}.
1929 @c ----------------------------------------------------------------
1930 @ifhtml
1931 <HR>
1932 @end ifhtml
1933 @sp 2
1934 The following boolean functions are selectors which take an argument
1935 @i{ARG}.  They return a value of true or false, and thus do not need to
1936 be compared with a value.  Each of these may be negated by prepending
1937 @samp{!} to their name.
1939 @c ----------------------------------------------------------------
1940 @node exists Selector Function, false Selector Function, wire Selector Variable, Selectors
1941 @comment  node-name,  next,  previous,  up
1942 @subsubsection exists Selector Function
1943 @cindex exists Selector Function
1944 @cindex exists, boolean mount selector
1945 @cindex !exists, boolean mount selector
1946 @cindex Mount selector; exists
1947 @cindex Selector; exists
1949 If the file listed by @i{ARG} exists (via @b{lstat}(2)), this function
1950 evaluates to true.  Otherwise it evaluates to false.
1952 @c ----------------------------------------------------------------
1953 @node false Selector Function, netgrp Selector Function, exists Selector Function, Selectors
1954 @comment  node-name,  next,  previous,  up
1955 @subsubsection false Selector Function
1956 @cindex false Selector Function
1957 @cindex false, boolean mount selector
1958 @cindex !false, boolean mount selector
1959 @cindex Mount selector; false
1960 @cindex Selector; false
1962 Always evaluates to false.  @i{ARG} is ignored.
1964 @c ----------------------------------------------------------------
1965 @node netgrp Selector Function, netgrpd Selector Function, false Selector Function, Selectors
1966 @comment  node-name,  next,  previous,  up
1967 @subsubsection netgrp Selector Function
1968 @cindex netgrp Selector Function
1969 @cindex netgrp, boolean mount selector
1970 @cindex !netgrp, boolean mount selector
1971 @cindex Mount selector; netgrp
1972 @cindex Selector; netgrp
1974 If the current host as determined by the value of @code{$@{host@}}
1975 (e.g., short host name) is a member of the netgroup @i{ARG}, this
1976 selector evaluates to true.  Otherwise it evaluates to false.
1978 For example, suppose you have a netgroup @samp{ppp-hosts}, and for
1979 reasons of performance, these have a local @file{/home} partition, while
1980 all other clients on the faster network can access a shared home
1981 directory.  A common map to use for both might look like the following:
1983 @example
1984 home/*  netgrp(ppp-hosts);type:=link;fs:=/local/$@{key@} \
1985         !netgrp(ppp-hosts);type:=nfs;rhost:=serv1;rfs:=/remote/$@{key@}
1986 @end example
1988 @c ----------------------------------------------------------------
1989 @node netgrpd Selector Function, in_network Selector Function, netgrp Selector Function, Selectors
1990 @comment  node-name,  next,  previous,  up
1991 @subsubsection netgrpd Selector Function
1992 @cindex netgrpd Selector Function
1993 @cindex netgrpd, boolean mount selector
1994 @cindex !netgrpd, boolean mount selector
1995 @cindex Mount selector; netgrpd
1996 @cindex Selector; netgrpd
1998 If the current host as determined by the value of @code{$@{hostd@}} is a
1999 member of the netgroup @i{ARG}, this selector evaluates to true.
2000 Otherwise it evaluates to false.
2002 The @samp{netgrpd} function uses fully-qualified host names
2003 (@code{$@{hostd@}}) to match netgroup names, while the @samp{netgrp}
2004 function (@pxref{netgrp Selector Function}) uses short host names
2005 (@code{$@{host@}}).
2007 @c ----------------------------------------------------------------
2008 @node in_network Selector Function, true Selector Function, netgrpd Selector Function, Selectors
2009 @comment  node-name,  next,  previous,  up
2010 @subsubsection in_network Selector Function
2011 @cindex in_network Selector Function
2012 @cindex in_network, boolean mount selector
2013 @cindex !in_network, boolean mount selector
2014 @cindex Mount selector; in_network
2015 @cindex Selector; in_network
2017 If the current host has any network interface that is locally attached
2018 to the network specified in @i{ARG} (either via name or number), this
2019 selector evaluates to true.  Otherwise it evaluates to false.
2021 For example, suppose you have two servers that have an exportable
2022 @file{/opt} that smaller clients can NFS mount.  The two servers are
2023 say, @samp{serv1} on network @samp{foo-net.site.com} and @samp{serv2} on
2024 network @samp{123.4.5.0}.  You can write a map to be used by all clients
2025 that will attempt to mount the closest one as follows:
2027 @example
2028 opt in_network(foo-net.site.com);rhost:=serv1;rfs:=/opt \
2029     in_network(123.4.5.0);rhost:=serv2;rfs:=/opt \
2030     rhost:=fallback-server
2031 @end example
2033 @c ----------------------------------------------------------------
2034 @node true Selector Function, , in_network Selector Function, Selectors
2035 @comment  node-name,  next,  previous,  up
2036 @subsubsection true Selector Function
2037 @cindex true Selector Function
2038 @cindex true, boolean mount selector
2039 @cindex !true, boolean mount selector
2040 @cindex Mount selector; true
2041 @cindex Selector; true
2043 Always evaluates to true.  @i{ARG} is ignored.
2045 @c ================================================================
2046 @node Map Options,  , Selectors, Location Format
2047 @comment  node-name,  next,  previous,  up
2048 @subsection Map Options
2049 @cindex Map options
2050 @cindex Setting map options
2052 Options are parsed concurrently with selectors.  The difference is that
2053 when an option is seen the string following the @samp{:=} is
2054 recorded for later use.  As a minimum the @var{type} option must be
2055 specified.  Each filesystem type has other options which must also be
2056 specified.  @xref{Filesystem Types}, for details on the filesystem
2057 specific options.@refill
2059 Superfluous option specifications are ignored and are not reported
2060 as errors.
2062 The following options apply to more than one filesystem type.
2064 @menu
2065 * addopts Option::
2066 * delay Option::
2067 * fs Option::
2068 * opts Option::
2069 * remopts Option::
2070 * sublink Option::
2071 * type Option::
2072 @end menu
2074 @node addopts Option, delay Option, Map Options, Map Options
2075 @comment  node-name,  next,  previous,  up
2076 @subsubsection addopts Option
2077 @cindex Setting additional options on a mount location
2078 @cindex Overriding or adding options to a mount
2079 @cindex addopts, mount option
2080 @cindex Mount option; addopts
2082 This option adds additional options to default options normally
2083 specified in the @samp{/defaults} entry or the defaults of the key entry
2084 being processed (@pxref{opts Option}).  Normally when you specify
2085 @samp{opts} in both the @samp{/defaults} and the map entry, the latter
2086 overrides the former completely.  But with @samp{addopts} it will append
2087 the options and override any conflicting ones.
2089 @samp{addopts} also overrides the value of the @samp{remopts} option
2090 (@pxref{remopts Option}), which unless specified defaults to the value
2091 of @samp{opts}.
2093 Options which start with @samp{no} will override those with the same
2094 name that do not start with @samp{no} and vice verse.  Special handling
2095 is given to inverted options such as @samp{soft} and @samp{hard},
2096 @samp{bg} and @samp{fg}, @samp{ro} and @samp{rw}, etc.
2098 For example, if the default options specified were
2099 @example
2100 opts:=rw,nosuid,intr,rsize=1024,wsize=1024,quota,posix
2101 @end example
2103 and the ones specified in a map entry were
2105 @example
2106 addopts:=grpid,suid,ro,rsize=2048,quota,nointr
2107 @end example
2109 then the actual options used would be
2111 @example
2112 wsize=1024,posix,grpid,suid,ro,rsize=2048,quota,nointr
2113 @end example
2115 @node delay Option, fs Option, addopts Option, Map Options
2116 @comment  node-name,  next,  previous,  up
2117 @subsubsection delay Option
2118 @cindex Setting a delay on a mount location
2119 @cindex Delaying mounts from specific locations
2120 @cindex Primary server
2121 @cindex Secondary server
2122 @cindex delay, mount option
2123 @cindex Mount option; delay
2125 The delay, in seconds, before an attempt will be made to mount from the
2126 current location.  Auxiliary data, such as network address, file handles
2127 and so on are computed regardless of this value.
2129 A delay can be used to implement the notion of primary and secondary
2130 file servers.  The secondary servers would have a delay of a few
2131 seconds, thus giving the primary servers a chance to respond first.
2133 @node fs Option, opts Option, delay Option, Map Options
2134 @comment  node-name,  next,  previous,  up
2135 @subsubsection fs Option
2136 @cindex Setting the local mount point
2137 @cindex Overriding the default mount point
2138 @cindex fs, mount option
2139 @cindex Mount option; fs
2141 The local mount point.  The semantics of this option vary between
2142 filesystems.
2144 For NFS and UFS filesystems the value of @code{$@{fs@}} is used as the
2145 local mount point.  For other filesystem types it has other meanings
2146 which are described in the section describing the respective filesystem
2147 type.  It is important that this string uniquely identifies the
2148 filesystem being mounted.  To satisfy this requirement, it should
2149 contain the name of the host on which the filesystem is resident and the
2150 pathname of the filesystem on the local or remote host.
2152 The reason for requiring the hostname is clear if replicated filesystems
2153 are considered.  If a fileserver goes down and a replacement filesystem
2154 is mounted then the @dfn{local} mount point @dfn{must} be different from
2155 that of the filesystem which is hung.  Some encoding of the filesystem
2156 name is required if more than one filesystem is to be mounted from any
2157 given host.
2159 If the hostname is first in the path then all mounts from a particular
2160 host will be gathered below a single directory.  If that server goes
2161 down then the hung mount points are less likely to be accidentally
2162 referenced, for example when @b{getcwd}(3) traverses the namespace to
2163 find the pathname of the current directory.
2165 The @samp{fs} option defaults to
2166 @code{$@{autodir@}/$@{rhost@}$@{rfs@}}.  In addition,
2167 @samp{rhost} defaults to the local host name (@code{$@{host@}}) and
2168 @samp{rfs} defaults to the value of @code{$@{path@}}, which is the full
2169 path of the requested file; @samp{/home/foo} in the example above
2170 (@pxref{Selectors}).  @code{$@{autodir@}} defaults to @samp{/a} but may
2171 be changed with the @code{-a} command line option.  Sun's automounter
2172 defaults to @samp{/tmp_mnt}.  Note that there is no @samp{/} between
2173 the @code{$@{rhost@}} and @code{$@{rfs@}} since @code{$@{rfs@}} begins
2174 with a @samp{/}.@refill
2176 @node opts Option, remopts Option, fs Option, Map Options
2177 @comment  node-name,  next,  previous,  up
2178 @subsubsection opts Option
2179 @cindex Setting system mount options
2180 @cindex Passing parameters to the mount system call
2181 @cindex mount system call
2182 @cindex mount system call flags
2183 @cindex The mount system call
2184 @cindex opts, mount option
2185 @cindex Mount option; opts
2187 The options to pass to the mount system call.  A leading @samp{-} is
2188 silently ignored.  The mount options supported generally correspond to
2189 those used by @b{mount}(8) and are listed below.  Some additional
2190 pseudo-options are interpreted by @i{Amd} and are also listed.
2192 Unless specifically overridden, each of the system default mount options
2193 applies.  Any options not recognized are ignored.  If no options list is
2194 supplied the string @samp{rw,defaults} is used and all the system
2195 default mount options apply.  Options which are not applicable for a
2196 particular operating system are silently ignored.  For example, only 4.4BSD
2197 is known to implement the @code{compress} and @code{spongy} options.
2199 @table @code
2201 @item acdirmax=@var{n}
2202 @cindex Mount flags; acdirmax
2203 Set the maximum directory attribute cache timeout to @var{n}.
2205 @item acdirmin=@var{n}
2206 @cindex Mount flags; acdirmin
2207 Set the minimum directory attribute cache timeout to @var{n}.
2209 @item acregmax=@var{n}
2210 @cindex Mount flags; acregmax
2211 Set the maximum file attribute cache timeout to @var{n}.
2213 @item acregmin=@var{n}
2214 @cindex Mount flags; acregmin
2215 Set the minimum file attribute cache timeout to @var{n}.
2217 @item actimeo=@var{n}
2218 @cindex Mount flags; actimeo
2219 Set the overall attribute cache timeout to @var{n}.
2221 @item auto
2222 @cindex Mount flags; auto
2223 @itemx ignore
2224 @cindex Mount flags; ignore
2225 Ignore this mount by @b{df}(1).
2227 @item cache
2228 @cindex Mount flags; cache
2229 Allow data to be cached from a remote server for this mount.
2231 @item compress
2232 @cindex Mount flags; compress
2233 Use NFS compression protocol.
2235 @item defperm
2236 @cindex Mount flags; defperm
2237 Ignore the permission mode bits, and default file permissions to 0555,
2238 UID 0, and GID 0.  Useful for CD-ROMs formatted as ISO-9660.
2240 @item dev
2241 @cindex Mount flags; dev
2242 Allow local special devices on this filesystem.
2244 @item dumbtimr
2245 @cindex Mount flags; dumbtimr
2246 Turn off the dynamic retransmit timeout estimator.  This may be useful
2247 for UDP mounts that exhibit high retry rates, since it is possible that
2248 the dynamically estimated timeout interval is too short.
2250 @item extatt
2251 @cindex Mount flags; extatt
2252 Enable extended attributes in ISO-9660 file systems.
2254 @item fsid
2255 @cindex Mount flags; fsid
2256 Set ID of filesystem.
2258 @item gens
2259 @cindex Mount flags; gens
2260 Enable generations in ISO-9660 file systems.  Generations allow you to
2261 see all versions of a given file.
2263 @item grpid
2264 @cindex Mount flags; grpid
2265 Use BSD directory group-id semantics.
2267 @item int
2268 @cindex Mount flags; int
2269 @itemx intr
2270 @cindex Mount flags; intr
2271 Allow keyboard interrupts on hard mounts.
2273 @item multi
2274 @cindex Mount flags; multi
2275 Perform multi-component lookup on files.
2277 @item maxgroups
2278 @cindex Mount flags; maxgroups
2279 Set the maximum number of groups to allow for this mount.
2281 @item nfsv3
2282 @cindex Mount flags; nfsv3
2283 Use NFS Version 3 for this mount.
2285 @item noac
2286 @cindex Mount flags; noac
2287 Turn off the attribute cache.
2289 @item noauto
2290 @cindex Mount flags; noauto
2291 This option is used by the mount command in @samp{/etc/fstab} or
2292 @samp{/etc/vfstab} and means not to mount this file system when mount -a
2293 is used.
2295 @item nocache
2296 @cindex Mount flags; nocache
2297 Do not allow data to be cached from a remote server for this
2298 mount.
2300 @item noconn
2301 @cindex Mount flags; noconn
2302 Don't make a connection on datagram transports.
2304 @item nocto
2305 @cindex Mount flags; nocto
2306 No close-to-open consistency.
2308 @item nodefperm
2309 @cindex Mount flags; nodefperm
2310 Do not ignore the permission mode bits.  Useful for CD-ROMS formatted as
2311 ISO-9660.
2313 @item nodev
2314 @cindex Mount flags; nodev
2315 @itemx nodevs
2316 @cindex Mount flags; nodevs
2317 Don't allow local special devices on this filesystem.
2319 @item noint
2320 @cindex Mount flags; noint
2321 Do not allow keyboard interrupts for this mount
2323 @item norrip
2324 @cindex Mount flags; norrip
2325 Turn off using of the Rock Ridge Interchange Protocol (RRIP) extensions
2326 to ISO-9660.
2328 @item nosub
2329 @cindex Mount flags; nosub
2330 Disallow mounts beneath this mount.
2332 @item nosuid
2333 @cindex Mount flags; nosuid
2334 Don't allow set-uid or set-gid executables on this filesystem.
2336 @item noversion
2337 @cindex Mount flags; noversion
2338 Strip the extension @samp{;#} from the version string of files recorded
2339 on an ISO-9660 CD-ROM.
2341 @item overlay
2342 @cindex Mount flags; overlay
2343 Overlay this mount on top of an existing mount, if any.
2345 @item pgthresh=@var{n}
2346 @cindex Mount flags; pgthresh
2347 Set the paging threshold to @var{n} kilobytes.
2349 @item port=@var{n}
2350 @cindex Mount flags; port
2351 Set the NFS port to @var{n}.
2353 @item posix
2354 @cindex Mount flags; posix
2355 Turn on POSIX static pathconf for mounts.
2357 @item proto=@var{s}
2358 @cindex Mount flags; proto
2359 Use transport protocol @var{s} for NFS (can be @code{"tcp"} or @code{"udp"}).
2361 @item quota
2362 @cindex Mount flags; quota
2363 Enable quota checking on this mount.
2365 @item rdonly
2366 @cindex Mount flags; rdonly
2367 @itemx ro
2368 @cindex Mount flags; ro
2369 Mount this filesystem readonly.
2371 @item resvport
2372 @cindex Mount flags; resvport
2373 Use a reserved port (smaller than 1024) for remote NFS mounts.  Most
2374 systems assume that, but some allow for mounts to occur on non-reserved
2375 ports.   This causes problems when such a system tries to NFS mount one
2376 that requires reserved ports.  It is recommended that this option always
2377 be on.
2379 @item retrans=@i{n}
2380 @cindex Mount flags; retrans
2381 The number of NFS retransmits made before a user error is generated by a
2382 @samp{soft} mounted filesystem, and before a @samp{hard} mounted
2383 filesystem reports @samp{NFS server @dfn{yoyo} not responding still
2384 trying}.
2386 @item retry
2387 @cindex Mount flags; retry
2388 Set the NFS retry counter.
2390 @item rrip
2391 @cindex Mount flags; rrip
2392 Uses the Rock Ridge Interchange Protocol (RRIP) extensions to ISO-9660.
2394 @item rsize=@var{n}
2395 @cindex Mount flags; rsize
2396 The NFS read packet size.  You may need to set this if you are using
2397 NFS/UDP through a gateway or a slow link.
2399 @item rw
2400 @cindex Mount flags; rw
2401 Allow reads and writes on this filesystem.
2403 @item soft
2404 @cindex Mount flags; soft
2405 Give up after @dfn{retrans} retransmissions.
2407 @item spongy
2408 @cindex Mount flags; spongy
2409 Like @samp{soft} for status requests, and @samp{hard} for data transfers.
2411 @item suid
2412 @cindex Mount flags; suid
2413 Allow set-uid programs on this mount.
2415 @item symttl
2416 @cindex Mount flags; symttl
2417 Turn of the symbolic link cache time-to-live.
2419 @item sync
2420 @cindex Mount flags; sync
2421 Perform synchronous filesystem operations on this mount.
2423 @item tcp
2424 @cindex Mount flags; tcp
2425 Use TCP/IP instead of UDP/IP, ignored if the NFS implementation does not
2426 support TCP/IP mounts.
2428 @item timeo=@var{n}
2429 @cindex Mount flags; timeo
2430 The NFS timeout, in tenth-seconds, before a request is retransmitted.
2432 @item vers=@var{n}
2433 @cindex Mount flags; vers
2434  Use NFS protocol version number @var{n} (can be 2 or 3).
2436 @item wsize=@var{n}
2437 @cindex Mount flags; wsize
2438 The NFS write packet size.  You may need to set this if you are using
2439 NFS/UDP through a gateway or a slow link.
2441 @end table
2443 The following options are implemented by @i{Amd}, rather than being
2444 passed to the kernel.
2446 @table @code
2448 @item nounmount
2449 @cindex Mount flags; nounmount
2450 Configures the mount so that its time-to-live will
2451 never expire.  This is also the default for some filesystem types.
2453 @c Implementation broken:
2455 @item ping=@var{n}
2456 @cindex Mount flags; ping
2457 The interval, in seconds, between keep-alive pings.  When four
2458 consecutive pings have failed the mount point is marked as hung.  This
2459 interval defaults to 30 seconds.  If the ping interval is less than zero,
2460 no pings are sent and the host is assumed to be always
2461 up.  By default, pings are not sent for an NFS/TCP mount.
2463 @item retry=@var{n}
2464 @cindex Mount flags; retry=@var{n}
2465 The number of times to retry the mount system call.
2467 @item utimeout=@var{n}
2468 @cindex Mount flags; utimeout=@var{n}
2469 The interval, in seconds, by which the mount's
2470 time-to-live is extended after an unmount attempt
2471 has failed.  In fact the interval is extended before the unmount is
2472 attempted to avoid thrashing.  The default value is 120 seconds (two
2473 minutes) or as set by the @code{-w} command line option.
2475 @end table
2477 @node remopts Option, sublink Option, opts Option, Map Options
2478 @comment  node-name,  next,  previous,  up
2479 @subsubsection remopts Option
2480 @cindex Setting system mount options for non-local networks
2481 @cindex remopts, mount option
2482 @cindex Mount option; remopts
2484 This option has the same use as @code{$@{opts@}} but applies only when
2485 the remote host is on a non-local network.  For example, when using NFS
2486 across a gateway it is often necessary to use smaller values for the
2487 data read and write sizes.  This can simply be done by specifying the
2488 small values in @var{remopts}.  When a non-local host is accessed, the
2489 smaller sizes will automatically be used.
2491 @i{Amd} determines whether a host is local by examining the network
2492 interface configuration at startup.  Any interface changes made after
2493 @i{Amd} has been started will not be noticed.  The likely effect will
2494 be that a host may incorrectly be declared non-local.
2496 Unless otherwise set, the value of @code{$@{remopts@}} is the same as
2497 the value of @code{$@{opts@}}.
2499 @node sublink Option, type Option, remopts Option, Map Options
2500 @comment  node-name,  next,  previous,  up
2501 @subsubsection sublink Option
2502 @cindex Setting the sublink option
2503 @cindex sublink, mount option
2504 @cindex Mount option; sublink
2506 The subdirectory within the mounted filesystem to which the reference
2507 should point.  This can be used to prevent duplicate mounts in cases
2508 where multiple directories in the same mounted filesystem are used.
2510 @node type Option, , sublink Option, Map Options
2511 @comment  node-name,  next,  previous,  up
2512 @subsubsection type Option
2513 @cindex Setting the filesystem type option
2514 @cindex type, mount option
2515 @cindex Mount option; type
2517 The filesystem type to be used.  @xref{Filesystem Types}, for a full
2518 description of each type.@refill
2520 @c ################################################################
2521 @node Amd Command Line Options, Filesystem Types, Mount Maps, Top
2522 @comment  node-name,  next,  previous,  up
2523 @chapter @i{Amd} Command Line Options
2524 @cindex Command line options, Amd
2525 @cindex Amd command line options
2526 @cindex Overriding defaults on the command line
2528 Many of @i{Amd}'s parameters can be set from the command line.  The
2529 command line is also used to specify automount points and maps.
2531 The general format of a command line is
2533 @example
2534 amd [@i{options}] [@{ @i{directory} @i{map-name} [-@i{map-options}] @} ...]
2535 @end example
2537 For each directory and map-name given or specified in the
2538 @file{amd.conf} file, @i{Amd} establishes an automount point.  The
2539 @dfn{map-options} may be any sequence of options or
2540 selectors---@pxref{Location Format}.  The @dfn{map-options} apply only
2541 to @i{Amd}'s mount point.
2543 @samp{type:=toplvl;cache:=mapdefault;fs:=$@{map@}} is the default value for the
2544 map options.  Default options for a map are read from a special entry in
2545 the map whose key is the string @samp{/defaults}.  When default options
2546 are given they are prepended to any options specified in the mount-map
2547 locations as explained in @ref{Map Defaults}.
2549 The @dfn{options} are any combination of those listed below.
2551 Once the command line has been parsed, the automount points are mounted.
2552 The mount points are created if they do not already exist, in which case they
2553 will be removed when @i{Amd} exits.
2554 Finally, @i{Amd} disassociates itself from its controlling terminal and
2555 forks into the background.
2557 Note: Even if @i{Amd} has been built with @samp{-DDEBUG} (via
2558 @code{configure --enable-debug}), it will still background itself and
2559 disassociate itself from the controlling terminal.  To use a debugger it
2560 is necessary to specify @samp{-D nodaemon} on the command line.
2561 However, even with all of this, mounts and unmounts are performed in the
2562 background, and @i{Amd} will always fork before doing them.  Therefore,
2563 debugging what happens closely during un/mounts is more challenging.
2565 @emph{All} of @i{Amd}'s command options (save @code{-F} and @code{-T})
2566 can be specified in the @file{amd.conf} file. @xref{Amd Configuration
2567 File}.  If @i{Amd} is invoked without any command line options, it will
2568 default to using the configuration file @file{/etc/amd.conf}, if one
2569 exists.
2571 @menu
2572 * -a Option::   Automount directory.
2573 * -c Option::   Cache timeout interval.
2574 * -d Option::   Domain name.
2575 * -k Option::   Kernel architecture.
2576 * -l Option::   Log file.
2577 * -n Option::   Hostname normalization.
2578 * -o Option::   Operating system version.
2579 * -p Option::   Output process id.
2580 * -r Option::   Restart existing mounts.
2581 * -t Option::   Kernel RPC timeout.
2582 * -v Option::   Version information.
2583 * -w Option::   Wait interval after failed unmount.
2584 * -x Option::   Log options.
2585 * -y Option::   NIS domain.
2586 * -C-Option::   Cluster name.
2587 * -D-Option::   Debug flags.
2588 * -F Option::   Amd configuration file.
2589 * -H Option::   Show brief help.
2590 * -O-Option::   Operating system name.
2591 * -S Option::   Lock executable pages in memory.
2592 * -T-Option::   Set tag for configuration file.
2593 @end menu
2595 @c ----------------------------------------------------------------
2596 @node -a Option, -c Option, Amd Command Line Options, Amd Command Line Options
2597 @comment  node-name,  next,  previous,  up
2598 @section @code{-a} @var{directory}
2599 @cindex Automount directory
2600 @cindex Setting the default mount directory
2602 Specifies the default mount directory.  This option changes the variable
2603 @code{$@{autodir@}} which otherwise defaults to @file{/a}.  For example,
2604 some sites prefer @file{/amd} or @file{/n}.
2606 @example
2607 amd -a /amd ...
2608 @end example
2610 @c ----------------------------------------------------------------
2611 @node -c Option, -d Option, -a Option, Amd Command Line Options
2612 @comment  node-name,  next,  previous,  up
2613 @section @code{-c} @var{cache-interval}
2614 @cindex Cache interval
2615 @cindex Interval before a filesystem times out
2616 @cindex Setting the interval before a filesystem times out
2617 @cindex Changing the interval before a filesystem times out
2619 Selects the period, in seconds, for which a name is cached by @i{Amd}.
2620 If no reference is made to the volume in this period, @i{Amd} discards
2621 the volume name to filesystem mapping.
2623 Once the last reference to a filesystem has been removed, @i{Amd}
2624 attempts to unmount the filesystem.  If the unmount fails the interval
2625 is extended by a further period as specified by the @samp{-w} command
2626 line option or by the @samp{utimeout} mount option.
2628 The default @dfn{cache-interval} is 300 seconds (five minutes).
2630 @c ----------------------------------------------------------------
2631 @node -d Option, -k Option, -c Option, Amd Command Line Options
2632 @comment  node-name,  next,  previous,  up
2633 @section @code{-d} @var{domain}
2634 @cindex Domain name
2635 @cindex Setting the local domain name
2636 @cindex Overriding the local domain name
2638 Specifies the host's domain.  This sets the internal variable
2639 @code{$@{domain@}} and affects the @code{$@{hostd@}} variable.
2641 If this option is not specified and the hostname already contains the
2642 local domain then that is used, otherwise the default value of
2643 @code{$@{domain@}} is @samp{unknown.domain}.
2645 For example, if the local domain was @samp{doc.ic.ac.uk}, @i{Amd} could
2646 be started as follows:
2648 @example
2649 amd -d doc.ic.ac.uk ...
2650 @end example
2652 @c ----------------------------------------------------------------
2653 @node -k Option, -l Option, -d Option, Amd Command Line Options
2654 @comment  node-name,  next,  previous,  up
2655 @section @code{-k} @var{kernel-architecture}
2656 @cindex Setting the Kernel architecture
2658 Specifies the kernel architecture of the system.  This is usually the
2659 output of @samp{uname -m} (the ``machine'' value gotten from
2660 @b{uname}(2)).  If the @b{uname}(2) system call is not available, the
2661 value of @code{$@{karch@}} defaults to that of @code{$@{arch@}}.
2663 The only effect of this option is to set the variable @code{$@{karch@}}.
2665 This option would be used as follows:
2667 @example
2668 amd -k `arch -k` ...
2669 @end example
2671 @c ----------------------------------------------------------------
2672 @node -l Option, -n Option, -k Option, Amd Command Line Options
2673 @comment  node-name,  next,  previous,  up
2674 @section @code{-l} @var{log-option}
2675 @cindex Log filename
2676 @cindex Setting the log file
2677 @cindex Using syslog to log errors
2678 @cindex syslog
2680 Selects the form of logging to be made.  Several special @dfn{log-options}
2681 are recognized.
2683 @enumerate
2684 @item
2685 If @dfn{log-option} is the string @samp{syslog}, @i{Amd} will use the
2686 @b{syslog}(3) mechanism.  If your system supports syslog facilities, then
2687 the default facility used is @samp{LOG_DAEMON}.
2689 @item
2690 @cindex syslog facility; specifying an alternate
2691 When using syslog, if you wish to change the facility, append its name
2692 to the log option name, delimited by a single colon.  For example, if
2693 @dfn{log-options} is the string @samp{syslog:local7} then @b{Amd} will
2694 log messages via @b{syslog}(3) using the @samp{LOG_LOCAL7} facility.  If
2695 the facility name specified is not recognized, @i{Amd} will default to
2696 @samp{LOG_DAEMON}.  Note: while you can use any syslog facility
2697 available on your system, it is generally a bad idea to use those
2698 reserved for other services such as @samp{kern}, @samp{lpr},
2699 @samp{cron}, etc.
2701 @item
2702 If @dfn{log-option} is the string @samp{/dev/stderr}, @i{Amd} will use
2703 standard error, which is also the default target for log messages.  To
2704 implement this, @i{Amd} simulates the effect of the @samp{/dev/fd}
2705 driver.
2706 @end enumerate
2708 Any other string is taken as a filename to use for logging.  Log
2709 messages are appended to the file if it already exists, otherwise a new
2710 file is created.  The file is opened once and then held open, rather
2711 than being re-opened for each message.
2713 Normally, when long-running daemons hold an open file descriptor on a
2714 log file, it is impossible to ``rotate'' the log file and compress older
2715 logs on a daily basis.  The daemon needs to be told to discard (via
2716 @b{close}(2)) its file handle, and re-open the log file.  This is done
2717 using @code{amq -l} @i{log-option}. @xref{Amq -l option}.
2719 If the @samp{syslog} option is specified but the system does not support
2720 syslog or if the named file cannot be opened or created, @i{Amd} will
2721 use standard error.  Error messages generated before @i{Amd} has
2722 finished parsing the command line are printed on standard error.
2724 Since @i{Amd} tends to generate a lot of logging information (especially
2725 if debugging was turned on), and due to it being an important program
2726 running on the system, it is usually best to log to a separate disk
2727 file.  In that case @i{Amd} would be started as follows:
2729 @example
2730 amd -l /var/log/amd ...
2731 @end example
2733 @c ----------------------------------------------------------------
2734 @node -n Option, -o Option, -l Option, Amd Command Line Options
2735 @comment  node-name,  next,  previous,  up
2736 @section @code{-n}
2737 @cindex Hostname normalization
2738 @cindex Aliased hostnames
2739 @cindex Resolving aliased hostnames
2740 @cindex Normalizing hostnames
2742 Normalizes the remote hostname before using it.  Normalization is done
2743 by replacing the value of @code{$@{rhost@}} with the (generally fully
2744 qualified) primary name returned by a hostname lookup.
2746 This option should be used if several names are used to refer to a
2747 single host in a mount map.
2749 @c ----------------------------------------------------------------
2750 @node -o Option, -p Option, -n Option, Amd Command Line Options
2751 @comment  node-name,  next,  previous,  up
2752 @section @code{-o} @var{op-sys-ver}
2753 @cindex Operating System version
2754 @cindex Setting the Operating System version
2756 Overrides the compiled-in version number of the operating system, with
2757 @var{op-sys-ver}.  Useful when the built-in version is not desired for
2758 backward compatibility reasons.  For example, if the built-in version is
2759 @samp{2.5.1}, you can override it to @samp{5.5.1}, and use older maps
2760 that were written with the latter in mind.
2762 @c ----------------------------------------------------------------
2763 @node -p Option, -r Option, -o Option, Amd Command Line Options
2764 @comment  node-name,  next,  previous,  up
2765 @section @code{-p}
2766 @cindex Process id
2767 @cindex Displaying the process id
2768 @cindex process id of Amd daemon
2769 @cindex pid file, creating with -p option
2770 @cindex Creating a pid file
2772 Causes @i{Amd}'s process id to be printed on standard output.
2773 This can be redirected to a suitable file for use with kill:
2775 @example
2776 amd -p > /var/run/amd.pid ...
2777 @end example
2779 This option only has an affect if @i{Amd} is running in daemon mode.
2780 If @i{Amd} is started with the @code{-D nodaemon} debug flag, this
2781 option is ignored.
2783 @c ----------------------------------------------------------------
2784 @node -r Option, -t Option, -p Option, Amd Command Line Options
2785 @comment  node-name,  next,  previous,  up
2786 @section @code{-r}
2787 @cindex Restarting existing mounts
2788 @cindex Picking up existing mounts
2790 Tells @i{Amd} to restart existing mounts (@pxref{Inheritance Filesystem}).
2791 @c @dfn{This option will be made the default in the next release.}
2793 @c ----------------------------------------------------------------
2794 @node -t Option, -v Option, -r Option, Amd Command Line Options
2795 @comment  node-name,  next,  previous,  up
2796 @section @code{-t} @var{timeout.retransmit}
2797 @cindex Setting Amd's RPC parameters
2799 Specifies the RPC @dfn{timeout} interval and the @dfn{retransmit}
2800 counter used by the kernel to communicate to @i{Amd}.  These are used to
2801 set the @samp{timeo} and @samp{retrans} mount options, respectively.
2802 The default timeout is 0.8 seconds, and the default number of
2803 retransmissions is 11.
2805 @i{Amd} relies on the kernel RPC retransmit mechanism to trigger mount
2806 retries.  The values of these parameters change the overall retry
2807 interval.  Too long an interval gives poor interactive response; too
2808 short an interval causes excessive retries.
2810 @c ----------------------------------------------------------------
2811 @node -v Option, -w Option, -t Option, Amd Command Line Options
2812 @comment  node-name,  next,  previous,  up
2813 @section @code{-v}
2814 @cindex Version information
2815 @cindex Discovering version information
2816 @cindex How to discover your version of Amd
2818 Print version information on standard error and then exit.  The output
2819 is of the form:
2821 @example
2822 Copyright (c) 1997-1999 Erez Zadok
2823 Copyright (c) 1990 Jan-Simon Pendry
2824 Copyright (c) 1990 Imperial College of Science, Technology & Medicine
2825 Copyright (c) 1990 The Regents of the University of California.
2826 am-utils version 6.0a15 (build 61).
2827 Built by ezk@@cs.columbia.edu on date Wed Oct 22 15:21:03 EDT 1997.
2828 cpu=sparc (big-endian), arch=sun4, karch=sun4u.
2829 full_os=solaris2.5.1, os=sos5, osver=5.5.1, vendor=sun.
2830 Map support for: root, passwd, union, nisplus, nis, ndbm, file, error.
2831 AMFS: nfs, link, nfsx, nfsl, host, linkx, program, union, inherit, 
2832       ufs, lofs, hsfs, pcfs, auto, direct, toplvl, error.
2833 FS: autofs, cachefs, cdfs, lofs, nfs, nfs3, pcfs, tfs, tmpfs, ufs.
2834 Network 1: wire="mcl-lab-net.cs.columbia.edu" (netnumber=128.59.13).
2835 Network 2: wire="14-net.cs.columbia.edu" (netnumber=128.59.14).
2836 Network 3: wire="old-net.cs.columbia.edu" (netnumber=128.59.16).
2837 @end example
2839 The information includes the version number, number of times @i{Amd} was
2840 compiled on the local system, release date and name of the release.
2841 Following come the cpu type, byte ordering, and the architecture and
2842 kernel architecture as @code{$@{arch@}} and @code{$@{karch@}},
2843 respectively.  The next line lists the operating system full name, short
2844 name, version, and vendor.  These four values correspond to the
2845 variables @code{$@{full_os@}}, @code{$@{os@}}, @code{$@{osver@}}, and
2846 @code{$@{vendor@}}, respectively.  @xref{Supported Platforms}.
2848 Then come a list of map types supported, filesystems internally
2849 supported by @i{Amd} (AMFS), and generic filesystems available (FS).
2850 Finally all known networks (if any) of this host are listed by name
2851 and number.  They are available via the variables
2852 @code{$@{wire@}} or @code{$@{network@}}, and
2853 @code{$@{netnumber@}} (@pxref{Selectors}) or the @samp{in_network}
2854 selector function (@pxref{in_network Selector Function}).
2856 @c ----------------------------------------------------------------
2857 @node -w Option, -x Option, -v Option, Amd Command Line Options
2858 @comment  node-name,  next,  previous,  up
2859 @section @code{-w} @var{wait-timeout}
2860 @cindex Setting the interval between unmount attempts
2861 @cindex unmount attempt backoff interval
2863 Selects the interval in seconds between unmount attempts after the
2864 initial time-to-live has expired.
2866 This defaults to 120 seconds (two minutes).
2868 @c ----------------------------------------------------------------
2869 @node -x Option, -y Option, -w Option, Amd Command Line Options
2870 @comment  node-name,  next,  previous,  up
2871 @section @code{-x} @var{opts}
2872 @cindex Log message selection
2873 @cindex Selecting specific log messages
2874 @cindex How to select log messages
2875 @cindex syslog priorities
2877 Specifies the type and verbosity of log messages.  @dfn{opts} is
2878 a comma separated list selected from the following options:
2880 @table @code
2881 @item fatal
2882 Fatal errors
2883 @item error
2884 Non-fatal errors
2885 @item user
2886 Non-fatal user errors
2887 @item warn
2888 Recoverable errors
2889 @item warning
2890 Alias for @code{warn}
2891 @item info
2892 Information messages
2893 @item map
2894 Mount map usage
2895 @item stats
2896 Additional statistics
2897 @item all
2898 All of the above
2899 @end table
2901 Initially a set of default logging flags is enabled.  This is as if
2902 @samp{-x all,nomap,nostats} had been selected.  The command line is
2903 parsed and logging is controlled by the @code{-x} option.  The very first
2904 set of logging flags is saved and can not be subsequently disabled using
2905 @i{Amq}.  This default set of options is useful for general production
2906 use.@refill
2908 The @samp{info} messages include details of what is mounted and
2909 unmounted and when filesystems have timed out.  If you want to have the
2910 default set of messages without the @samp{info} messages then you simply
2911 need @samp{-x noinfo}.  The messages given by @samp{user} relate to
2912 errors in the mount maps, so these are useful when new maps are
2913 installed.  The following table lists the syslog priorities used for each
2914 of the message types.@refill
2916 @table @code
2917 @item fatal
2918 @samp{LOG_CRIT}
2919 @item error
2920 @samp{LOG_ERR}
2921 @item user
2922 @samp{LOG_WARNING}
2923 @item warning
2924 @samp{LOG_WARNING}
2925 @item info
2926 @samp{LOG_INFO}
2927 @item debug
2928 @samp{LOG_DEBUG}
2929 @item map
2930 @samp{LOG_DEBUG}
2931 @item stats
2932 @samp{LOG_INFO}
2933 @end table
2936 The options can be prefixed by the string @samp{no} to indicate
2937 that this option should be turned off.  For example, to obtain all
2938 but @samp{info} messages the option @samp{-x all,noinfo} would be used.
2940 If @i{Amd} was built with debugging enabled the @code{debug} option is
2941 automatically enabled regardless of the command line options.
2943 @c ----------------------------------------------------------------
2944 @node -y Option, -C-Option, -x Option, Amd Command Line Options
2945 @comment  node-name,  next,  previous,  up
2946 @section @code{-y} @var{NIS-domain}
2947 @cindex NIS (YP) domain name
2948 @cindex Overriding the NIS (YP) domain name
2949 @cindex Setting the NIS (YP) domain name
2950 @cindex YP domain name
2952 Selects an alternate NIS domain.  This is useful for debugging and
2953 cross-domain shared mounting.  If this flag is specified, @i{Amd}
2954 immediately attempts to bind to a server for this domain.
2955 @c @i{Amd} refers to NIS maps when it starts, unless the @code{-m} option
2956 @c is specified, and whenever required in a mount map.
2958 @c ----------------------------------------------------------------
2959 @node -C-Option, -D-Option, -y Option, Amd Command Line Options
2960 @comment  node-name,  next,  previous,  up
2961 @section @code{-C} @var{cluster-name}
2962 @cindex Cluster names
2963 @cindex Setting the cluster name
2965 Specifies the name of the cluster of which the local machine is a member.
2966 The only effect is to set the variable @code{$@{cluster@}}.
2967 The @dfn{cluster-name} is will usually obtained by running another command which uses
2968 a database to map the local hostname into a cluster name.
2969 @code{$@{cluster@}} can then be used as a selector to restrict mounting of
2970 replicated data.
2971 If this option is not given, @code{$@{cluster@}} has the same value as @code{$@{domain@}}.
2972 This would be used as follows:
2974 @example
2975 amd -C `clustername` ...
2976 @end example
2978 @c ----------------------------------------------------------------
2979 @node -D-Option, -F Option, -C-Option, Amd Command Line Options
2980 @comment  node-name,  next,  previous,  up
2981 @section @code{-D} @var{opts}
2982 @cindex Debug options
2983 @cindex Setting debug flags
2985 Controls the verbosity and coverage of the debugging trace; @dfn{opts}
2986 is a comma separated list of debugging options.  The @code{-D} option is
2987 only available if @i{Amd} was compiled with @samp{-DDEBUG}, or
2988 configured with @code{configure --enable-debug}.  The memory debugging
2989 facilities (@samp{mem}) are only available if @i{Amd} was compiled with
2990 @samp{-DDEBUG_MEM} (in addition to @samp{-DDEBUG}), or configured with
2991 @code{configure --enable-debug=mem}.
2993 The most common options to use are @samp{-D trace} and @samp{-D test}
2994 (which turns on all the useful debug options).  As usual, every option
2995 can be prefixed with @samp{no} to turn it off.
2997 @table @code
2998 @item all
2999 all options
3000 @item amq
3001 register for amq
3002 @item daemon
3003 enter daemon mode
3004 @item fork
3005 fork server
3006 @item full
3007 program trace
3008 @item info
3009 @cindex debugging hesiod resolver service
3010 @cindex Hesiod: turning on RES_DEBUG
3011 info service specific debugging (hesiod, nis, etc.)  In the case of
3012 hesiod maps, turns on the hesiod RES_DEBUG internal debugging option.
3013 @item mem
3014 trace memory allocations
3015 @item mtab
3016 use local @file{./mtab} file
3017 @item str
3018 debug string munging
3019 @item test
3020 full debug but no daemon
3021 @item trace
3022 trace RPC protocol and NFS mount arguments
3023 @end table
3025 You may also refer to the program source for a more detailed explanation
3026 of the available options.
3028 @c ----------------------------------------------------------------
3029 @node -F Option, -H Option, -D-Option, Amd Command Line Options
3030 @comment  node-name,  next,  previous,  up
3031 @section @code{-F} @var{conf-file}
3032 @cindex Amd configuration file; specifying name
3033 @cindex Amd configuration file
3034 @cindex amd.conf file
3036 Specify an @i{Amd} configuration file @var{conf-file} to use.  For a
3037 description of the format and syntax, @pxref{Amd Configuration File}.
3038 This configuration file is used to specify any options in lieu of typing
3039 many of them on the command line.  The @file{amd.conf} file includes
3040 directives for every command line option @i{Amd} has, and many more that
3041 are only available via the configuration file facility.  The
3042 configuration file specified by this option is processed after all other
3043 options had been processed, regardless of the actual location of this
3044 option on the command line.
3046 @c ----------------------------------------------------------------
3047 @node -H Option, -O-Option, -F Option, Amd Command Line Options
3048 @comment  node-name,  next,  previous,  up
3049 @section @code{-H}
3050 @cindex Displaying brief help
3051 @cindex Help; showing from Amd
3053 Print a brief help and usage string.
3055 @c ----------------------------------------------------------------
3056 @node -O-Option, -S Option, -H Option, Amd Command Line Options
3057 @comment  node-name,  next,  previous,  up
3058 @section @code{-O} @var{op-sys-name}
3059 @cindex Operating System name
3060 @cindex Setting the Operating System name
3062 Overrides the compiled-in name of the operating system, with
3063 @var{op-sys-name}.  Useful when the built-in name is not desired for
3064 backward compatibility reasons.  For example, if the build in name is
3065 @samp{sunos5}, you can override it to the old name @samp{sos5}, and use
3066 older maps which were written with the latter in mind.
3068 @c ----------------------------------------------------------------
3069 @node -S Option, -T-Option, -O-Option, Amd Command Line Options
3070 @comment  node-name,  next,  previous,  up
3071 @section @code{-S}
3072 @cindex plock; using
3073 @cindex locking executable pages in memory
3075 Do @emph{not} lock the running executable pages of @i{Amd} into memory.
3076 To improve @i{Amd}'s performance, systems that support the @b{plock}(3)
3077 call lock the @i{Amd} process into memory.  This way there is less
3078 chance the operating system will schedule, page out, and swap the
3079 @i{Amd} process as needed.  This tends to improve @i{Amd}'s performance,
3080 at the cost of reserving the memory used by the @i{Amd} process (making
3081 it unavailable for other processes).  If this behavior is not desired,
3082 use the @code{-S} option.
3084 @c ----------------------------------------------------------------
3085 @node -T-Option, , -S Option, Amd Command Line Options
3086 @comment  node-name,  next,  previous,  up
3087 @section @code{-T} @var{tag}
3088 @cindex Tags for Amd configuration file
3089 @cindex Configuration file; tags
3091 Specify a tag to use with @file{amd.conf}.  All map entries tagged with
3092 @var{tag} will be processed.  Map entries that are not tagged are always
3093 processed.  Map entries that are tagged with a tag other than @var{tag}
3094 will not be processed.
3096 @c ################################################################
3097 @node Filesystem Types, Amd Configuration File, Amd Command Line Options, Top
3098 @comment  node-name,  next,  previous,  up
3099 @chapter Filesystem Types
3100 @cindex Filesystem types
3101 @cindex Mount types
3102 @cindex Types of filesystem
3104 To mount a volume, @i{Amd} must be told the type of filesystem to be
3105 used.  Each filesystem type typically requires additional information
3106 such as the fileserver name for NFS.
3108 From the point of view of @i{Amd}, a @dfn{filesystem} is anything that
3109 can resolve an incoming name lookup.  An important feature is support
3110 for multiple filesystem types.  Some of these filesystems are
3111 implemented in the local kernel and some on remote fileservers, whilst
3112 the others are implemented internally by @i{Amd}.@refill
3114 The two common filesystem types are UFS and NFS.  Four other user
3115 accessible filesystems (@samp{link}, @samp{program}, @samp{auto} and
3116 @samp{direct}) are also implemented internally by @i{Amd} and these are
3117 described below.  There are two additional filesystem types internal to
3118 @i{Amd} which are not directly accessible to the user (@samp{inherit}
3119 and @samp{error}).  Their use is described since they may still have an
3120 effect visible to the user.@refill
3122 @menu
3123 * Network Filesystem::          A single NFS filesystem.
3124 * Network Host Filesystem::     NFS mount a host's entire export tree.
3125 * Network Filesystem Group::    An atomic group of NFS filesystems.
3126 * Unix Filesystem::             Native disk filesystem.
3127 * Caching Filesystem::          Caching from remote server filesystem.
3128 * CD-ROM Filesystem::           ISO9660 CD ROM.
3129 * Loopback Filesystem::         Local loopback-mount filesystem.
3130 * Memory/RAM Filesystem::       A memory or RAM-based filesystem.
3131 * Null Filesystem::             4.4BSD's loopback-mount filesystem.
3132 * Floppy Filesystem::           MS-DOS Floppy filesystem.
3133 * Translucent Filesystem::      The directory merging filesystem.
3134 * Shared Memory+Swap Filesystem:: Sun's tmpfs filesystem.
3135 * User ID Mapping Filesystem::  4.4BSD's umapfs filesystem.
3136 * Program Filesystem::          Generic Program mounts.
3137 * Symbolic Link Filesystem::    Local link.
3138 * Symbolic Link Filesystem II:: Local link referencing existing filesystem.
3139 * NFS-Link Filesystem::         Link if path exists, NFS otherwise.
3140 * Automount Filesystem::
3141 * Direct Automount Filesystem::
3142 * Union Filesystem::
3143 * Error Filesystem::
3144 * Top-level Filesystem::
3145 * Autofs Filesystem::           Sun's kernel-based automounter filesystem.
3146 * Root Filesystem::
3147 * Inheritance Filesystem::
3148 @end menu
3150 @c ----------------------------------------------------------------
3151 @node Network Filesystem, Network Host Filesystem, Filesystem Types, Filesystem Types
3152 @comment  node-name,  next,  previous,  up
3153 @section Network Filesystem (@samp{nfs})
3154 @cindex NFS
3155 @cindex Mounting an NFS filesystem
3156 @cindex How to mount and NFS filesystem
3157 @cindex nfs, filesystem type
3158 @cindex Filesystem type; nfs
3160 The @dfn{nfs} (@samp{type:=nfs}) filesystem type provides access to Sun's NFS.
3162 @noindent
3163 The following options must be specified:
3165 @table @code
3166 @cindex rhost, mount option
3167 @cindex Mount option; rhost
3168 @item rhost
3169 the remote fileserver.  This must be an entry in the hosts database.  IP
3170 addresses are not accepted.  The default value is taken
3171 from the local host name (@code{$@{host@}}) if no other value is
3172 specified.
3174 @cindex rfs, mount option
3175 @cindex Mount option; rfs
3176 @item rfs
3177 the remote filesystem.
3178 If no value is specified for this option, an internal default of
3179 @code{$@{path@}} is used.
3180 @end table
3182 NFS mounts require a two stage process.  First, the @dfn{file handle} of
3183 the remote file system must be obtained from the server.  Then a mount
3184 system call must be done on the local system.  @i{Amd} keeps a cache
3185 of file handles for remote file systems.  The cache entries have a
3186 lifetime of a few minutes.
3188 If a required file handle is not in the cache, @i{Amd} sends a request
3189 to the remote server to obtain it.  @i{Amd} @dfn{does not} wait for
3190 a response; it notes that one of the locations needs retrying, but
3191 continues with any remaining locations.  When the file handle becomes
3192 available, and assuming none of the other locations was successfully
3193 mounted, @i{Amd} will retry the mount.  This mechanism allows several
3194 NFS filesystems to be mounted in parallel.
3195 @c @footnote{The mechanism
3196 @c is general, however NFS is the only filesystem
3197 @c for which the required hooks have been written.}
3198 The first one which responds with a valid file handle will be used.
3200 @noindent
3201 An NFS entry might be:
3203 @example
3204 jsp  host!=charm;type:=nfs;rhost:=charm;rfs:=/home/charm;sublink:=jsp
3205 @end example
3207 The mount system call and any unmount attempts are always done
3208 in a new task to avoid the possibility of blocking @i{Amd}.
3210 @c ----------------------------------------------------------------
3211 @node Network Host Filesystem, Network Filesystem Group, Network Filesystem, Filesystem Types
3212 @comment  node-name,  next,  previous,  up
3213 @section Network Host Filesystem (@samp{host})
3214 @cindex Network host filesystem
3215 @cindex Mounting entire export trees
3216 @cindex How to mount all NFS exported filesystems
3217 @cindex host, filesystem type
3218 @cindex Filesystem type; host
3220 @c NOTE: the current implementation of the @dfn{host} filesystem type
3221 @c sometimes fails to maintain a consistent view of the remote mount tree.
3222 @c This happens when the mount times out and only some of the remote mounts
3223 @c are successfully unmounted.  To prevent this from occurring, use the
3224 @c @samp{nounmount} mount option.
3226 The @dfn{host} (@samp{type:=host}) filesystem allows access to the entire export tree of an
3227 NFS server.  The implementation is layered above the @samp{nfs}
3228 implementation so keep-alives work in the same way.  The only option
3229 which needs to be specified is @samp{rhost} which is the name of the
3230 fileserver to mount.
3232 The @samp{host} filesystem type works by querying the mount daemon on
3233 the given fileserver to obtain its export list.  @i{Amd} then obtains
3234 filehandles for each of the exported filesystems.  Any errors at this
3235 stage cause that particular filesystem to be ignored.  Finally each
3236 filesystem is mounted.  Again, errors are logged but ignored.  One
3237 common reason for mounts to fail is that the mount point does not exist.
3238 Although @i{Amd} attempts to automatically create the mount point, it
3239 may be on a remote filesystem to which @i{Amd} does not have write
3240 permission.
3242 When an attempt to unmount a @samp{host} filesystem mount fails, @i{Amd}
3243 remounts any filesystems which had successfully been unmounted.  To do
3244 this @i{Amd} queries the mount daemon again and obtains a fresh copy of
3245 the export list.  @i{Amd} then tries to mount any exported filesystems
3246 which are not currently mounted.
3248 Sun's automounter provides a special @samp{-hosts} map.  To achieve the
3249 same effect with @i{Amd} requires two steps.  First a mount map must
3250 be created as follows:
3252 @example
3253 *       type:=host;rhost:=$@{key@};fs:=$@{autodir@}/$@{rhost@}/root
3254 @end example
3256 @noindent
3257 and then start @i{Amd} with the following command
3259 @example
3260 amd /net net.map
3261 @end example
3263 @noindent
3264 where @samp{net.map} is the name of map described above.  Note that the
3265 value of @code{$@{fs@}} is overridden in the map.  This is done to avoid
3266 a clash between the mount tree and any other filesystem already mounted
3267 from the same fileserver.
3269 If different mount options are needed for different hosts then
3270 additional entries can be added to the map, for example
3272 @example
3273 host2       opts:=ro,nosuid,soft
3274 @end example
3276 @noindent
3277 would soft mount @samp{host2} read-only.
3279 @c ----------------------------------------------------------------
3280 @node Network Filesystem Group, Unix Filesystem, Network Host Filesystem, Filesystem Types
3281 @comment  node-name,  next,  previous,  up
3282 @section Network Filesystem Group (@samp{nfsx})
3283 @cindex Network filesystem group
3284 @cindex Atomic NFS mounts
3285 @cindex Mounting an atomic group of NFS filesystems
3286 @cindex How to mount an atomic group of NFS filesystems
3287 @cindex nfsx, filesystem type
3288 @cindex Filesystem type; nfsx
3290 The @dfn{nfsx} (@samp{type:=nfsx}) filesystem allows a group of filesystems to be mounted
3291 from a single NFS server.  The implementation is layered above the
3292 @samp{nfs} implementation so keep-alives work in the same way.
3294 The options are the same as for the @samp{nfs} filesystem with one
3295 difference.
3297 @noindent
3298 The following options must be specified:
3300 @table @code
3301 @item rhost
3302 the remote fileserver.  This must be an entry in the hosts database.  IP
3303 addresses are not accepted.  The default value is taken from the local
3304 host name (@code{$@{host@}}) if no other value is specified.
3306 @item rfs
3307 as a list of filesystems to mount.  The list is in the form of a comma
3308 separated strings.
3309 @end table
3311 @noindent
3312 For example:
3314 @example
3315 pub  type:=nfsx;rhost:=gould;\
3316      rfs:=/public,/,graphics,usenet;fs:=$@{autodir@}/$@{rhost@}/root
3317 @end example
3319 The first string defines the root of the tree, and is applied as a
3320 prefix to the remaining members of the list which define the individual
3321 filesystems.  The first string is @emph{not} used as a filesystem name.
3322 A parallel operation is used to determine the local mount points to
3323 ensure a consistent layout of a tree of mounts.
3325 Here, the @emph{three} filesystems, @samp{/public},
3326 @samp{/public/graphics} and @samp{/public/usenet}, would be mounted.@refill
3328 A local mount point, @code{$@{fs@}}, @emph{must} be specified.  The
3329 default local mount point will not work correctly in the general case.
3330 A suggestion is to use @samp{fs:=$@{autodir@}/$@{rhost@}/root}.@refill
3332 @c ----------------------------------------------------------------
3333 @node Unix Filesystem, Caching Filesystem, Network Filesystem Group, Filesystem Types
3334 @comment  node-name,  next,  previous,  up
3335 @section Unix Filesystem (@samp{ufs}, @samp{xfs}, or @samp{efs})
3336 @cindex Unix filesystem
3337 @cindex UFS
3338 @cindex XFS
3339 @cindex EFS
3340 @cindex Mounting a UFS filesystem
3341 @cindex Mounting a local disk
3342 @cindex How to mount a UFS filesystems
3343 @cindex How to mount a local disk
3344 @cindex Disk filesystems
3345 @cindex ufs, filesystem type
3346 @cindex Filesystem type; ufs
3347 @cindex xfs, filesystem type
3348 @cindex Filesystem type; xfs
3349 @cindex efs, filesystem type
3350 @cindex Filesystem type; efs
3352 The @dfn{ufs} (@samp{type:=ufs}) filesystem type provides access to the system's standard
3353 disk filesystem---usually a derivative of the Berkeley Fast Filesystem.
3355 @noindent
3356 The following option must be specified:
3358 @table @code
3359 @cindex dev, mount option
3360 @cindex Mount option; dev
3361 @item dev
3362 the block special device to be mounted.
3363 @end table
3365 A UFS entry might be:
3367 @example
3368 jsp   host==charm;type:=ufs;dev:=/dev/sd0d;sublink:=jsp
3369 @end example
3371 UFS is the default Unix disk-based file system, which Am-utils picks up
3372 during the autoconfiguration phase.  Some systems have more than one
3373 type, such as IRIX, that comes with EFS (Extent File System) and XFS
3374 (Extended File System).  In those cases, you may explicitly set the file
3375 system type, by using entries such:
3377 @example
3378 ez1   type:=efs;dev:=/dev/xd0a
3379 ez2   type:=xfs;dev:=/dev/sd3c
3380 @end example
3382 @c ----------------------------------------------------------------
3383 @node Caching Filesystem, CD-ROM Filesystem, Unix Filesystem, Filesystem Types
3384 @comment  node-name,  next,  previous,  up
3385 @section Caching Filesystem (@samp{cachefs})
3386 @cindex Caching Filesystem
3387 @cindex cachefs, filesystem type
3388 @cindex Filesystem type; cachefs
3390 The @dfn{cachefs} (@samp{type:=cachefs}) filesystem caches files from
3391 one location onto another, presumably providing faster access.  It is
3392 particularly useful to cache from a larger and remote (slower) NFS
3393 partition to a smaller and local (faster) UFS directory.
3395 @noindent
3396 The following options must be specified:
3398 @table @code
3399 @cindex cachedir, mount option
3400 @cindex Mount option; cachedir
3401 @item cachedir
3402 the directory where the cache is stored.
3403 @item rfs
3404 the path name to the ``back file system'' to be cached from.
3405 @item fs
3406 the ``front file system'' mount point to the cached files, where @i{Amd}
3407 will set a symbolic link pointing to.
3408 @end table
3410 A CacheFS entry for, say, the @file{/import} @i{Amd} mount point, might
3413 @example
3414 copt  type:=cachefs;cachedir:=/cache;rfs:=/import/opt;fs:=/n/import/copt
3415 @end example
3417 Access to the pathname @file{/import/copt} will follow a symbolic link
3418 to @file{/n/import/copt}.  The latter is the mount point for a caching
3419 file system, that caches from @file{/import/opt} to @file{/cache}.
3421 @b{Caveats}:
3422 @enumerate
3423 @item This file system is currently only implemented for Solaris 2.x!
3424 @item Before being used for the first time, the cache directory @i{must} be
3425 initialized with @samp{cfsadmin -c @var{cachedir}}.  See the manual page for
3426 @b{cfsadmin}(1M) for more information.
3427 @item The ``back file system'' mounted must be a complete file system, not
3428 a subdirectory thereof; otherwise you will get an error ``Invalid Argument''.
3429 @item If @i{Amd} aborts abnormally, the state of the cache may be
3430 inconsistent, requiring running the command @file{fsck -F cachefs
3431 @var{cachedir}}.  Otherwise you will get the error ``No Space Left on Device''.
3432 @end enumerate
3434 @c ----------------------------------------------------------------
3435 @node CD-ROM Filesystem, Loopback Filesystem, Caching Filesystem, Filesystem Types
3436 @comment  node-name,  next,  previous,  up
3437 @section CD-ROM Filesystem (@samp{cdfs})
3438 @cindex CD-ROM Filesystem
3439 @cindex cdfs, filesystem type
3440 @cindex Filesystem type; cdfs
3442 The @dfn{cdfs} (@samp{type:=cdfs}) filesystem mounts a CD-ROM with an
3443 ISO9660 format filesystem on it.
3445 @noindent
3446 The following option must be specified:
3448 @table @code
3449 @cindex dev, mount option
3450 @cindex Mount option; dev
3451 @item dev
3452 the block special device to be mounted.
3453 @end table
3455 Some operating systems will fail to mount read-only CDs unless the
3456 @samp{ro} option is specified.  A cdfs entry might be:
3458 @example
3459 cdfs      os==sunos4;type:=cdfs;dev:=/dev/sr0 \
3460           os==sunos5;addopts:=ro;type:=cdfs;dev:=/dev/dsk/c0t6d0s2
3461 @end example
3463 @c ----------------------------------------------------------------
3464 @node Loopback Filesystem, Memory/RAM Filesystem, CD-ROM Filesystem, Filesystem Types
3465 @comment  node-name,  next,  previous,  up
3466 @section Loopback Filesystem (@samp{lofs})
3467 @cindex Loopback Filesystem
3468 @cindex lofs, filesystem type
3469 @cindex Filesystem type; lofs
3471 The @dfn{lofs} (@samp{type:=lofs}) filesystem is also called the
3472 loopback filesystem.  It mounts a local directory on another, thus
3473 providing mount-time binding to another location (unlike symbolic
3474 links).
3476 The loopback filesystem is particularly useful within the context of a
3477 chroot-ed directory (via @b{chroot}(2)), to provide access to
3478 directories otherwise inaccessible.
3480 @noindent
3481 The following option must be specified:
3483 @table @code
3484 @cindex rfs, mount option
3485 @cindex Mount option; rfs
3486 @item rfs
3487 the pathname to be mounted on top of @code{$@{fs@}}.
3488 @end table
3490 Usually, the FTP server runs in a chroot-ed environment, for security
3491 reasons.  In this example, lofs is used to provide a subdirectory within
3492 a user's home directory, also available for public ftp.
3494 @example
3495 lofs      type:=lofs;rfs:=/home/ezk/myftpdir;fs:=/usr/ftp/pub/ezk
3496 @end example
3498 @c ----------------------------------------------------------------
3499 @node Memory/RAM Filesystem, Null Filesystem, Loopback Filesystem, Filesystem Types
3500 @comment  node-name,  next,  previous,  up
3501 @section Memory/RAM Filesystem (@samp{mfs})
3502 @cindex Memory/RAM Filesystem
3503 @cindex mfs, filesystem type
3504 @cindex Filesystem type; mfs
3506 The @dfn{mfs} (@samp{type:=mfs}) filesystem is available in 4.4BSD,
3507 Linux, and other systems.  It creates a filesystem in a portion of the
3508 system's memory, thus providing very fast file (volatile) access.
3510 XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3512 @c ----------------------------------------------------------------
3513 @node Null Filesystem, Floppy Filesystem, Memory/RAM Filesystem, Filesystem Types
3514 @comment  node-name,  next,  previous,  up
3515 @section Null Filesystem (@samp{nullfs})
3516 @cindex Null Filesystem
3517 @cindex nullfs, filesystem type
3518 @cindex Filesystem type; nullfs
3520 The @dfn{nullfs} (@samp{type:=nullfs}) filesystem is available from 4.4BSD,
3521 and is very similar to the loopback filesystem, @dfn{lofs}.
3523 XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3525 @c ----------------------------------------------------------------
3526 @node Floppy Filesystem, Translucent Filesystem, Null Filesystem, Filesystem Types
3527 @comment  node-name,  next,  previous,  up
3528 @section Floppy Filesystem (@samp{pcfs})
3529 @cindex Floppy Filesystem
3530 @cindex pcfs, filesystem type
3531 @cindex Filesystem type; pcfs
3533 The @dfn{pcfs} (@samp{type:=pcfs}) filesystem mounts a floppy previously
3534 formatted for the MS-DOS format.
3536 @noindent
3537 The following option must be specified:
3539 @table @code
3540 @cindex dev, mount option
3541 @cindex Mount option; dev
3542 @item dev
3543 the block special device to be mounted.
3544 @end table
3546 A pcfs entry might be:
3548 @example
3549 pcfs      os==sunos4;type:=pcfs;dev:=/dev/fd0 \
3550           os==sunos5;type:=pcfs;dev:=/dev/diskette
3551 @end example
3553 @c ----------------------------------------------------------------
3554 @node Translucent Filesystem, Shared Memory+Swap Filesystem, Floppy Filesystem, Filesystem Types
3555 @comment  node-name,  next,  previous,  up
3556 @section Translucent Filesystem (@samp{tfs})
3557 @cindex Translucent Filesystem
3558 @cindex tfs, filesystem type
3559 @cindex Filesystem type; tfs
3561 The @dfn{tfs} (@samp{type:=tfs}) filesystem is an older version of the
3562 4.4BSD @dfn{unionfs}.
3564 XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3566 @c ----------------------------------------------------------------
3567 @node Shared Memory+Swap Filesystem, User ID Mapping Filesystem, Translucent Filesystem, Filesystem Types
3568 @comment  node-name,  next,  previous,  up
3569 @section Shared Memory+Swap Filesystem (@samp{tmpfs})
3570 @cindex Shared Memory and Swap Filesystem
3571 @cindex tmpfs, filesystem type
3572 @cindex Filesystem type; tmpfs
3574 The @dfn{tmpfs} (@samp{type:=tmpfs}) filesystem shares memory between a
3575 the swap device and the rest of the system.  It is generally used to
3576 provide a fast access @file{/tmp} directory, one that uses memory that
3577 is otherwise unused.  This filesystem is available in SunOS 4.x and 5.x.
3579 XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3581 @c ----------------------------------------------------------------
3582 @node User ID Mapping Filesystem, Program Filesystem, Shared Memory+Swap Filesystem, Filesystem Types
3583 @comment  node-name,  next,  previous,  up
3584 @section User ID Mapping Filesystem (@samp{umapfs})
3585 @cindex User ID Mapping Filesystem
3586 @cindex umapfs, filesystem type
3587 @cindex Filesystem type; umapfs
3589 The @dfn{umapfs} (@samp{type:=umapfs}) filesystem maps User IDs of file
3590 ownership, and is available from 4.4BSD.
3592 XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3594 @c ----------------------------------------------------------------
3595 @node Program Filesystem, Symbolic Link Filesystem, User ID Mapping Filesystem, Filesystem Types
3596 @comment  node-name,  next,  previous,  up
3597 @section Program Filesystem (@samp{program})
3598 @cindex Program filesystem
3599 @cindex Mount a filesystem under program control
3600 @cindex program, filesystem type
3601 @cindex Filesystem type; program
3603 The @dfn{program} (@samp{type:=program}) filesystem type allows a
3604 program to be run whenever a mount or unmount is required.  This allows
3605 easy addition of support for other filesystem types, such as MIT's
3606 Remote Virtual Disk (RVD) which has a programmatic interface via the
3607 commands @samp{rvdmount} and @samp{rvdunmount}.
3609 @noindent
3610 The following options must be specified:
3612 @table @code
3613 @cindex mount, mount option
3614 @cindex Mount option; mount
3615 @item mount
3616 the program which will perform the mount.
3618 @cindex unmount, mount option
3619 @cindex Mount option; unmount
3620 @item unmount
3621 the program which will perform the unmount.
3622 @end table
3624 The exit code from these two programs is interpreted as a Unix error
3625 code.  As usual, exit code zero indicates success.  To execute the
3626 program @i{Amd} splits the string on whitespace to create an array of
3627 substrings.  Single quotes @samp{'} can be used to quote whitespace
3628 if that is required in an argument.  There is no way to escape or change
3629 the quote character.
3631 To run the program @samp{rvdmount} with a host name and filesystem as
3632 arguments would be specified by
3633 @samp{fs:=$@{autodir@}$@{path@};mount:="/etc/rvdmount rvdmount fserver
3634 $@{fs@}"}.
3636 The first element in the array is taken as the pathname of the program
3637 to execute.  The other members of the array form the argument vector to
3638 be passed to the program, @dfn{including argument zero}.  This means
3639 that the split string must have at least two elements.  The program is
3640 directly executed by @i{Amd}, not via a shell.  This means that scripts
3641 must begin with a @code{#!} interpreter specification.
3643 If a filesystem type is to be heavily used, it may be worthwhile adding
3644 a new filesystem type into @i{Amd}, but for most uses the program
3645 filesystem should suffice.
3647 When the program is run, standard input and standard error are inherited
3648 from the current values used by @i{Amd}.  Standard output is a
3649 duplicate of standard error.  The value specified with the @code{-l}
3650 command line option has no effect on standard error.
3652 @c ----------------------------------------------------------------
3653 @node Symbolic Link Filesystem, Symbolic Link Filesystem II, Program Filesystem, Filesystem Types
3654 @comment  node-name,  next,  previous,  up
3655 @section Symbolic Link Filesystem (@samp{link})
3656 @cindex Symbolic link filesystem
3657 @cindex Referencing part of the local name space
3658 @cindex Mounting part of the local name space
3659 @cindex How to reference part of the local name space
3660 @cindex link, filesystem type
3661 @cindex symlink, link filesystem type
3662 @cindex Filesystem type; link
3664 Each filesystem type creates a symbolic link to point from the volume
3665 name to the physical mount point.  The @samp{link} filesystem does the
3666 same without any other side effects.  This allows any part of the
3667 machines name space to be accessed via @i{Amd}.
3669 One common use for the symlink filesystem is @file{/homes} which can be
3670 made to contain an entry for each user which points to their
3671 (auto-mounted) home directory.  Although this may seem rather expensive,
3672 it provides a great deal of administrative flexibility.
3674 @noindent
3675 The following option must be defined:
3677 @table @code
3678 @item fs
3679 The value of @var{fs} option specifies the destination of the link, as
3680 modified by the @var{sublink} option.  If @var{sublink} is non-null, it
3681 is appended to @code{$@{fs@}}@code{/} and the resulting string is used
3682 as the target.
3683 @end table
3685 The @samp{link} filesystem can be thought of as identical to the
3686 @samp{ufs} filesystem but without actually mounting anything.
3688 An example entry might be:
3690 @example
3691 jsp   host==charm;type:=link;fs:=/home/charm;sublink:=jsp
3692 @end example
3693 which would return a symbolic link pointing to @file{/home/charm/jsp}.
3695 @c ----------------------------------------------------------------
3696 @node Symbolic Link Filesystem II, NFS-Link Filesystem, Symbolic Link Filesystem, Filesystem Types
3697 @comment  node-name,  next,  previous,  up
3698 @section Symbolic Link Filesystem II (@samp{linkx})
3699 @cindex Symbolic link filesystem II
3700 @cindex Referencing an existing part of the local name space
3701 @cindex Mounting an existing part of the local name space
3702 @cindex How to reference an existing part of the local name space
3703 @cindex linkx, filesystem type
3704 @cindex symlink, linkx filesystem type
3705 @cindex Filesystem type; linkx
3707 The @dfn{linkx} (@samp{type:=linkx}) filesystem type is identical to @samp{link} with the
3708 exception that the target of the link must exist.  Existence is checked
3709 with the @b{lstat}(2) system call.
3711 The @samp{linkx} filesystem type is particularly useful for wildcard map
3712 entries.  In this case, a list of possible targets can be given and
3713 @i{Amd} will choose the first one which exists on the local machine.
3715 @c ----------------------------------------------------------------
3716 @node NFS-Link Filesystem, Automount Filesystem, Symbolic Link Filesystem II, Filesystem Types
3717 @comment  node-name,  next,  previous,  up
3718 @section NFS-Link Filesystem (@samp{nfsl})
3719 @cindex NFS-Link filesystem II
3720 @cindex Referencing an existing part of the name space if target exists
3721 @cindex Mounting a remote part of the name space if target is missing
3722 @cindex Symlink if target exists, NFS otherwise
3723 @cindex nfsl, filesystem type
3724 @cindex symlink, nfsl filesystem type
3725 @cindex Filesystem type; nfsl
3727 The @dfn{nfsl} (@samp{type:=nfsl}) filesystem type is a combination of two others:
3728 @samp{link} and @samp{nfs}.  If the local host name is equal to the
3729 value of @code{$@{rhost@}}, or if the target pathname listed in
3730 @code{$@{fs@}} exists, @samp{nfsl} will behave exactly as
3731 @samp{type:=link}, and refer to the target as a symbolic link.  If the
3732 local host name is not equal to the value of @code{$@{rhost@}}, or if
3733 the target of the link does not exist, @i{Amd} will treat it as
3734 @samp{type:=nfs}, and will mount a remote pathname for it.
3736 The @samp{nfsl} filesystem type is particularly useful as a shorthand
3737 for the more cumbersome and yet one of the most popular @i{Amd}
3738 entries.  For example, you can simplify all map entries that look like:
3740 @example
3741 zing    -fs:=/n/shekel/u/zing \
3742         host!=shekel;type:=nfs;rhost:=shekel;rfs:=$@{fs@} \
3743         host==shekel;type:=link
3744 @end example
3748 @example
3749 zing    -fs:=/n/shekel/u/zing \
3750         exists($@{fs@});type:=link \
3751         !exists($@{fs@});type:=nfs;rhost:=shekel;rfs:=$@{fs@}
3752 @end example
3754 into a shorter form
3756 @example
3757 zing    type:=nfsl;fs:=/n/shekel/u/zing;rhost:=shekel;rfs:=$@{fs@}
3758 @end example
3760 Not just does it make the maps smaller and simpler, but it avoids
3761 possible mistakes that often happen when forgetting to set up the two
3762 entries (one for @samp{type:=nfs} and the other for @samp{type:=link})
3763 necessary to perform transparent mounts of existing or remote mounts.
3765 @c ----------------------------------------------------------------
3766 @node Automount Filesystem, Direct Automount Filesystem, NFS-Link Filesystem, Filesystem Types
3767 @comment  node-name,  next,  previous,  up
3768 @section Automount Filesystem (@samp{auto})
3769 @cindex Automount filesystem
3770 @cindex Map cache types
3771 @cindex Setting map cache parameters
3772 @cindex How to set map cache parameters
3773 @cindex How to start an indirect automount point
3774 @cindex auto, filesystem type
3775 @cindex Filesystem type; auto
3776 @cindex SIGHUP signal
3777 @cindex Map cache synchronizing
3778 @cindex Synchronizing the map cache
3779 @cindex Map cache options
3780 @cindex Regular expressions in maps
3782 The @dfn{auto} (@samp{type:=auto}) filesystem type creates a new automount point below an
3783 existing automount point.  Top-level automount points appear as system
3784 mount points.  An automount mount point can also appear as a
3785 sub-directory of an existing automount point.  This allows some
3786 additional structure to be added, for example to mimic the mount tree of
3787 another machine.
3789 The following options may be specified:
3791 @table @code
3792 @cindex cache, mount map option
3793 @cindex Mount map option; cache
3794 @item cache
3795 specifies whether the data in this mount-map should be
3796 cached.  The default value is @samp{none}, in which case
3797 no caching is done in order to conserve memory.
3799 However, better performance and reliability can be obtained by caching
3800 some or all of a mount-map.
3802 If the cache option specifies @samp{all},
3803 the entire map is enumerated when the mount point is created.
3805 If the cache option specifies @samp{inc}, caching is done incrementally
3806 as and when data is required.
3807 Some map types do not support cache mode @samp{all}, in which case @samp{inc}
3808 is used whenever @samp{all} is requested.
3810 Caching can be entirely disabled by using cache mode @samp{none}.
3812 If the cache option specifies @samp{regexp} then the entire map will be
3813 enumerated and each key will be treated as an egrep-style regular
3814 expression.  The order in which a cached map is searched does not
3815 correspond to the ordering in the source map so the regular expressions
3816 should be mutually exclusive to avoid confusion.
3818 Each mount map type has a default cache type, usually @samp{inc}, which
3819 can be selected by specifying @samp{mapdefault}.
3821 The cache mode for a mount map can only be selected on the command line.
3822 Starting @i{Amd} with the command:
3824 @example
3825 amd /homes hesiod.homes -cache:=inc
3826 @end example
3828 will cause @samp{/homes} to be automounted using the @dfn{Hesiod} name
3829 server with local incremental caching of all successfully resolved names.
3831 All cached data is forgotten whenever @i{Amd} receives a @samp{SIGHUP}
3832 signal and, if cache @samp{all} mode was selected, the cache will be
3833 reloaded.  This can be used to inform @i{Amd} that a map has been
3834 updated.  In addition, whenever a cache lookup fails and @i{Amd} needs
3835 to examine a map, the map's modify time is examined.  If the cache is
3836 out of date with respect to the map then it is flushed as if a
3837 @samp{SIGHUP} had been received.
3839 An additional option (@samp{sync}) may be specified to force @i{Amd} to
3840 check the map's modify time whenever a cached entry is being used.  For
3841 example, an incremental, synchronized cache would be created by the
3842 following command:
3844 @example
3845 amd /homes hesiod.homes -cache:=inc,sync
3846 @end example
3848 @item fs
3849 specifies the name of the mount map to use for the new mount point.
3851 Arguably this should have been specified with the @code{$@{rfs@}} option but
3852 we are now stuck with it due to historical accident.
3854 @c %If the string @samp{.} is used then the same map is used;
3855 @c %in addition the lookup prefix is set to the name of the mount point followed
3856 @c %by a slash @samp{/}.
3857 @c %This is the same as specifying @samp{fs:=\$@{map@};pref:=\$@{key@}/}.
3860 @item pref
3861 alters the name that is looked up in the mount map.  If
3862 @code{$@{pref@}}, the @dfn{prefix}, is non-null then it is prepended to
3863 the name requested by the kernel @dfn{before} the map is searched.
3864 @end table
3866 The server @samp{dylan.doc.ic.ac.uk} has two user disks:
3867 @samp{/dev/dsk/2s0} and @samp{/dev/dsk/5s0}.  These are accessed as
3868 @samp{/home/dylan/dk2} and @samp{/home/dylan/dk5} respectively.  Since
3869 @samp{/home} is already an automount point, this naming is achieved with
3870 the following map entries:@refill
3872 @example
3873 dylan        type:=auto;fs:=$@{map@};pref:=$@{key@}/
3874 dylan/dk2    type:=ufs;dev:=/dev/dsk/2s0
3875 dylan/dk5    type:=ufs;dev:=/dev/dsk/5s0
3876 @end example
3878 @c ----------------------------------------------------------------
3879 @node Direct Automount Filesystem, Union Filesystem, Automount Filesystem, Filesystem Types
3880 @comment  node-name,  next,  previous,  up
3881 @section Direct Automount Filesystem (@samp{direct})
3882 @cindex Direct automount filesystem
3883 @cindex How to start a direct automount point
3884 @cindex direct, filesystem type
3885 @cindex Filesystem type; direct
3887 The @dfn{direct} (@samp{type:=direct}) filesystem is almost identical to
3888 the automount filesystem.  Instead of appearing to be a directory of
3889 mount points, it appears as a symbolic link to a mounted filesystem.
3890 The mount is done at the time the link is accessed.  @xref{Automount
3891 Filesystem}, for a list of required options.
3893 Direct automount points are created by specifying the @samp{direct}
3894 filesystem type on the command line:
3896 @example
3897 amd ... /usr/man auto.direct -type:=direct
3898 @end example
3900 where @samp{auto.direct} would contain an entry such as:
3902 @example
3903 usr/man    -type:=nfs;rfs:=/usr/man \
3904            rhost:=man-server1  rhost:=man-server2
3905 @end example
3907 In this example, @samp{man-server1} and @samp{man-server2} are file
3908 servers which export copies of the manual pages.  Note that the key
3909 which is looked up is the name of the automount point without the
3910 leading @samp{/}.
3912 @c ----------------------------------------------------------------
3913 @node Union Filesystem, Error Filesystem, Direct Automount Filesystem, Filesystem Types
3914 @comment  node-name,  next,  previous,  up
3915 @section Union Filesystem (@samp{union})
3916 @cindex Union filesystem
3917 @cindex union, filesystem type
3918 @cindex Filesystem type; union
3920 The @dfn{union} (@samp{type:=union}) filesystem type allows the contents of several
3921 directories to be merged and made visible in a single directory.  This
3922 can be used to overcome one of the major limitations of the Unix mount
3923 mechanism which only allows complete directories to be mounted.
3925 For example, supposing @file{/tmp} and @file{/var/tmp} were to be merged
3926 into a new directory called @file{/mtmp}, with files in @file{/var/tmp}
3927 taking precedence.  The following command could be used to achieve this
3928 effect:
3930 @example
3931 amd ... /mtmp union:/tmp:/var/tmp -type:=union
3932 @end example
3934 Currently, the unioned directories must @emph{not} be automounted.  That
3935 would cause a deadlock.  This seriously limits the current usefulness of
3936 this filesystem type and the problem will be addressed in a future
3937 release of @i{Amd}.
3939 Files created in the union directory are actually created in the last
3940 named directory.  This is done by creating a wildcard entry which points
3941 to the correct directory.  The wildcard entry is visible if the union
3942 directory is listed, so allowing you to see which directory has
3943 priority.
3945 The files visible in the union directory are computed at the time
3946 @i{Amd} is started, and are not kept up-to-date with respect to the
3947 underlying directories.  Similarly, if a link is removed, for example
3948 with the @samp{rm} command, it will be lost forever.
3950 @c ----------------------------------------------------------------
3951 @node Error Filesystem, Top-level Filesystem, Union Filesystem, Filesystem Types
3952 @comment  node-name,  next,  previous,  up
3953 @section Error Filesystem (@samp{error})
3954 @cindex Error filesystem
3955 @cindex error, filesystem type
3956 @cindex Filesystem type; error
3958 The @dfn{error} (@samp{type:=error}) filesystem type is used internally as a catch-all in the
3959 case where none of the other filesystems was selected, or some other
3960 error occurred.  Lookups and mounts always fail with ``No such file or
3961 directory''.  All other operations trivially succeed.
3963 The error filesystem is not directly accessible.
3965 @c ----------------------------------------------------------------
3966 @node Top-level Filesystem, Autofs Filesystem, Error Filesystem, Filesystem Types
3967 @comment  node-name,  next,  previous,  up
3968 @section Top-level Filesystem (@samp{toplvl})
3969 @cindex Top level filesystem
3970 @cindex toplvl, filesystem type
3971 @cindex Filesystem type; toplvl
3973 The @dfn{toplvl} (@samp{type:=toplvl}) filesystems is derived from the @samp{auto} filesystem
3974 and is used to mount the top-level automount nodes.  Requests of this
3975 type are automatically generated from the command line arguments and can
3976 also be passed in by using the @code{-M} option of the @dfn{Amq} command.
3977 That option is insecure, and is unavailable unless am-utils was
3978 configured with @samp{--with-amq-mount}.
3980 @c ----------------------------------------------------------------
3981 @node Root Filesystem, Inheritance Filesystem, Autofs Filesystem, Filesystem Types
3982 @comment  node-name,  next,  previous,  up
3983 @section Root Filesystem (@samp{root})
3984 @cindex Root filesystem
3985 @cindex root, filesystem type
3986 @cindex Filesystem type; root
3988 The @dfn{root} (@samp{type:=root}) filesystem type acts as an internal
3989 placeholder onto which @i{Amd} can pin @samp{toplvl} mounts.  Only one
3990 node of this type need ever exist and one is created automatically
3991 during startup.  The effect of having more than one root node is
3992 undefined.
3994 The root filesystem is not directly accessible.
3996 @c ----------------------------------------------------------------
3997 @node Autofs Filesystem, Root Filesystem, Top-level Filesystem, Filesystem Types
3998 @comment  node-name,  next,  previous,  up
3999 @section Autofs Filesystem (@samp{autofs})
4000 @cindex Autofs filesystem
4001 @cindex autofs, filesystem type
4002 @cindex Filesystem type; autofs
4004 The @dfn{autofs} (@samp{type:=autofs}) filesystem uses Sun's kernel-based automounter
4005 supporting filesystem for @i{Amd}'s mount points.  Hence it is another
4006 type of top level filesystem.
4008 The autofs filesystem is not directly accessible from @i{Amd} maps, but
4009 only from the @file{amd.conf} file (@pxref{mount_type Parameter}).
4011 Note that Autofs support is still very early.  See the distribution file
4012 @file{README.autofs} for detail of what works and what does not.
4014 @c ----------------------------------------------------------------
4015 @node Inheritance Filesystem, , Root Filesystem, Filesystem Types
4016 @comment  node-name,  next,  previous,  up
4017 @section Inheritance Filesystem (@samp{inherit})
4018 @cindex Inheritance filesystem
4019 @cindex Nodes generated on a restart
4020 @cindex inherit, filesystem type
4021 @cindex Filesystem type; inherit
4023 The @dfn{inheritance} (@samp{type:=inherit}) filesystem is not directly
4024 accessible.  Instead, internal mount nodes of this type are
4025 automatically generated when @i{Amd} is started with the @code{-r} option.
4026 At this time the system mount table is scanned to locate any filesystems
4027 which are already mounted.  If any reference to these filesystems is
4028 made through @i{Amd} then instead of attempting to mount it, @i{Amd}
4029 simulates the mount and @dfn{inherits} the filesystem.  This allows a
4030 new version of @i{Amd} to be installed on a live system simply by
4031 killing the old daemon with @samp{SIGTERM} and starting the new one.@refill
4033 This filesystem type is not generally visible externally, but it is
4034 possible that the output from @samp{amq -m} may list @samp{inherit} as
4035 the filesystem type.  This happens when an inherit operation cannot
4036 be completed for some reason, usually because a fileserver is down.
4038 @c ################################################################
4039 @node Amd Configuration File, Run-time Administration, Filesystem Types, Top
4040 @comment  node-name,  next,  previous,  up
4041 @chapter Amd Configuration File
4042 @cindex  Amd Configuration File
4043 @cindex amd.conf
4045 The @samp{amd.conf} file is the configuration file for @i{Amd}, as part
4046 of the am-utils suite.  This file contains runtime configuration
4047 information for the @i{Amd} automounter program.
4049 @menu
4050 * File Format::
4051 * The Global Section::
4052 * Regular Map Sections::
4053 * Common Parameters::
4054 * Global Parameters::
4055 * Regular Map Parameters::
4056 * amd.conf Examples::
4057 @end menu
4059 @c ================================================================
4060 @node File Format, The Global Section, Amd Configuration File, Amd Configuration File
4061 @comment  node-name,  next,  previous,  up
4062 @section File Format
4063 @cindex amd.conf file format
4065 The @samp{amd.conf} file consists of sections and parameters.  A section
4066 begins with the name of the section in square brackets @samp{[]} and
4067 continues until the next section begins or the end of the file is reached.
4068 Sections contain parameters of the form @samp{name = value}.
4070 The file is line-based --- that is, each newline-terminated line
4071 represents either a comment, a section name or a parameter.  No
4072 line-continuation syntax is available.
4074 Section names, parameter names and their values are case sensitive.
4076 Only the first equals sign in a parameter is significant.  Whitespace
4077 before or after the first equals sign is discarded.  Leading, trailing
4078 and internal whitespace in section and parameter names is irrelevant.
4079 Leading and trailing whitespace in a parameter value is discarded.
4080 Internal whitespace within a parameter value is not allowed, unless the
4081 whole parameter value is quoted with double quotes as in @samp{name =
4082 "some value"}.
4084 Any line beginning with a pound sign @samp{#} is ignored, as are lines
4085 containing only whitespace.
4087 The values following the equals sign in parameters are all either a
4088 string (no quotes needed if string does not include spaces) or a
4089 boolean, which may be given as @samp{yes}/@samp{no}.  Case is significant in all
4090 values.  Some items such as cache timeouts are numeric.
4092 @c ================================================================
4093 @node The Global Section, Regular Map Sections, File Format, Amd Configuration File
4094 @comment  node-name,  next,  previous,  up
4095 @section The Global Section
4096 @cindex amd.conf global section
4098 The global section must be specified as @samp{[global]}.  Parameters in
4099 this section either apply to @i{Amd} as a whole, or to all other regular map
4100 sections which follow.  There should be only one global section defined
4101 in one configuration file.
4103 It is highly recommended that this section be specified first in the
4104 configuration file.  If it is not, then regular map sections which
4105 precede it will not use global values defined later.
4107 @c ================================================================
4108 @node Regular Map Sections, Common Parameters, The Global Section, Amd Configuration File
4109 @comment  node-name,  next,  previous,  up
4110 @section Regular Map Sections
4111 @cindex amd.conf regular map sections
4113 Parameters in regular (non-global) sections apply to a single map entry.
4114 For example, if the map section @samp{[/homes]} is defined, then all
4115 parameters following it will be applied to the @file{/homes}
4116 @i{Amd}-managed mount point.
4118 @c ================================================================
4119 @node Common Parameters, Global Parameters, Regular Map Sections, Amd Configuration File
4120 @comment  node-name,  next,  previous,  up
4121 @section Common Parameters
4122 @cindex amd.conf common parameters
4124 These parameters can be specified either in the global or a map-specific
4125 section.  Entries specified in a map-specific section override the default
4126 value or one defined in the global section.   If such a common parameter is
4127 specified only in the global section, it is applicable to all regular map
4128 sections that follow.
4130 @menu
4131 * browsable_dirs Parameter::
4132 * map_options Parameter::
4133 * map_type Parameter::
4134 * mount_type Parameter::
4135 * search_path Parameter::
4136 @end menu
4138 @c ----------------------------------------------------------------
4139 @node browsable_dirs Parameter, map_options Parameter, Common Parameters, Common Parameters
4140 @comment  node-name,  next,  previous,  up
4141 @subsection @t{browsable_dirs} Parameter
4142 @cindex browsable_dirs Parameter
4144 (type=string, default=@samp{no}).  If @samp{yes}, then @i{Amd}'s top-level
4145 mount points will be browsable to @b{readdir}(3) calls.  This means you
4146 could run for example @b{ls}(1) and see what keys are available to mount
4147 in that directory.  Not all entries are made visible to @b{readdir}(3):
4148 the @samp{/defaults} entry, wildcard entries, and those with a @file{/}
4149 in them are not included.  If you specify @samp{full} to this option,
4150 all but the @samp{/defaults} entry will be visible.  Note that if you run
4151 a command which will attempt to @b{stat}(2) the entries, such as often
4152 done by @samp{ls -l} or @samp{ls -F}, @i{Amd} will attempt to mount
4153 @i{every} entry in that map.  This is often called a ``mount storm''.
4155 @c ----------------------------------------------------------------
4156 @node map_options Parameter, map_type Parameter, browsable_dirs Parameter, Common Parameters
4157 @comment  node-name,  next,  previous,  up
4158 @subsection @t{map_options} Parameter
4159 @cindex map_options Parameter
4161 (type=string, default no options).  This option is the same as
4162 specifying map options on the command line to @i{Amd}, such as
4163 @samp{cache:=all}.
4165 @c ----------------------------------------------------------------
4166 @node map_type Parameter, mount_type Parameter, map_options Parameter, Common Parameters
4167 @comment  node-name,  next,  previous,  up
4168 @subsection @t{map_type} Parameter
4169 @cindex map_type Parameter
4171 (type=string, default search all map types).  If specified, @i{Amd} will
4172 initialize the map only for the type given.  This is useful to avoid the
4173 default map search type used by @i{Amd} which takes longer and can have
4174 undesired side-effects such as initializing NIS even if not used.
4175 Possible values are
4177 @table @samp
4178 @item file
4179 plain files
4180 @item hesiod
4181 Hesiod name service from MIT
4182 @item ldap
4183 Lightweight Directory Access Protocol
4184 @item ndbm
4185 (New) dbm style hash files
4186 @item nis
4187 Network Information Services (version 2)
4188 @item nisplus
4189 Network Information Services Plus (version 3)
4190 @item passwd
4191 local password files
4192 @item union
4193 union maps
4194 @end table
4196 @c ----------------------------------------------------------------
4197 @node mount_type Parameter, search_path Parameter, map_type Parameter, Common Parameters
4198 @comment  node-name,  next,  previous,  up
4199 @subsection @t{mount_type} Parameter
4200 @cindex mount_type Parameter
4202 (type=string, default=@samp{nfs}).  All @i{Amd} mount types default to NFS.
4203 That is, @i{Amd} is an NFS server on the map mount points, for the local
4204 host it is running on.  If @samp{autofs} is specified, @i{Amd} will be
4205 an autofs server for those mount points.
4207 @c ----------------------------------------------------------------
4208 @node search_path Parameter, , mount_type Parameter, Common Parameters
4209 @comment  node-name,  next,  previous,  up
4210 @subsection @t{search_path} Parameter
4211 @cindex search_path Parameter
4213 (type=string, default no search path).  This provides a
4214 (colon-delimited) search path for file maps.  Using a search path,
4215 sites can allow for local map customizations and overrides, and can
4216 distributed maps in several locations as needed.
4218 @c ================================================================
4219 @node Global Parameters, Regular Map Parameters, Common Parameters, Amd Configuration File
4220 @comment  node-name,  next,  previous,  up
4221 @section Global Parameters
4222 @cindex amd.conf global parameters
4224 The following parameters are applicable to the @samp{[global]} section only.
4226 @menu
4227 * arch Parameter::    
4228 * auto_dir Parameter::
4229 * cache_duration Parameter::
4230 * cluster Parameter:: 
4231 * debug_options Parameter::
4232 * dismount_interval Parameter::
4233 * full_os Parameter::
4234 * fully_qualified_hosts Parameter::
4235 * hesiod_base Parameter::   
4236 * karch Parameter::   
4237 * ldap_base Parameter::
4238 * ldap_cache_maxmem Parameter::
4239 * ldap_cache_seconds Parameter::
4240 * ldap_hostports Parameter::
4241 * local_domain Parameter::
4242 * log_file Parameter::
4243 * log_options Parameter::
4244 * nfs_retransmit_counter Parameter::
4245 * nfs_retry_interval Parameter::
4246 * nis_domain Parameter::
4247 * normalize_hostnames Parameter::
4248 * os Parameter::      
4249 * osver Parameter::   
4250 * pid_file Parameter::
4251 * plock Parameter::   
4252 * portmap_program Parameter::
4253 * print_pid Parameter::
4254 * print_version Parameter::
4255 * restart_mounts Parameter::
4256 * selectors_on_default Parameter::
4257 * show_statfs_entries Parameter::
4258 * unmount_on_exit Parameter::
4259 * vendor Parameter::
4260 @end menu
4262 @c ----------------------------------------------------------------
4263 @node arch Parameter, auto_dir Parameter, Global Parameters, Global Parameters
4264 @comment  node-name,  next,  previous,  up
4265 @subsection @t{arch} Parameter
4266 @cindex arch Parameter
4268 (type=string, default to compiled in value).  Allows you to override the
4269 value of the @i{arch} @i{Amd} variable.
4271 @c ----------------------------------------------------------------
4272 @node auto_dir Parameter, cache_duration Parameter, arch Parameter, Global Parameters
4273 @comment  node-name,  next,  previous,  up
4274 @subsection @t{auto_dir} Parameter
4275 @cindex auto_dir Parameter
4277 (type=string, default=@samp{/a}).  Same as the @code{-a} option to @i{Amd}.
4278 This sets the private directory where @i{Amd} will create
4279 sub-directories for its real mount points.
4281 @c ----------------------------------------------------------------
4282 @node cache_duration Parameter, cluster Parameter, auto_dir Parameter, Global Parameters
4283 @comment  node-name,  next,  previous,  up
4284 @subsection @t{cache_duration} Parameter
4285 @cindex cache_duration Parameter
4287 (type=numeric, default=300).  Same as the @code{-c} option to
4288 @i{Amd}.  Sets the duration in seconds that looked up map entries remain
4289 in the cache.
4291 @c ----------------------------------------------------------------
4292 @node cluster Parameter, debug_options Parameter, cache_duration Parameter, Global Parameters
4293 @comment  node-name,  next,  previous,  up
4294 @subsection @t{cluster} Parameter
4295 @cindex cluster Parameter
4297 (type=string, default no cluster).  Same as the @code{-C} option to
4298 @i{Amd}.  Specifies the alternate HP-UX cluster to use.
4300 @c ----------------------------------------------------------------
4301 @node debug_options Parameter, dismount_interval Parameter, cluster Parameter, Global Parameters
4302 @comment  node-name,  next,  previous,  up
4303 @subsection @t{debug_options} Parameter
4304 @cindex debug_options Parameter
4306 (type=string, default no debug options).  Same as the @code{-D} option
4307 to @i{Amd}.  Specify any debugging options for @i{Amd}.  Works only if
4308 am-utils was configured for debugging using the @code{--enable-debug}
4309 option.  The @samp{mem} option, as well as all other options, can be
4310 turned on via @code{--enable-debug=mem}.  Otherwise debugging options
4311 are ignored.  Options are comma delimited, and can be preceded by the
4312 string @samp{no} to negate their meaning.  You can get the list of
4313 supported debugging and logging options by running @code{amd -H}.
4314 Possible values are:
4316 @table @samp
4317 @item all
4318 all options
4319 @item amq
4320 register for amq
4321 @item daemon
4322 enter daemon mode
4323 @item fork
4324 fork server
4325 @item full
4326 program trace
4327 @item mem
4328 trace memory allocations
4329 @item mtab
4330 use local @file{./mtab} file
4331 @item str
4332 debug string munging
4333 @item test
4334 full debug but no daemon
4335 @item trace
4336 trace RPC protocol and NFS mount arguments
4337 @end table
4339 @c ----------------------------------------------------------------
4340 @node dismount_interval Parameter, full_os Parameter, debug_options Parameter, Global Parameters
4341 @comment  node-name,  next,  previous,  up
4342 @subsection @t{dismount_interval} Parameter
4343 @cindex dismount_interval Parameter
4345 (type=numeric, default=120).  Same as the @code{-w} option to
4346 @i{Amd}.  Specify in seconds, the time between attempts to dismount file
4347 systems that have exceeded their cached times.
4349 @c ----------------------------------------------------------------
4350 @node full_os Parameter, fully_qualified_hosts Parameter, dismount_interval Parameter, Global Parameters
4351 @comment  node-name,  next,  previous,  up
4352 @subsection @t{full_os} Parameter
4353 @cindex full_os Parameter
4355 (type=string, default to compiled in value).  The full name of the
4356 operating system, along with its version.  Allows you to override the
4357 compiled-in full name and version of the operating system.  Useful when
4358 the compiled-in name is not desired.  For example, the full operating
4359 system name on linux comes up as @samp{linux}, but you can override it
4360 to @samp{linux-2.2.5}.
4362 @c ----------------------------------------------------------------
4363 @node fully_qualified_hosts Parameter, hesiod_base Parameter, full_os Parameter, Global Parameters
4364 @comment  node-name,  next,  previous,  up
4365 @subsection @t{fully_qualified_hosts} Parameter
4366 @cindex fully_qualified_hosts Parameter
4368 (type=string, default=@samp{no}).  If @samp{yes}, @i{Amd} will perform RPC
4369 authentication using fully-qualified host names.  This is necessary for
4370 some systems, and especially when performing cross-domain mounting.  For
4371 this function to work, the @i{Amd} variable @samp{$@{hostd@}} is used,
4372 requiring that @samp{$@{domain@}} not be null.
4374 @c ----------------------------------------------------------------
4375 @node hesiod_base Parameter, karch Parameter, fully_qualified_hosts Parameter, Global Parameters
4376 @comment  node-name,  next,  previous,  up
4377 @subsection @t{hesiod_base} Parameter
4378 @cindex hesiod_base Parameter
4380 (type=string, default=@samp{automount}).  Specify the base name for
4381 hesiod maps.
4383 @c ----------------------------------------------------------------
4384 @node karch Parameter, ldap_base Parameter, hesiod_base Parameter, Global Parameters
4385 @comment  node-name,  next,  previous,  up
4386 @subsection @t{karch} Parameter
4387 @cindex karch Parameter
4389 (type=string, default to karch of the system).  Same as the @code{-k}
4390 option to @i{Amd}.  Allows you to override the kernel-architecture of
4391 your system.  Useful for example on Sun (Sparc) machines, where you can
4392 build one @i{Amd} binary, and run it on multiple machines, yet you want
4393 each one to get the correct @i{karch} variable set (for example, sun4c,
4394 sun4m, sun4u, etc.)  Note that if not specified, @i{Amd} will use
4395 @b{uname}(2) to figure out the kernel architecture of the machine.
4397 @c ----------------------------------------------------------------
4398 @node ldap_base Parameter, ldap_cache_maxmem Parameter, karch Parameter, Global Parameters
4399 @comment  node-name,  next,  previous,  up
4400 @subsection @t{ldap_base} Parameter
4401 @cindex ldap_base Parameter
4403 (type=string, default not set).  Specify the base name for
4404 LDAP.
4406 @c ----------------------------------------------------------------
4407 @node ldap_cache_maxmem Parameter, ldap_cache_seconds Parameter, ldap_base Parameter, Global Parameters
4408 @comment  node-name,  next,  previous,  up
4409 @subsection @t{ldap_cache_maxmem} Parameter
4410 @cindex ldap_cache_maxmem Parameter
4412 (type=numeric, default=131072).  Specify the maximum memory @i{Amd}
4413 should use to cache LDAP entries.
4415 @c ----------------------------------------------------------------
4416 @node ldap_cache_seconds Parameter, ldap_hostports Parameter, ldap_cache_maxmem Parameter, Global Parameters
4417 @comment  node-name,  next,  previous,  up
4418 @subsection @t{ldap_cache_seconds} Parameter
4419 @cindex ldap_cache_seconds Parameter
4421 (type=numeric, default=0).  Specify the number of seconds to keep
4422 entries in the cache.
4424 @c ----------------------------------------------------------------
4425 @node ldap_hostports Parameter, local_domain Parameter, ldap_cache_seconds Parameter, Global Parameters
4426 @comment  node-name,  next,  previous,  up
4427 @subsection @t{ldap_hostports} Parameter
4428 @cindex ldap_hostports Parameter
4430 (type=string, default not set).  Specify
4431 LDAP-specific values such as country and organization.
4433 @c ----------------------------------------------------------------
4434 @node local_domain Parameter, log_file Parameter, ldap_hostports Parameter, Global Parameters
4435 @comment  node-name,  next,  previous,  up
4436 @subsection @t{local_domain} Parameter
4437 @cindex local_domain Parameter
4439 (type=string, default no sub-domain).  Same as the @code{-d} option
4440 to @i{Amd}.  Specify the local domain name.  If this option is not given
4441 the domain name is determined from the hostname, by removing the first
4442 component of the fully-qualified host name.
4444 @c ----------------------------------------------------------------
4445 @node log_file Parameter, log_options Parameter, local_domain Parameter, Global Parameters
4446 @comment  node-name,  next,  previous,  up
4447 @subsection @t{log_file} Parameter
4448 @cindex log_file Parameter
4450 (type=string, default=@samp{stderr}).  Same as the @code{-l} option to
4451 @i{Amd}.  Specify a file name to log @i{Amd} events to.
4452 If the string @samp{/dev/stderr} is specified,
4453 @i{Amd} will send its events to the standard error file descriptor.
4455 If the string @samp{syslog} is given, @i{Amd} will record its events
4456 with the system logger @b{syslogd}(8).  If your system supports syslog
4457 facilities, then the default facility used is @samp{LOG_DAEMON}.
4459 When using syslog, if you wish to change the facility, append its name
4460 to the option name, delimited by a single colon.  For example, if it is
4461 the string @samp{syslog:local7} then @i{Amd} will log messages via
4462 @b{syslog}(3) using the @samp{LOG_LOCAL7} facility.  If the facility
4463 name specified is not recognized, @i{Amd} will default to @samp{LOG_DAEMON}.
4464 Note: while you can use any syslog facility available on your system, it
4465 is generally a bad idea to use those reserved for other services such as
4466 @samp{kern}, @samp{lpr}, @samp{cron}, etc.
4468 @c ----------------------------------------------------------------
4469 @node log_options Parameter, nfs_retransmit_counter Parameter, log_file Parameter, Global Parameters
4470 @comment  node-name,  next,  previous,  up
4471 @subsection @t{log_options} Parameter
4472 @cindex log_options Parameter
4474 (type=string, default no logging options).  Same as the @code{-x}
4475 option to @i{Amd}.  Specify any logging options for @i{Amd}.  Options
4476 are comma delimited, and can be preceded by the string @samp{no} to
4477 negate their meaning.  The @samp{debug} logging option is only available
4478 if am-utils was configured with @code{--enable-debug}.  You can get the
4479 list of supported debugging options by running @code{amd -H}.  Possible
4480 values are:
4482 @table @samp
4483 @item all
4484 all messages
4485 @item debug
4486 debug messages
4487 @item error
4488 non-fatal system errors
4489 @item fatal
4490 fatal errors
4491 @item info
4492 information
4493 @item map
4494 map errors
4495 @item stats
4496 additional statistical information
4497 @item user
4498 non-fatal user errors
4499 @item warn
4500 warnings
4501 @item warning
4502 warnings
4503 @end table
4505 @c ----------------------------------------------------------------
4506 @node nfs_retransmit_counter Parameter, nfs_retry_interval Parameter, log_options Parameter, Global Parameters
4507 @comment  node-name,  next,  previous,  up
4508 @subsection @t{nfs_retransmit_counter} Parameter
4509 @cindex nfs_retransmit_counter Parameter
4511 (type=numeric, default=11).  Same as the @i{retransmit} part of the
4512 @code{-t} @i{timeout.retransmit} option to @i{Amd}.  Specifies the
4513 number of NFS retransmissions that the kernel will use to communicate
4514 with @i{Amd}.  @xref{-t Option}.
4516 @c ----------------------------------------------------------------
4517 @node nfs_retry_interval Parameter, nis_domain Parameter, nfs_retransmit_counter Parameter, Global Parameters
4518 @comment  node-name,  next,  previous,  up
4519 @subsection @t{nfs_retry_interval} Parameter
4520 @cindex nfs_retry_interval Parameter
4522 (type=numeric, default=8).  Same as the @i{timeout} part of the
4523 @code{-t} @i{timeout.retransmit} option to @i{Amd}.  Specifies the NFS
4524 timeout interval, in @emph{tenths} of seconds, between NFS/RPC retries
4525 (for UDP only).  This is the value that the kernel will use to
4526 communicate with @i{Amd}.  @xref{-t Option}.
4528 Amd relies on the kernel RPC retransmit mechanism to trigger mount
4529 retries.  The values of the @i{nfs_retransmit_counter} and the
4530 @i{nfs_retry_interval} parameters change the overall retry interval.
4531 Too long an interval gives poor interactive response; too short an
4532 interval causes excessive retries.
4534 @c ----------------------------------------------------------------
4535 @node nis_domain Parameter, normalize_hostnames Parameter, nfs_retry_interval Parameter, Global Parameters
4536 @comment  node-name,  next,  previous,  up
4537 @subsection @t{nis_domain} Parameter
4538 @cindex nis_domain Parameter
4540 (type=string, default to local NIS domain name).  Same as the
4541 @code{-y} option to @i{Amd}.  Specify an alternative NIS domain from
4542 which to fetch the NIS maps.  The default is the system domain name.
4543 This option is ignored if NIS support is not available.
4545 @c ----------------------------------------------------------------
4546 @node normalize_hostnames Parameter, os Parameter, nis_domain Parameter, Global Parameters
4547 @comment  node-name,  next,  previous,  up
4548 @subsection @t{normalize_hostnames} Parameter
4549 @cindex normalize_hostnames Parameter
4551 (type=boolean, default=@samp{no}).  Same as the @code{-n} option to @i{Amd}.
4552 If @samp{yes}, then the name referred to by @code{$@{rhost@}} is normalized
4553 relative to the host database before being used.  The effect is to
4554 translate aliases into ``official'' names.
4556 @c ----------------------------------------------------------------
4557 @node os Parameter, osver Parameter, normalize_hostnames Parameter, Global Parameters
4558 @comment  node-name,  next,  previous,  up
4559 @subsection @t{os} Parameter
4560 @cindex os Parameter
4562 (type=string, default to compiled in value).  Same as the @code{-O}
4563 option to @i{Amd}.  Allows you to override the compiled-in name of the
4564 operating system.  Useful when the built-in name is not desired for
4565 backward compatibility reasons.  For example, if the built-in name is
4566 @samp{sunos5}, you can override it to @samp{sos5}, and use older maps
4567 which were written with the latter in mind.
4570 @c ----------------------------------------------------------------
4571 @node osver Parameter, pid_file Parameter, os Parameter, Global Parameters
4572 @comment  node-name,  next,  previous,  up
4573 @subsection @t{osver} Parameter
4574 @cindex osver Parameter
4576 (type=string, default to compiled in value).  Same as the @code{-o}
4577 option to @i{Amd}.  Allows you to override the compiled-in version
4578 number of the operating system.  Useful when the built-in version is not
4579 desired for backward compatibility reasons.  For example, if the build
4580 in version is @samp{2.5.1}, you can override it to @samp{5.5.1}, and use
4581 older maps that were written with the latter in mind.
4583 @c ----------------------------------------------------------------
4584 @node pid_file Parameter, plock Parameter, osver Parameter, Global Parameters
4585 @comment  node-name,  next,  previous,  up
4586 @subsection @t{pid_file} Parameter
4587 @cindex pid_file Parameter
4589 (type=string, default=@samp{/dev/stdout}).  Specify a file to store the process
4590 ID of the running daemon into.  If not specified, @i{Amd} will print its
4591 process id onto the standard output.  Useful for killing @i{Amd} after
4592 it had run.  Note that the PID of a running @i{Amd} can also be
4593 retrieved via @i{Amq} (@pxref{Amq -p option}).
4595 This file is used only if the @samp{print_pid} option is on
4596 (@pxref{print_pid Parameter}).
4598 @c ----------------------------------------------------------------
4599 @node plock Parameter, portmap_program Parameter, pid_file Parameter, Global Parameters
4600 @comment  node-name,  next,  previous,  up
4601 @subsection @t{plock} Parameter
4602 @cindex plock Parameter
4604 (type=boolean, default=@samp{yes}).  Same as the @code{-S} option to @i{Amd}.
4605 If @samp{yes}, lock the running executable pages of @i{Amd} into memory.
4606 To improve @i{Amd}'s performance, systems that support the @b{plock}(3)
4607 call can lock the @i{Amd} process into memory.  This way there is less
4608 chance the operating system will schedule, page out, and swap the
4609 @i{Amd} process as needed.  This improves @i{Amd}'s performance, at the
4610 cost of reserving the memory used by the @i{Amd} process (making it
4611 unavailable for other processes).
4613 @c ----------------------------------------------------------------
4614 @node portmap_program Parameter, print_pid Parameter, plock Parameter, Global Parameters
4615 @comment  node-name,  next,  previous,  up
4616 @subsection @t{portmap_program} Parameter
4617 @cindex portmap_program Parameter
4619 (type=numeric, default=300019).  Specify an alternate Port-mapper RPC
4620 program number, other than the official number.  This is useful when
4621 running multiple @i{Amd} processes.  For example, you can run another
4622 @i{Amd} in ``test'' mode, without affecting the primary @i{Amd} process
4623 in any way.  For safety reasons, the alternate program numbers that can
4624 be specified must be in the range 300019-300029, inclusive.  @i{Amq} has
4625 an option @code{-P} which can be used to specify an alternate program
4626 number of an @i{Amd} to contact.  In this way, amq can fully control any
4627 number of @i{Amd} processes running on the same host.
4629 @c ----------------------------------------------------------------
4630 @node print_pid Parameter, print_version Parameter, portmap_program Parameter, Global Parameters
4631 @comment  node-name,  next,  previous,  up
4632 @subsection @t{print_pid} Parameter
4633 @cindex print_pid Parameter
4635 (type=boolean, default=@samp{no}).  Same as the @code{-p} option to @i{Amd}.
4636 If @samp{yes}, @i{Amd} will print its process ID upon starting.
4638 @c ----------------------------------------------------------------
4639 @node print_version Parameter, restart_mounts Parameter, print_pid Parameter, Global Parameters
4640 @comment  node-name,  next,  previous,  up
4641 @subsection @t{print_version} Parameter
4642 @cindex print_version Parameter
4644 (type=boolean, default=@samp{no}).  Same as the @code{-v} option to @i{Amd},
4645 but the version prints and @i{Amd} continues to run.  If @samp{yes}, @i{Amd}
4646 will print its version information string, which includes some
4647 configuration and compilation values.
4649 @c ----------------------------------------------------------------
4650 @node restart_mounts Parameter, selectors_on_default Parameter, print_version Parameter, Global Parameters
4651 @comment  node-name,  next,  previous,  up
4652 @subsection @t{restart_mounts} Parameter
4653 @cindex restart_mounts Parameter
4655 (type=boolean, default=@samp{no}).  Same as the @code{-r} option to @i{Amd}.
4656 If @samp{yes} @i{Amd} will scan the mount table to determine which file
4657 systems are currently mounted.  Whenever one of these would have been
4658 auto-mounted, @i{Amd} inherits it.
4660 @c ----------------------------------------------------------------
4661 @node selectors_on_default Parameter, show_statfs_entries Parameter, restart_mounts Parameter, Global Parameters
4662 @comment  node-name,  next,  previous,  up
4663 @subsection @t{selectors_on_default} Parameter
4664 @cindex selectors_on_default Parameter
4666 (type=boolean, default=@samp{no}).  If @samp{yes}, then the @samp{/defaults} entry of
4667 maps will be looked for and any selectors processed before setting defaults
4668 for all other keys in that map.  Useful when you want to set different
4669 options for a complete map based on some parameters.  For example, you
4670 may want to better the NFS performance over slow slip-based networks as
4671 follows:
4673 @example
4674 /defaults \
4675     wire==slip-net;opts:=intr,rsize=1024,wsize=1024 \
4676     wire!=slip-net;opts:=intr,rsize=8192,wsize=8192
4677 @end example
4679 @c ----------------------------------------------------------------
4680 @node show_statfs_entries Parameter, unmount_on_exit Parameter, selectors_on_default Parameter, Global Parameters
4681 @comment  node-name,  next,  previous,  up
4682 @subsection @t{show_statfs_entries} Parameter
4683 @cindex show_statfs_entries Parameter
4685 (type=boolean), default=@samp{no}).  If @samp{yes}, then all maps which are
4686 browsable will also show the number of entries (keys) they have when
4687 @b{df}(1) runs. (This is accomplished by returning non-zero values to
4688 the @b{statfs}(2) system call).
4690 @c ----------------------------------------------------------------
4691 @node unmount_on_exit Parameter, vendor Parameter, show_statfs_entries Parameter, Global Parameters
4692 @comment  node-name,  next,  previous,  up
4693 @subsection @t{unmount_on_exit} Parameter
4694 @cindex unmount_on_exit Parameter
4696 (type=boolean), default=@samp{no}).  If @samp{yes}, then @i{Amd} will attempt
4697 to unmount all file systems which it knows about.  Normally it leaves
4698 all (esp. NFS) mounted file systems intact.  Note that @i{Amd} does not
4699 know about file systems mounted before it starts up, unless the
4700 @samp{restart_mounts} option is used (@pxref{restart_mounts Parameter}).
4702 @c ----------------------------------------------------------------
4703 @node vendor Parameter, , unmount_on_exit Parameter, Global Parameters
4704 @comment  node-name,  next,  previous,  up
4705 @subsection @t{vendor} Parameter
4706 @cindex vendor Parameter
4708 (type=string, default to compiled in value).  The name of the vendor of
4709 the operating system.  Overrides the compiled-in vendor name.  Useful
4710 when the compiled-in name is not desired.  For example, most Intel based
4711 systems set the vendor name to @samp{unknown}, but you can set it to
4712 @samp{redhat}.
4714 @c ================================================================
4715 @node Regular Map Parameters, amd.conf Examples, Global Parameters, Amd Configuration File
4716 @comment  node-name,  next,  previous,  up
4717 @section Regular Map Parameters
4718 @cindex amd.conf regular map parameters
4720 The following parameters are applicable only to regular map sections.
4722 @menu
4723 * map_name Parameter::
4724 * tag Parameter::     
4725 @end menu
4727 @c ----------------------------------------------------------------
4728 @node map_name Parameter, tag Parameter, Regular Map Parameters, Regular Map Parameters
4729 @comment  node-name,  next,  previous,  up
4730 @subsection map_name Parameter
4731 @cindex map_name Parameter
4733 (type=string, must be specified).  Name of the map where the keys are
4734 located.
4736 @c ----------------------------------------------------------------
4737 @node tag Parameter, , map_name Parameter, Regular Map Parameters
4738 @comment  node-name,  next,  previous,  up
4739 @subsection tag Parameter
4740 @cindex tag Parameter
4742 (type=string, default no tag).  Each map entry in the configuration file
4743 can be tagged.  If no tag is specified, that map section will always be
4744 processed by @i{Amd}.  If it is specified, then @i{Amd} will process the map
4745 if the @code{-T} option was given to @i{Amd}, and the value given to that
4746 command-line option matches that in the map section.
4748 @c ================================================================
4749 @node amd.conf Examples, , Regular Map Parameters, Amd Configuration File
4750 @comment  node-name,  next,  previous,  up
4751 @section amd.conf Examples
4752 @cindex amd.conf examples
4754 The following is the actual @code{amd.conf} file I use at the
4755 Computer Science Department of Columbia University.
4757 @example
4758 # GLOBAL OPTIONS SECTION
4759 [ global ]
4760 normalize_hostnames =    no
4761 print_pid =              no
4762 #pid_file =              /var/run/amd.pid
4763 restart_mounts =         yes
4764 #unmount_on_exit =       yes
4765 auto_dir =               /n
4766 log_file =               /var/log/amd
4767 log_options =            all
4768 #debug_options =         all
4769 plock =                  no
4770 selectors_on_default =   yes
4771 # config.guess picks up "sunos5" and I don't want to edit my maps yet
4772 os =                     sos5
4773 # if you print_version after setting up "os", it will show it.
4774 print_version =          no
4775 map_type =               file
4776 search_path =            /etc/amdmaps:/usr/lib/amd:/usr/local/AMD/lib
4777 browsable_dirs =         yes
4778 fully_qualified_hosts =  no
4780 # DEFINE AN AMD MOUNT POINT
4781 [ /u ]
4782 map_name =               amd.u
4783                          
4784 [ /proj ]                
4785 map_name =               amd.proj
4786                          
4787 [ /src ]                 
4788 map_name =               amd.src
4789                          
4790 [ /misc ]                
4791 map_name =               amd.misc
4792                          
4793 [ /import ]              
4794 map_name =               amd.import
4795                          
4796 [ /tftpboot/.amd ]       
4797 tag =                    tftpboot
4798 map_name =               amd.tftpboot
4799 @end example
4801 @c ################################################################
4802 @node Run-time Administration, FSinfo, Amd Configuration File, Top
4803 @comment  node-name,  next,  previous,  up
4804 @chapter Run-time Administration
4805 @cindex Run-time administration
4806 @cindex Amq command
4808 @menu
4809 * Starting Amd::
4810 * Stopping Amd::
4811 * Restarting Amd::
4812 * Controlling Amd::
4813 @end menu
4815 @node Starting Amd, Stopping Amd, Run-time Administration, Run-time Administration
4816 @comment  node-name,  next,  previous,  up
4817 @section Starting @i{Amd}
4818 @cindex Starting Amd
4819 @cindex Additions to /etc/rc.local
4820 @cindex /etc/rc.local additions
4821 @cindex ctl-amd
4823 @i{Amd} is best started from @samp{/etc/rc.local} on BSD systems, or
4824 from the appropriate start-level script in @samp{/etc/init.d} on System V
4825 systems.
4827 @example
4828 if [ -f /usr/local/sbin/ctl-amd ]; then
4829     /usr/local/sbin/ctl-amd start; (echo -n ' amd') > /dev/console
4831 @end example
4833 @noindent
4834 The shell script, @samp{ctl-amd} is used to start, stop, or restart
4835 @i{Amd}.  It is a relatively generic script.  All options you want to
4836 set should not be made in this script, but rather updated in the
4837 @file{amd.conf} file. @xref{Amd Configuration File}.
4839 If you do not wish to use an @i{Amd} configuration file, you may start
4840 @i{Amd} manually.  For example, getting the map entries via NIS:
4842 @example
4843 amd -r -l /var/log/amd `ypcat -k auto.master`
4844 @end example
4846 @node Stopping Amd, Restarting Amd, Starting Amd, Run-time Administration
4847 @comment  node-name,  next,  previous,  up
4848 @section Stopping @i{Amd}
4849 @cindex Stopping Amd
4850 @cindex SIGTERM signal
4851 @cindex SIGINT signal
4853 @i{Amd} stops in response to two signals.
4855 @table @samp
4856 @item SIGTERM
4857 causes the top-level automount points to be unmounted and then @i{Amd}
4858 to exit.  Any automounted filesystems are left mounted.  They can be
4859 recovered by restarting @i{Amd} with the @code{-r} command line option.@refill
4861 @item SIGINT
4862 causes @i{Amd} to attempt to unmount any filesystems which it has
4863 automounted, in addition to the actions of @samp{SIGTERM}.  This signal
4864 is primarily used for debugging.@refill
4865 @end table
4867 Actions taken for other signals are undefined.
4869 The easiest and safest way to stop @i{Amd}, without having to find its
4870 process ID by hand, is to use the @file{ctl-amd} script, as with:
4872 @example
4873 ctl-amd stop
4874 @end example
4876 @node Restarting Amd, Controlling Amd, Stopping Amd, Run-time Administration
4877 @comment  node-name,  next,  previous,  up
4878 @section Restarting @i{Amd}
4879 @cindex Restarting Amd
4880 @cindex Killing and starting Amd
4882 Before @i{Amd} can be started, it is vital to ensure that no other
4883 @i{Amd} processes are managing any of the mount points, and that the
4884 previous process(es) have terminated cleanly.  When a terminating signal
4885 is set to @i{Amd}, the automounter does @emph{not} terminate right then.
4886 Rather, it starts by unmounting all of its managed mount mounts in the
4887 background, and then terminates.  It usually takes a few seconds for
4888 this process to happen, but it can take an arbitrarily longer time.  If
4889 two or more @i{Amd} processes attempt to manage the same mount point, it
4890 usually will result in a system lockup.
4892 The easiest and safest way to restart @i{Amd}, without having to find
4893 its process ID by hand, sending it the @samp{SIGTERM} signal, waiting for @i{Amd}
4894 to die cleanly, and verifying so, is to use the @file{ctl-amd} script,
4895 as with:
4897 @example
4898 ctl-amd restart
4899 @end example
4901 The script will locate the process ID of @i{Amd}, kill it, and wait for
4902 it to die cleanly before starting a new instance of the automounter.
4903 @file{ctl-amd} will wait for a total of 30 seconds for @i{Amd} to die,
4904 and will check once every 5 seconds if it had.
4906 @node Controlling Amd, , Restarting Amd, Run-time Administration
4907 @comment  node-name,  next,  previous,  up
4908 @section Controlling @i{Amd}
4909 @cindex Controlling Amd
4910 @cindex Discovering what is going on at run-time
4911 @cindex Listing currently mounted filesystems
4913 It is sometimes desirable or necessary to exercise external control
4914 over some of @i{Amd}'s internal state.  To support this requirement,
4915 @i{Amd} implements an RPC interface which is used by the @dfn{Amq} program.
4916 A variety of information is available.
4918 @i{Amq} generally applies an operation, specified by a single letter option,
4919 to a list of mount points.  The default operation is to obtain statistics
4920 about each mount point.  This is similar to the output shown above
4921 but includes information about the number and type of accesses to each
4922 mount point.
4924 @menu
4925 * Amq default::       Default command behavior.
4926 * Amq -f option::     Flushing the map cache.
4927 * Amq -h option::     Controlling a non-local host.
4928 * Amq -l option::     Controlling the log file.
4929 * Amq -m option::     Obtaining mount statistics.
4930 * Amq -M-option::     Mounting a volume.
4931 * Amq -p option::     Getting Amd's process ID.
4932 * Amq -P-option::     Contacting alternate Amd processes.
4933 * Amq -s option::     Obtaining global statistics.
4934 * Amq -T option::     Use TCP transport.
4935 * Amq -U-option::     Use UDP transport.
4936 * Amq -u option::     Forcing volumes to time out.
4937 * Amq -v option::     Version information.
4938 * Other Amq options:: Three other special options.
4939 @end menu
4941 @c ----------------------------------------------------------------
4942 @node Amq default, Amq -f option, Controlling Amd, Controlling Amd
4943 @comment  node-name,  next,  previous,  up
4944 @subsection @i{Amq} default information
4946 With no arguments, @dfn{Amq} obtains a brief list of all existing
4947 mounts created by @i{Amd}.  This is different from the list displayed by
4948 @b{df}(1) since the latter only includes system mount points.
4950 @noindent
4951 The output from this option includes the following information:
4953 @itemize @bullet
4954 @item
4955 the automount point,
4956 @item
4957 the filesystem type,
4958 @item
4959 the mount map or mount information,
4960 @item
4961 the internal, or system mount point.
4962 @end itemize
4964 @noindent
4965 For example:
4967 @example
4968 /            root   "root"                    sky:(pid75)
4969 /homes       toplvl /usr/local/etc/amd.homes  /homes
4970 /home        toplvl /usr/local/etc/amd.home   /home
4971 /homes/jsp   nfs    charm:/home/charm         /a/charm/home/charm/jsp
4972 /homes/phjk  nfs    toytown:/home/toytown     /a/toytown/home/toytown/ai/phjk
4973 @end example
4975 @noindent
4976 If an argument is given then statistics for that volume name will
4977 be output.  For example:
4979 @example
4980 What         Uid   Getattr Lookup RdDir   RdLnk   Statfs Mounted@@
4981 /homes       0     1196    512    22      0       30     90/09/14 12:32:55
4982 /homes/jsp   0     0       0      0       1180    0      90/10/13 12:56:58
4983 @end example
4985 @table @code
4986 @item What
4987 the volume name.
4989 @item Uid
4990 ignored.
4992 @item Getattr
4993 the count of NFS @dfn{getattr} requests on this node.  This should only be
4994 non-zero for directory nodes.
4996 @item Lookup
4997 the count of NFS @dfn{lookup} requests on this node.  This should only be
4998 non-zero for directory nodes.
5000 @item RdDir
5001 the count of NFS @dfn{readdir} requests on this node.  This should only
5002 be non-zero for directory nodes.
5004 @item RdLnk
5005 the count of NFS @dfn{readlink} requests on this node.  This should be
5006 zero for directory nodes.
5008 @item Statfs
5009 the count of NFS @dfn{statfs} requests on this node.  This should only
5010 be non-zero for top-level automount points.
5012 @item Mounted@@
5013 the date and time the volume name was first referenced.
5014 @end table
5016 @c ----------------------------------------------------------------
5017 @node Amq -f option, Amq -h option, Amq default, Controlling Amd
5018 @comment  node-name,  next,  previous,  up
5019 @subsection @i{Amq} @code{-f} option
5020 @cindex Flushing the map cache
5021 @cindex Map cache, flushing
5023 The @code{-f} option causes @i{Amd} to flush the internal mount map cache.
5024 This is useful for example in Hesiod maps since @i{Amd} will not
5025 automatically notice when they have been updated.  The map cache can
5026 also be synchronized with the map source by using the @samp{sync} option
5027 (@pxref{Automount Filesystem}).@refill
5029 @c ----------------------------------------------------------------
5030 @node Amq -l option, Amq -m option, Amq -h option, Controlling Amd
5031 @comment  node-name,  next,  previous,  up
5032 @subsection @i{Amq} @code{-l} option
5033 @cindex Resetting the Amd log file
5034 @cindex Setting the Amd log file via Amq
5035 @cindex Log file, resetting
5037 Tell @i{Amd} to use @i{log_file} as the log file name.  For security
5038 reasons, this @emph{must} be the same log file which @i{Amd} used when
5039 started.  This option is therefore only useful to refresh @i{Amd}'s open
5040 file handle on the log file, so that it can be rotated and compressed
5041 via daily cron jobs.
5043 @c ----------------------------------------------------------------
5044 @node Amq -h option, Amq -l option, Amq -f option, Controlling Amd
5045 @comment  node-name,  next,  previous,  up
5046 @subsection @i{Amq} @code{-h} option
5047 @cindex Querying an alternate host
5049 By default the local host is used.  In an HP-UX cluster the root server
5050 is used since that is the only place in the cluster where @i{Amd} will
5051 be running.  To query @i{Amd} on another host the @code{-h} option should
5052 be used.
5054 @c ----------------------------------------------------------------
5055 @node Amq -m option, Amq -M-option, Amq -l option, Controlling Amd
5056 @comment  node-name,  next,  previous,  up
5057 @subsection @i{Amq} @code{-m} option
5059 The @code{-m} option displays similar information about mounted
5060 filesystems, rather than automount points.  The output includes the
5061 following information:
5063 @itemize @bullet
5064 @item
5065 the mount information,
5066 @item
5067 the mount point,
5068 @item
5069 the filesystem type,
5070 @item
5071 the number of references to this filesystem,
5072 @item
5073 the server hostname,
5074 @item
5075 the state of the file server,
5076 @item
5077 any error which has occurred.
5078 @end itemize
5080 For example:
5082 @example
5083 "root"           truth:(pid602)     root   1 localhost is up
5084 hesiod.home      /home              toplvl 1 localhost is up
5085 hesiod.vol       /vol               toplvl 1 localhost is up
5086 hesiod.homes     /homes             toplvl 1 localhost is up
5087 amy:/home/amy    /a/amy/home/amy    nfs    5 amy is up
5088 swan:/home/swan  /a/swan/home/swan  nfs    0 swan is up (Permission denied)
5089 ex:/home/ex      /a/ex/home/ex      nfs    0 ex is down
5090 @end example
5092 When the reference count is zero the filesystem is not mounted but
5093 the mount point and server information is still being maintained
5094 by @i{Amd}.
5096 @c ----------------------------------------------------------------
5097 @node Amq -M-option, Amq -p option, Amq -m option, Controlling Amd
5098 @comment  node-name,  next,  previous,  up
5099 @subsection @i{Amq} @code{-M} option
5101 The @code{-M} option passes a new map entry to @i{Amd} and waits for it to
5102 be evaluated, possibly causing a mount.  For example, the following
5103 command would cause @samp{/home/toytown} on host @samp{toytown} to be
5104 mounted locally on @samp{/mnt/toytown}.
5106 @example
5107 amq -M '/mnt/toytown type:=nfs;rfs:=/home/toytown;rhost:=toytown;fs:=$@{key@}'
5108 @end example
5110 @i{Amd} applies some simple security checks before allowing this
5111 operation.  The check tests whether the incoming request is from a
5112 privileged UDP port on the local machine.  ``Permission denied'' is
5113 returned if the check fails.
5115 This option is very insecure as it is vulnerable to attacks such as IP
5116 Spoofing.  In other words, it is relatively easy for an attacker who
5117 really wants to, to make your @i{Amd} process mount any filesystem from
5118 the Internet!  Therefore, the @emph{complete} code which supports the
5119 @code{-M} option in @i{Amd} and @i{Amq} is turned off by default.  To turn
5120 it on, you have to reconfigure am-utils with @code{configure
5121 --enable-amq-mount}.  Think twice before doing so, and use this option
5122 only if you absolutely need to.
5124 A future release of @i{Amd} will include code to allow the @b{mount}(8)
5125 command to mount automount points:
5127 @example
5128 mount -t amd /vol hesiod.vol
5129 @end example
5131 This will then allow @i{Amd} to be controlled from the standard system
5132 filesystem mount list.
5134 @c ----------------------------------------------------------------
5135 @node Amq -p option, Amq -P-option, Amq -M-option, Controlling Amd
5136 @comment  node-name,  next,  previous,  up
5137 @subsection @i{Amq} @code{-p} option
5138 @cindex Process ID; Amd
5139 @cindex Amd's process ID
5140 @cindex Amd's PID
5141 @cindex PID; Amd
5143 Return the process ID of the remote or locally running @i{Amd}.  Useful
5144 when you need to send a signal to the local @i{Amd} process, and would
5145 rather not have to search through the process table.  This option is
5146 used in the @file{ctl-amd} script.
5148 @c ----------------------------------------------------------------
5149 @node Amq -P-option, Amq -s option, Amq -p option, Controlling Amd
5150 @comment  node-name,  next,  previous,  up
5151 @subsection @i{Amq} @code{-P} option
5152 @cindex Multiple Amd processes
5153 @cindex Running multiple Amd
5154 @cindex Debugging a new Amd configuration
5155 @cindex RPC Program numbers; Amd
5157 Contact an alternate running @i{Amd} that had registered itself on a
5158 different RPC @var{program_number} and apply all other operations to
5159 that instance of the automounter.  This is useful when you run multiple
5160 copies of @i{Amd}, and need to manage each one separately.  If not
5161 specified, @i{Amq} will use the default program number for @i{Amd}, 300019.
5162 For security reasons, the only alternate program numbers @i{Amd} can use
5163 range from 300019 to 300029, inclusive.
5165 For example, to kill an alternate running @i{Amd}:
5167 @example
5168 kill `amq -p -P 300020`
5169 @end example
5171 @c ----------------------------------------------------------------
5172 @node Amq -s option, Amq -T option, Amq -P-option, Controlling Amd
5173 @comment  node-name,  next,  previous,  up
5174 @subsection @i{Amq} @code{-s} option
5175 @cindex Global statistics
5176 @cindex Statistics
5178 The @code{-s} option displays global statistics.  If any other options are specified
5179 or any filesystems named then this option is ignored.  For example:
5181 @example
5182 requests  stale     mount     mount     unmount
5183 deferred  fhandles  ok        failed    failed
5184 1054      1         487       290       7017
5185 @end example
5187 @table @samp
5188 @item Deferred requests
5189 are those for which an immediate reply could not be constructed.  For
5190 example, this would happen if a background mount was required.
5192 @item Stale filehandles
5193 counts the number of times the kernel passes a stale filehandle to @i{Amd}.
5194 Large numbers indicate problems.
5196 @item Mount ok
5197 counts the number of automounts which were successful.
5199 @item Mount failed
5200 counts the number of automounts which failed.
5202 @item Unmount failed
5203 counts the number of times a filesystem could not be unmounted.  Very
5204 large numbers here indicate that the time between unmount attempts
5205 should be increased.
5206 @end table
5208 @c ----------------------------------------------------------------
5209 @node Amq -T option, Amq -U-option, Amq -s option, Controlling Amd
5210 @comment  node-name,  next,  previous,  up
5211 @subsection @i{Amq} @code{-T} option
5212 @cindex Forcing Amq to use a TCP transport
5213 @cindex TCP; using with Amq
5215 The @code{-T} option causes the @i{Amq} to contact @i{Amd} using the TCP
5216 transport only (connection oriented).  Normally, @i{Amq} will use TCP
5217 first, and if that failed, will try UDP.
5219 @c ----------------------------------------------------------------
5220 @node Amq -U-option, Amq -u option, Amq -T option, Controlling Amd
5221 @comment  node-name,  next,  previous,  up
5222 @subsection @i{Amq} @code{-U} option
5223 @cindex Forcing Amq to use a UDP transport
5224 @cindex UDP; using with Amq
5226 The @code{-U} option causes the @i{Amq} to contact @i{Amd} using the UDP
5227 transport only (connectionless).  Normally, @i{Amq} will use TCP first,
5228 and if that failed, will try UDP.
5230 @c ----------------------------------------------------------------
5231 @node Amq -u option, Amq -v option, Amq -U-option, Controlling Amd
5232 @comment  node-name,  next,  previous,  up
5233 @subsection @i{Amq} @code{-u} option
5234 @cindex Forcing filesystem to time out
5235 @cindex Unmounting a filesystem
5237 The @code{-u} option causes the time-to-live interval of the named mount
5238 points to be expired, thus causing an unmount attempt.  This is the only
5239 safe way to unmount an automounted filesystem.  It is not possible to
5240 unmount a filesystem which has been mounted with the @samp{nounmount}
5241 flag.
5243 @c The @code{-H} option informs @i{Amd} that the specified mount point has hung -
5244 @c as if its keepalive timer had expired.
5246 @c ----------------------------------------------------------------
5247 @node Amq -v option, Other Amq options, Amq -u option, Controlling Amd
5248 @comment  node-name,  next,  previous,  up
5249 @subsection @i{Amq} @code{-v} option
5250 @cindex Version information at run-time
5252 The @code{-v} option displays the version of @i{Amd} in a similar way to
5253 @i{Amd}'s @code{-v} option.
5255 @c ----------------------------------------------------------------
5256 @node Other Amq options, , Amq -v option, Controlling Amd
5257 @comment  node-name,  next,  previous,  up
5258 @subsection Other @i{Amq} options
5259 @cindex Logging options via Amq
5260 @cindex Debugging options via Amq
5262 Two other operations are implemented.  These modify the state of @i{Amd}
5263 as a whole, rather than any particular filesystem.  The @code{-x} and
5264 @code{-D} options have exactly the same effect as @i{Amd}'s corresponding
5265 command line options.
5267 When @i{Amd} receives a @code{-x} flag it limits the log options being
5268 modified to those which were not enabled at startup.  This prevents a
5269 user turning @emph{off} any logging option which was specified at
5270 startup, though any which have been turned on since then can still be
5271 turned off.  The @code{-D} option has a similar behavior.
5273 @c ################################################################
5274 @node FSinfo, Hlfsd, Run-time Administration, Top
5275 @comment  node-name,  next,  previous,  up
5276 @chapter FSinfo
5277 @cindex FSinfo
5278 @cindex Filesystem info package
5280 XXX: this chapter should be reviewed by someone knowledgeable with
5281 fsinfo.
5283 @menu
5284 * FSinfo Overview::                 Introduction to FSinfo.
5285 * Using FSinfo::                    Basic concepts.
5286 * FSinfo Grammar::                  Language syntax, semantics and examples.
5287 * FSinfo host definitions::         Defining a new host.
5288 * FSinfo host attributes::          Definable host attributes. 
5289 * FSinfo filesystems::              Defining locally attached filesystems.
5290 * FSinfo static mounts::            Defining additional static mounts.
5291 * FSinfo automount definitions::
5292 * FSinfo Command Line Options::
5293 * FSinfo errors::
5294 @end menu
5296 @node FSinfo Overview, Using FSinfo, FSinfo, FSinfo
5297 @comment  node-name,  next,  previous,  up
5298 @section @i{FSinfo} overview
5299 @cindex FSinfo overview
5301 @i{FSinfo} is a filesystem management tool.  It has been designed to
5302 work with @i{Amd} to help system administrators keep track of the ever
5303 increasing filesystem namespace under their control.
5305 The purpose of @i{FSinfo} is to generate all the important standard
5306 filesystem data files from a single set of input data.  Starting with a
5307 single data source guarantees that all the generated files are
5308 self-consistent.  One of the possible output data formats is a set of
5309 @i{Amd} maps which can be used amongst the set of hosts described in the
5310 input data.
5312 @i{FSinfo} implements a declarative language.  This language is
5313 specifically designed for describing filesystem namespace and physical
5314 layouts.  The basic declaration defines a mounted filesystem including
5315 its device name, mount point, and all the volumes and access
5316 permissions.  @i{FSinfo} reads this information and builds an internal
5317 map of the entire network of hosts.  Using this map, many different data
5318 formats can be produced including @file{/etc/fstab},
5319 @file{/etc/exports}, @i{Amd} mount maps and
5320 @file{/etc/bootparams}.@refill
5322 @node Using FSinfo, FSinfo Grammar, FSinfo Overview, FSinfo
5323 @comment  node-name,  next,  previous,  up
5324 @section Using @i{FSinfo}
5325 @cindex Using FSinfo
5327 The basic strategy when using @i{FSinfo} is to gather all the
5328 information about all disks on all machines into one set of
5329 declarations.  For each machine being managed, the following data is
5330 required:
5332 @itemize @bullet
5333 @item
5334 Hostname
5335 @item
5336 List of all filesystems and, optionally, their mount points.
5337 @item
5338 Names of volumes stored on each filesystem.
5339 @item
5340 NFS export information for each volume.
5341 @item
5342 The list of static filesystem mounts.
5343 @end itemize
5345 The following information can also be entered into the same
5346 configuration files so that all data can be kept in one place.
5348 @itemize @bullet
5349 @item
5350 List of network interfaces
5351 @item
5352 IP address of each interface
5353 @item
5354 Hardware address of each interface
5355 @item
5356 Dumpset to which each filesystem belongs
5357 @item
5358 and more @dots{}
5359 @end itemize
5361 To generate @i{Amd} mount maps, the automount tree must also be defined
5362 (@pxref{FSinfo automount definitions}).  This will have been designed at
5363 the time the volume names were allocated.  Some volume names will not be
5364 automounted, so @i{FSinfo} needs an explicit list of which volumes
5365 should be automounted.@refill
5367 Hostnames are required at several places in the @i{FSinfo} language.  It
5368 is important to stick to either fully qualified names or unqualified
5369 names.  Using a mixture of the two will inevitably result in confusion.
5371 Sometimes volumes need to be referenced which are not defined in the set
5372 of hosts being managed with @i{FSinfo}.  The required action is to add a
5373 dummy set of definitions for the host and volume names required.  Since
5374 the files generated for those particular hosts will not be used on them,
5375 the exact values used is not critical.
5377 @node FSinfo Grammar, FSinfo host definitions, Using FSinfo, FSinfo
5378 @comment  node-name,  next,  previous,  up
5379 @section @i{FSinfo} grammar
5380 @cindex FSinfo grammar
5381 @cindex Grammar, FSinfo
5383 @i{FSinfo} has a relatively simple grammar.  Distinct syntactic
5384 constructs exist for each of the different types of data, though they
5385 share a common flavor.  Several conventions are used in the grammar
5386 fragments below.
5388 The notation, @i{list(}@t{xxx}@i{)}, indicates a list of zero or more
5389 @t{xxx}'s.  The notation, @i{opt(}@t{xxx}@i{)}, indicates zero or one
5390 @t{xxx}.  Items in double quotes, @i{eg} @t{"host"}, represent input
5391 tokens.  Items in angle brackets, @i{eg} @var{<hostname>}, represent
5392 strings in the input.  Strings need not be in double quotes, except to
5393 differentiate them from reserved words.  Quoted strings may include the
5394 usual set of C ``@t{\}'' escape sequences with one exception: a
5395 backslash-newline-whitespace sequence is squashed into a single space
5396 character.  To defeat this feature, put a further backslash at the start
5397 of the second line.
5399 At the outermost level of the grammar, the input consists of a
5400 sequence of host and automount declarations.  These declarations are
5401 all parsed before they are analyzed.  This means they can appear in
5402 any order and cyclic host references are possible.
5404 @example
5405 fsinfo      : @i{list(}fsinfo_attr@i{)} ;
5407 fsinfo_attr : host | automount ;
5408 @end example
5410 @menu
5411 * FSinfo host definitions::
5412 * FSinfo automount definitions::
5413 @end menu
5415 @node FSinfo host definitions, FSinfo host attributes, FSinfo Grammar, FSinfo
5416 @comment  node-name,  next,  previous,  up
5417 @section @i{FSinfo} host definitions
5418 @cindex FSinfo host definitions
5419 @cindex Defining a host, FSinfo
5421 A host declaration consists of three parts: a set of machine attribute
5422 data, a list of filesystems physically attached to the machine, and a
5423 list of additional statically mounted filesystems.
5425 @example
5426 host        : "host" host_data @i{list(}filesystem@i{@i{)}} @i{list(}mount@i{@i{)}} ;
5427 @end example
5429 Each host must be declared in this way exactly once.  Such things as the
5430 hardware address, the architecture and operating system types and the
5431 cluster name are all specified within the @dfn{host data}.
5433 All the disks the machine has should then be described in the @dfn{list
5434 of filesystems}.  When describing disks, you can specify what
5435 @dfn{volname} the disk/partition should have and all such entries are
5436 built up into a dictionary which can then be used for building the
5437 automounter maps.
5439 The @dfn{list of mounts} specifies all the filesystems that should be
5440 statically mounted on the machine.
5442 @menu
5443 * FSinfo host attributes::
5444 * FSinfo filesystems::
5445 * FSinfo static mounts::
5446 @end menu
5448 @node FSinfo host attributes, FSinfo filesystems, FSinfo host definitions , FSinfo host definitions
5449 @comment  node-name,  next,  previous,  up
5450 @section @i{FSinfo} host attributes
5451 @cindex FSinfo host attributes
5452 @cindex Defining host attributes, FSinfo
5454 The host data, @dfn{host_data}, always includes the @dfn{hostname}.  In
5455 addition, several other host attributes can be given.
5457 @example
5458 host_data   : @var{<hostname>}
5459             | "@{" @i{list(}host_attrs@i{)} "@}" @var{<hostname>}
5460             ;
5462 host_attrs  : host_attr "=" @var{<string>}
5463             | netif
5464             ;
5466 host_attr   : "config"
5467             | "arch"
5468             | "os"
5469             | "cluster"
5470             ;
5471 @end example
5473 The @dfn{hostname} is, typically, the fully qualified hostname of the
5474 machine.
5476 Examples:
5478 @example
5479 host dylan.doc.ic.ac.uk
5481 host @{
5482     os = hpux
5483     arch = hp300
5484 @} dougal.doc.ic.ac.uk
5485 @end example
5487 The options that can be given as host attributes are shown below.
5489 @menu
5490 * netif Option:         FSinfo host netif:
5491 * config Option:        FSinfo host config:
5492 * arch Option:          FSinfo host arch:
5493 * os Option:            FSinfo host os:
5494 * cluster Option:       FSinfo host cluster:
5495 @end menu
5497 @node FSinfo host netif, FSinfo host config, , FSinfo host attributes
5498 @comment  node-name,  next,  previous,  up
5499 @subsection netif Option
5501 This defines the set of network interfaces configured on the machine.
5502 The interface attributes collected by @i{FSinfo} are the IP address,
5503 subnet mask and hardware address.  Multiple interfaces may be defined
5504 for hosts with several interfaces by an entry for each interface.  The
5505 values given are sanity checked, but are currently unused for anything
5506 else.
5508 @example
5509 netif       : "netif" @var{<string>} "@{" @i{list(}netif_attrs@i{)} "@}" ;
5511 netif_attrs : netif_attr "=" @var{<string>} ;
5513 netif_attr  : "inaddr" | "netmask" | "hwaddr" ;
5514 @end example
5516 Examples:
5518 @example
5519 netif ie0 @{
5520     inaddr  = 129.31.81.37
5521     netmask = 0xfffffe00
5522     hwaddr  = "08:00:20:01:a6:a5"
5525 netif ec0 @{ @}
5526 @end example
5528 @node FSinfo host config, FSinfo host arch, FSinfo host netif, FSinfo host attributes
5529 @comment  node-name,  next,  previous,  up
5530 @subsection config Option
5531 @cindex FSinfo config host attribute
5532 @cindex config, FSinfo host attribute
5534 This option allows you to specify configuration variables for the
5535 startup scripts (@file{rc} scripts).  A simple string should immediately
5536 follow the keyword.
5538 Example:
5540 @example
5541 config "NFS_SERVER=true"
5542 config "ZEPHYR=true"
5543 @end example
5545 This option is currently unsupported.
5547 @node FSinfo host arch, FSinfo host os, FSinfo host config, FSinfo host attributes
5548 @comment  node-name,  next,  previous,  up
5549 @subsection arch Option
5550 @cindex FSinfo arch host attribute
5551 @cindex arch, FSinfo host attribute
5553 This defines the architecture of the machine.  For example:
5555 @example
5556 arch = hp300
5557 @end example
5559 This is intended to be of use when building architecture specific
5560 mountmaps, however, the option is currently unsupported.
5562 @node FSinfo host os, FSinfo host cluster, FSinfo host arch, FSinfo host attributes
5563 @comment  node-name,  next,  previous,  up
5564 @subsection os Option
5565 @cindex FSinfo os host attribute
5566 @cindex os, FSinfo host attribute
5568 This defines the operating system type of the host.  For example:
5570 @example
5571 os = hpux
5572 @end example
5574 This information is used when creating the @file{fstab} files, for
5575 example in choosing which format to use for the @file{fstab} entries
5576 within the file.
5578 @node FSinfo host cluster, , FSinfo host os, FSinfo host attributes
5579 @comment  node-name,  next,  previous,  up
5580 @subsection cluster Option
5581 @cindex FSinfo cluster host attribute
5582 @cindex cluster, FSinfo host attribute
5584 This is used for specifying in which cluster the machine belongs.  For
5585 example:
5587 @example
5588 cluster = "theory"
5589 @end example
5591 The cluster is intended to be used when generating the automount maps,
5592 although it is currently unsupported.
5594 @node FSinfo filesystems, FSinfo static mounts, FSinfo host attributes, FSinfo host definitions
5595 @comment  node-name,  next,  previous,  up
5596 @section @i{FSinfo} filesystems
5597 @cindex FSinfo filesystems
5599 The list of physically attached filesystems follows the machine
5600 attributes.  These should define all the filesystems available from this
5601 machine, whether exported or not.  In addition to the device name,
5602 filesystems have several attributes, such as filesystem type, mount
5603 options, and @samp{fsck} pass number which are needed to generate
5604 @file{fstab} entries.
5606 @example
5607 filesystem  : "fs" @var{<device>} "@{" @i{list(}fs_data@i{)} "@}" ;
5609 fs_data     : fs_data_attr "=" @var{<string>}
5610             | mount
5611             ;
5613 fs_data_attr
5614             : "fstype" | "opts" | "passno"
5615             | "freq" | "dumpset" | "log"
5616             ;
5617 @end example
5619 Here, @var{<device>} is the device name of the disk (for example,
5620 @file{/dev/dsk/2s0}).  The device name is used for building the mount
5621 maps and for the @file{fstab} file.  The attributes that can be
5622 specified are shown in the following section.
5624 The @i{FSinfo} configuration file for @code{dylan.doc.ic.ac.uk} is listed below.
5626 @example
5627 host dylan.doc.ic.ac.uk
5629 fs /dev/dsk/0s0 @{
5630         fstype = swap
5633 fs /dev/dsk/0s0 @{
5634         fstype = hfs
5635         opts = rw,noquota,grpid
5636         passno = 0;
5637         freq = 1;
5638         mount / @{ @}
5641 fs /dev/dsk/1s0 @{
5642         fstype = hfs
5643         opts = defaults
5644         passno = 1;
5645         freq = 1;
5646         mount /usr @{
5647                 local @{
5648                         exportfs "dougal eden dylan zebedee brian"
5649                         volname /nfs/hp300/local
5650                 @}
5651         @}
5654 fs /dev/dsk/2s0 @{
5655         fstype = hfs
5656         opts = defaults
5657         passno = 1;
5658         freq = 1;
5659         mount default @{
5660                 exportfs "toytown_clients hangers_on"
5661                 volname /home/dylan/dk2
5662         @}
5665 fs /dev/dsk/3s0 @{
5666         fstype = hfs
5667         opts = defaults
5668         passno = 1;
5669         freq = 1;
5670         mount default @{
5671                 exportfs "toytown_clients hangers_on"
5672                 volname /home/dylan/dk3
5673         @}
5676 fs /dev/dsk/5s0 @{
5677         fstype = hfs
5678         opts = defaults
5679         passno = 1;
5680         freq = 1;
5681         mount default @{
5682                 exportfs "toytown_clients hangers_on"
5683                 volname /home/dylan/dk5
5684         @}
5686 @end example
5688 @menu
5689 * fstype Option:        FSinfo filesystems fstype:
5690 * opts Option:          FSinfo filesystems opts:
5691 * passno Option:        FSinfo filesystems passno:
5692 * freq Option:          FSinfo filesystems freq:
5693 * mount Option:         FSinfo filesystems mount:
5694 * dumpset Option:       FSinfo filesystems dumpset:
5695 * log Option:           FSinfo filesystems log:
5696 @end menu
5698 @node FSinfo filesystems fstype, FSinfo filesystems opts, , FSinfo filesystems
5699 @comment  node-name,  next,  previous,  up
5700 @subsection fstype Option
5701 @cindex FSinfo fstype filesystems option
5702 @cindex fstype, FSinfo filesystems option
5703 @cindex export, FSinfo special fstype
5705 This specifies the type of filesystem being declared and will be placed
5706 into the @file{fstab} file as is.  The value of this option will be
5707 handed to @code{mount} as the filesystem type---it should have such
5708 values as @code{4.2}, @code{nfs} or @code{swap}.  The value is not
5709 examined for correctness.
5711 There is one special case.  If the filesystem type is specified as
5712 @samp{export} then the filesystem information will not be added to the
5713 host's @file{fstab} information, but it will still be visible on the
5714 network.  This is useful for defining hosts which contain referenced
5715 volumes but which are not under full control of @i{FSinfo}.
5717 Example:
5719 @example
5720 fstype = swap
5721 @end example
5723 @node FSinfo filesystems opts, FSinfo filesystems passno, FSinfo filesystems fstype, FSinfo filesystems
5724 @comment  node-name,  next,  previous,  up
5725 @subsection opts Option
5726 @cindex FSinfo opts filesystems option
5727 @cindex opts, FSinfo filesystems option
5729 This defines any options that should be given to @b{mount}(8) in the
5730 @file{fstab} file.  For example:
5732 @example
5733 opts = rw,nosuid,grpid
5734 @end example
5736 @node FSinfo filesystems passno, FSinfo filesystems freq, FSinfo filesystems opts, FSinfo filesystems
5737 @comment  node-name,  next,  previous,  up
5738 @subsection passno Option
5739 @cindex FSinfo passno filesystems option
5740 @cindex passno, FSinfo filesystems option
5742 This defines the @b{fsck}(8) pass number in which to check the
5743 filesystem.  This value will be placed into the @file{fstab} file.
5745 Example:
5747 @example
5748 passno = 1
5749 @end example
5751 @node FSinfo filesystems freq, FSinfo filesystems mount, FSinfo filesystems passno, FSinfo filesystems
5752 @comment  node-name,  next,  previous,  up
5753 @subsection freq Option
5754 @cindex FSinfo freq filesystems option
5755 @cindex freq, FSinfo filesystems option
5757 This defines the interval (in days) between dumps.  The value is placed
5758 as is into the @file{fstab} file.
5760 Example:
5762 @example
5763 freq = 3
5764 @end example
5766 @node FSinfo filesystems mount, FSinfo filesystems dumpset, FSinfo filesystems freq, FSinfo filesystems
5767 @comment  node-name,  next,  previous,  up
5768 @subsection mount Option
5769 @cindex FSinfo mount filesystems option
5770 @cindex mount, FSinfo filesystems option
5771 @cindex exportfs, FSinfo mount option
5772 @cindex volname, FSinfo mount option
5773 @cindex sel, FSinfo mount option
5775 This defines the mountpoint at which to place the filesystem.  If the
5776 mountpoint of the filesystem is specified as @code{default}, then the
5777 filesystem will be mounted in the automounter's tree under its volume
5778 name and the mount will automatically be inherited by the automounter.
5780 Following the mountpoint, namespace information for the filesystem may
5781 be described.  The options that can be given here are @code{exportfs},
5782 @code{volname} and @code{sel}.
5784 The format is:
5786 @example
5787 mount       : "mount" vol_tree ;
5789 vol_tree    : @i{list(}vol_tree_attr@i{)} ;
5791 vol_tree_attr
5792             :  @var{<string>} "@{" @i{list(}vol_tree_info@i{)} vol_tree "@}" ;
5794 vol_tree_info
5795             : "exportfs" @var{<export-data>}
5796             | "volname" @var{<volname>}
5797             | "sel" @var{<selector-list>}
5798             ;
5799 @end example
5801 Example:
5803 @example
5804 mount default @{
5805     exportfs "dylan dougal florence zebedee"
5806     volname /vol/andrew
5808 @end example
5810 In the above example, the filesystem currently being declared will have
5811 an entry placed into the @file{exports} file allowing the filesystem to
5812 be exported to the machines @code{dylan}, @code{dougal}, @code{florence}
5813 and @code{zebedee}.  The volume name by which the filesystem will be
5814 referred to remotely, is @file{/vol/andrew}.  By declaring the
5815 mountpoint to be @code{default}, the filesystem will be mounted on the
5816 local machine in the automounter tree, where @i{Amd} will automatically
5817 inherit the mount as @file{/vol/andrew}.@refill
5819 @table @samp
5820 @item exportfs
5821 a string defining which machines the filesystem may be exported to.
5822 This is copied, as is, into the @file{exports} file---no sanity checking
5823 is performed on this string.@refill
5825 @item volname
5826 a string which declares the remote name by which to reference the
5827 filesystem.  The string is entered into a dictionary and allows you to
5828 refer to this filesystem in other places by this volume name.@refill
5830 @item sel
5831 a string which is placed into the automounter maps as a selector for the
5832 filesystem.@refill
5834 @end table
5836 @node FSinfo filesystems dumpset, FSinfo filesystems log, FSinfo filesystems mount, FSinfo filesystems
5837 @comment  node-name,  next,  previous,  up
5838 @subsection dumpset Option
5839 @cindex FSinfo dumpset filesystems option
5840 @cindex dumpset, FSinfo filesystems option
5842 This provides support for Imperial College's local file backup tools and
5843 is not documented further here.
5845 @node FSinfo filesystems log, , FSinfo filesystems dumpset, FSinfo filesystems    
5846 @comment  node-name,  next,  previous,  up
5847 @subsection log Option
5848 @cindex FSinfo log filesystems option
5849 @cindex log, FSinfo filesystems option
5851 Specifies the log device for the current filesystem. This is ignored if
5852 not required by the particular filesystem type.
5854 @node FSinfo static mounts, FSinfo automount definitions , FSinfo filesystems, FSinfo host definitions
5855 @comment  node-name,  next,  previous,  up
5856 @section @i{FSinfo} static mounts
5857 @cindex FSinfo static mounts
5858 @cindex Statically mounts filesystems, FSinfo
5860 Each host may also have a number of statically mounted filesystems.  For
5861 example, the host may be a diskless workstation in which case it will
5862 have no @code{fs} declarations.  In this case the @code{mount}
5863 declaration is used to determine from where its filesystems will be
5864 mounted.  In addition to being added to the @file{fstab} file, this
5865 information can also be used to generate a suitable @file{bootparams}
5866 file.@refill
5868 @example
5869 mount       : "mount" @var{<volname>} @i{list(}localinfo@i{)} ;
5871 localinfo   : localinfo_attr @var{<string>} ;
5873 localinfo_attr
5874             : "as"
5875             | "from"
5876             | "fstype"
5877             | "opts"
5878             ;
5879 @end example
5881 The filesystem specified to be mounted will be searched for in the
5882 dictionary of volume names built when scanning the list of hosts'
5883 definitions.
5885 The attributes have the following semantics:
5886 @table @samp
5887 @item from @var{machine}
5888 mount the filesystem from the machine with the hostname of
5889 @dfn{machine}.@refill
5891 @item as @var{mountpoint}
5892 mount the filesystem locally as the name given, in case this is
5893 different from the advertised volume name of the filesystem.
5895 @item opts @var{options}
5896 native @b{mount}(8) options.
5898 @item fstype @var{type}
5899 type of filesystem to be mounted.
5900 @end table
5902 An example:
5904 @example
5905 mount /export/exec/hp300/local as /usr/local
5906 @end example
5908 If the mountpoint specified is either @file{/} or @file{swap}, the
5909 machine will be considered to be booting off the net and this will be
5910 noted for use in generating a @file{bootparams} file for the host which
5911 owns the filesystems.
5913 @node FSinfo automount definitions, FSinfo Command Line Options, FSinfo static mounts, FSinfo
5914 @comment  node-name,  next,  previous,  up
5915 @section Defining an @i{Amd} Mount Map in @i{FSinfo}
5916 @cindex FSinfo automount definitions
5917 @cindex Defining an Amd mount map, FSinfo
5919 The maps used by @i{Amd} can be constructed from @i{FSinfo} by defining
5920 all the automount trees.  @i{FSinfo} takes all the definitions found and
5921 builds one map for each top level tree.
5923 The automount tree is usually defined last.  A single automount
5924 configuration will usually apply to an entire management domain.  One
5925 @code{automount} declaration is needed for each @i{Amd} automount point.
5926 @i{FSinfo} determines whether the automount point is @dfn{direct}
5927 (@pxref{Direct Automount Filesystem}) or @dfn{indirect}
5928 (@pxref{Top-level Filesystem}).  Direct automount points are
5929 distinguished by the fact that there is no underlying
5930 @dfn{automount_tree}.@refill
5932 @example
5933 automount   : "automount" @i{opt(}auto_opts@i{)} automount_tree ;
5935 auto_opts   : "opts" @var{<mount-options>} ;
5937 automount_tree
5938             : @i{list(}automount_attr@i{)}
5939             ;
5941 automount_attr
5942             : @var{<string>} "=" @var{<volname>}
5943             | @var{<string>} "->" @var{<symlink>}
5944             | @var{<string>} "@{" automount_tree "@}"
5945             ;
5946 @end example
5948 If @var{<mount-options>} is given, then it is the string to be placed in
5949 the maps for @i{Amd} for the @code{opts} option.
5951 A @dfn{map} is typically a tree of filesystems, for example @file{home}
5952 normally contains a tree of filesystems representing other machines in
5953 the network.
5955 A map can either be given as a name representing an already defined
5956 volume name, or it can be a tree.  A tree is represented by placing
5957 braces after the name.  For example, to define a tree @file{/vol}, the
5958 following map would be defined:
5960 @example
5961 automount /vol @{ @}
5962 @end example
5964 Within a tree, the only items that can appear are more maps.
5965 For example:
5967 @example
5968 automount /vol @{
5969     andrew @{ @}
5970     X11 @{ @}
5972 @end example
5974 In this case, @i{FSinfo} will look for volumes named @file{/vol/andrew}
5975 and @file{/vol/X11} and a map entry will be generated for each.  If the
5976 volumes are defined more than once, then @i{FSinfo} will generate
5977 a series of alternate entries for them in the maps.@refill
5979 Instead of a tree, either a link (@var{name} @code{->}
5980 @var{destination}) or a reference can be specified (@var{name} @code{=}
5981 @var{destination}).  A link creates a symbolic link to the string
5982 specified, without further processing the entry.  A reference will
5983 examine the destination filesystem and optimize the reference.  For
5984 example, to create an entry for @code{njw} in the @file{/homes} map,
5985 either of the two forms can be used:@refill
5987 @example
5988 automount /homes @{
5989     njw -> /home/dylan/njw
5991 @end example
5995 @example
5996 automount /homes @{
5997     njw = /home/dylan/njw
5999 @end example
6001 In the first example, when @file{/homes/njw} is referenced from @i{Amd},
6002 a link will be created leading to @file{/home/dylan/njw} and the
6003 automounter will be referenced a second time to resolve this filename.
6004 The map entry would be:
6006 @example
6007 njw type:=link;fs:=/home/dylan/njw
6008 @end example
6010 In the second example, the destination directory is analyzed and found
6011 to be in the filesystem @file{/home/dylan} which has previously been
6012 defined in the maps. Hence the map entry will look like:
6014 @example
6015 njw rhost:=dylan;rfs:=/home/dylan;sublink:=njw
6016 @end example
6018 Creating only one symbolic link, and one access to @i{Amd}.
6020 @node FSinfo Command Line Options, FSinfo errors, FSinfo automount definitions, FSinfo
6021 @comment  node-name,  next,  previous,  up
6022 @section @i{FSinfo} Command Line Options
6023 @cindex FSinfo command line options
6024 @cindex Command line options, FSinfo
6026 @i{FSinfo} is started from the command line by using the command:
6028 @example
6029 fsinfo [@i{options}] @i{files} ...
6030 @end example
6032 The input to @i{FSinfo} is a single set of definitions of machines and
6033 automount maps.  If multiple files are given on the command-line, then
6034 the files are concatenated together to form the input source.  The files
6035 are passed individually through the C pre-processor before being parsed.
6037 Several options define a prefix for the name of an output file.  If the
6038 prefix is not specified no output of that type is produced.  The suffix
6039 used will correspond either to the hostname to which a file belongs, or
6040 to the type of output if only one file is produced.  Dumpsets and the
6041 @file{bootparams} file are in the latter class.  To put the output into
6042 a subdirectory simply put a @file{/} at the end of the prefix, making
6043 sure that the directory has already been made before running
6044 @i{Fsinfo}.
6046 @menu
6047 * -a FSinfo Option::    Amd automount directory:
6048 * -b FSinfo Option::    Prefix for bootparams files.
6049 * -d FSinfo Option::    Prefix for dumpset data files.
6050 * -e FSinfo Option::    Prefix for exports files.
6051 * -f FSinfo Option::    Prefix for fstab files.
6052 * -h FSinfo Option::    Local hostname.
6053 * -m FSinfo Option::    Prefix for automount maps.
6054 * -q FSinfo Option::    Ultra quiet mode.
6055 * -v FSinfo Option::    Verbose mode.
6056 * -I FSinfo Option::    Define new #include directory.
6057 * -D-FSinfo Option::    Define macro.
6058 * -U FSinfo Option::    Undefine macro.
6059 @end menu
6061 @node -a FSinfo Option, -b FSinfo Option, FSinfo Command Line Options, FSinfo Command Line Options
6062 @comment  node-name,  next,  previous,  up
6063 @subsection @code{-a} @var{autodir}
6065 Specifies the directory name in which to place the automounter's
6066 mountpoints.  This defaults to @file{/a}.  Some sites have the autodir set
6067 to be @file{/amd}, and this would be achieved by:
6069 @example
6070 fsinfo -a /amd ...
6071 @end example
6073 @node -b FSinfo Option, -d FSinfo Option, -a FSinfo Option, FSinfo Command Line Options
6074 @comment  node-name,  next,  previous,  up
6075 @subsection @code{-b} @var{bootparams}
6076 @cindex bootparams, FSinfo prefix
6078 This specifies the prefix for the @file{bootparams} filename.  If it is
6079 not given, then the file will not be generated.  The @file{bootparams}
6080 file will be constructed for the destination machine and will be placed
6081 into a file named @file{bootparams} and prefixed by this string.  The
6082 file generated contains a list of entries describing each diskless
6083 client that can boot from the destination machine.
6085 As an example, to create a @file{bootparams} file in the directory
6086 @file{generic}, the following would be used:
6088 @example
6089 fsinfo -b generic/ ...
6090 @end example
6092 @node -d FSinfo Option, -e FSinfo Option, -b FSinfo Option, FSinfo Command Line Options
6093 @comment  node-name,  next,  previous,  up
6094 @subsection @code{-d} @var{dumpsets}
6095 @cindex dumpset, FSinfo prefix
6097 This specifies the prefix for the @file{dumpsets} file.  If it is not
6098 specified, then the file will not be generated.  The file will be for
6099 the destination machine and will be placed into a filename
6100 @file{dumpsets}, prefixed by this string.  The @file{dumpsets} file is
6101 for use by Imperial College's local backup system.
6103 For example, to create a @file{dumpsets} file in the directory @file{generic},
6104 then you would use the following:
6106 @example
6107 fsinfo -d generic/ ...
6108 @end example
6110 @node -e FSinfo Option, -f FSinfo Option, -d FSinfo Option, FSinfo Command Line Options
6111 @comment  node-name,  next,  previous,  up
6112 @subsection @code{-e} @var{exportfs}
6113 @cindex exports, FSinfo prefix
6115 Defines the prefix for the @file{exports} files.  If it is not given,
6116 then the file will not be generated.  For each machine defined in the
6117 configuration files as having disks, an @file{exports} file is
6118 constructed and given a filename determined by the name of the machine,
6119 prefixed with this string.  If a machine is defined as diskless, then no
6120 @file{exports} file will be created for it.  The files contain entries
6121 for directories on the machine that may be exported to clients.
6123 Example: To create the @file{exports} files for each diskfull machine
6124 and place them into the directory @file{exports}:
6126 @example
6127 fsinfo -e exports/ ...
6128 @end example
6130 @node -f FSinfo Option, -h FSinfo Option, -e FSinfo Option, FSinfo Command Line Options
6131 @comment  node-name,  next,  previous,  up
6132 @subsection @code{-f} @var{fstab}
6133 @cindex fstab, FSinfo prefix
6135 This defines the prefix for the @file{fstab} files.  The files will only
6136 be created if this prefix is defined.  For each machine defined in the
6137 configuration files, a @file{fstab} file is created with the filename
6138 determined by prefixing this string with the name of the machine.  These
6139 files contain entries for filesystems and partitions to mount at boot
6140 time.
6142 Example, to create the files in the directory @file{fstabs}:
6144 @example
6145 fsinfo -f fstabs/ ...
6146 @end example
6148 @node -h FSinfo Option, -m FSinfo Option, -f FSinfo Option, FSinfo Command Line Options
6149 @comment  node-name,  next,  previous,  up
6150 @subsection @code{-h} @var{hostname}
6151 @cindex hostname, FSinfo command line option
6153 Defines the hostname of the destination machine to process for.  If this
6154 is not specified, it defaults to the local machine name, as returned by
6155 @b{gethostname}(2).
6157 Example:
6159 @example
6160 fsinfo -h dylan.doc.ic.ac.uk ...
6161 @end example
6163 @node -m FSinfo Option, -q FSinfo Option, -h FSinfo Option, FSinfo Command Line Options
6164 @comment  node-name,  next,  previous,  up
6165 @subsection @code{-m} @var{mount-maps}
6166 @cindex maps, FSinfo command line option
6168 Defines the prefix for the automounter files.  The maps will only be
6169 produced if this prefix is defined.  The mount maps suitable for the
6170 network defined by the configuration files will be placed into files
6171 with names calculated by prefixing this string to the name of each map.
6173 For example, to create the automounter maps and place them in the
6174 directory @file{automaps}:
6176 @example
6177 fsinfo -m automaps/ ...
6178 @end example
6180 @node -q FSinfo Option, -v FSinfo Option, -m FSinfo Option, FSinfo Command Line Options
6181 @comment  node-name,  next,  previous,  up
6182 @subsection @code{-q}
6183 @cindex quiet, FSinfo command line option
6185 Selects quiet mode.  @i{FSinfo} suppress the ``running commentary'' and
6186 only outputs any error messages which are generated.
6188 @node -v FSinfo Option, -D-FSinfo Option, -q FSinfo Option, FSinfo Command Line Options
6189 @comment  node-name,  next,  previous,  up
6190 @subsection @code{-v}
6191 @cindex verbose, FSinfo command line option
6193 Selects verbose mode.  When this is activated, the program will display
6194 more messages, and display all the information discovered when
6195 performing the semantic analysis phase.  Each verbose message is output
6196 to @file{stdout} on a line starting with a @samp{#} character.
6198 @node -D-FSinfo Option, -I FSinfo Option, -v FSinfo Option, FSinfo Command Line Options
6199 @comment  node-name,  next,  previous,  up
6200 @subsection @code{-D} @var{name[=defn]}
6202 Defines a symbol @dfn{name} for the preprocessor when reading the
6203 configuration files.  Equivalent to @code{#define} directive.
6205 @node -I FSinfo Option, -U FSinfo Option, -D-FSinfo Option, FSinfo Command Line Options
6206 @comment  node-name,  next,  previous,  up
6207 @subsection @code{-I} @var{directory}
6209 This option is passed into the preprocessor for the configuration files.
6210 It specifies directories in which to find include files
6212 @node -U FSinfo Option, , -I FSinfo Option, FSinfo Command Line Options
6213 @comment  node-name,  next,  previous,  up
6214 @subsection @code{-U} @var{name}
6216 Removes any initial definition of the symbol @dfn{name}.  Inverse of the
6217 @code{-D} option.
6219 @node FSinfo errors, , FSinfo Command Line Options, FSinfo
6220 @comment  node-name,  next,  previous,  up
6221 @section Errors produced by @i{FSinfo}
6222 @cindex FSinfo error messages
6224 The following table documents the errors and warnings which @i{FSinfo} may produce.
6226 @table @t
6228 @item " expected
6229 Occurs if an unescaped newline is found in a quoted string.
6231 @item ambiguous mount: @var{volume} is a replicated filesystem
6232 If several filesystems are declared as having the same volume name, they
6233 will be considered replicated filesystems.  To mount a replicated
6234 filesystem statically, a specific host will need to be named, to say
6235 which particular copy to try and mount, else this error will
6236 result.
6238 @item can't open @var{filename} for writing
6239 Occurs if any errors are encountered when opening an output file.
6241 @item cannot determine localname since volname @var{volume} is not uniquely defined
6242 If a volume is replicated and an attempt is made to mount the filesystem
6243 statically without specifying a local mountpoint, @i{FSinfo} cannot
6244 calculate a mountpoint, as the desired pathname would be
6245 ambiguous.
6247 @item @var{device} has duplicate exportfs data
6248 Produced if the @samp{exportfs} option is used multiple times within the
6249 same branch of a filesystem definition. For example, if you attempt to
6250 set the @samp{exportfs} data at different levels of the mountpoint
6251 directory tree.
6253 @item dump frequency for @var{host}:@var{device} is non-zero
6254 Occurs if @var{device} has its @samp{fstype} declared to be @samp{swap}
6255 or @samp{export} and the @samp{dump} option is set to a value greater
6256 than zero.  Swap devices should not be dumped.
6258 @item duplicate host @var{hostname}!
6259 If a host has more than one definition.
6261 @item end of file within comment
6262 A comment was unterminated before the end of one of the configuration
6263 files.
6265 @item @var{filename}: cannot open for reading
6266 If a file specified on the command line as containing configuration data
6267 could not be opened.
6269 @item @var{filesystem} has a volname but no exportfs data
6270 Occurs when a volume name is declared for a file system, but the string
6271 specifying what machines the filesystem can be exported to is
6272 missing.
6274 @item fs field "@var{field-name}" already set
6275 Occurs when multiple definitions are given for one of the attributes of a
6276 host's filesystem.
6278 @item host field "@var{field-name}" already set
6279 If duplicate definitions are given for any of the fields with a host
6280 definition.
6282 @item @var{host}:@var{device} has more than one mount point
6283 Occurs if the mount option for a host's filesystem specifies multiple
6284 trees at which to place the mountpoint.
6286 @item @var{host}:@var{device} has no mount point
6287 Occurs if the @samp{mount} option is not specified for a host's
6288 filesystem.
6290 @item @var{host}:@var{device} needs field "@var{field-name}"
6291 Occurs when a filesystem is missing a required field. @var{field-name} could
6292 be one of @samp{fstype}, @samp{opts}, @samp{passno} or
6293 @samp{mount}.
6295 @item @var{host}:mount field specified for swap partition
6296 Occurs if a mountpoint is given for a filesystem whose type is declared
6297 to be @samp{swap}.
6299 @item malformed IP dotted quad: @var{address}
6300 If the Internet address of an interface is incorrectly specified.  An
6301 Internet address definition is handled to @b{inet_addr}(3N) to see if it
6302 can cope.  If not, then this message will be displayed.
6304 @item malformed netmask: @var{netmask}
6305 If the netmask cannot be decoded as though it were a hexadecimal number,
6306 then this message will be displayed.  It will typically be caused by
6307 incorrect characters in the @var{netmask} value.
6309 @item mount field "@var{field-name}" already set
6310 Occurs when a static mount has multiple definitions of the same field.
6312 @item mount tree field "@var{field-name}" already set
6313 Occurs when the @var{field-name} is defined more than once during the
6314 definition of a filesystems mountpoint.
6316 @item netif field @var{field-name} already set
6317 Occurs if you attempt to define an attribute of an interface more than
6318 once.
6320 @item network booting requires both root and swap areas
6321 Occurs if a machine has mount declarations for either the root partition
6322 or the swap area, but not both.  You cannot define a machine to only
6323 partially boot via the network.
6325 @item no disk mounts on @var{hostname}
6326 If there are no static mounts, nor local disk mounts specified for a
6327 machine, this message will be displayed.
6329 @item no volname given for @var{host}:@var{device}
6330 Occurs when a filesystem is defined to be mounted on @file{default}, but
6331 no volume name is given for the file system, then the mountpoint cannot
6332 be determined.
6334 @item not allowed '/' in a directory name
6335 Occurs when a pathname with multiple directory elements is specified as
6336 the name for an automounter tree.  A tree should only have one name at
6337 each level.
6339 @item pass number for @var{host}:@var{device} is non-zero
6340 Occurs if @var{device} has its @samp{fstype} declared to be @samp{swap}
6341 or @samp{export} and the @b{fsck}(8) pass number is set. Swap devices should not be
6342 fsck'd.  @xref{FSinfo filesystems fstype}.
6344 @item sub-directory @var{directory} of @var{directory-tree} starts with '/'
6345 Within the filesystem specification for a host, if an element
6346 @var{directory} of the mountpoint begins with a @samp{/} and it is not
6347 the start of the tree.
6349 @item sub-directory of @var{directory-tree} is named "default"
6350 @samp{default} is a keyword used to specify if a mountpoint should be
6351 automatically calculated by @i{FSinfo}.  If you attempt to specify a
6352 directory name as this, it will use the filename of @file{default} but
6353 will produce this warning.
6355 @item unknown \ sequence
6356 Occurs if an unknown escape sequence is found inside a string.  Within a
6357 string, you can give the standard C escape sequences for strings, such
6358 as newlines and tab characters.
6360 @item unknown directory attribute
6361 If an unknown keyword is found while reading the definition of a host's
6362 filesystem mount option.
6364 @item unknown filesystem attribute
6365 Occurs if an unrecognized keyword is used when defining a host's
6366 filesystems.
6368 @item unknown host attribute
6369 Occurs if an unrecognized keyword is used when defining a host.
6371 @item unknown mount attribute
6372 Occurs if an unrecognized keyword is found while parsing the list of
6373 static mounts.
6375 @item unknown volname @var{volume} automounted @i{[} on @i{name} @i{]}
6376 Occurs if @var{volume} is used in a definition of an automount map but the volume
6377 name has not been declared during the host filesystem definitions.
6379 @item volname @var{volume} is unknown
6380 Occurs if an attempt is made to mount or reference a volume name which
6381 has not been declared during the host filesystem definitions.
6383 @item volname @var{volume} not exported from @var{machine}
6384 Occurs if you attempt to mount the volume @var{volume} from a machine
6385 which has not declared itself to have such a filesystem
6386 available.
6388 @end table
6390 @c ################################################################
6391 @node Hlfsd, Assorted Tools, FSinfo, Top
6392 @comment  node-name,  next,  previous,  up
6393 @chapter Hlfsd
6394 @pindex Hlfsd
6395 @cindex Home-Link Filesystem
6397 @i{Hlfsd} is a daemon which implements a filesystem containing a
6398 symbolic link to subdirectory within a user's home directory, depending
6399 on the user which accessed that link.  It was primarily designed to
6400 redirect incoming mail to users' home directories, so that it can be read
6401 from anywhere.  It was designed and implemented by
6402 @email{ezk@@cs.columbia.edu,Erez Zadok} and
6403 @email{dupuy@@cs.columbia.edu,Alexander Dupuy}, at the
6404 @uref{http://www.cs.columbia.edu/,Computer Science Department} of
6405 @uref{http://www.columbia.edu/,Columbia University}.  A
6406 @uref{http://www.cs.columbia.edu/~ezk/research/hlfsd/hlfsd.html,paper}
6407 on @i{Hlfsd} was presented at the Usenix LISA VII conference in 1993.
6409 @i{Hlfsd} operates by mounting itself as an NFS server for the directory
6410 containing @i{linkname}, which defaults to @file{/hlfs/home}.  Lookups
6411 within that directory are handled by @i{Hlfsd}, which uses the
6412 password map to determine how to resolve the lookup.  The directory will
6413 be created if it doesn't already exist.  The symbolic link will be to
6414 the accessing user's home directory, with @i{subdir} appended to it.  If
6415 not specified, @i{subdir} defaults to @file{.hlfsdir}.  This directory
6416 will also be created if it does not already exist.
6418 A @samp{SIGTERM} sent to @i{Hlfsd} will cause it to shutdown.  A
6419 @samp{SIGHUP} will flush the internal caches, and reload the password
6420 map.  It will also close and reopen the log file, to enable the original
6421 log file to be removed or rotated.  A @samp{SIGUSR1} will cause it to
6422 dump its internal table of user IDs and home directories to the file
6423 @file{/tmp/hlfsddump}.
6425 @menu
6426 * Introduction to Hlfsd::
6427 * Background to Mail Delivery::        
6428 * Using Hlfsd::       
6429 @end menu
6431 @c ================================================================
6432 @node Introduction to Hlfsd, Background to Mail Delivery, Hlfsd, Hlfsd
6433 @comment  node-name,  next,  previous,  up
6434 @section Introduction to Hlfsd
6435 @cindex Introduction to Hlfsd
6436 @cindex Hlfsd; introduction
6438 Electronic mail has become one of the major applications for many
6439 computer networks, and use of this service is expected to increase over
6440 time, as networks proliferate and become faster.  Providing a convenient
6441 environment for users to read, compose, and send electronic mail has
6442 become a requirement for systems administrators (SAs).
6444 Widely used methods for handling mail usually require users to be logged
6445 into a designated ``home'' machine, where their mailbox files reside.
6446 Only on that one machine can they read newly arrived mail.  Since users
6447 have to be logged into that system to read their mail, they often find
6448 it convenient to run all of their other processes on that system as
6449 well, including memory and CPU-intensive jobs.  For example, in our
6450 department, we have allocated and configured several multi-processor
6451 servers to handle such demanding CPU/memory applications, but these were
6452 underutilized, in large part due to the inconvenience of not being able
6453 to read mail on those machines.  (No home directories were located on
6454 these designated CPU-servers, since we did not want NFS service for
6455 users' home directories to have to compete with CPU-intensive jobs.  At the
6456 same time, we discouraged users from running demanding applications on
6457 their home machines.)
6459 Many different solutions have been proposed to allow users to read their
6460 mail on any host.  However, all of these solutions fail in one or more
6461 of several ways:
6463 @itemize @bullet
6465 @item
6466 they introduce new single points of failure
6468 @item
6469 they require using different mail transfer agents (MTAs) or user agents
6470 (UAs)
6472 @item
6473 they do not solve the problem for all cases, i.e.  the solution is only
6474 partially successful for a particular environment.
6476 @end itemize
6478 We have designed a simple filesystem, called the @dfn{Home-Link File
6479 System}, to provide the ability to deliver mail to users' home
6480 directories, without modification to mail-related applications. We have
6481 endeavored to make it as stable as possible.  Of great importance to us
6482 was to make sure the HLFS daemon, @file{hlfsd} , would not hang under
6483 any circumstances, and would take the next-best action when faced with
6484 problems.  Compared to alternative methods, @i{Hlfsd} is a stable, more
6485 general solution, and easier to install/use.  In fact, in some ways, we
6486 have even managed to improve the reliability and security of mail
6487 service.
6489 Our server implements a small filesystem containing a symbolic link
6490 to a subdirectory of the invoking user's home directory, and named symbolic
6491 links to users' mailbox files.
6493 The @i{Hlfsd} server finds out the @var{uid} of the process that is
6494 accessing its mount point, and resolves the pathname component @samp{home} as a
6495 symbolic link to a subdirectory within the home directory given by the
6496 @var{uid}'s entry in the password file.  If the @var{gid} of the process
6497 that attempts to access a mailbox file is a special one (called
6498 HLFS_GID), then the server maps the name of the @emph{next} pathname
6499 component directly to the user's mailbox.  This is necessary so that
6500 access to a mailbox file by users other than the owner can succeed.  The
6501 server has safety features in case of failures such as hung filesystems
6502 or home directory filesystems that are inaccessible or full.
6504 On most of our machines, mail gets delivered to the directory
6505 @file{/var/spool/mail}. Many programs, including UAs, depend on that
6506 path.  @i{Hlfsd} creates a directory @file{/mail}, and mounts itself on
6507 top of that directory.  @i{Hlfsd} implements the path name component
6508 called @samp{home}, pointing to a subdirectory of the user's home directory.
6509 We have made @file{/var/spool/mail} a symbolic link to
6510 @file{/mail/home}, so that accessing @file{/var/spool/mail} actually
6511 causes access to a subdirectory within a user's home directory.
6513 The following table shows an example of how resolving the pathname
6514 @file{/var/mail/@i{NAME}} to @file{/users/ezk/.mailspool/@i{NAME}} proceeds.
6516 @multitable {Resolving Component} {Pathname left to resolve} {Value if symbolic link}
6518 @item @b{Resolving Component}
6519 @tab @b{Pathname left to resolve}
6520 @tab @b{Value if symbolic link}
6522 @item @t{/}
6523 @tab @t{var/mail/}@i{NAME}
6525 @item @t{var/}
6526 @tab @t{mail/}@i{NAME}
6528 @item @t{mail}@@
6529 @tab @t{/mail/home/}@i{NAME}
6530 @tab @t{mail}@@ -> @t{/mail/home}
6532 @item @t{/}
6533 @tab @t{mail/home/}@i{NAME}
6535 @item @t{mail/}
6536 @tab @t{home/}@i{NAME}
6538 @item @t{home}@@
6539 @tab @i{NAME}
6540 @tab @t{home}@@ -> @t{/users/ezk/.mailspool}
6542 @item @t{/}
6543 @tab @t{users/ezk/.mailspool/}@i{NAME}
6545 @item @t{users/}
6546 @tab @t{ezk/.mailspool/}@i{NAME}
6548 @item @t{ezk/}
6549 @tab @t{.mailspool/}@i{NAME}
6551 @item @t{.mailspool/}
6552 @tab @i{NAME}
6554 @item @i{NAME}
6556 @end multitable
6558 @c ================================================================
6559 @node Background to Mail Delivery, Using Hlfsd, Introduction to Hlfsd, Hlfsd
6560 @comment  node-name,  next,  previous,  up
6561 @section Background to Mail Delivery
6562 @cindex Background to Mail Delivery
6563 @cindex Hlfsd; background
6565 This section provides an in-depth discussion of why available methods
6566 for delivering mail to home directories are not as good as the one used
6567 by @i{Hlfsd}.
6569 @menu
6570 * Single-Host Mail Spool Directory::
6571 * Centralized Mail Spool Directory::
6572 * Distributed Mail Spool Service::
6573 * Why Deliver Into the Home Directory?::
6574 @end menu
6576 @c ----------------------------------------------------------------
6577 @node Single-Host Mail Spool Directory, Centralized Mail Spool Directory, Background to Mail Delivery, Background to Mail Delivery
6578 @comment  node-name,  next,  previous,  up
6579 @subsection Single-Host Mail Spool Directory
6580 @cindex Single-Host Mail Spool Directory
6582 The most common method for mail delivery is for mail to be appended to a
6583 mailbox file in a standard spool directory on the designated ``mail
6584 home'' machine of the user. The greatest advantage of this method is
6585 that it is the default method most vendors provide with their systems,
6586 thus very little (if any) configuration is required on the SA's part.
6587 All they need to set up are mail aliases directing mail to the host on
6588 which the user's mailbox file is assigned.  (Otherwise, mail is
6589 delivered locally, and users find mailboxes on many machines.)
6591 As users become more sophisticated, and aided by windowing systems, they
6592 find themselves logging in on multiple hosts at once, performing several
6593 tasks concurrently.  They ask to be able to read their mail on any host
6594 on the network, not just the one designated as their ``mail home''.
6596 @c ----------------------------------------------------------------
6597 @node Centralized Mail Spool Directory, Distributed Mail Spool Service, Single-Host Mail Spool Directory, Background to Mail Delivery
6598 @comment  node-name,  next,  previous,  up
6599 @subsection Centralized Mail Spool Directory
6600 @cindex Centralized Mail Spool Directory
6602 A popular method for providing mail readability from any host is to have
6603 all mail delivered to a mail spool directory on a designated
6604 ``mail-server'' which is exported via NFS to all of the hosts on the
6605 network.  Configuring such a system is relatively easy.  On most
6606 systems, the bulk of the work is a one-time addition to one or two
6607 configuration files in @file{/etc}.  The file-server's spool directory
6608 is then hard-mounted across every machine on the local network.  In
6609 small environments with only a handful of hosts this can be an
6610 acceptable solution.  In our department, with a couple of hundred active
6611 hosts and thousands of mail messages processed daily, this was deemed
6612 completely unacceptable, as it introduced several types of problems:
6614 @table @b
6616 @item Scalability and Performance
6618 As more and more machines get added to the network, more mail traffic
6619 has to go over NFS to and from the mail-server. Users like to run
6620 mail-watchers, and read their mail often. The stress on the shared
6621 infrastructure increases with every user and host added; loads on the
6622 mail server would most certainly be high since all mail delivery goes
6623 through that one machine.@footnote{ Delivery via NFS-mounted filesystems
6624 may require usage of @samp{rpc.lockd} and @samp{rpc.statd} to provide
6625 distributed file-locking, both of which are widely regarded as unstable
6626 and unreliable.  Furthermore, this will degrade performance, as local
6627 processes as well as remote @samp{nfsd} processes are kept busy.}  This
6628 leads to lower reliability and performance.  To reduce the number of
6629 concurrent connections between clients and the server host, some SAs
6630 have resorted to automounting the mail-spool directory.  But this
6631 solution only makes things worse: since users often run mail watchers,
6632 and many popular applications such as @samp{trn}, @samp{emacs},
6633 @samp{csh} or @samp{ksh} check periodically for new mail, the
6634 automounted directory would be effectively permanently mounted.  If it
6635 gets unmounted automatically by the automounter program, it is most
6636 likely to get mounted shortly afterwards, consuming more I/O resources
6637 by the constant cycle of mount and umount calls.
6639 @item Reliability
6641 The mail-server host and its network connectivity must be very reliable.
6642 Worse, since the spool directory has to be hard-mounted,@footnote{No SA
6643 in their right minds would soft-mount read/write partitions --- the
6644 chances for data loss are too great.} many processes which access the
6645 spool directory (various shells, @samp{login}, @samp{emacs}, etc.)
6646 would be hung as long as connectivity to the mail-server is severed. To
6647 improve reliability, SAs may choose to backup the mail-server's spool
6648 partition several times a day.  This may make things worse since reading
6649 or delivering mail while backups are in progress may cause backups to be
6650 inconsistent; more backups consume more backup-media resources, and
6651 increase the load on the mail-server host.
6653 @end table
6655 @c ----------------------------------------------------------------
6656 @node Distributed Mail Spool Service, Why Deliver Into the Home Directory?, Centralized Mail Spool Directory, Background to Mail Delivery
6657 @comment  node-name,  next,  previous,  up
6658 @subsection Distributed Mail Spool Service
6659 @cindex Distributed Mail Spool Service
6661 Despite the existence of a few systems that support delivery to users'
6662 home directories, mail delivery to home directories hasn't caught on.
6663 We believe the main reason is that there are too many programs that
6664 ``know'' where mailbox files reside.  Besides the obvious (the delivery
6665 program @file{/bin/mail} and mail readers like @file{/usr/ucb/Mail},
6666 @samp{mush}, @samp{mm}, etc.), other programs that know mailbox location
6667 are login, from, almost every shell, @samp{xbiff}, @samp{xmailbox}, and
6668 even some programs not directly related to mail, such as @samp{emacs}
6669 and @samp{trn}.  Although some of these programs can be configured to
6670 look in different directories with the use of environment variables and
6671 other resources, many of them cannot.  The overall porting work is
6672 significant.
6674 Other methods that have yet to catch on require the use of a special
6675 mail-reading server, such as IMAP or POP.  The main disadvantage of
6676 these systems is that UAs need to be modified to use these services ---
6677 a long and involved task.  That is why they are not popular at this
6678 time.
6680 Several other ideas have been proposed and even used in various
6681 environments.  None of them is robust.  They are mostly very
6682 specialized, inflexible, and do not extend to the general case.  Some of
6683 the ideas are plain bad, potentially leading to lost or corrupt mail:
6685 @table @b
6687 @item automounters
6689 Using an automounter such as @i{Amd} to provide a set of symbolic links
6690 from the normal spool directory to user home directories is not
6691 sufficient.  UAs rename, unlink, and recreate the mailbox as a regular
6692 file, therefore it must be a real file, not a symbolic link.
6693 Furthermore, it must reside in a real directory which is writable by the
6694 UAs and MTAs.  This method may also require populating
6695 @file{/var/spool/mail} with symbolic links and making sure they are
6696 updated.  Making @i{Amd} manage that directory directly fails, since
6697 many various lock files need to be managed as well.  Also, @i{Amd} does
6698 not provide all of the NFS operations which are required to write mail
6699 such as write, create, remove, and unlink.
6701 @item @code{$MAIL}
6703 Setting this variable to an automounted directory pointing to the user's
6704 mail spool host only solves the problem for those programs which know
6705 and use @code{$MAIL}.  Many programs don't, therefore this solution is partial
6706 and of limited flexibility.  Also, it requires the SAs or the users to
6707 set it themselves --- an added level of inconvenience and possible
6708 failures.
6710 @item @t{/bin/mail}
6712 Using a different mail delivery agent could be the solution.  One such
6713 example is @samp{hdmail}.  However, @samp{hdmail} still requires
6714 modifying all UAs, the MTA's configuration, installing new daemons, and
6715 changing login scripts.  This makes the system less upgradable or
6716 compatible with others, and adds one more complicated system for SAs to
6717 deal with.  It is not a complete solution because it still requires each
6718 user have their @code{$MAIL} variable setup correctly, and that every program
6719 use this variable.
6721 @end table
6723 @c ----------------------------------------------------------------
6724 @node Why Deliver Into the Home Directory?, , Distributed Mail Spool Service, Background to Mail Delivery
6725 @comment  node-name,  next,  previous,  up
6726 @subsection Why Deliver Into the Home Directory?
6727 @cindex Why Deliver Into the Home Directory?
6728 @cindex Hlfsd; Why Deliver Into the Home Directory?
6730 There are several major reasons why SAs might want to deliver mail
6731 directly into the users' home directories:
6733 @table @b
6735 @item Location
6737 Many mail readers need to move mail from the spool directory to the
6738 user's home directory.  It speeds up this operation if the two are on
6739 the same filesystem.  If for some reason the user's home directory is
6740 inaccessible, it isn't that useful to be able to read mail, since there
6741 is no place to move it to.  In some cases, trying to move mail to a
6742 non-existent or hung filesystem may result in mail loss.
6744 @item Distribution
6746 Having all mail spool directories spread among the many more filesystems
6747 minimizes the chances that complete environments will grind to a halt
6748 when a single server is down.  It does increase the chance that there
6749 will be someone who is not able to read their mail when a machine is
6750 down, but that is usually preferred to having no one be able to read
6751 their mail because a centralized mail server is down.  The problem of
6752 losing some mail due to the (presumably) higher chances that a user's
6753 machine is down is minimized in HLFS.
6755 @item Security
6757 Delivering mail to users' home directories has another advantage ---
6758 enhanced security and privacy.  Since a shared system mail spool
6759 directory has to be world-readable and searchable, any user can see
6760 whether other users have mail, when they last received new mail, or when
6761 they last read their mail.  Programs such as @samp{finger} display this
6762 information, which some consider an infringement of privacy.  While it
6763 is possible to disable this feature of @samp{finger} so that remote
6764 users cannot see a mailbox file's status, this doesn't prevent local
6765 users from getting the information.  Furthermore, there are more
6766 programs which make use of this information.  In shared environments,
6767 disabling such programs has to be done on a system-wide basis, but with
6768 mail delivered to users' home directories, users less concerned with
6769 privacy who do want to let others know when they last received or read
6770 mail can easily do so using file protection bits.
6772 @c Lastly, on systems that do not export their NFS filesystem with
6773 @c @t{anon=0}, superusers are less likely to snoop around others' mail, as
6774 @c they become ``nobodies'' across NFS.
6776 @end table
6778 In summary, delivering mail to home directories provides users the
6779 functionality sought, and also avoids most of the problems just
6780 discussed.
6782 @c ================================================================
6783 @node Using Hlfsd, , Background to Mail Delivery, Hlfsd
6784 @comment  node-name,  next,  previous,  up
6785 @section Using Hlfsd
6786 @cindex Using Hlfsd
6787 @cindex Hlfsd; using
6789 @menu
6790 * Controlling Hlfsd:: 
6791 * Hlfsd Options::     
6792 * Hlfsd Files::       
6793 @end menu
6795 @c ----------------------------------------------------------------
6796 @node Controlling Hlfsd, Hlfsd Options, Using Hlfsd, Using Hlfsd
6797 @comment  node-name,  next,  previous,  up
6798 @subsection Controlling Hlfsd
6799 @cindex Controlling Hlfsd
6800 @cindex Hlfsd; controlling
6801 @pindex ctl-hlfsd
6803 Much the same way @i{Amd} is controlled by @file{ctl-amd}, so does
6804 @i{Hlfsd} get controlled by the @file{ctl-hlfsd} script:
6806 @table @t
6808 @item ctl-hlfsd start
6809 Start a new @i{Hlfsd}.
6811 @item ctl-hlfsd stop
6812 Stop a running @i{Hlfsd}.
6814 @item ctl-hlfsd restart
6815 Stop a running @i{Hlfsd}, wait for 10 seconds, and then start a new
6816 one.  It is hoped that within 10 seconds, the previously running
6817 @i{Hlfsd} terminate properly; otherwise, starting a second one could
6818 cause system lockup.
6820 @end table
6822 For example, on our systems, we start @i{Hlfsd} within @file{ctl-hlfsd}
6823 as follows on Solaris 2 systems:
6825 @example
6826 hlfsd -a /var/alt_mail -x all -l /var/log/hlfsd /mail/home .mailspool
6827 @end example
6829 The directory @file{/var/alt_mail} is a directory in the root partition
6830 where alternate mail will be delivered into, when it cannot be delivered
6831 into the user's home directory.
6833 Normal mail gets delivered into @file{/var/mail}, but on our systems,
6834 that is a symbolic link to @file{/mail/home}.  @file{/mail} is managed
6835 by @i{Hlfsd}, which creates a dynamic symlink named @samp{home},
6836 pointing to the subdirectory @file{.mailspool} @emph{within} the
6837 accessing user's home directory.  This results in mail which normally
6838 should go to @file{/var/mail/@code{$USER}}, to go to
6839 @file{@code{$HOME}/.mailspool/@code{$USER}}.
6841 @i{Hlfsd} does not create the @file{/var/mail} symlink.  This needs to
6842 be created (manually) once on each host, by the system administrators,
6843 as follows:
6845 @example
6846 mv /var/mail /var/alt_mail
6847 ln -s /mail/home /var/mail
6848 @end example
6850 @c ----------------------------------------------------------------
6851 @node Hlfsd Options, Hlfsd Files, Controlling Hlfsd, Using Hlfsd
6852 @comment  node-name,  next,  previous,  up
6853 @subsection Hlfsd Options
6854 @cindex Hlfsd Options
6855 @cindex Hlfsd; Options
6857 @table @t
6859 @item -a @var{alt_dir}
6860 Alternate directory.  The name of the directory to which the symbolic
6861 link returned by @i{Hlfsd} will point, if it cannot access the home
6862 directory of the user.  This defaults to @file{/var/hlfs}.  This
6863 directory will be created if it doesn't exist.  It is expected that
6864 either users will read these files, or the system administrators will
6865 run a script to resend this ``lost mail'' to its owner.
6867 @item -c @var{cache-interval}
6868 Caching interval.  @i{Hlfsd} will cache the validity of home directories
6869 for this interval, in seconds.  Entries which have been verified within
6870 the last @var{cache-interval} seconds will not be verified again, since
6871 the operation could be expensive, and the entries are most likely still
6872 valid.  After the interval has expired, @i{Hlfsd} will re-verify the
6873 validity of the user's home directory, and reset the cache time-counter.
6874 The default value for @var{cache-interval} is 300 seconds (5 minutes).
6876 @item -f
6877 Force fast startup.  This option tells @i{Hlfsd} to skip startup-time
6878 consistency checks such as existence of mount directory, alternate spool
6879 directory, symlink to be hidden under the mount directory, their
6880 permissions and validity.
6882 @item -g @var{group}
6883 Set the special group HLFS_GID to @var{group}.  Programs such as
6884 @file{/usr/ucb/from} or @file{/usr/sbin/in.comsat}, which access the
6885 mailboxes of other users, must be setgid @samp{HLFS_GID} to work properly.  The
6886 default group is @samp{hlfs}.  If no group is provided, and there is no
6887 group @samp{hlfs}, this feature is disabled.
6889 @item -h
6890 Help.  Print a brief help message, and exit.
6892 @item -i @var{reload-interval}
6893 Map-reloading interval.  Each @var{reload-interval} seconds, @i{Hlfsd}
6894 will reload the password map.  @i{Hlfsd} needs the password map for the
6895 UIDs and home directory pathnames.  @i{Hlfsd} schedules a @samp{SIGALRM} to
6896 reload the password maps.  A @samp{SIGHUP} sent to @i{Hlfsd} will force it to
6897 reload the maps immediately.  The default value for
6898 @var{reload-interval} is 900 seconds (15 minutes.)
6900 @item -l @var{logfile}
6901 Specify a log file to which @i{Hlfsd} will record events.  If
6902 @var{logfile} is the string @samp{syslog} then the log messages will be
6903 sent to the system log daemon by @b{syslog}(3), using the @samp{LOG_DAEMON}
6904 facility.  This is also the default.
6906 @item -n
6907 No verify.  @i{Hlfsd} will not verify the validity of the symbolic link
6908 it will be returning, or that the user's home directory contains
6909 sufficient disk-space for spooling.  This can speed up @i{Hlfsd} at the
6910 cost of possibly returning symbolic links to home directories which are
6911 not currently accessible or are full.  By default, @i{Hlfsd} validates
6912 the symbolic-link in the background.  The @code{-n} option overrides the
6913 meaning of the @code{-c} option, since no caching is necessary.
6915 @item -o @var{mount-options}
6916 Mount options which @i{Hlfsd} will use to mount itself on top of
6917 @var{dirname}.  By default, @var{mount-options} is set to @samp{ro}.  If
6918 the system supports symbolic-link caching, default options are set
6919 to @samp{ro,nocache}.
6921 @item -p
6922 Print PID.  Outputs the process-id of @i{Hlfsd} to standard output where
6923 it can be saved into a file.
6925 @item -v
6926 Version.  Displays version information to standard error.
6928 @item -x @var{log-options}
6929 Specify run-time logging options.  The options are a comma separated
6930 list chosen from: @samp{fatal}, @samp{error}, @samp{user}, @samp{warn}, @samp{info}, @samp{map}, @samp{stats}, @samp{all}.
6932 @item -C
6933 Force @i{Hlfsd} to run on systems that cannot turn off the NFS
6934 attribute-cache.  Use of this option on those systems is discouraged, as
6935 it may result in loss or misdelivery of mail.  The option is ignored on
6936 systems that can turn off the attribute-cache.
6938 @item -D @var{log-options}
6939 Select from a variety of debugging options.  Prefixing an option with
6940 the string @samp{no} reverses the effect of that option.  Options are
6941 cumulative.  The most useful option is @samp{all}.  Since this option is
6942 only used for debugging other options are not documented here.  A fuller
6943 description is available in the program source.  A @samp{SIGUSR1} sent
6944 to @i{Hlfsd} will cause it to dump its internal password map to the file
6945 @file{/usr/tmp/hlfsd.dump.XXXXXX}, where @samp{XXXXXX} will be replaced
6946 by a random string generated by @b{mktemp}(3) or (the more secure)
6947 @b{mkstemp}(3).
6949 @item -P @var{password-file}
6950 Read the user-name, user-id, and home directory information from the
6951 file @var{password-file}.  Normally, @i{Hlfsd} will use @b{getpwent}(3)
6952 to read the password database.  This option allows you to override the
6953 default database, and is useful if you want to map users' mail files to
6954 a directory other than their home directory.  Only the username, uid,
6955 and home-directory fields of the file @var{password-file} are read and
6956 checked.  All other fields are ignored.  The file @var{password-file}
6957 must otherwise be compliant with Unix Version 7 colon-delimited format
6958 @b{passwd}(4).
6960 @end table
6962 @c ----------------------------------------------------------------
6963 @node Hlfsd Files, , Hlfsd Options, Using Hlfsd
6964 @comment  node-name,  next,  previous,  up
6965 @subsection Hlfsd Files
6966 @cindex Hlfsd Files
6967 @cindex Hlfsd; Files
6969 The following files are used by @i{Hlfsd}:
6971 @table @file
6973 @item /hlfs
6974 directory under which @i{Hlfsd} mounts itself and manages the symbolic
6975 link @file{home}.
6977 @item .hlfsdir
6978 default sub-directory in the user's home directory, to which the
6979 @file{home} symbolic link returned by @i{Hlfsd} points.
6981 @item /var/hlfs
6982 directory to which @file{home} symbolic link returned by @i{Hlfsd}
6983 points if it is unable to verify the that user's home directory is
6984 accessible.
6986 @end table
6988 For discussion on other files used by @i{Hlfsd}, see @xref{lostaltmail}, and
6989 @ref{lostaltmail.conf-sample}.
6991 @c ################################################################
6992 @node Assorted Tools, Examples, Hlfsd, Top
6993 @comment  node-name,  next,  previous,  up
6994 @chapter Assorted Tools
6995 @cindex  Assorted Tools
6997 The following are additional utilities and scripts included with
6998 am-utils, and get installed.
7000 @menu
7001 * am-eject::          
7002 * amd.conf-sample::   
7003 * amd2ldif::          
7004 * amd2sun::           
7005 * automount2amd::           
7006 * ctl-amd::           
7007 * ctl-hlfsd::         
7008 * expn::              
7009 * fix-amd-map::       
7010 * fixmount::          
7011 * fixrmtab::          
7012 * lostaltmail::       
7013 * lostaltmail.conf-sample::
7014 * mk-amd-map::        
7015 * pawd::              
7016 * wait4amd::          
7017 * wait4amd2die::      
7018 * wire-test::         
7019 @end menu
7021 @c ----------------------------------------------------------------
7022 @node am-eject, amd.conf-sample, Assorted Tools, Assorted Tools
7023 @comment  node-name,  next,  previous,  up
7024 @section am-eject
7025 @pindex am-eject
7027 A shell script unmounts a floppy or CD-ROM that is automounted, and
7028 then attempts to eject the removable device.
7030 @c ----------------------------------------------------------------
7031 @node amd.conf-sample, amd2ldif, am-eject, Assorted Tools
7032 @comment  node-name,  next,  previous,  up
7033 @section amd.conf-sample
7034 @pindex amd.conf-sample
7036 A sample @i{Amd} configuration file. @xref{Amd Configuration File}. 
7038 @c ----------------------------------------------------------------
7039 @node amd2ldif, amd2sun, amd.conf-sample, Assorted Tools
7040 @comment  node-name,  next,  previous,  up
7041 @section amd2ldif
7042 @pindex amd2ldif
7044 A script to convert @i{Amd} maps to LDAP input files.  Use it as follows:
7046 @example
7047 amd2ldif @i{mapname} @i{base} < @i{amd.mapfile} > @i{mapfile.ldif}
7048 @end example
7050 @c ----------------------------------------------------------------
7051 @node amd2sun, automount2amd, amd2ldif, Assorted Tools
7052 @comment  node-name,  next,  previous,  up
7053 @section amd2sun
7054 @pindex amd2sun
7056 A script to convert @i{Amd} maps to Sun Automounter maps.  Use it as
7057 follows
7059 @example
7060 amd2sun < @i{amd.mapfile} > @i{auto_mapfile}
7061 @end example
7063 @c ----------------------------------------------------------------
7064 @node automount2amd, ctl-amd, amd2sun, Assorted Tools
7065 @comment  node-name,  next,  previous,  up
7066 @section automount2amd
7067 @pindex automount2amd
7069 A script to convert old Sun Automounter maps to @i{Amd} maps.
7071 Say you have the Sun automount file @i{auto.foo}, with these two lines:
7072 @example
7073 home                  earth:/home
7074 moon  -ro,intr        server:/proj/images
7075 @end example
7076 Running
7077 @example
7078 automount2amd auto.foo > amd.foo
7079 @end example
7081 will produce the @i{Amd} map @i{amd.foo} with this content:
7083 @example
7084 # generated by automount2amd on Sat Aug 14 17:59:32 US/Eastern 1999
7086 /defaults \\
7087   type:=nfs;opts:=rw,grpid,nosuid,utimeout=600
7089 home \
7090   host==earth;type:=link;fs:=/home \\
7091   rhost:=earth;rfs:=/home
7093 moon \
7094   -addopts:=ro,intr \\
7095   host==server;type:=link;fs:=/proj/images \\
7096   rhost:=server;rfs:=/proj/images
7097 @end example
7099 This perl script will use the following @i{/default} entry
7100 @example
7101 type:=nfs;opts:=rw,grpid,nosuid,utimeout=600
7102 @end example
7103 If you wish to override that, define the @b{$DEFAULTS} environment
7104 variable, or modify the script.
7106 If you wish to generate Amd maps using the @i{hostd} (@pxref{hostd
7107 Selector Variable}) @i{Amd} map syntax, then define the environment
7108 variable @b{$DOMAIN} or modify the script.
7110 Note that automount2amd does not understand newer Sun Automount map
7111 syntax, those used by autofs.
7113 @c ----------------------------------------------------------------
7114 @node ctl-amd, ctl-hlfsd, automount2amd, Assorted Tools
7115 @comment  node-name,  next,  previous,  up
7116 @section ctl-amd
7117 @pindex ctl-amd
7119 A script to start, stop, or restart @i{Amd}.  Use it as follows:
7121 @table @t
7122 @item ctl-amd start
7123 Start a new @i{Amd} process.
7124 @item ctl-amd stop
7125 Stop the running @i{Amd}.
7126 @item ctl-amd restart
7127 Stop the running @i{Amd} (if any), safely wait for it to terminate, and
7128 then start a new process --- only if the previous one died cleanly.
7129 @end table
7131 @xref{Run-time Administration}, for more details.
7133 @c ----------------------------------------------------------------
7134 @node ctl-hlfsd, expn, ctl-amd, Assorted Tools
7135 @comment  node-name,  next,  previous,  up
7136 @section ctl-hlfsd
7137 @pindex ctl-hlfsd
7139 A script for controlling @i{Hlfsd}, much the same way @file{ctl-amd}
7140 controls @i{Amd}.  Use it as follows:
7142 @table @t
7143 @item ctl-hlfsd start
7144 Start a new @i{Hlfsd} process.
7145 @item ctl-hlfsd stop
7146 Stop the running @i{Hlfsd}.
7147 @item ctl-hlfsd restart
7148 Stop the running @i{Hlfsd} (if any), wait for 10 seconds for it to
7149 terminate, and then start a new process --- only if the previous one
7150 died cleanly.
7151 @end table
7153 @xref{Hlfsd}, for more details.
7155 @c ----------------------------------------------------------------
7156 @node expn, fix-amd-map, ctl-hlfsd, Assorted Tools
7157 @comment  node-name,  next,  previous,  up
7158 @section expn
7159 @pindex expn
7161 A script to expand email addresses into their full name.  It is
7162 generally useful when using with the @file{lostaltmail} script, but is a
7163 useful tools otherwise.
7165 @example
7166 $ expn -v ezk@@cs.columbia.edu
7167 ezk@@cs.columbia.edu ->
7168         ezk@@shekel.mcl.cs.columbia.edu
7169 ezk@@shekel.mcl.cs.columbia.edu ->
7170         Erez Zadok <"| /usr/local/mh/lib/slocal -user ezk || exit 75>
7171         Erez Zadok <\ezk>
7172         Erez Zadok </u/zing/ezk/.mailspool/backup>
7173 @end example
7175 @c ----------------------------------------------------------------
7176 @node fix-amd-map, fixmount, expn, Assorted Tools
7177 @comment  node-name,  next,  previous,  up
7178 @section fix-amd-map
7179 @pindex fix-amd-map
7181 Am-utils changed some of the syntax and default values of some
7182 variables.  For example, the default value for @samp{$@{os@}} for
7183 Solaris 2.x (aka SunOS 5.x) systems used to be @samp{sos5}, it is now
7184 more automatically generated from @file{config.guess} and its value is
7185 @samp{sunos5}.
7187 This script converts older @i{Amd} maps to new ones.  Use it as follows:
7189 @example
7190 fix-amd-map < @i{old.map} > @i{new.map}
7191 @end example
7193 @c ----------------------------------------------------------------
7194 @node fixmount, fixrmtab, fix-amd-map, Assorted Tools
7195 @comment  node-name,  next,  previous,  up
7196 @section fixmount
7197 @pindex fixmount
7199 @samp{fixmount} is a variant of @b{showmount}(8) that can delete bogus
7200 mount entries in remote @b{mountd}(8) daemons.  This is useful to
7201 cleanup otherwise ever-accumulating ``junk''.  Use it for example:
7203 @example
7204 fixmount -r @i{host}
7205 @end example
7207 See the online manual page for @samp{fixmount} for more details of its
7208 usage.
7210 @c ----------------------------------------------------------------
7211 @node fixrmtab, lostaltmail, fixmount, Assorted Tools
7212 @comment  node-name,  next,  previous,  up
7213 @section fixrmtab
7214 @pindex fixrmtab
7216 A script to invalidate @file{/etc/rmtab} entries for hosts named.  Also
7217 restart mountd for changes to take effect.  Use it for example:
7219 @example
7220 fixrmtab @i{host1} @i{host2} @i{...}
7221 @end example
7223 @c ----------------------------------------------------------------
7224 @node lostaltmail, lostaltmail.conf-sample, fixrmtab, Assorted Tools
7225 @comment  node-name,  next,  previous,  up
7226 @section lostaltmail
7227 @pindex lostaltmail
7229 A script used with @i{Hlfsd} to resend any ``lost'' mail.  @i{Hlfsd}
7230 redirects mail which cannot be written into the user's home directory to
7231 an alternate directory.  This is useful to continue delivering mail,
7232 even if the user's file system was unavailable, full, or over quota.
7233 But, the mail which gets delivered to  the alternate directory needs to
7234 be resent to its respective users.  This is what the @samp{lostaltmail}
7235 script does. 
7237 Use it as follows:
7239 @example
7240 lostaltmail
7241 @end example
7243 This script needs a configuration file @samp{lostaltmail.conf} set up
7244 with the right parameters to properly work.  @xref{Hlfsd}, for more
7245 details.
7247 @c ----------------------------------------------------------------
7248 @node lostaltmail.conf-sample, mk-amd-map, lostaltmail, Assorted Tools
7249 @comment  node-name,  next,  previous,  up
7250 @section lostaltmail.conf-sample
7251 @pindex lostaltmail.conf-sample
7252 @cindex lostaltmail; configuration file
7254 This is a text file with configuration parameters needed for the
7255 @samp{lostaltmail} script.  The script includes comments explaining each
7256 of the configuration variables.  See it for more information.  Also
7257 @pxref{Hlfsd} for general information.
7259 @c ----------------------------------------------------------------
7260 @node mk-amd-map, pawd, lostaltmail.conf-sample, Assorted Tools
7261 @comment  node-name,  next,  previous,  up
7262 @section mk-amd-map
7263 @pindex mk-amd-map
7265 This program converts a normal @i{Amd} map file into an ndbm database
7266 with the same prefix as the named file.  Use it as follows:
7268 @example
7269 mk-amd-map @i{mapname}
7270 @end example
7272 @c ----------------------------------------------------------------
7273 @node pawd, wait4amd, mk-amd-map, Assorted Tools
7274 @comment  node-name,  next,  previous,  up
7275 @section pawd
7276 @pindex pawd
7278 @i{Pawd} is used to print the current working directory, adjusted to
7279 reflect proper paths that can be reused to go through the automounter
7280 for the shortest possible path.  In particular, the path printed back
7281 does not include any of @i{Amd}'s local mount points.  Using them is
7282 unsafe, because @i{Amd} may unmount managed file systems from the mount
7283 points, and thus including them in paths may not always find the files
7284 within.
7286 Without any arguments, @i{Pawd} will print the automounter adjusted
7287 current working directory.  With any number of arguments, it will print
7288 the adjusted path of each one of the arguments.
7290 @c ----------------------------------------------------------------
7291 @node wait4amd, wait4amd2die, pawd, Assorted Tools
7292 @comment  node-name,  next,  previous,  up
7293 @section wait4amd
7294 @pindex wait4amd
7296 A script to wait for @i{Amd} to start on a particular host before
7297 performing an arbitrary command.  The command is executed repeatedly,
7298 with 1 second intervals in between.  You may interrupt the script using
7299 @samp{^C} (or whatever keyboard sequence your terminal's @samp{intr} function
7300 is bound to).
7302 Examples:
7304 @table @t
7305 @item wait4amd saturn amq -p -h saturn
7306 When @i{Amd} is up on host @samp{saturn}, get the process ID of that
7307 running @i{Amd}.
7308 @item wait4amd pluto rlogin pluto
7309 Remote login to host @samp{pluto} when @i{Amd} is up on that host.  It
7310 is generally necessary to wait for @i{Amd} to properly start and
7311 initialize on a remote host before logging in to it, because otherwise
7312 user home directories may not be accessible across the network.
7313 @item wait4amd pluto
7314 A short-hand version of the previous command, since the most useful
7315 reason for this script is to login to a remote host.  I use it very
7316 often when testing out new versions of @i{Amd}, and need to reboot hung
7317 hosts.
7318 @end table
7320 @c ----------------------------------------------------------------
7321 @node wait4amd2die, wire-test, wait4amd, Assorted Tools
7322 @comment  node-name,  next,  previous,  up
7323 @section wait4amd2die
7324 @pindex wait4amd2die
7326 This script is used internally by @samp{ctl-amd} when used to restart
7327 @i{Amd}.  It waits for @i{Amd} to terminate.  If it detected that
7328 @i{Amd} terminated cleanly, this script will return an exist status of
7329 zero.  Otherwise, it will return a non-zero exit status.
7331 The script tests for @i{Amd}'s existence once every 5 seconds, six
7332 times, for a total of 30 seconds.  It will return a zero exist status as
7333 soon as it detects that @i{Amd} dies.
7335 @c ----------------------------------------------------------------
7336 @node wire-test, , wait4amd2die, Assorted Tools
7337 @comment  node-name,  next,  previous,  up
7338 @section wire-test
7339 @pindex wire-test
7341 A simple program to test if some of the most basic networking functions
7342 in am-util's library @file{libamu} work.  It also tests the combination
7343 of NFS protocol and version number that are supported from the current
7344 host, to a remote one.
7346 For example, in this test a machine which only supports NFS Version 2 is
7347 contacting a remote host that can support the same version, but using
7348 both UDP and TCP.  If no host name is specified, @samp{wire-test} will
7349 try @file{localhost}.
7351 @example
7352 $ wire-test moisil
7353 Network name is "mcl-lab-net.cs.columbia.edu"
7354 Network number is "128.59.13"
7355 Network name is "old-net.cs.columbia.edu"
7356 Network number is "128.59.16"
7357 My IP address is 0x7f000001.
7358 NFS Version and protocol tests to host "moisil"...
7359         testing vers=2, proto="udp" -> found version 2.
7360         testing vers=3, proto="udp" -> failed!
7361         testing vers=2, proto="tcp" -> found version 2.
7362         testing vers=3, proto="tcp" -> failed!
7363 @end example
7365 @c ################################################################
7366 @node Examples, Internals, Assorted Tools, Top
7367 @comment  node-name,  next,  previous,  up
7368 @chapter Examples
7370 @menu
7371 * User Filesystems::
7372 * Home Directories::
7373 * Architecture Sharing::
7374 * Wildcard Names::
7375 * rwho servers::
7376 * /vol::
7377 * /defaults with selectors::
7378 * /tftpboot in a chroot-ed environment::
7380 @end menu
7382 @node User Filesystems, Home Directories, Examples, Examples
7383 @comment  node-name,  next,  previous,  up
7384 @section User Filesystems
7385 @cindex User filesystems
7386 @cindex Mounting user filesystems
7388 With more than one fileserver, the directories most frequently
7389 cross-mounted are those containing user home directories.  A common
7390 convention used at Imperial College is to mount the user disks under
7391 @t{/home/}@i{machine}.
7393 Typically, the @samp{/etc/fstab} file contained a long list of entries
7394 such as:
7396 @example
7397 @i{machine}:/home/@i{machine} /home/@i{machine} nfs ...
7398 @end example
7400 for each fileserver on the network.
7402 There are numerous problems with this system.  The mount list can become
7403 quite large and some of the machines may be down when a system is
7404 booted.  When a new fileserver is installed, @samp{/etc/fstab} must be
7405 updated on every machine, the mount directory created and the filesystem
7406 mounted.
7408 In many environments most people use the same few workstations, but
7409 it is convenient to go to a colleague's machine and access your own
7410 files.  When a server goes down, it can cause a process on a client
7411 machine to hang.  By minimizing the mounted filesystems to only include
7412 those actively being used, there is less chance that a filesystem will
7413 be mounted when a server goes down.
7415 The following is a short extract from a map taken from a research fileserver
7416 at Imperial College.
7418 Note the entry for @samp{localhost} which is used for users such as
7419 the operator (@samp{opr}) who have a home directory on most machine as
7420 @samp{/home/localhost/opr}.
7422 @example
7423 /defaults       opts:=rw,intr,grpid,nosuid
7424 charm           host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \
7425                 host==$@{key@};type:=ufs;dev:=/dev/xd0g
7430 localhost       type:=link;fs:=$@{host@}
7433 # dylan has two user disks so have a
7434 # top directory in which to mount them.
7436 dylan           type:=auto;fs:=$@{map@};pref:=$@{key@}/
7438 dylan/dk2       host!=dylan;type:=nfs;rhost:=dylan;rfs:=/home/$@{key@} \
7439                 host==dylan;type:=ufs;dev:=/dev/dsk/2s0
7441 dylan/dk5       host!=dylan;type:=nfs;rhost:=dylan;rfs:=/home/$@{key@} \
7442                 host==dylan;type:=ufs;dev:=/dev/dsk/5s0
7445 toytown         host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \
7446                 host==$@{key@};type:=ufs;dev:=/dev/xy1g
7449 zebedee         host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \
7450                 host==$@{key@};type:=ufs;dev:=/dev/dsk/1s0
7452 # Just for access...
7454 gould           type:=auto;fs:=$@{map@};pref:=$@{key@}/
7455 gould/staff     host!=gould;type:=nfs;rhost:=gould;rfs:=/home/$@{key@}
7457 gummo           host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@}
7459 @end example
7461 This map is shared by most of the machines listed so on those
7462 systems any of the user disks is accessible via a consistent name.
7463 @i{Amd} is started with the following command
7465 @example
7466 amd /home amd.home
7467 @end example
7469 Note that when mounting a remote filesystem, the @dfn{automounted}
7470 mount point is referenced, so that the filesystem will be mounted if
7471 it is not yet (at the time the remote @samp{mountd} obtains the file handle).
7473 @node Home Directories, Architecture Sharing, User Filesystems, Examples
7474 @comment  node-name,  next,  previous,  up
7475 @section Home Directories
7476 @cindex Home directories
7477 @cindex Example of mounting home directories
7478 @cindex Mount home directories
7480 One convention for home directories is to locate them in @samp{/homes}
7481 so user @samp{jsp}'s home directory is @samp{/homes/jsp}.  With more
7482 than a single fileserver it is convenient to spread user files across
7483 several machines.  All that is required is a mount-map which converts
7484 login names to an automounted directory.
7486 Such a map might be started by the command:
7488 @example
7489 amd /homes amd.homes
7490 @end example
7492 where the map @samp{amd.homes} contained the entries:
7494 @example
7495 /defaults   type:=link   # All the entries are of type:=link
7496 jsp         fs:=/home/charm/jsp
7497 njw         fs:=/home/dylan/dk5/njw
7499 phjk        fs:=/home/toytown/ai/phjk
7500 sjv         fs:=/home/ganymede/sjv
7501 @end example
7503 Whenever a login name is accessed in @samp{/homes} a symbolic link
7504 appears pointing to the real location of that user's home directory.  In
7505 this example, @samp{/homes/jsp} would appear to be a symbolic link
7506 pointing to @samp{/home/charm/jsp}.  Of course, @samp{/home} would also
7507 be an automount point.
7509 This system causes an extra level of symbolic links to be used.
7510 Although that turns out to be relatively inexpensive, an alternative is
7511 to directly mount the required filesystems in the @samp{/homes}
7512 map.  The required map is simple, but long, and its creation is best automated.
7513 The entry for @samp{jsp} could be:
7515 @example
7516 jsp   -sublink:=$@{key@};rfs:=/home/charm \
7517                host==charm;type:=ufs;dev:=/dev/xd0g \
7518                host!=charm;type:=nfs;rhost:=charm
7519 @end example
7521 This map can become quite big if it contains a large number of entries.
7522 By combining two other features of @i{Amd} it can be greatly simplified.
7524 First the UFS partitions should be mounted under the control of
7525 @samp{/etc/fstab}, taking care that they are mounted in the same place
7526 that @i{Amd} would have automounted them.  In most cases this would be
7527 something like @samp{/a/@dfn{host}/home/@dfn{host}} and
7528 @samp{/etc/fstab} on host @samp{charm} would have a line:@refill
7530 @example
7531 /dev/xy0g /a/charm/home/charm 4.2 rw,nosuid,grpid 1 5
7532 @end example
7534 The map can then be changed to:
7536 @example
7537 /defaults    type:=nfs;sublink:=$@{key@};opts:=rw,intr,nosuid,grpid
7538 jsp          rhost:=charm;rfs:=/home/charm
7539 njw          rhost:=dylan;rfs:=/home/dylan/dk5
7541 phjk         rhost:=toytown;rfs:=/home/toytown;sublink:=ai/$@{key@}
7542 sjv          rhost:=ganymede;rfs:=/home/ganymede
7543 @end example
7545 This map operates as usual on a remote machine (@i{ie} @code{$@{host@}}
7546 not equal to @code{$@{rhost@}}).  On the machine where the filesystem is
7547 stored (@i{ie} @code{$@{host@}} equal to @code{$@{rhost@}}), @i{Amd}
7548 will construct a local filesystem mount point which corresponds to the
7549 name of the locally mounted UFS partition.  If @i{Amd} is started with
7550 the @code{-r} option then instead of attempting an NFS mount, @i{Amd} will
7551 simply inherit the UFS mount (@pxref{Inheritance Filesystem}).  If
7552 @code{-r} is not used then a loopback NFS mount will be made.  This type of
7553 mount is known to cause a deadlock on many systems.
7555 @node Architecture Sharing, Wildcard Names, Home Directories, Examples
7556 @comment  node-name,  next,  previous,  up
7557 @section Architecture Sharing
7558 @cindex Architecture sharing
7559 @cindex Sharing a fileserver between architectures
7560 @cindex Architecture dependent volumes
7562 @c %At the moment some of the research machines have sets of software
7563 @c %mounted in @samp{/vol}.  This contains subdirectories for \TeX,
7564 @c %system sources, local sources, prolog libraries and so on.
7565 Often a filesystem will be shared by machines of different architectures.
7566 Separate trees can be maintained for the executable images for each
7567 architecture, but it may be more convenient to have a shared tree,
7568 with distinct subdirectories.
7570 A shared tree might have the following structure on the fileserver (called
7571 @samp{fserver} in the example):
7573 @example
7574 local/tex
7575 local/tex/fonts
7576 local/tex/lib
7577 local/tex/bin
7578 local/tex/bin/sun3
7579 local/tex/bin/sun4
7580 local/tex/bin/hp9000
7582 @end example
7584 In this example, the subdirectories of @samp{local/tex/bin} should be
7585 hidden when accessed via the automount point (conventionally @samp{/vol}).
7586 A mount-map for @samp{/vol} to achieve this would look like:
7588 @example
7589 /defaults   sublink:=$@{/key@};rhost:=fserver;type:=link
7590 tex         type:=auto;fs:=$@{map@};pref:=$@{key@}/
7591 tex/fonts   host!=fserver;type:=nfs;rfs:=/vol/tex \
7592             host==fserver;fs:=/usr/local/tex
7593 tex/lib     host!=fserver;type:=nfs;rfs:=/vol/tex \
7594             host==fserver;fs:=/usr/local/tex
7595 tex/bin     -sublink:=$@{/key@}/$@{arch@} \
7596             host!=fserver;type:=nfs;rfs:=/vol/tex \
7597             host:=fserver;fs:=/usr/local/tex
7598 @end example
7600 When @samp{/vol/tex/bin} is referenced, the current machine architecture
7601 is automatically appended to the path by the @code{$@{sublink@}}
7602 variable.  This means that users can have @samp{/vol/tex/bin} in their
7603 @samp{PATH} without concern for architecture dependencies.
7605 @node Wildcard Names, rwho servers, Architecture Sharing, Examples
7606 @comment  node-name,  next,  previous,  up
7607 @section Wildcard Names & Replicated Servers
7609 By using the wildcard facility, @i{Amd} can @dfn{overlay} an existing
7610 directory with additional entries.
7611 The system files are usually mounted under @samp{/usr}.  If instead,
7612 @i{Amd} is mounted on @samp{/usr}, additional
7613 names can be overlayed to augment or replace names in the ``master'' @samp{/usr}.
7614 A map to do this would have the form:
7616 @example
7617 local  type:=auto;fs:=local-map
7618 share  type:=auto;fs:=share-map
7619 *      -type:=nfs;rfs:=/export/exec/$@{arch@};sublink:="$@{key@}" \
7620         rhost:=fserv1  rhost:=fserv2  rhost:=fserv3
7621 @end example
7623 Note that the assignment to @code{$@{sublink@}} is surrounded by double
7624 quotes to prevent the incoming key from causing the map to be
7625 misinterpreted.  This map has the effect of directing any access to
7626 @samp{/usr/local} or @samp{/usr/share} to another automount point.
7628 In this example, it is assumed that the @samp{/usr} files are replicated
7629 on three fileservers: @samp{fserv1}, @samp{fserv2} and @samp{fserv3}.
7630 For any references other than to @samp{local} and @samp{share} one of
7631 the servers is used and a symbolic link to
7632 @t{$@{autodir@}/$@{rhost@}/export/exec/$@{arch@}/@i{whatever}} is
7633 returned once an appropriate filesystem has been mounted.@refill
7635 @node rwho servers, /vol, Wildcard Names, Examples
7636 @comment  node-name,  next,  previous,  up
7637 @section @samp{rwho} servers
7638 @cindex rwho servers
7639 @cindex Architecture specific mounts
7640 @cindex Example of architecture specific mounts
7642 The @samp{/usr/spool/rwho} directory is a good candidate for automounting.
7643 For efficiency reasons it is best to capture the rwho data on a small
7644 number of machines and then mount that information onto a large number
7645 of clients.  The data written into the rwho files is byte order dependent
7646 so only servers with the correct byte ordering can be used by a client:
7648 @example
7649 /defaults         type:=nfs
7650 usr/spool/rwho    -byte==little;rfs:=/usr/spool/rwho \
7651                       rhost:=vaxA  rhost:=vaxB \
7652                   || -rfs:=/usr/spool/rwho \
7653                       rhost:=sun4  rhost:=hp300
7654 @end example
7656 @node /vol, /defaults with selectors, rwho servers, Examples
7657 @comment  node-name,  next,  previous,  up
7658 @section @samp{/vol}
7659 @cindex /vol
7660 @cindex Catch-all mount point
7661 @cindex Generic volume name
7663 @samp{/vol} is used as a catch-all for volumes which do not have other
7664 conventional names.
7666 Below is part of the @samp{/vol} map for the domain @samp{doc.ic.ac.uk}.
7667 The @samp{r+d} tree is used for new or experimental software that needs
7668 to be available everywhere without installing it on all the fileservers.
7669 Users wishing to try out the new software then simply include
7670 @samp{/vol/r+d/@{bin,ucb@}} in their path.@refill
7672 The main tree resides on one host @samp{gould.doc.ic.ac.uk}, which has
7673 different @samp{bin}, @samp{etc}, @samp{lib} and @samp{ucb}
7674 sub-directories for each machine architecture.  For example,
7675 @samp{/vol/r+d/bin} for a Sun-4 would be stored in the sub-directory
7676 @samp{bin/sun4} of the filesystem @samp{/usr/r+d}.  When it was accessed
7677 a symbolic link pointing to @samp{/a/gould/usr/r+d/bin/sun4} would be
7678 returned.@refill
7680 @example
7681 /defaults    type:=nfs;opts:=rw,grpid,nosuid,intr,soft
7682 wp           -opts:=rw,grpid,nosuid;rhost:=charm \
7683              host==charm;type:=link;fs:=/usr/local/wp \
7684              host!=charm;type:=nfs;rfs:=/vol/wp
7687 src          -opts:=rw,grpid,nosuid;rhost:=charm \
7688              host==charm;type:=link;fs:=/usr/src \
7689              host!=charm;type:=nfs;rfs:=/vol/src
7691 r+d          type:=auto;fs:=$@{map@};pref:=r+d/
7692 # per architecture bin,etc,lib&ucb...
7693 r+d/bin      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
7694 r+d/etc      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
7695 r+d/include  rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}
7696 r+d/lib      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
7697 r+d/man      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}
7698 r+d/src      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}
7699 r+d/ucb      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
7700 # hades pictures
7701 pictures     -opts:=rw,grpid,nosuid;rhost:=thpfs \
7702              host==thpfs;type:=link;fs:=/nbsd/pictures \
7703              host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=pictures
7704 # hades tools
7705 hades        -opts:=rw,grpid,nosuid;rhost:=thpfs \
7706              host==thpfs;type:=link;fs:=/nbsd/hades \
7707              host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=hades
7708 # bsd tools for hp.
7709 bsd          -opts:=rw,grpid,nosuid;arch==hp9000;rhost:=thpfs \
7710              host==thpfs;type:=link;fs:=/nbsd/bsd \
7711              host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=bsd
7712 @end example
7714 @node /defaults with selectors, /tftpboot in a chroot-ed environment, /vol, Examples
7715 @comment  node-name,  next,  previous,  up
7716 @section @samp{/defaults} with selectors
7717 @cindex /defaults with selectors
7718 @cindex selectors on default
7720 It is sometimes useful to have different defaults for a given map.  To
7721 achieve this, the @samp{/defaults} entry must be able to process normal
7722 selectors.  This feature is turned on by setting
7723 @samp{selectors_on_default = yes} in the @file{amd.conf} file.
7724 @xref{selectors_on_default Parameter}.
7726 In this example, I set different default NFS mount options for hosts
7727 which are running over a slower network link.  By setting a smaller size
7728 for the NFS read and write buffer sizes, you can greatly improve remote
7729 file service performance.
7731 @example
7732 /defaults \
7733   wire==slip-net;opts:=rw,intr,rsize=1024,wsize=1024,timeo=20,retrans=10 \
7734   wire!=slip-net;opts:=rw,intr
7735 @end example
7737 @node /tftpboot in a chroot-ed environment, , /defaults with selectors, Examples
7738 @comment  node-name,  next,  previous,  up
7739 @section @samp{/tftpboot} in a chroot-ed environment
7740 @cindex /tftpboot in a chroot-ed environment
7741 @cindex chroot: /tftpboot example
7743 In this complex example, we attempt to run an @i{Amd} process
7744 @emph{inside} a chroot-ed environment.  @samp{tftpd} (Trivial FTP) is
7745 used to trivially retrieve files used to boot X-Terminals, Network
7746 Printers, Network routers, diskless workstations, and other such
7747 devices.  For security reasons, @samp{tftpd} (and also @samp{ftpd})
7748 processes are run using the @b{chroot}(2) system call.  This provides an
7749 environment for these processes, where access to any files outside the
7750 directory where the chroot-ed process runs is denied.
7752 For example, if you start @samp{tftpd} on your system with
7754 @example
7755 chroot /tftpboot /usr/sbin/tftpd
7756 @end example
7758 @noindent
7759 then the @samp{tftpd} process will not be able to access any files
7760 outside @file{/tftpboot}.  This ensures that no one can retrieve files
7761 such as @file{/etc/passwd} and run password crackers on it.
7763 Since the TFTP service works by broadcast, it is necessary to have at
7764 least one TFTP server running on each subnet.  If you have lots of files
7765 that you need to make available for @samp{tftp}, and many subnets, it
7766 could take significant amounts of disk space on each host serving them.
7768 A solution we implemented at Columbia University was to have every host
7769 run @samp{tftpd}, but have those servers retrieve the boot files from
7770 two replicated servers.  Those replicated servers have special
7771 partitions dedicated to the many network boot files.
7773 We start @i{Amd} as follows:
7775 @example
7776 amd /tftpboot/.amd amd.tftpboot
7777 @end example
7779 That is, @i{Amd} is serving the directory @file{/tftpboot/.amd}.  The
7780 @samp{tftp} server runs inside @file{/tftpboot} and is chroot-ed in that
7781 directory too.  The @file{amd.tftpboot} map looks like:
7783 @example
7785 # Amd /tftpboot directory -> host map
7788 /defaults  opts:=nosuid,ro,intr,soft;fs:=/tftpboot/import;type:=nfs
7790 tp         host==lol;rfs:=/n/lol/import/tftpboot;type:=lofs \
7791            host==ober;rfs:=/n/ober/misc/win/tftpboot;type:=lofs \
7792            rhost:=ober;rfs:=/n/ober/misc/win/tftpboot \
7793            rhost:=lol;rfs:=/n/lol/import/tftpboot
7794 @end example
7796 To help understand this example, I list a few of the file entries that
7797 are created inside @file{/tftpboot}:
7799 @example
7800 $ ls -la /tftpboot
7801 dr-xr-xr-x   2 root   512 Aug 30 23:11 .amd
7802 drwxrwsr-x  12 root   512 Aug 30 08:00 import
7803 lrwxrwxrwx   1 root    33 Feb 27  1997 adminpr.cfg -> ./.amd/tp/hplj/adminpr.cfg
7804 lrwxrwxrwx   1 root    22 Dec  5  1996 tekxp -> ./.amd/tp/xterms/tekxp
7805 lrwxrwxrwx   1 root     1 Dec  5  1996 tftpboot -> .
7806 @end example
7808 Here is an explanation of each of the entries listed above:
7810 @table @code
7812 @item .amd
7813 This is the @i{Amd} mount point.  Note that you do not need to run a
7814 separate @i{Amd} process for the TFTP service.  The @b{chroot}(2) system
7815 call only protects against file access, but the same process can still
7816 serve files and directories inside and outside the chroot-ed
7817 environment, because @i{Amd} itself was not run in chroot-ed mode.
7819 @item import
7820 This is the mount point where @i{Amd} will mount the directories
7821 containing the boot files.  The map is designed so that remote
7822 directories will be NFS mounted (even if they are already mounted
7823 elsewhere), and local directories are loopback mounted (since they are
7824 not accessible outside the chroot-ed @file{/tftpboot} directory).
7826 @item adminpr.cfg
7827 @itemx tekxp
7828 Two manually created symbolic links to directories @emph{inside} the
7829 @i{Amd}-managed directory.  The crossing of the component @file{tp} will
7830 cause @i{Amd} to automount one of the remote replicas.  Once crossed,
7831 access to files inside proceeds as usual.  The @samp{adminpr.cfg} is a
7832 configuration file for an HP Laser-Jet 4si printer, and the @samp{tekxp}
7833 is a directory for Tektronix X-Terminal boot files.
7835 @item tftpboot
7836 This innocent looking symlink is important.  Usually, when devices boot
7837 via the TFTP service, they perform the @samp{get file} command to
7838 retrieve @var{file}.  However, some devices assume that @samp{tftpd}
7839 does not run in a chroot-ed environment, but rather ``unprotected'', and
7840 thus use a full pathname for files to retrieve, as in @samp{get
7841 /tftpboot/file}.  This symlink effectively strips out the leading
7842 @file{/tftpboot/}.
7844 @end table
7846 @c ################################################################
7847 @node Internals, Acknowledgments & Trademarks, Examples, Top
7848 @comment  node-name,  next,  previous,  up
7849 @chapter Internals
7851 Note that there are more error and logging messages possible than are
7852 listed here.  Most of them are self-explanatory.  Refer to the program
7853 sources for more details on the rest.
7855 @menu
7856 * Log Messages::
7857 @end menu
7859 @node Log Messages, , Internals, Internals
7860 @comment  node-name,  next,  previous,  up
7861 @section Log Messages
7863 In the following sections a brief explanation is given of some of the
7864 log messages made by @i{Amd}.  Where the message is in @samp{typewriter}
7865 font, it corresponds exactly to the message produced by @i{Amd}.  Words
7866 in @dfn{italic} are replaced by an appropriate string.  Variables,
7867 @code{$@{@i{var}@}}, indicate that the value of the appropriate variable is
7868 output.
7870 Log messages are either sent directly to a file,
7871 or logged via the @b{syslog}(3) mechanism.  @xref{log_file Parameter}.
7872 In either case, entries in the file are of the form:
7873 @example
7874 @i{date-string}  @i{hostname} @t{amd[}@i{pid}@t{]}  @i{message}
7875 @end example
7877 @menu
7878 * Fatal errors::
7879 * Info messages::
7880 @end menu
7882 @node Fatal errors, Info messages, Log Messages, Log Messages
7883 @comment  node-name,  next,  previous,  up
7884 @subsection Fatal errors
7886 @i{Amd} attempts to deal with unusual events.  Whenever it is not
7887 possible to deal with such an error, @i{Amd} will log an appropriate
7888 message and, if it cannot possibly continue, will either exit or abort.
7889 These messages are selected by @samp{-x fatal} on the command line.
7890 When @b{syslog}(3) is being used, they are logged with level
7891 @samp{LOG_FATAL}.  Even if @i{Amd} continues to operate it is likely to
7892 remain in a precarious state and should be restarted at the earliest
7893 opportunity.
7895 @table @t
7897 @item Attempting to inherit not-a-filesystem
7898 The prototype mount point created during a filesystem restart did not
7899 contain a reference to the restarted filesystem.  This error ``should
7900 never happen''.
7902 @item Can't bind to domain "@i{NIS-domain}"
7903 A specific NIS domain was requested on the command line, but no server
7904 for that domain is available on the local net.
7906 @item Can't determine IP address of this host (@i{hostname})
7907 When @i{Amd} starts it determines its own IP address.  If this lookup
7908 fails then @i{Amd} cannot continue.  The hostname it looks up is that
7909 obtained returned by @b{gethostname}(2) system call.
7911 @item Can't find root file handle for @i{automount point}
7912 @i{Amd} creates its own file handles for the automount points.  When it
7913 mounts itself as a server, it must pass these file handles to the local
7914 kernel.  If the filehandle is not obtainable the mount point is ignored.
7915 This error ``should never happen''.
7917 @item Must be root to mount filesystems (euid = @i{euid})
7918 To prevent embarrassment, @i{Amd} makes sure it has appropriate system
7919 privileges.  This amounts to having an euid of 0.  The check is made
7920 after argument processing complete to give non-root users a chance to
7921 access the @code{-v} option.
7923 @item No work to do - quitting
7924 No automount points were given on the command line and so there is no
7925 work to do.
7927 @item Out of memory
7928 While attempting to malloc some memory, the memory space available to
7929 @i{Amd} was exhausted.  This is an unrecoverable error.
7931 @item Out of memory in realloc
7932 While attempting to realloc some memory, the memory space available to
7933 @i{Amd} was exhausted.  This is an unrecoverable error.
7935 @item cannot create rpc/udp service
7936 Either the NFS or AMQ endpoint could not be created.
7938 @item gethostname: @i{description}
7939 The @b{gethostname}(2) system call failed during startup.
7941 @item host name is not set
7942 The @b{gethostname}(2) system call returned a zero length host name.
7943 This can happen if @i{Amd} is started in single user mode just after
7944 booting the system.
7946 @item ifs_match called!
7947 An internal error occurred while restarting a pre-mounted filesystem.
7948 This error ``should never happen''.
7950 @item mount_afs: @i{description}
7951 An error occurred while @i{Amd} was mounting itself.
7953 @item run_rpc failed
7954 Somehow the main NFS server loop failed.  This error ``should never
7955 happen''.
7957 @item unable to free rpc arguments in amqprog_1
7958 The incoming arguments to the AMQ server could not be free'ed.
7960 @item unable to free rpc arguments in nfs_program_1
7961 The incoming arguments to the NFS server could not be free'ed.
7963 @item unable to register (AMQ_PROGRAM, AMQ_VERSION, udp)
7964 The AMQ server could not be registered with the local portmapper or the
7965 internal RPC dispatcher.
7967 @item unable to register (NFS_PROGRAM, NFS_VERSION, 0)
7968 The NFS server could not be registered with the internal RPC dispatcher.
7970 @end table
7972 XXX: This section needs to be updated
7974 @node Info messages, , Fatal errors, Log Messages
7975 @comment  node-name,  next,  previous,  up
7976 @subsection Info messages
7978 @i{Amd} generates information messages to record state changes.  These
7979 messages are selected by @samp{-x info} on the command line.  When
7980 @b{syslog}(3) is being used, they are logged with level @samp{LOG_INFO}.
7982 The messages listed below can be generated and are in a format suitable
7983 for simple statistical analysis.  @dfn{mount-info} is the string
7984 that is displayed by @dfn{Amq} in its mount information column and
7985 placed in the system mount table.
7987 @table @t
7989 @item "@t{$@{@i{path}@}}" forcibly timed out
7990 An automount point has been timed out by the @i{Amq} command.
7992 @item "@t{$@{@i{path}@}}" has timed out
7993 No access to the automount point has been made within the timeout
7994 period.
7996 @item Filehandle denied for "$@{@i{rhost}@}:$@{@i{rfs}@}"
7997 The mount daemon refused to return a file handle for the requested filesystem.
7999 @item Filehandle error for "$@{@i{rhost}@}:$@{@i{rfs}@}": @i{description}
8000 The mount daemon gave some other error for the requested filesystem.
8002 @item Finishing with status @i{exit-status}
8003 @i{Amd} is about to exit with the given exit status. 
8005 @item Re-synchronizing cache for map @t{$@{@i{map}@}}
8006 The named map has been modified and the internal cache is being re-synchronized.
8008 @item file server @t{$@{@i{rhost}@}} is down - timeout of "@t{$@{@i{path}@}}" ignored
8009 An automount point has timed out, but the corresponding file server is
8010 known to be down.  This message is only produced once for each mount
8011 point for which the server is down.
8013 @item file server @t{$@{@i{rhost}@}} type nfs is down
8014 An NFS file server that was previously up is now down.
8016 @item file server @t{$@{@i{rhost}@}} type nfs is up
8017 An NFS file server that was previously down is now up.
8019 @item file server @t{$@{@i{rhost}@}} type nfs starts down
8020 A new NFS file server has been referenced and is known to be down.
8022 @item file server @t{$@{@i{rhost}@}} type nfs starts up
8023 A new NFS file server has been referenced and is known to be up.
8025 @item mount of "@t{$@{@i{path}@}}" on @t{$@{@i{fs}@}} timed out
8026 Attempts to mount a filesystem for the given automount point have failed
8027 to complete within 30 seconds.
8029 @item @i{mount-info} mounted fstype @t{$@{@i{type}@}} on @t{$@{@i{fs}@}}
8030 A new file system has been mounted.
8032 @item @i{mount-info} restarted fstype @t{$@{@i{type}@}} on @t{$@{@i{fs}@}}
8033 @i{Amd} is using a pre-mounted filesystem to satisfy a mount request.
8035 @item @i{mount-info} unmounted fstype @t{$@{@i{type}@}} from @t{$@{@i{fs}@}}
8036 A file system has been unmounted.
8038 @item @i{mount-info} unmounted fstype @t{$@{@i{type}@}} from @t{$@{@i{fs}@}} link @t{$@{@i{fs}@}}/@t{$@{@i{sublink}@}}
8039 A file system of which only a sub-directory was in use has been unmounted.
8041 @item restarting @i{mount-info} on @t{$@{@i{fs}@}}
8042 A pre-mounted file system has been noted.
8044 @end table
8046 XXX: This section needs to be updated
8048 @c ################################################################
8049 @node Acknowledgments & Trademarks, Index, Internals, Top
8050 @comment  node-name,  next,  previous,  up
8051 @unnumbered Acknowledgments & Trademarks
8053 Many thanks to the @email{amd-dev@@majordomo.cs.columbia.edu,Amd
8054 Developers} mailing list through the months developing am-utils.  These
8055 members have contributed to the discussions, ideas, code and
8056 documentation, and subjected their systems to alpha quality code.
8057 Special thanks go to those
8058 @uref{http://www.cs.columbia.edu/~ezk/am-utils/AUTHORS.txt,authors} who
8059 have submitted patches.
8061 Thanks to the Formal Methods Group at Imperial College for suffering
8062 patiently while @i{Amd} was being developed on their machines.
8064 Thanks to the many people who have helped with the development of
8065 @i{Amd}, especially Piete Brooks at the Cambridge University Computing
8066 Lab for many hours of testing, experimentation and discussion.
8068 Thanks to the @email{amd-workers@@majordomo.glue.umd.edu,Amd Workers}
8069 mailing list members for many suggestions and bug reports to @i{Amd}.
8071 @itemize @bullet
8072 @item
8073 @b{DEC}, @b{VAX} and @b{Ultrix} are registered trademarks of Digital
8074 Equipment Corporation.
8075 @item
8076 @b{AIX} and @b{IBM} are registered trademarks of International Business
8077 Machines Corporation.
8078 @item
8079 @b{Sun}, @b{NFS} and @b{SunOS} are registered trademarks of Sun
8080 Microsystems, Inc.
8081 @item
8082 @b{UNIX} is a registered trademark in the USA and other countries,
8083 exclusively licensed through X/Open Company, Ltd.
8084 @item
8085 All other registered trademarks are owned by their respective owners.
8086 @end itemize
8088 @c ################################################################
8089 @node Index, , Acknowledgments & Trademarks, Top
8090 @comment  node-name,  next,  previous,  up
8091 @unnumbered Index
8093 @printindex cp
8095 @contents
8096 @bye
8098 @c ====================================================================
8099 @c ISPELL LOCAL WORDS:
8100 @c LocalWords:  setfilename amdref overfullrule settitle titlepage titlefont nz
8101 @c LocalWords:  authorfont vskip ifinfo iftex cindex unnumberedsec dfn xref vol
8102 @c LocalWords:  locationN pxref jpo nott concentrix Sjoerd sjoerd cwi Eitan vuw
8103 @c LocalWords:  Mizrotsky eitan shumuji dgux fpx scp hcx metcalf masala hlh OTS
8104 @c LocalWords:  Presnell srp cgl Trost trost ogi pyrOSx OSx tubsibr riscix iX
8105 @c LocalWords:  Piete pb Lindblad cjl ai umax utek xinu Mitchum D'Souza dsouza
8106 @c LocalWords:  mrc apu alliant aviion AViiON fps macII multimax tahoe vax emph
8107 @c LocalWords:  mapdefault valA valB valC YPTSDIR ETCDIR substr MAKEDBM YPDBDIR
8108 @c LocalWords:  NOPUSH njw dylan dk dylan njw anydir domN achilles mjh pref sel
8109 @c LocalWords:  gdef loc loc loc ldots autodir remopts rwho rwho styx styx yoyo
8110 @c LocalWords:  noindent gould rvdmount rvdunmount fserver mtmp unioned logfile
8111 @c LocalWords:  dmn esac phjk toytown toytown toytown toytown phjk RdDir RdLnk
8112 @c LocalWords:  volname attrs netif dougal inaddr hwaddr ec mountmaps passno xy
8113 @c LocalWords:  freq dumpset hfs brian florence localinfo fstabs automaps defn
8114 @c LocalWords:  localname fsck'd opr gummo sjv ganymede sjv fserv fserv fserv
8115 @c LocalWords:  vaxA vaxB wp thpfs nbsd asis ifs amqprog free'ed printindex gov
8116 @c LocalWords:  LocalWords syncodeindex Distrib bsdnet lanl AutoMounter acis ic
8117 @c LocalWords:  ac uk aix bsd Mullender nl il DG lcs hpux irix ucsf NeXT cse cl
8118 @c LocalWords:  mt FX hp ibm mips utils def def Domainname eg hostd getwd tmp
8119 @c LocalWords:  subsubsection rw grpid intr noconn nocto nodevs nosuid retrans
8120 @c LocalWords:  rsize tcp timeo nounmount utimeout DDEBUG nodaemon fd hostnames
8121 @c LocalWords:  pid Amd's pendry vangogh nfsx backoff stats nomap nostats CRIT
8122 @c LocalWords:  noinfo clustername RVD dsk dsk amq hostports osver statfs str
8123 @c LocalWords:  ou counter's amdmaps proj src tftpboot sh mv cd sbin ypcat inet
8124 @c LocalWords:  Getattr getattr localhost fhandles netmask fstype noquota addr
8125 @c LocalWords:  exportfs Dumpsets dumpsets pindex ldif fixmount fixrmtab euid
8126 @c LocalWords:  lostaltmail realloc netnumber itemx primnetnum primnetname ARG
8127 @c LocalWords:  subsnetname subsnetnum netgrp netgroup multitable Shlib dec osf
8128 @c LocalWords:  hppa pc bsdi freebsd netbsd openbsd ncr sysv rs acdirmax fsid
8129 @c LocalWords:  acdirmin acregmax acregmin actimeo dumbtimr nfsv noac noauto sd
8130 @c LocalWords:  nocache nodev noint nosub pgthresh posix rdonly suid symttl mfs
8131 @c LocalWords:  AMFS umapfs myftpdir unionfs es mapname mapfile mapfile slocal
8132 @c LocalWords:  mailspool saturn saturn notknown lol ober dr xr xr drwxrwsr cfg
8133 @c LocalWords:  lrwxrwxrwx adminpr hplj adminpr cfg tekxp xterms tekxp Dupuy tp
8134 @c LocalWords:  linkname hlfsddump dirname rmtab pluto rlogin direntry pg vr dn
8135 @c LocalWords:  maxmem hlfsdir xmailbox showmount cn amdmap amdmapName resvport
8136 @c LocalWords:  objectClass amdmapKey amdmapValue ln powerpc amdmapTimestamp ez
8137 @c LocalWords:  moisil FSinfo Libtool Unmounting sublink fileservers NullProc
8138 @c LocalWords:  gethostname mount's unmounts linkx remounts unmounting UAs SA's
8139 @c LocalWords:  mountpoint mountpoints unescaped UIDs util's overlayed uref EFS
8140 @c LocalWords:  serv maxgroups nfsl cachedir copt cfsadmin efs addopts fg ROMs
8141 @c LocalWords:  nointr extatt setchapternewpage columnfractions alphaev gnulibc
8142 @c LocalWords:  freebsdelf gnuoldld ifhtml defperm nodefperm norrip RRIP rrip
8143 @c LocalWords:  noversion attr XXXXXX netgrpd rh mkstemp