]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/amd/doc/am-utils.texi
MFC r308493, r308619: Update amd from am-utils 6.1.5 to 6.2.
[FreeBSD/stable/10.git] / contrib / amd / doc / am-utils.texi
1 \input texinfo          @c -*-texinfo-*-
2 @c
3 @c Copyright (c) 1997-2014 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.
11 @c
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. Neither the name of the University nor the names of its contributors
21 @c    may be used to endorse or promote products derived from this software
22 @c    without specific prior written permission.
23 @c
24 @c THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 @c ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 @c IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 @c ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 @c FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 @c DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 @c OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 @c HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 @c LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 @c OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 @c
35 @c
36 @c File: am-utils/doc/am-utils.texi
37 @c
38 @setfilename am-utils.info
39
40 @include version.texi
41
42 @c info directory entry
43 @dircategory Administration
44 @direntry
45 * Am-utils: (am-utils).          The Amd automounter suite of utilities
46 @end direntry
47
48 @settitle Am-utils (4.4BSD Automounter Utilities)
49 @setchapternewpage odd
50
51 @titlepage
52 @title Am-utils (4.4BSD Automounter Utilities)
53 @subtitle For version @value{VERSION}, @value{UPDATED}
54
55 @author Erez Zadok
56 (Originally by Jan-Simon Pendry and Nick Williams)
57
58 @page
59 Copyright @copyright{} 1997-2014 Erez Zadok
60 @*
61 Copyright @copyright{} 1989 Jan-Simon Pendry
62 @*
63 Copyright @copyright{} 1989 Imperial College of Science, Technology & Medicine
64 @*
65 Copyright @copyright{} 1989 The Regents of the University of California.
66 @sp 1
67 All Rights Reserved.
68 @vskip 1ex
69 Permission to copy this document, or any portion of it, as
70 necessary for use of this software is granted provided this
71 copyright notice and statement of permission are included.
72 @end titlepage
73 @page
74
75 @c Define a new index for options.
76 @syncodeindex pg cp
77 @syncodeindex vr cp
78
79 @ifinfo
80
81 @c ################################################################
82 @node Top, License, , (DIR)
83
84 @b{Am-utils (4.4BSD Automounter Utilities) User Manual}
85 @*
86 For version @value{VERSION}, @value{UPDATED}
87
88 @b{Erez Zadok}
89 @*
90 (Originally by Jan-Simon Pendry and Nick Williams)
91
92 Copyright @copyright{} 1997-2014 Erez Zadok
93 @*
94 Copyright @copyright{} 1989 Jan-Simon Pendry
95 @*
96 Copyright @copyright{} 1989 Imperial College of Science, Technology & Medicine
97 @*
98 Copyright @copyright{} 1989 The Regents of the University of California.
99 @*
100 All Rights Reserved.
101
102 Permission to copy this document, or any portion of it, as
103 necessary for use of this software is granted provided this
104 copyright notice and statement of permission are included.
105
106 Am-utils is the 4.4BSD Automounter Tool Suite, which includes the Amd
107 automounter, the Amq query and control program, the Hlfsd daemon, and
108 other tools.  This Info file describes how to use and understand the
109 tools within Am-utils.
110 @end ifinfo
111
112 @menu
113 * License::                  Explains the terms and conditions for using
114                              and distributing Am-utils.
115 * Distrib::                  How to get the latest Am-utils distribution.
116 * AddInfo::                  How to get additional information.
117 * Intro::                    An introduction to Automounting concepts.
118 * History::                  History of am-utils' development.
119 * Overview::                 An overview of Amd.
120 * Supported Platforms::      Machines and Systems supported by Amd.
121 * Mount Maps::               Details of mount maps.
122 * Amd Command Line Options:: All the Amd command line options explained.
123 * Filesystem Types::         The different mount types supported by Amd.
124 * Amd Configuration File::   The amd.conf file syntax and meaning.
125 * Run-time Administration::  How to start, stop and control Amd.
126 * FSinfo::                   The FSinfo filesystem management tool.
127 * Hlfsd::                    The Home-Link Filesystem server.
128 * Assorted Tools::           Other tools which come with am-utils.
129 * Examples::                 Some examples showing how Amd might be used.
130 * Internals::                Implementation details.
131 * Acknowledgments & Trademarks:: Legal Notes.
132
133 Indexes
134 * Index::                    An item for each concept.
135 @end menu
136
137 @iftex
138 @unnumbered Preface
139
140 This manual documents the use of the 4.4BSD automounter tool suite,
141 which includes @i{Amd}, @i{Amq}, @i{Hlfsd}, and other programs.  This is
142 primarily a reference manual.  While no tutorial exists, there are
143 examples available.  @xref{Examples}.
144
145 This manual comes in two forms: the published form and the Info form.
146 The Info form is for on-line perusal with the INFO program which is
147 distributed along with GNU texinfo package (a version of which is
148 available for GNU Emacs).@footnote{GNU packages can be found in
149 @url{ftp://ftp.gnu.org/pub/gnu/}.}  Both forms contain substantially
150 the same text and are generated from a common source file, which is
151 distributed with the @i{Am-utils} source.
152 @end iftex
153
154 @c ################################################################
155 @node License, Distrib, Top, Top
156 @unnumbered License
157 @cindex License Information
158
159 @i{Am-utils} is not in the public domain; it is copyrighted and there are
160 restrictions on its distribution.
161
162 Redistribution and use in source and binary forms, with or without
163 modification, are permitted provided that the following conditions are
164 met:
165
166 @enumerate
167
168 @item
169 Redistributions of source code must retain the above copyright notice,
170 this list of conditions and the following disclaimer.
171
172 @item
173 Redistributions in binary form must reproduce the above copyright
174 notice, this list of conditions and the following disclaimer in the
175 documentation and/or other materials provided with the distribution.
176
177 @item
178 Neither the name of the University nor the names of its contributors may
179 be used to endorse or promote products derived from this software
180 without specific prior written permission.
181
182 @end enumerate
183
184 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
185 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
186 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
187 PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
188 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
189 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
190 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
191 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
192 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
193 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
194 THE POSSIBILITY OF SUCH DAMAGE.
195
196 @c ################################################################
197 @node Distrib, AddInfo, License, Top
198 @unnumbered Source Distribution
199 @cindex Source code distribution
200 @cindex Obtaining the source code
201
202 The @i{Am-utils} home page is located in
203 @example
204 @url{http://www.am-utils.org/}
205 @end example
206
207 You can get the latest distribution version of @i{Am-utils} from
208 @example
209 @url{ftp://ftp.am-utils.org/pub/am-utils/am-utils.tar.gz}
210 @end example
211
212 Additional alpha, beta, and release distributions are available in
213 @example
214 @url{ftp://ftp.am-utils.org/pub/am-utils/}.
215 @end example
216
217 Revision 5.2 was part of the 4.3BSD Reno distribution.
218
219 Revision 5.3bsdnet, a late alpha version of 5.3, was part
220 of the BSD network version 2 distribution
221
222 Revision 6.0 was made independently by
223 Erez Zadok at the Computer Science
224 Department of @uref{http://www.cs.columbia.edu/,Columbia University},
225 as part of his
226 @uref{http://www.fsl.cs.sunysb.edu/docs/zadok-thesis-proposal/,PhD
227 thesis work}.  Am-utils (especially version 6.1) continues to be
228 developed and maintained at the
229 @uref{http://www.cs.sunysb.edu/,Computer Science Department} of
230 @uref{http://www.stonybrook.edu/,Stony Brook University}, as a service
231 to the user community.
232
233
234 @xref{History}, for more details.
235
236 @c ################################################################
237 @node AddInfo, Intro, Distrib, Top
238 @unnumbered Getting Additional Information
239 @cindex Getting Additional Information
240
241 @unnumberedsec Bug Reports
242 @cindex Bug reports
243
244 Before reporting a bug, see if it is a known one in the
245 @uref{http://www.am-utils.org/docs/am-utils/BUGS.txt,bugs} file.
246
247 If you find a problem and hopefully you can reproduce it, please
248 describe it in detail and
249 @uref{https://bugzilla.filesystems.org/,submit a bug report} via
250 @uref{http://www.bugzilla.org/,Bugzilla}.  Alternatively, you can send
251 your bug report to the ``am-utils'' list (see
252 @url{http://www.am-utils.org/} under ``Mailing Lists'') quoting the details
253 of the release and your configuration.  These details can be obtained
254 by running the command @samp{amd -v}.  It would greatly help if you
255 could provide a reproducible procedure for detecting the bug you are
256 reporting.
257
258 Providing working patches is highly encouraged.  Every patch
259 incorporated, however small, will get its author an honorable mention in
260 the @uref{http://www.am-utils.org/docs/am-utils/AUTHORS.txt,authors
261 file}.
262
263 @unnumberedsec Mailing Lists
264 @cindex Mailing lists
265
266 There are several mailing lists for people interested in keeping up-to-date
267 with developments.
268
269 @c ###############
270
271 @enumerate
272
273 @item
274 The users mailing list, @samp{am-utils} is for
275
276 @itemize @minus
277 @item
278 announcements of alpha and beta releases of am-utils
279 @item
280 reporting of bugs and patches
281 @item
282 discussions of new features for am-utils
283 @item
284 implementation and porting issues
285 @end itemize
286
287 To subscribe, visit @url{http://www.am-utils.org/} under ``Mailing
288 Lists.''  After subscribing, you can post a message to this list.  To
289 avoid as much spam as possible, only subscribers to this list may post
290 to it.
291
292 Subscribers of @samp{am-utils} are most helpful if they have the time
293 and resources to test new and development versions of amd, on as many
294 different platforms as possible.  They should also be prepared to
295 learn and use the GNU Autoconf, Automake, and Libtool packages, as
296 needed; and of course, become familiar with the complex code in the
297 am-utils package.  In other words, subscribers on this list should
298 hopefully be able to contribute meaningfully to the development of
299 amd.
300
301 Note that this @samp{am-utils} list used to be called @samp{amd-dev}
302 before January 1st, 2004.  Please use the new name, @samp{am-utils}.
303
304 @item
305 The announcements mailing list, @samp{am-utils-announce} is for
306 announcements only (mostly new releases).  To subscribe, visit
307 @url{http://www.am-utils.org/} under ``Mailing Lists.''
308 This list is read-only: only am-utils developers may post to it.
309
310 @item
311 We distribute nightly CVS snapshots in
312 @url{ftp://ftp.am-utils.org/pub/am-utils/snapshots/daily/}.  If you
313 like to get email notices of commits to the am-utils CVS repository,
314 subscribe to the CVS logs mailing list, @samp{am-utils-cvs} at
315 @url{http://www.am-utils.org/} under ``Mailing Lists.''
316
317 @item
318 The older list which was used to user discussions, @samp{amd-workers},
319 is defunct as of January 2004.  (Its last address was
320 @email{amd-workers AT majordomo.glue.umd.edu}.)  Don't use
321 @samp{amd-workers}: use the newer, more active @samp{am-utils} list.
322
323 @item
324 For completeness, there's a developers-only closed list called
325 @samp{am-utils-developers} (see @url{http://www.am-utils.org/} under
326 ``Mailing Lists'').
327
328 @end enumerate
329
330 @unnumberedsec Am-utils Book
331 @cindex Am-utils book
332 @cindex Amd book
333 @cindex Automounter book
334 @cindex book
335
336 @uref{http://www.cs.sunysb.edu/~ezk,Erez Zadok} wrote a
337 @uref{http://www.fsl.cs.sunysb.edu/docs/amd-book/,book}, titled @i{Linux NFS and
338 Automounter Administration}, ISBN 0-7821-2739-8, (Sybex, 2001).  The
339 book is full of details and examples that go beyond what this manual
340 has.  The book also covers NFS in great detail.  Although the book is
341 geared toward Linux users, it is general enough for any Unix
342 administrator and contains specific sections for non-Linux systems.
343
344 @c ################################################################
345 @node Intro, History, AddInfo, Top
346 @unnumbered Introduction
347 @cindex Introduction
348
349 An @dfn{automounter} maintains a cache of mounted filesystems.
350 Filesystems are mounted on demand when they are first referenced,
351 and unmounted after a period of inactivity.
352
353 @i{Amd} may be used as a replacement for Sun's automounter.  The choice
354 of which filesystem to mount can be controlled dynamically with
355 @dfn{selectors}.  Selectors allow decisions of the form ``hostname is
356 @var{this},'' or ``architecture is not @var{that}.''  Selectors may be
357 combined arbitrarily.  @i{Amd} also supports a variety of filesystem
358 types, including NFS, UFS and the novel @dfn{program} filesystem.  The
359 combination of selectors and multiple filesystem types allows identical
360 configuration files to be used on all machines thus reducing the
361 administrative overhead.
362
363 @i{Amd} ensures that it will not hang if a remote server goes down.
364 Moreover, @i{Amd} can determine when a remote server has become
365 inaccessible and then mount replacement filesystems as and when they
366 become available.
367
368 @i{Amd} contains no proprietary source code and has been ported to
369 numerous flavors of Unix.
370
371 @c ################################################################
372 @node History, Overview, Intro, Top
373 @unnumbered History
374 @cindex History
375
376 The @i{Amd} package has been without an official maintainer since 1992.
377 Several people have stepped in to maintain it unofficially.  Most
378 notable were the `upl' (Unofficial Patch Level) releases of @i{Amd},
379 created by me (@uref{http://www.cs.sunysb.edu/~ezk,Erez Zadok}), and available from
380 @url{ftp://ftp.am-utils.org/pub/amd/}.  The last such unofficial
381 release was `upl102'.
382
383 Through the process of patching and aging, it was becoming more and more
384 apparent that @i{Amd} was in much need of revitalizing.  Maintaining
385 @i{Amd} had become a difficult task.  I took it upon myself to cleanup
386 the code, so that it would be easier to port to new platforms, add new
387 features, keep up with the many new feature requests, and deal with the
388 never ending stream of bug reports.
389
390 I have been working on such a release of @i{Amd} on and off since
391 January of 1996.  The new suite of tools is currently named "am-utils"
392 (AutoMounter Utilities), in line with GNU naming conventions, befitting
393 the contents of the package.  In October of 1996 I had received enough
394 offers to help me with this task that I decided to make a mailing list
395 for this group of people.  Around the same time, @i{Amd} had become a
396 necessary part of my PhD thesis work, resulting in more work performed
397 on am-utils.
398
399 Am-utils version 6.0 was numbered with a major new release number to
400 distinguish it from the last official release of @i{Amd} (5.x).  Many
401 new features have been added such as a GNU @code{configure} system, NFS
402 Version 3, a run-time configuration file (`amd.conf'), many new ports,
403 more scripts and programs, as well as numerous bug fixes.  Another
404 reason for the new major release number was to alert users of am-utils
405 that user-visible interfaces may have changed.  In order to make @i{Amd}
406 work well for the next 10 years, and be easier to maintain, it was
407 necessary to remove old or unused features, change various syntax files,
408 etc.  However, great care was taken to ensure the maximum possible
409 backwards compatibility.
410
411 Am-utils version 6.1 has autofs support for Linux and Solaris 2.5+ as
412 @i{the} major new feature, in addition to several other minor new
413 features.  The autofs support is completely transparent to the
414 end-user, aside from the fact that @code{/bin/pwd} now always returns
415 the correct amd-ified path.  The administrator can easily switch
416 between NFS and autofs mounts by changing one parameter in
417 @code{amd.conf}.  Autofs support and maintenance was developed in
418 conjunction with @email{ionut AT badula.org,Ion Badulescu}.
419
420 @c ################################################################
421 @node Overview, Supported Platforms, History, Top
422 @chapter Overview
423
424 @i{Amd} maintains a cache of mounted filesystems.  Filesystems are
425 @dfn{demand-mounted} when they are first referenced, and unmounted after
426 a period of inactivity.  @i{Amd} may be used as a replacement for Sun's
427 @b{automount}(8) program.  It contains no proprietary source code and
428 has been ported to numerous flavors of Unix.  @xref{Supported
429 Platforms}.@refill
430
431 @i{Amd} was designed as the basis for experimenting with filesystem
432 layout and management.  Although @i{Amd} has many direct applications it
433 is loaded with additional features which have little practical use.  At
434 some point the infrequently used components may be removed to streamline
435 the production system.
436
437 @i{Amd} supports the notion of @dfn{replicated} filesystems by evaluating
438 each member of a list of possible filesystem locations one by one.
439 @i{Amd} checks that each cached mapping remains valid.  Should a mapping be
440 lost -- such as happens when a fileserver goes down -- @i{Amd} automatically
441 selects a replacement should one be available.
442
443 @menu
444 * Fundamentals::
445 * Filesystems and Volumes::
446 * Volume Naming::
447 * Volume Binding::
448 * Operational Principles::
449 * Mounting a Volume::
450 * Automatic Unmounting::
451 * Keep-alives::
452 * Non-blocking Operation::
453 @end menu
454
455 @node Fundamentals, Filesystems and Volumes, Overview, Overview
456 @comment  node-name,  next,  previous,  up
457 @section Fundamentals
458 @cindex Automounter fundamentals
459
460 The fundamental concept behind @i{Amd} is the ability to separate the
461 name used to refer to a file from the name used to refer to its physical
462 storage location.  This allows the same files to be accessed with the
463 same name regardless of where in the network the name is used.  This is
464 very different from placing @file{/n/hostname} in front of the pathname
465 since that includes location dependent information which may change if
466 files are moved to another machine.
467
468 By placing the required mappings in a centrally administered database,
469 filesystems can be re-organized without requiring changes to
470 configuration files, shell scripts and so on.
471
472 @node Filesystems and Volumes, Volume Naming, Fundamentals, Overview
473 @comment  node-name,  next,  previous,  up
474 @section Filesystems and Volumes
475 @cindex Filesystem
476 @cindex Volume
477 @cindex Fileserver
478 @cindex sublink
479
480 @i{Amd} views the world as a set of fileservers, each containing one or
481 more filesystems where each filesystem contains one or more
482 @dfn{volumes}.  Here the term @dfn{volume} is used to refer to a
483 coherent set of files such as a user's home directory or a @TeX{}
484 distribution.@refill
485
486 In order to access the contents of a volume, @i{Amd} must be told in
487 which filesystem the volume resides and which host owns the filesystem.
488 By default the host is assumed to be local and the volume is assumed to
489 be the entire filesystem.  If a filesystem contains more than one
490 volume, then a @dfn{sublink} is used to refer to the sub-directory
491 within the filesystem where the volume can be found.
492
493 @node Volume Naming, Volume Binding, Filesystems and Volumes, Overview
494 @comment  node-name,  next,  previous,  up
495 @section Volume Naming
496 @cindex Volume names
497 @cindex Network-wide naming
498 @cindex Replicated volumes
499 @cindex Duplicated volumes
500 @cindex Replacement volumes
501
502 Volume names are defined to be unique across the entire network.  A
503 volume name is the pathname to the volume's root as known by the users
504 of that volume.  Since this name uniquely identifies the volume
505 contents, all volumes can be named and accessed from each host, subject
506 to administrative controls.
507
508 Volumes may be replicated or duplicated.  Replicated volumes contain
509 identical copies of the same data and reside at two or more locations in
510 the network.  Each of the replicated volumes can be used
511 interchangeably.  Duplicated volumes each have the same name but contain
512 different, though functionally identical, data.  For example,
513 @samp{/vol/tex} might be the name of a @TeX{} distribution which varied
514 for each machine architecture.@refill
515
516 @i{Amd} provides facilities to take advantage of both replicated and
517 duplicated volumes.  Configuration options allow a single set of
518 configuration data to be shared across an entire network by taking
519 advantage of replicated and duplicated volumes.
520
521 @i{Amd} can take advantage of replacement volumes by mounting them as
522 required should an active fileserver become unavailable.
523
524 @node Volume Binding, Operational Principles, Volume Naming, Overview
525 @comment  node-name,  next,  previous,  up
526 @section Volume Binding
527 @cindex Volume binding
528 @cindex Unix namespace
529 @cindex Namespace
530 @cindex Binding names to filesystems
531
532 Unix implements a namespace of hierarchically mounted filesystems.  Two
533 forms of binding between names and files are provided.  A @dfn{hard
534 link} completes the binding when the name is added to the filesystem.  A
535 @dfn{soft link} delays the binding until the name is accessed.  An
536 @dfn{automounter} adds a further form in which the binding of name to
537 filesystem is delayed until the name is accessed.@refill
538
539 The target volume, in its general form, is a tuple (host, filesystem,
540 sublink) which can be used to name the physical location of any volume
541 in the network.
542
543 When a target is referenced, @i{Amd} ignores the sublink element and
544 determines whether the required filesystem is already mounted.  This is
545 done by computing the local mount point for the filesystem and checking
546 for an existing filesystem mounted at the same place.  If such a
547 filesystem already exists then it is assumed to be functionally
548 identical to the target filesystem.  By default there is a one-to-one
549 mapping between the pair (host, filesystem) and the local mount point so
550 this assumption is valid.
551
552 @node Operational Principles, Mounting a Volume, Volume Binding, Overview
553 @comment  node-name,  next,  previous,  up
554 @section Operational Principles
555 @cindex Operational principles
556
557 @i{Amd} operates by introducing new mount points into the namespace.
558 These are called @dfn{automount} points.  The kernel sees these
559 automount points as NFS filesystems being served by @i{Amd}.  Having
560 attached itself to the namespace, @i{Amd} is now able to control the
561 view the rest of the system has of those mount points.  RPC calls are
562 received from the kernel one at a time.
563
564 When a @dfn{lookup} call is received @i{Amd} checks whether the name is
565 already known.  If it is not, the required volume is mounted.  A
566 symbolic link pointing to the volume root is then returned.  Once the
567 symbolic link is returned, the kernel will send all other requests
568 direct to the mounted filesystem.
569
570 If a volume is not yet mounted, @i{Amd} consults a configuration
571 @dfn{mount-map} corresponding to the automount point.  @i{Amd} then
572 makes a runtime decision on what and where to mount a filesystem based
573 on the information obtained from the map.
574
575 @i{Amd} does not implement all the NFS requests; only those relevant
576 to name binding such as @dfn{lookup}, @dfn{readlink} and @dfn{readdir}.
577 Some other calls are also implemented but most simply return an error
578 code; for example @dfn{mkdir} always returns ``read-only filesystem''.
579
580 @node Mounting a Volume, Automatic Unmounting, Operational Principles, Overview
581 @comment  node-name,  next,  previous,  up
582 @section Mounting a Volume
583 @cindex Mounting a volume
584 @cindex Location lists
585 @cindex Alternate locations
586 @cindex Mount retries
587 @cindex Background mounts
588
589 Each automount point has a corresponding mount map.  The mount map
590 contains a list of key--value pairs.  The key is the name of the volume
591 to be mounted.  The value is a list of locations describing where the
592 filesystem is stored in the network.  In the source for the map the
593 value would look like
594
595 @display
596 location1  location2  @dots{}  locationN
597 @end display
598
599 @i{Amd} examines each location in turn.  Each location may contain
600 @dfn{selectors} which control whether @i{Amd} can use that location.
601 For example, the location may be restricted to use by certain hosts.
602 Those locations which cannot be used are ignored.
603
604 @i{Amd} attempts to mount the filesystem described by each remaining
605 location until a mount succeeds or @i{Amd} can no longer proceed.  The
606 latter can occur in three ways:
607
608 @itemize @bullet
609 @item
610 If none of the locations could be used, or if all of the locations
611 caused an error, then the last error is returned.
612
613 @item
614 If a location could be used but was being mounted in the background then
615 @i{Amd} marks that mount as being ``in progress'' and continues with
616 the next request; no reply is sent to the kernel.
617
618 @item
619 Lastly, one or more of the mounts may have been @dfn{deferred}.  A mount
620 is deferred if extra information is required before the mount can
621 proceed.  When the information becomes available the mount will take
622 place, but in the mean time no reply is sent to the kernel.  If the
623 mount is deferred, @i{Amd} continues to try any remaining locations.
624 @end itemize
625
626 Once a volume has been mounted, @i{Amd} establishes a @dfn{volume
627 mapping} which is used to satisfy subsequent requests.@refill
628
629 @node Automatic Unmounting, Keep-alives, Mounting a Volume, Overview
630 @comment  node-name,  next,  previous,  up
631 @section Automatic Unmounting
632
633 To avoid an ever increasing number of filesystem mounts, @i{Amd} removes
634 volume mappings which have not been used recently.  A time-to-live
635 interval is associated with each mapping and when that expires the
636 mapping is removed.  When the last reference to a filesystem is removed,
637 that filesystem is unmounted.  If the unmount fails, for example the
638 filesystem is still busy, the mapping is re-instated and its
639 time-to-live interval is extended.  The global default for this grace
640 period is controlled by the @code{-w} command-line option (@pxref{-w
641 Option, -w}) or the @i{amd.conf} parameter @samp{dismount_interval}
642 (@pxref{dismount_interval Parameter}).  It is also possible to set this
643 value on a per-mount basis (@pxref{opts Option, opts, opts}).
644
645 Filesystems can be forcefully timed out using the @i{Amq} command.
646 @xref{Run-time Administration}.  Note that on new enough systems that
647 support forced unmounts, such as Linux, @i{Amd} can try to use the
648 @b{umount2}(2) system call to force the unmount, if the regular
649 @b{umount}(2) system call failed in a way that indicates that the
650 mount point is hung or stale.  @xref{forced_unmounts Parameter}.
651
652 @node Keep-alives, Non-blocking Operation, Automatic Unmounting, Overview
653 @comment  node-name,  next,  previous,  up
654 @section Keep-alives
655 @cindex Keep-alives
656 @cindex Server crashes
657 @cindex NFS ping
658
659 Use of some filesystem types requires the presence of a server on
660 another machine.  If a machine crashes then it is of no concern to
661 processes on that machine that the filesystem is unavailable.  However,
662 to processes on a remote host using that machine as a fileserver this
663 event is important.  This situation is most widely recognized when an
664 NFS server crashes and the behavior observed on client machines is that
665 more and more processes hang.  In order to provide the possibility of
666 recovery, @i{Amd} implements a @dfn{keep-alive} interval timer for some
667 filesystem types.  Currently only NFS makes use of this service.
668
669 The basis of the NFS keep-alive implementation is the observation that
670 most sites maintain replicated copies of common system data such as
671 manual pages, most or all programs, system source code and so on.  If
672 one of those servers goes down it would be reasonable to mount one of
673 the others as a replacement.
674
675 The first part of the process is to keep track of which fileservers are
676 up and which are down.  @i{Amd} does this by sending RPC requests to the
677 servers' NFS @code{NullProc} and checking whether a reply is returned.
678 While the server state is uncertain the requests are re-transmitted at
679 three second intervals and if no reply is received after four attempts
680 the server is marked down.  If a reply is received the fileserver is
681 marked up and stays in that state for 30 seconds at which time another
682 NFS ping is sent.  This interval is configurable and can even be
683 turned off using the @i{ping} option.  @xref{opts Option}.
684
685 Once a fileserver is marked down, requests continue to be sent every 30
686 seconds in order to determine when the fileserver comes back up.  During
687 this time any reference through @i{Amd} to the filesystems on that
688 server fail with the error ``Operation would block''.  If a replacement
689 volume is available then it will be mounted, otherwise the error is
690 returned to the user.
691
692 @c @i{Amd} keeps track of which servers are up and which are down.
693 @c It does this by sending RPC requests to the servers' NFS {\sc NullProc} and
694 @c checking whether a reply is returned.  If no replies are received after a
695 @c short period, @i{Amd} marks the fileserver @dfn{down}.
696 @c RPC requests continue to be sent so that it will notice when a fileserver
697 @c comes back up.
698 @c ICMP echo packets \cite{rfc:icmp} are not used because it is the availability
699 @c of the NFS service that is important, not the existence of a base kernel.
700 @c Whenever a reference to a fileserver which is down is made via @i{Amd}, an alternate
701 @c filesystem is mounted if one is available.
702 @c
703 Although this action does not protect user files, which are unique on
704 the network, or processes which do not access files via @i{Amd} or
705 already have open files on the hung filesystem, it can prevent most new
706 processes from hanging.
707 @c
708 @c With a suitable combination of filesystem management and mount-maps,
709 @c machines can be protected against most server downtime.  This can be
710 @c enhanced by allocating boot-servers dynamically which allows a diskless
711 @c workstation to be quickly restarted if necessary.  Once the root filesystem
712 @c is mounted, @i{Amd} can be started and allowed to mount the remainder of
713 @c the filesystem from whichever fileservers are available.
714
715 @node Non-blocking Operation, , Keep-alives, Overview
716 @comment  node-name,  next,  previous,  up
717 @section Non-blocking Operation
718 @cindex Non-blocking operation
719 @cindex Multiple-threaded server
720 @cindex RPC retries
721
722 Since there is only one instance of @i{Amd} for each automount point,
723 and usually only one instance on each machine, it is important that it
724 is always available to service kernel calls.  @i{Amd} goes to great
725 lengths to ensure that it does not block in a system call.  As a last
726 resort @i{Amd} will fork before it attempts a system call that may block
727 indefinitely, such as mounting an NFS filesystem.  Other tasks such as
728 obtaining filehandle information for an NFS filesystem, are done using a
729 purpose built non-blocking RPC library which is integrated with
730 @i{Amd}'s task scheduler.  This library is also used to implement NFS
731 keep-alives (@pxref{Keep-alives}).
732
733 Whenever a mount is deferred or backgrounded, @i{Amd} must wait for it
734 to complete before replying to the kernel.  However, this would cause
735 @i{Amd} to block waiting for a reply to be constructed.  Rather than do
736 this, @i{Amd} simply @dfn{drops} the call under the assumption that the
737 kernel RPC mechanism will automatically retry the request.
738
739 @c ################################################################
740 @node Supported Platforms, Mount Maps, Overview, Top
741 @comment  node-name,  next,  previous,  up
742 @chapter Supported Platforms
743 @cindex Supported Platforms
744 @cindex shared libraries
745 @cindex NFS V.3 support
746
747 @i{Am-utils} has been ported to a wide variety of machines and operating
748 systems.  @i{Am-utils}'s code works for little-endian and big-endian
749 machines, as well as 32 bit and 64 bit architectures.  Furthermore, when
750 @i{Am-utils} ports to an Operating System on one architecture, it is generally
751 readily portable to the same Operating System on all platforms on which
752 it is available.
753
754 See the @file{INSTALL} in the distribution for more specific details on
755 building and/or configuring for some systems.
756
757 @c ################################################################
758 @node Mount Maps, Amd Command Line Options, Supported Platforms, Top
759 @comment  node-name,  next,  previous,  up
760 @chapter Mount Maps
761 @cindex Mount maps
762 @cindex Automounter configuration maps
763 @cindex Mount information
764
765 @i{Amd} has no built-in knowledge of machines or filesystems.
766 External @dfn{mount-maps} are used to provide the required information.
767 Specifically, @i{Amd} needs to know when and under what conditions it
768 should mount filesystems.
769
770 The map entry corresponding to the requested name contains a list of
771 possible locations from which to resolve the request.  Each location
772 specifies filesystem type, information required by that filesystem (for
773 example the block special device in the case of UFS), and some
774 information describing where to mount the filesystem (@pxref{fs Option}).  A
775 location may also contain @dfn{selectors} (@pxref{Selectors}).@refill
776
777 @menu
778 * Map Types::
779 * Key Lookup::
780 * Location Format::
781 @end menu
782
783 @node Map Types, Key Lookup, Mount Maps, Mount Maps
784 @comment  node-name,  next,  previous,  up
785 @section Map Types
786 @cindex Mount map types
787 @cindex Map types
788 @cindex Configuration map types
789 @cindex Types of mount map
790 @cindex Types of configuration map
791 @cindex Determining the map type
792
793 A mount-map provides the run-time configuration information to @i{Amd}.
794 Maps can be implemented in many ways.  Some of the forms supported by
795 @i{Amd} are regular files, ndbm databases, NIS maps, the @dfn{Hesiod}
796 name server, and even the password file.
797
798 A mount-map @dfn{name} is a sequence of characters.  When an automount
799 point is created a handle on the mount-map is obtained.  For each map
800 type configured, @i{Amd} attempts to reference the map of the
801 appropriate type.  If a map is found, @i{Amd} notes the type for future
802 use and deletes the reference, for example closing any open file
803 descriptors.  The available maps are configured when @i{Amd} is built
804 and can be displayed by running the command @samp{amd -v}.
805
806 When using an @i{Amd} configuration file (@pxref{Amd Configuration File})
807 and the keyword @samp{map_type} (@pxref{map_type Parameter}), you may
808 force the map used to any type.
809
810 By default, @i{Amd} caches data in a mode dependent on the type of map.
811 This is the same as specifying @samp{cache:=mapdefault} and selects a
812 suitable default cache mode depending on the map type.  The individual
813 defaults are described below.  The @var{cache} option can be specified
814 on automount points to alter the caching behavior (@pxref{Automount
815 Filesystem}).@refill
816
817 The following map types have been implemented, though some are not
818 available on all machines.  Run the command @samp{amd -v} to obtain a
819 list of map types configured on your machine.
820
821 @menu
822 * File maps::
823 * ndbm maps::
824 * NIS maps::
825 * NIS+ maps::
826 * Hesiod maps::
827 * Password maps::
828 * Union maps::
829 * LDAP maps::
830 * Executable maps::
831 @end menu
832
833 @c ----------------------------------------------------------------
834 @node File maps, ndbm maps, Map Types, Map Types
835 @comment  node-name,  next,  previous,  up
836 @subsection File maps
837 @cindex File maps
838 @cindex Flat file maps
839 @cindex File map syntactic conventions
840
841 When @i{Amd} searches a file for a map entry it does a simple scan of
842 the file and supports both comments and continuation lines.
843
844 Continuation lines are indicated by a backslash character (@samp{\}) as
845 the last character of a line in the file.  The backslash, newline character
846 @emph{and any leading white space on the following line} are discarded.  A maximum
847 line length of 2047 characters is enforced after continuation lines are read
848 but before comments are stripped.  Each line must end with
849 a newline character; that is newlines are terminators, not separators.
850 The following examples illustrate this:
851
852 @example
853 key     valA   valB;   \
854           valC
855 @end example
856
857 specifies @emph{three} locations, and is identical to
858
859 @example
860 key     valA   valB;   valC
861 @end example
862
863 However,
864
865 @example
866 key     valA   valB;\
867           valC
868 @end example
869
870 specifies only @emph{two} locations, and is identical to
871
872 @example
873 key     valA   valB;valC
874 @end example
875
876 After a complete line has been read from the file, including
877 continuations, @i{Amd} determines whether there is a comment on the
878 line.  A comment begins with a hash (``@samp{#}'') character and
879 continues to the end of the line.  There is no way to escape or change
880 the comment lead-in character.
881
882 Note that continuation lines and comment support @dfn{only} apply to
883 file maps, or ndbm maps built with the @code{mk-amd-map} program.
884
885 When caching is enabled, file maps have a default cache mode of
886 @code{all} (@pxref{Automount Filesystem}).
887
888 @c ----------------------------------------------------------------
889 @node ndbm maps, NIS maps, File maps, Map Types
890 @comment  node-name,  next,  previous,  up
891 @subsection ndbm maps
892 @cindex ndbm maps
893
894 An ndbm map may be used as a fast access form of a file map.  The program,
895 @code{mk-amd-map}, converts a normal map file into an ndbm database.
896 This program supports the same continuation and comment conventions that
897 are provided for file maps.  Note that ndbm format files may @emph{not}
898 be sharable across machine architectures.  The notion of speed generally
899 only applies to large maps; a small map, less than a single disk block,
900 is almost certainly better implemented as a file map.
901
902 ndbm maps have a default cache mode of @samp{all}
903 (@pxref{Automount Filesystem}).
904
905 @c ----------------------------------------------------------------
906 @node NIS maps, NIS+ maps, ndbm maps, Map Types
907 @comment  node-name,  next,  previous,  up
908 @subsection NIS maps
909 @cindex NIS (YP) maps
910
911 When using NIS (formerly YP), an @i{Amd} map is implemented directly
912 by the underlying NIS map.  Comments and continuation lines are
913 @emph{not} supported in the automounter and must be stripped when
914 constructing the NIS server's database.
915
916 NIS maps have a default cache mode of @code{all} (@pxref{Automount
917 Filesystem}).
918
919 The following rule illustrates what could be added to your NIS @file{Makefile},
920 in this case causing the @file{amd.home} map to be rebuilt:
921 @example
922 $(YPTSDIR)/amd.home.time: $(ETCDIR)/amd.home
923     -@@sed -e "s/#.*$$//" -e "/^$$/d" $(ETCDIR)/amd.home | \
924       awk '@{  \
925          for (i = 1; i <= NF; i++) \
926              if (i == NF) @{ \
927              if (substr($$i, length($$i), 1) == "\\") \
928                  printf("%s", substr($$i, 1, length($$i) - 1)); \
929              else \
930                  printf("%s\n", $$i); \
931              @} \
932              else \
933              printf("%s ", $$i); \
934          @}' | \
935     $(MAKEDBM) - $(YPDBDIR)/amd.home; \
936     touch $(YPTSDIR)/amd.home.time; \
937     echo "updated amd.home"; \
938     if [ ! $(NOPUSH) ]; then \
939         $(YPPUSH) amd.home; \
940         echo "pushed amd.home"; \
941     else \
942         : ; \
943     fi
944 @end example
945
946 Here @code{$(YPTSDIR)} contains the time stamp files, and
947 @code{$(YPDBDIR)} contains the dbm format NIS files.
948
949 @c ----------------------------------------------------------------
950 @node NIS+ maps, Hesiod maps, NIS maps, Map Types
951 @comment  node-name,  next,  previous,  up
952 @subsection NIS+ maps
953 @cindex NIS+ maps
954
955 NIS+ maps do not support cache mode @samp{all} and, when caching is
956 enabled, have a default cache mode of @samp{inc}.
957
958 XXX: FILL IN WITH AN EXAMPLE.
959
960 @c ----------------------------------------------------------------
961 @node Hesiod maps, Password maps, NIS+ maps, Map Types
962 @comment  node-name,  next,  previous,  up
963 @subsection Hesiod maps
964 @cindex Hesiod maps
965
966 When the map name begins with the string @samp{hesiod.} lookups are made
967 using the @dfn{Hesiod} name server.  The string following the dot is
968 used as a name qualifier and is prepended with the key being located.
969 The entire string is then resolved in the @code{automount} context, or
970 the @i{amd.conf} parameter @samp{hesiod_base} (@pxref{hesiod_base
971 Parameter}).  For example, if the key is @samp{jsp} and map name is
972 @samp{hesiod.homes} then @dfn{Hesiod} is asked to resolve
973 @samp{jsp.homes.automount}.
974
975 Hesiod maps do not support cache mode @samp{all} and, when caching is
976 enabled, have a default cache mode of @samp{inc} (@pxref{Automount
977 Filesystem}).
978
979 The following is an example of a @dfn{Hesiod} map entry:
980
981 @example
982 jsp.homes.automount HS TXT "rfs:=/home/charm;rhost:=charm;sublink:=jsp"
983 njw.homes.automount HS TXT "rfs:=/home/dylan/dk2;rhost:=dylan;sublink:=njw"
984 @end example
985
986 @c ----------------------------------------------------------------
987 @node Password maps, Union maps, Hesiod maps, Map Types
988 @comment  node-name,  next,  previous,  up
989 @subsection Password maps
990 @cindex Password file maps
991 @cindex /etc/passwd maps
992 @cindex User maps, automatic generation
993 @cindex Automatic generation of user maps
994 @cindex Using the password file as a map
995
996 The password map support is unlike the four previous map types.  When
997 the map name is the string @file{/etc/passwd} @i{Amd} can lookup a user
998 name in the password file and re-arrange the home directory field to
999 produce a usable map entry.
1000
1001 @i{Amd} assumes the home directory has the format
1002 `@t{/}@i{anydir}@t{/}@i{dom1}@t{/../}@i{domN}@t{/}@i{login}'.
1003 @c @footnote{This interpretation is not necessarily exactly what you want.}
1004 It breaks this string into a map entry where @code{$@{rfs@}} has the
1005 value `@t{/}@i{anydir}@t{/}@i{domN}', @code{$@{rhost@}} has the value
1006 `@i{domN}@t{.}@i{...}@t{.}@i{dom1}', and @code{$@{sublink@}} has the
1007 value @i{login}.@refill
1008
1009 Thus if the password file entry was
1010
1011 @example
1012 /home/achilles/jsp
1013 @end example
1014
1015 the map entry used by @i{Amd} would be
1016
1017 @example
1018 rfs:=/home/achilles;rhost:=achilles;sublink:=jsp
1019 @end example
1020
1021 Similarly, if the password file entry was
1022
1023 @example
1024 /home/cc/sugar/mjh
1025 @end example
1026
1027 the map entry used by @i{Amd} would be
1028
1029 @example
1030 rfs:=/home/sugar;rhost:=sugar.cc;sublink:=mhj
1031 @end example
1032
1033 @c ----------------------------------------------------------------
1034 @node Union maps, LDAP maps, Password maps, Map Types
1035 @comment  node-name,  next,  previous,  up
1036 @subsection Union maps
1037 @cindex Union file maps
1038
1039 The union map support is provided specifically for use with the union
1040 filesystem, @pxref{Union Filesystem}.
1041
1042 It is identified by the string @samp{union:} which is followed by a
1043 colon separated list of directories.  The directories are read in order,
1044 and the names of all entries are recorded in the map cache.  Later
1045 directories take precedence over earlier ones.  The union filesystem
1046 type then uses the map cache to determine the union of the names in all
1047 the directories.
1048
1049 @c ----------------------------------------------------------------
1050 @node LDAP maps, Executable maps, Union maps, Map Types
1051 @comment  node-name,  next,  previous,  up
1052 @subsection LDAP maps
1053 @cindex LDAP maps
1054 @cindex Lightweight Directory Access Protocol
1055
1056 LDAP (Lightweight Directory Access Protocol) maps do not support cache
1057 mode @samp{all} and, when caching is enabled, have a default cache mode
1058 of @samp{inc}.
1059
1060 For example, an @i{Amd} map @samp{amd.home} that looks as follows:
1061
1062 @example
1063 /defaults    opts:=rw,intr;type:=link
1064
1065 zing         -rhost:=shekel \
1066              host==shekel \
1067              host!=shekel;type:=nfs
1068 @end example
1069 @noindent
1070 when converted to LDAP (@pxref{amd2ldif}), will result in the following
1071 LDAP database:
1072 @example
1073 $ amd2ldif amd.home CUCS < amd.home
1074 dn: cn=amdmap timestamp, CUCS
1075 cn             : amdmap timestamp
1076 objectClass    : amdmapTimestamp
1077 amdmapTimestamp: 873071363
1078
1079 dn: cn=amdmap amd.home[/defaults], CUCS
1080 cn          : amdmap amd.home[/defaults]
1081 objectClass : amdmap
1082 amdmapName  : amd.home
1083 amdmapKey   : /defaults
1084 amdmapValue : opts:=rw,intr;type:=link
1085
1086 dn: cn=amdmap amd.home[], CUCS
1087 cn          : amdmap amd.home[]
1088 objectClass : amdmap
1089 amdmapName  : amd.home
1090 amdmapKey   :
1091 amdmapValue :
1092
1093 dn: cn=amdmap amd.home[zing], CUCS
1094 cn          : amdmap amd.home[zing]
1095 objectClass : amdmap
1096 amdmapName  : amd.home
1097 amdmapKey   : zing
1098 amdmapValue : -rhost:=shekel host==shekel host!=shekel;type:=nfs
1099 @end example
1100
1101 @c ----------------------------------------------------------------
1102 @node Executable maps, , LDAP maps, Map Types
1103 @comment  node-name,  next,  previous,  up
1104 @subsection Executable maps
1105 @cindex Executable maps
1106
1107 An executable map is a dynamic map in which the keys and values for
1108 the maps are generated on the fly by a program or script.  The program
1109 is expected to take a single parameter argument which is the key to
1110 lookup.  If the key is found, the program should print on stdout the
1111 key-value pair that were found; if the key was not found, nothing
1112 should be printed out.  Below is an sample of such a map script:
1113
1114 @example
1115 #!/bin/sh
1116 # executable map example
1117 case "$1" in
1118     "/defaults" )
1119         echo "/defaults   type:=nfs;rfs:=filer"
1120         ;;
1121     "a" )
1122         echo "a   type:=nfs;fs:=/tmp"
1123         ;;
1124     "b" )
1125         echo "b   type:=link;fs:=/usr/local"
1126         ;;
1127     * )  # no match, echo nothing
1128         ;;
1129 esac
1130 @end example
1131
1132 @xref{exec_map_timeout Parameter}.
1133
1134 @c ----------------------------------------------------------------
1135 @c subsection Gdbm
1136 @c ----------------------------------------------------------------
1137 @node Key Lookup, Location Format, Map Types, Mount Maps
1138 @comment  node-name,  next,  previous,  up
1139 @section How keys are looked up
1140 @cindex Key lookup
1141 @cindex Map lookup
1142 @cindex Looking up keys
1143 @cindex How keys are looked up
1144 @cindex Wildcards in maps
1145
1146 The key is located in the map whose type was determined when the
1147 automount point was first created.  In general the key is a pathname
1148 component.  In some circumstances this may be modified by variable
1149 expansion (@pxref{Variable Expansion}) and prefixing.  If the automount
1150 point has a prefix, specified by the @var{pref} option, then that is
1151 prepended to the search key before the map is searched.
1152
1153 If the map cache is a @samp{regexp} cache then the key is treated as an
1154 egrep-style regular expression, otherwise a normal string comparison is
1155 made.
1156
1157 If the key cannot be found then a @dfn{wildcard} match is attempted.
1158 @i{Amd} repeatedly strips the basename from the key, appends @samp{/*} and
1159 attempts a lookup.  Finally, @i{Amd} attempts to locate the special key @samp{*}.
1160
1161 For example, the following sequence would be checked if @file{home/dylan/dk2} was
1162 being located:
1163
1164 @example
1165    home/dylan/dk2
1166    home/dylan/*
1167    home/*
1168    *
1169 @end example
1170
1171 At any point when a wildcard is found, @i{Amd} proceeds as if an exact
1172 match had been found and the value field is then used to resolve the
1173 mount request, otherwise an error code is propagated back to the kernel.
1174 (@pxref{Filesystem Types}).@refill
1175
1176 @node Location Format, , Key Lookup, Mount Maps
1177 @comment  node-name,  next,  previous,  up
1178 @section Location Format
1179 @cindex Location format
1180 @cindex Map entry format
1181 @cindex How locations are parsed
1182
1183 The value field from the lookup provides the information required to
1184 mount a filesystem.  The information is parsed according to the syntax
1185 shown below.
1186
1187 @display
1188 @i{location-list}:
1189                   @i{location-selection}
1190                   @i{location-list} @i{white-space} @t{||} @i{white-space} @i{location-selection}
1191 @i{location-selection}:
1192                   @i{location}
1193                   @i{location-selection} @i{white-space} @i{location}
1194 @i{location}:
1195                   @i{location-info}
1196                   @t{-}@i{location-info}
1197                   @t{-}
1198 @i{location-info}:
1199                   @i{sel-or-opt}
1200                   @i{location-info}@t{;}@i{sel-or-opt}
1201                   @t{;}
1202 @i{sel-or-opt}:
1203                   @i{selection}
1204                   @i{opt-ass}
1205 @i{selection}:
1206                   selector@t{==}@i{value}
1207                   selector@t{!=}@i{value}
1208 @i{opt-ass}:
1209                   option@t{:=}@i{value}
1210 @i{white-space}:
1211                   space
1212                   tab
1213 @end display
1214
1215 Note that unquoted whitespace is not allowed in a location description.
1216 White space is only allowed, and is mandatory, where shown with non-terminal
1217 @i{white-space}.
1218
1219 A @dfn{location-selection} is a list of possible volumes with which to
1220 satisfy the request.  Each @dfn{location-selection} is tried
1221 sequentially, until either one succeeds or all fail.  This, by the
1222 way, is different from the historically documented behavior, which
1223 claimed (falsely, at least for last 3 years) that @i{Amd} would
1224 attempt to mount all @dfn{location-selection}s in parallel and the
1225 first one to succeed would be used.
1226
1227 @dfn{location-selection}s are optionally separated by the @samp{||}
1228 operator.  The effect of this operator is to prevent use of
1229 location-selections to its right if any of the location-selections on
1230 its left were selected, whether or not any of them were successfully
1231 mounted (@pxref{Selectors}).@refill
1232
1233 The location-selection, and singleton @dfn{location-list},
1234 @samp{type:=ufs;dev:=/dev/xd1g} would inform @i{Amd} to mount a UFS
1235 filesystem from the block special device @file{/dev/xd1g}.
1236
1237 The @dfn{sel-or-opt} component is either the name of an option required
1238 by a specific filesystem, or it is the name of a built-in, predefined
1239 selector such as the architecture type.  The value may be quoted with
1240 double quotes @samp{"}, for example
1241 @samp{type:="ufs";dev:="/dev/xd1g"}.  These quotes are stripped when the
1242 value is parsed and there is no way to get a double quote into a value
1243 field.  Double quotes are used to get white space into a value field,
1244 which is needed for the program filesystem (@pxref{Program Filesystem}).@refill
1245
1246 @menu
1247 * Map Defaults::
1248 * Variable Expansion::
1249 * Selectors::
1250 * Map Options::
1251 @end menu
1252
1253 @node Map Defaults, Variable Expansion, Location Format, Location Format
1254 @comment  node-name,  next,  previous,  up
1255 @subsection Map Defaults
1256 @cindex Map defaults
1257 @cindex How to set default map parameters
1258 @cindex Setting default map parameters
1259
1260 A location beginning with a dash @samp{-} is used to specify default
1261 values for subsequent locations.  Any previously specified defaults in
1262 the location-list are discarded.  The default string can be empty in
1263 which case no defaults apply.
1264
1265 The location @samp{-fs:=/mnt;opts:=ro} would set the local mount point
1266 to @file{/mnt} and cause mounts to be read-only by default.  Defaults
1267 specified this way are appended to, and so override, any global map
1268 defaults given with @samp{/defaults}).
1269
1270 @c
1271 @c A @samp{/defaults} value @dfn{gdef} and a location list
1272 @c \begin{quote}
1273 @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$
1274 @c \end{quote}
1275 @c is equivalent to
1276 @c \begin{quote}
1277 @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$
1278 @c \end{quote}
1279 @c which is equivalent to
1280 @c \begin{quote}
1281 @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$
1282 @c \end{quote}
1283
1284 @node Variable Expansion, Selectors, Map Defaults, Location Format
1285 @comment  node-name,  next,  previous,  up
1286 @subsection Variable Expansion
1287 @cindex Variable expansion
1288 @cindex How variables are expanded
1289 @cindex Pathname operators
1290 @cindex Domain stripping
1291 @cindex Domainname operators
1292 @cindex Stripping the local domain name
1293 @cindex Environment variables
1294 @cindex How to access environment variables in maps
1295
1296 To allow generic location specifications @i{Amd} does variable expansion
1297 on each location and also on some of the option strings.  Any option or
1298 selector appearing in the form @code{$@dfn{var}} is replaced by the
1299 current value of that option or selector.  For example, if the value of
1300 @code{$@{key@}} was @samp{bin}, @code{$@{autodir@}} was @samp{/a} and
1301 @code{$@{fs@}} was `@t{$@{autodir@}}@t{/local/}@t{$@{key@}}' then
1302 after expansion @code{$@{fs@}} would have the value @samp{/a/local/bin}.
1303 Any environment variable can be accessed in a similar way.@refill
1304
1305 Two pathname operators are available when expanding a variable.  If the
1306 variable name begins with @samp{/} then only the last component of the
1307 pathname is substituted.  For example, if @code{$@{path@}} was
1308 @samp{/foo/bar} then @code{$@{/path@}} would be expanded to @samp{bar}.
1309 Similarly, if the variable name ends with @samp{/} then all but the last
1310 component of the pathname is substituted.  In the previous example,
1311 @code{$@{path/@}} would be expanded to @samp{/foo}.@refill
1312
1313 Two domain name operators are also provided.  If the variable name
1314 begins with @samp{.} then only the domain part of the name is
1315 substituted.  For example, if @code{$@{rhost@}} was
1316 @samp{swan.doc.ic.ac.uk} then @code{$@{.rhost@}} would be expanded to
1317 @samp{doc.ic.ac.uk}.  Similarly, if the variable name ends with @samp{.}
1318 then only the host component is substituted.  In the previous example,
1319 @code{$@{rhost.@}} would be expanded to @samp{swan}.@refill
1320
1321 Variable expansion is a two phase process.  Before a location is parsed,
1322 all references to selectors, @i{eg} @code{$@{path@}}, are expanded.  The
1323 location is then parsed, selections are evaluated and option assignments
1324 recorded.  If there were no selections or they all succeeded the
1325 location is used and the values of the following options are expanded in
1326 the order given: @var{sublink}, @var{rfs}, @var{fs}, @var{opts},
1327 @var{remopts}, @var{mount} and @var{unmount}.
1328
1329 Note that expansion of option values is done after @dfn{all} assignments
1330 have been completed and not in a purely left to right order as is done
1331 by the shell.  This generally has the desired effect but care must be
1332 taken if one of the options references another, in which case the
1333 ordering can become significant.
1334
1335 There are two special cases concerning variable expansion:
1336
1337 @enumerate
1338 @item
1339 before a map is consulted, any selectors in the name received
1340 from the kernel are expanded.  For example, if the request from the
1341 kernel was for `@t{$@{arch@}}@t{.bin}' and the machine architecture
1342 was @samp{vax}, the value given to @code{$@{key@}} would be
1343 @samp{vax.bin}.@refill
1344
1345 @item
1346 the value of @code{$@{rhost@}} is expanded and normalized before the
1347 other options are expanded.  The normalization process strips any local
1348 sub-domain components.  For example, if @code{$@{domain@}} was
1349 @samp{Berkeley.EDU} and @code{$@{rhost@}} was initially
1350 @samp{snow.Berkeley.EDU}, after the normalization it would simply be
1351 @samp{snow}.  Hostname normalization is currently done in a
1352 @emph{case-dependent} manner.@refill
1353 @end enumerate
1354
1355 @c======================================================================
1356 @node Selectors, Map Options, Variable Expansion, Location Format
1357 @comment  node-name,  next,  previous,  up
1358 @subsection Selectors
1359 @cindex Selectors
1360
1361 Selectors are used to control the use of a location.  It is possible to
1362 share a mount map between many machines in such a way that filesystem
1363 location, architecture and operating system differences are hidden from
1364 the users.  A selector of the form @samp{arch==sun3;os==sunos4} would only
1365 apply on Sun-3s running SunOS 4.x.
1366
1367 Selectors can be negated by using @samp{!=} instead of @samp{==}.  For
1368 example to select a location on all non-Vax machines the selector
1369 @samp{arch!=vax} would be used.
1370
1371 Selectors are evaluated left to right.  If a selector fails then that
1372 location is ignored.  Thus the selectors form a conjunction and the
1373 locations form a disjunction.  If all the locations are ignored or
1374 otherwise fail then @i{Amd} uses the @dfn{error} filesystem
1375 (@pxref{Error Filesystem}).  This is equivalent to having a location
1376 @samp{type:=error} at the end of each mount-map entry.@refill
1377
1378 The default value of many of the selectors listed here can be overridden
1379 by an @i{Amd} command line switch or in an @i{Amd} configuration file.
1380 @xref{Amd Configuration File}.
1381
1382 The following selectors are currently implemented.
1383
1384 @menu
1385 * arch Selector Variable::
1386 * autodir Selector Variable::
1387 * byte Selector Variable::
1388 * cluster Selector Variable::
1389 * domain Selector Variable::
1390 * dollar Selector Variable::
1391 * host Selector Variable::
1392 * hostd Selector Variable::
1393 * karch Selector Variable::
1394 * os Selector Variable::
1395 * osver Selector Variable::
1396 * full_os Selector Variable::
1397 * vendor Selector Variable::
1398
1399 * key Selector Variable::
1400 * map Selector Variable::
1401 * netnumber Selector Variable::
1402 * network Selector Variable::
1403 * path Selector Variable::
1404 * wire Selector Variable::
1405 * uid Selector Variable::
1406 * gid Selector Variable::
1407
1408 * exists Selector Function::
1409 * false Selector Function::
1410 * netgrp Selector Function::
1411 * netgrpd Selector Function::
1412 * in_network Selector Function::
1413 * true Selector Function::
1414 * xhost Selector Function::
1415 @end menu
1416
1417 @c ----------------------------------------------------------------
1418 @node arch Selector Variable, autodir Selector Variable, Selectors, Selectors
1419 @comment  node-name,  next,  previous,  up
1420 @subsubsection arch Selector Variable
1421 @cindex arch Selector Variable
1422 @cindex arch, mount selector
1423 @cindex Mount selector; arch
1424 @cindex Selector; arch
1425
1426 The machine architecture which was automatically determined at compile
1427 time.  The architecture type can be displayed by running the command
1428 @samp{amd -v}.  You can override this value also using the @code{-A}
1429 command line option.  @xref{Supported Platforms}.@refill
1430
1431 @c ----------------------------------------------------------------
1432 @node autodir Selector Variable, byte Selector Variable, arch Selector Variable, Selectors
1433 @comment  node-name,  next,  previous,  up
1434 @subsubsection autodir Selector Variable
1435 @cindex autodir Selector Variable
1436 @cindex autodir, mount selector
1437 @cindex Mount selector; autodir
1438 @cindex Selector; autodir
1439
1440 The default directory under which to mount filesystems.  This may be
1441 changed by the @code{-a} command line option.  @xref{fs Option}.
1442
1443 @c ----------------------------------------------------------------
1444 @node byte Selector Variable, cluster Selector Variable, autodir Selector Variable, Selectors
1445 @comment  node-name,  next,  previous,  up
1446 @subsubsection byte Selector Variable
1447 @cindex byte Selector Variable
1448 @cindex byte, mount selector
1449 @cindex Mount selector; byte
1450 @cindex Selector; byte
1451
1452 The machine's byte ordering.  This is either @samp{little}, indicating
1453 little-endian, or @samp{big}, indicating big-endian.  One possible use
1454 is to share @samp{rwho} databases (@pxref{rwho servers}).  Another is to
1455 share ndbm databases, however this use can be considered a courageous
1456 juggling act.
1457
1458 @c ----------------------------------------------------------------
1459 @node cluster Selector Variable, domain Selector Variable, byte Selector Variable, Selectors
1460 @comment  node-name,  next,  previous,  up
1461 @subsubsection cluster Selector Variable
1462 @cindex cluster Selector Variable
1463 @cindex cluster, mount selector
1464 @cindex Mount selector; cluster
1465 @cindex Selector; cluster
1466
1467 This is provided as a hook for the name of the local cluster.  This can
1468 be used to decide which servers to use for copies of replicated
1469 filesystems.  @code{$@{cluster@}} defaults to the value of
1470 @code{$@{domain@}} unless a different value is set with the @code{-C}
1471 command line option.
1472
1473 @c ----------------------------------------------------------------
1474 @node domain Selector Variable, dollar Selector Variable, cluster Selector Variable, Selectors
1475 @comment  node-name,  next,  previous,  up
1476 @subsubsection domain Selector Variable
1477 @cindex domain Selector Variable
1478 @cindex domain, mount selector
1479 @cindex Mount selector; domain
1480 @cindex Selector; domain
1481
1482 The local domain name as specified by the @code{-d} command line option.
1483 @xref{host Selector Variable}.
1484
1485 @c ----------------------------------------------------------------
1486 @node dollar Selector Variable, host Selector Variable, domain Selector Variable, Selectors
1487 @comment  node-name,  next,  previous,  up
1488 @subsubsection dollar Selector Variable
1489 @cindex dollar Selector Variable
1490
1491 This is a special variable, whose sole purpose is to produce a literal
1492 dollar sign in the value of another variable.  For example, if you have
1493 a remote file system whose name is @samp{/disk$s}, you can mount it by
1494 setting the remote file system variable as follows:
1495
1496 @example
1497 rfs:=/disk$@{dollar@}s
1498 @end example
1499
1500 @c ----------------------------------------------------------------
1501 @node host Selector Variable, hostd Selector Variable, dollar Selector Variable, Selectors
1502 @comment  node-name,  next,  previous,  up
1503 @subsubsection host Selector Variable
1504 @cindex host Selector Variable
1505 @cindex host, mount selector
1506 @cindex Mount selector; host
1507 @cindex Selector; host
1508
1509 The local hostname as determined by @b{gethostname}(2).  If no domain
1510 name was specified on the command line and the hostname contains a
1511 period @samp{.} then the string before the period is used as the host
1512 name, and the string after the period is assigned to @code{$@{domain@}}.
1513 For example, if the hostname is @samp{styx.doc.ic.ac.uk} then
1514 @code{host} would be @samp{styx} and @code{domain} would be
1515 @samp{doc.ic.ac.uk}.  @code{hostd} would be
1516 @samp{styx.doc.ic.ac.uk}.@refill
1517
1518 @c ----------------------------------------------------------------
1519 @node hostd Selector Variable, karch Selector Variable, host Selector Variable, Selectors
1520 @comment  node-name,  next,  previous,  up
1521 @subsubsection hostd Selector Variable
1522 @cindex hostd Selector Variable
1523 @cindex hostd, mount selector
1524 @cindex Mount selector; hostd
1525 @cindex Selector; hostd
1526
1527 This resolves to the @code{$@{host@}} and @code{$@{domain@}}
1528 concatenated with a @samp{.} inserted between them if required.  If
1529 @code{$@{domain@}} is an empty string then @code{$@{host@}} and
1530 @code{$@{hostd@}} will be identical.
1531
1532 @c ----------------------------------------------------------------
1533 @node karch Selector Variable, os Selector Variable, hostd Selector Variable, Selectors
1534 @comment  node-name,  next,  previous,  up
1535 @subsubsection karch Selector Variable
1536 @cindex karch Selector Variable
1537 @cindex karch, mount selector
1538 @cindex Mount selector; karch
1539 @cindex Selector; karch
1540
1541 This is provided as a hook for the kernel architecture.  This is used on
1542 SunOS 4 and SunOS 5, for example, to distinguish between different
1543 @samp{/usr/kvm} volumes.  @code{$@{karch@}} defaults to the ``machine''
1544 value gotten from @b{uname}(2).  If the @b{uname}(2) system call is not
1545 available, the value of @code{$@{karch@}} defaults to that of
1546 @code{$@{arch@}}.  Finally, a different value can be set with the @code{-k}
1547 command line option.
1548
1549 @c ----------------------------------------------------------------
1550 @node os Selector Variable, osver Selector Variable, karch Selector Variable, Selectors
1551 @comment  node-name,  next,  previous,  up
1552 @subsubsection os Selector Variable
1553 @cindex os Selector Variable
1554 @cindex os, mount selector
1555 @cindex Mount selector; os
1556 @cindex Selector; os
1557
1558 The operating system.  Like the machine architecture, this is
1559 automatically determined at compile time.  The operating system name can
1560 be displayed by running the command @samp{amd -v}.  @xref{Supported
1561 Platforms}.@refill
1562
1563 @c ----------------------------------------------------------------
1564 @node osver Selector Variable, full_os Selector Variable, os Selector Variable, Selectors
1565 @comment  node-name,  next,  previous,  up
1566 @subsubsection osver Selector Variable
1567 @cindex osver Selector Variable
1568 @cindex osver, mount selector
1569 @cindex Mount selector; osver
1570 @cindex Selector; osver
1571
1572 The operating system version.  Like the machine architecture, this is
1573 automatically determined at compile time.  The operating system name can
1574 be displayed by running the command @samp{amd -v}.  @xref{Supported
1575 Platforms}.@refill
1576
1577 @c ----------------------------------------------------------------
1578 @node full_os Selector Variable, vendor Selector Variable, osver Selector Variable, Selectors
1579 @comment  node-name,  next,  previous,  up
1580 @subsubsection full_os Selector Variable
1581 @cindex full_os Selector Variable
1582 @cindex full_os, mount selector
1583 @cindex Mount selector; full_os
1584 @cindex Selector; full_os
1585
1586 The full name of the operating system, including its version.  This
1587 value is automatically determined at compile time.  The full operating
1588 system name and version can be displayed by running the command
1589 @samp{amd -v}.  @xref{Supported Platforms}.@refill
1590
1591 @c ----------------------------------------------------------------
1592 @node vendor Selector Variable, key Selector Variable, full_os Selector Variable, Selectors
1593 @comment  node-name,  next,  previous,  up
1594 @subsubsection vendor Selector Variable
1595 @cindex vendor Selector Variable
1596 @cindex vendor, mount selector
1597 @cindex Mount selector; vendor
1598 @cindex Selector; vendor
1599
1600 The name of the vendor of the operating system.  This value is
1601 automatically determined at compile time.  The name of the vendor can be
1602 displayed by running the command @samp{amd -v}.  @xref{Supported
1603 Platforms}.@refill
1604
1605
1606 @c ----------------------------------------------------------------
1607 @ifhtml
1608 <HR>
1609 @end ifhtml
1610 @sp 3
1611 The following selectors are also provided.  Unlike the other selectors,
1612 they vary for each lookup.  Note that when the name from the kernel is
1613 expanded prior to a map lookup, these selectors are all defined as empty
1614 strings.
1615
1616 @c ----------------------------------------------------------------
1617 @node key Selector Variable, map Selector Variable, vendor Selector Variable, Selectors
1618 @comment  node-name,  next,  previous,  up
1619 @subsubsection key Selector Variable
1620 @cindex key Selector Variable
1621 @cindex key, mount selector
1622 @cindex Mount selector; key
1623 @cindex Selector; key
1624
1625 The name being resolved.  For example, if @file{/home} is an automount
1626 point, then accessing @file{/home/foo} would set @code{$@{key@}} to the
1627 string @samp{foo}.  The key is prefixed by the @var{pref} option set in
1628 the parent mount point.  The default prefix is an empty string.  If the
1629 prefix was @file{blah/} then @code{$@{key@}} would be set to
1630 @file{blah/foo}.@refill
1631
1632 @c ----------------------------------------------------------------
1633 @node map Selector Variable, netnumber Selector Variable, key Selector Variable, Selectors
1634 @comment  node-name,  next,  previous,  up
1635 @subsubsection map Selector Variable
1636 @cindex map Selector Variable
1637 @cindex map, mount selector
1638 @cindex Mount selector; map
1639 @cindex Selector; map
1640
1641 The name of the mount map being used.
1642
1643 @c ----------------------------------------------------------------
1644 @node netnumber Selector Variable, network Selector Variable, map Selector Variable, Selectors
1645 @comment  node-name,  next,  previous,  up
1646 @subsubsection netnumber Selector Variable
1647 @cindex netnumber Selector Variable
1648 @cindex netnumber, mount selector
1649 @cindex Mount selector; netnumber
1650 @cindex Selector; netnumber
1651
1652 This selector is identical to the @samp{in_network} selector function,
1653 see @ref{in_network Selector Function}.  It will match either the name
1654 or number of @i{any} network interface on which this host is connected
1655 to.  The names and numbers of all attached interfaces are available from
1656 the output of @samp{amd -v}.
1657
1658 @c ----------------------------------------------------------------
1659 @node network Selector Variable, path Selector Variable, netnumber Selector Variable, Selectors
1660 @comment  node-name,  next,  previous,  up
1661 @subsubsection network Selector Variable
1662 @cindex network Selector Variable
1663 @cindex network, mount selector
1664 @cindex Mount selector; network
1665 @cindex Selector; network
1666
1667 This selector is identical to the @samp{in_network} selector function,
1668 see @ref{in_network Selector Function}.  It will match either the name
1669 or number of @i{any} network interface on which this host is connected
1670 to.  The names and numbers of all attached interfaces are available from
1671 the output of @samp{amd -v}.
1672
1673 @c ----------------------------------------------------------------
1674 @node path Selector Variable, wire Selector Variable, network Selector Variable, Selectors
1675 @comment  node-name,  next,  previous,  up
1676 @subsubsection path Selector Variable
1677 @cindex path Selector Variable
1678 @cindex path, mount selector
1679 @cindex Mount selector; path
1680 @cindex Selector; path
1681
1682 The full pathname of the name being resolved.  For example
1683 @file{/home/foo} in the example above.
1684
1685 @c ----------------------------------------------------------------
1686 @node wire Selector Variable, uid Selector Variable, path Selector Variable, Selectors
1687 @comment  node-name,  next,  previous,  up
1688 @subsubsection wire Selector Variable
1689 @cindex wire Selector Variable
1690 @cindex wire, mount selector
1691 @cindex Mount selector; wire
1692 @cindex Selector; wire
1693
1694 This selector is identical to the @samp{in_network} selector function,
1695 see @ref{in_network Selector Function}.  It will match either the name
1696 or number of @i{any} network interface on which this host is connected
1697 to.  The names and numbers of all attached interfaces are available from
1698 the output of @samp{amd -v}.
1699
1700 @c ----------------------------------------------------------------
1701 @node uid Selector Variable, gid Selector Variable, wire Selector Variable, Selectors
1702 @comment  node-name,  next,  previous,  up
1703 @subsubsection uid Selector Variable
1704 @cindex uid Selector Variable
1705 @cindex uid, mount selector
1706 @cindex Mount selector; uid
1707 @cindex Selector; uid
1708
1709 This selector provides the numeric effective user ID (UID) of the user
1710 which last accessed an automounted path name.  This simple example shows
1711 how floppy mounting can be assigned only to machine owners:
1712
1713 @example
1714 floppy  -type:=pcfs \
1715         uid==2301;host==shekel;dev:=/dev/floppy \
1716         uid==6712;host==titan;dev=/dev/fd0 \
1717         uid==0;dev:=/dev/fd0c \
1718         type:=error
1719 @end example
1720
1721 The example allows two machine owners to mount floppies on their
1722 designated workstations, allows the root user to mount on any host, and
1723 otherwise forces an error.
1724
1725 @c ----------------------------------------------------------------
1726 @node gid Selector Variable, exists Selector Function, uid Selector Variable, Selectors
1727 @comment  node-name,  next,  previous,  up
1728 @subsubsection gid Selector Variable
1729 @cindex gid Selector Variable
1730 @cindex gid, mount selector
1731 @cindex Mount selector; gid
1732 @cindex Selector; gid
1733
1734 This selector provides the numeric effective group ID (GID) of the user
1735 which last accessed an automounted path name.
1736
1737 @c ----------------------------------------------------------------
1738 @ifhtml
1739 <HR>
1740 @end ifhtml
1741 @sp 2
1742 The following boolean functions are selectors which take an argument
1743 @i{ARG}.  They return a value of true or false, and thus do not need to
1744 be compared with a value.  Each of these may be negated by prepending
1745 @samp{!} to their name.
1746
1747 @c ----------------------------------------------------------------
1748 @node exists Selector Function, false Selector Function, gid Selector Variable, Selectors
1749 @comment  node-name,  next,  previous,  up
1750 @subsubsection exists Selector Function
1751 @cindex exists Selector Function
1752 @cindex exists, boolean mount selector
1753 @cindex !exists, boolean mount selector
1754 @cindex Mount selector; exists
1755 @cindex Selector; exists
1756
1757 If the file listed by @i{ARG} exists (via @b{lstat}(2)), this function
1758 evaluates to true.  Otherwise it evaluates to false.
1759
1760 @c ----------------------------------------------------------------
1761 @node false Selector Function, netgrp Selector Function, exists Selector Function, Selectors
1762 @comment  node-name,  next,  previous,  up
1763 @subsubsection false Selector Function
1764 @cindex false Selector Function
1765 @cindex false, boolean mount selector
1766 @cindex !false, boolean mount selector
1767 @cindex Mount selector; false
1768 @cindex Selector; false
1769
1770 Always evaluates to false.  @i{ARG} is ignored.
1771
1772 @c ----------------------------------------------------------------
1773 @node netgrp Selector Function, netgrpd Selector Function, false Selector Function, Selectors
1774 @comment  node-name,  next,  previous,  up
1775 @subsubsection netgrp Selector Function
1776 @cindex netgrp Selector Function
1777 @cindex netgrp, boolean mount selector
1778 @cindex !netgrp, boolean mount selector
1779 @cindex Mount selector; netgrp
1780 @cindex Selector; netgrp
1781
1782 The argument @i{ARG} of this selector is a netgroup name followed
1783 optionally by a comma and a host name.  If the host name is not
1784 specified, it defaults to @code{$@{host@}}.  If the host name (short
1785 name) is a member of the netgroup, this selector evaluates to true.
1786 Otherwise it evaluates to false.
1787
1788 For example, suppose you have a netgroup @samp{ppp-hosts}, and for
1789 reasons of performance, these have a local @file{/home} partition,
1790 while all other clients on the faster network can access a shared home
1791 directory.  A common map to use for both might look like the
1792 following:
1793
1794 @example
1795 home/*  netgrp(ppp-hosts);type:=link;fs:=/local/$@{key@} \
1796         !netgrp(ppp-hosts);type:=nfs;rhost:=serv1;rfs:=/remote/$@{key@}
1797 @end example
1798
1799 A more complex example that takes advantage of the two argument netgrp
1800 mount selector is given in the following scenario.  Suppose one wants
1801 to mount the local scratch space from a each host under
1802 @file{scratch/<hostname>} and some hosts have their scratch space in a
1803 different path than others.  Hosts in the netgroup @samp{apple-hosts}
1804 have their scratch space in the @file{/apple} path, where hosts in the
1805 netgroup @samp{cherry-hosts} have their scratch space in the
1806 @file{/cherry} path.  For hosts that are neither in the
1807 @samp{apple-hosts} or @samp{cherry-hosts} netgroups we want to make a
1808 symlink pointing to nowhere but provide a descriptive error message in
1809 the link destination:
1810
1811 @example
1812 scratch/*       netgrp(apple-hosts,$@{/key@});type:=nfs;rhost:=$@{/key@};\
1813                     rfs:="/apple" \
1814                 netgrp(cherry-hosts,$@{/key@});type:=nfs;rhost:=$@{/key@};\
1815                     rfs:="/cherry" \
1816                 type:=link;rfs:="no local partition for $@{/key@}"
1817 @end example
1818
1819 @c ----------------------------------------------------------------
1820 @node netgrpd Selector Function, in_network Selector Function, netgrp Selector Function, Selectors
1821 @comment  node-name,  next,  previous,  up
1822 @subsubsection netgrpd Selector Function
1823 @cindex netgrpd Selector Function
1824 @cindex netgrpd, boolean mount selector
1825 @cindex !netgrpd, boolean mount selector
1826 @cindex Mount selector; netgrpd
1827 @cindex Selector; netgrpd
1828
1829 The argument @i{ARG} of this selector is a netgroup name followed
1830 optionally by a comma and a host name.  If the host name is not
1831 specified, it defaults to @code{$@{hostd@}}.  If the host name
1832 (fully-qualified name) is a member of the netgroup, this selector
1833 evaluates to true.  Otherwise it evaluates to false.
1834
1835 The @samp{netgrpd} function uses fully-qualified host names to match
1836 netgroup names, while the @samp{netgrp} function (@pxref{netgrp
1837 Selector Function}) uses short host names.
1838
1839 @c ----------------------------------------------------------------
1840 @node in_network Selector Function, true Selector Function, netgrpd Selector Function, Selectors
1841 @comment  node-name,  next,  previous,  up
1842 @subsubsection in_network Selector Function
1843 @cindex in_network Selector Function
1844 @cindex in_network, boolean mount selector
1845 @cindex !in_network, boolean mount selector
1846 @cindex Mount selector; in_network
1847 @cindex Selector; in_network
1848
1849 This selector matches against any network name or number with an
1850 optional netmask.  First, if the current host has any network interface that is
1851 locally attached to the network specified in @i{ARG} (either via name or
1852 number), this selector evaluates to true.
1853
1854 Second, @samp{in_network} supports a network/netmask syntax such as
1855 @samp{128.59.16.0/255.255.255.0}, @samp{128.59.16.0/24},
1856 @samp{128.59.16.0/0xffffff00}, or @samp{128.59.16.0/}.  Using the last
1857 form, @i{Amd} will match the specified network number against the
1858 default netmasks of each of the locally attached interfaces.
1859
1860 If the selector does not match, it evaluates to false.
1861
1862 For example, suppose you have two servers that have an exportable
1863 @file{/opt} that smaller clients can NFS mount.  The two servers are
1864 say, @samp{serv1} on network @samp{foo-net.site.com} and @samp{serv2} on
1865 network @samp{123.4.5.0}.  You can write a map to be used by all clients
1866 that will attempt to mount the closest one as follows:
1867
1868 @example
1869 opt in_network(foo-net.site.com);rhost:=serv1;rfs:=/opt \
1870     in_network(123.4.5.0);rhost:=serv2;rfs:=/opt \
1871     rhost:=fallback-server
1872 @end example
1873
1874 @c ----------------------------------------------------------------
1875 @node true Selector Function, xhost Selector Function, in_network Selector Function, Selectors
1876 @comment  node-name,  next,  previous,  up
1877 @subsubsection true Selector Function
1878 @cindex true Selector Function
1879 @cindex true, boolean mount selector
1880 @cindex !true, boolean mount selector
1881 @cindex Mount selector; true
1882 @cindex Selector; true
1883
1884 Always evaluates to true.  @i{ARG} is ignored.
1885
1886 @c ----------------------------------------------------------------
1887 @node xhost Selector Function, , true Selector Function, Selectors
1888 @comment  node-name,  next,  previous,  up
1889 @subsubsection xhost Selector Function
1890 @cindex xhost Selector Function
1891 @cindex xhost, boolean mount selector
1892 @cindex !xhost, boolean mount selector
1893 @cindex Mount selector; xhost
1894 @cindex Selector; xhost
1895 @cindex CNAMEs
1896
1897 This function compares @i{ARG} against the current hostname, similarly
1898 to the @ref{host Selector Variable}.  However, this function will
1899 also match if @i{ARG} is a CNAME (DNS Canonical Name, or alias) for
1900 the current host's name.
1901
1902 @c ================================================================
1903 @node Map Options,  , Selectors, Location Format
1904 @comment  node-name,  next,  previous,  up
1905 @subsection Map Options
1906 @cindex Map options
1907 @cindex Setting map options
1908
1909 Options are parsed concurrently with selectors.  The difference is that
1910 when an option is seen the string following the @samp{:=} is
1911 recorded for later use.  As a minimum the @var{type} option must be
1912 specified.  Each filesystem type has other options which must also be
1913 specified.  @xref{Filesystem Types}, for details on the filesystem
1914 specific options.@refill
1915
1916 Superfluous option specifications are ignored and are not reported
1917 as errors.
1918
1919 The following options apply to more than one filesystem type.
1920
1921 @menu
1922 * addopts Option::
1923 * delay Option::
1924 * fs Option::
1925 * opts Option::
1926 * remopts Option::
1927 * sublink Option::
1928 * type Option::
1929 @end menu
1930
1931 @node addopts Option, delay Option, Map Options, Map Options
1932 @comment  node-name,  next,  previous,  up
1933 @subsubsection addopts Option
1934 @cindex Setting additional options on a mount location
1935 @cindex Overriding or adding options to a mount
1936 @cindex addopts, mount option
1937 @cindex Mount option; addopts
1938
1939 This option adds additional options to default options normally
1940 specified in the @samp{/defaults} entry or the defaults of the key entry
1941 being processed (@pxref{opts Option}).  Normally when you specify
1942 @samp{opts} in both the @samp{/defaults} and the map entry, the latter
1943 overrides the former completely.  But with @samp{addopts} it will append
1944 the options and override any conflicting ones.
1945
1946 @samp{addopts} also overrides the value of the @samp{remopts} option
1947 (@pxref{remopts Option}), which unless specified defaults to the value
1948 of @samp{opts}.
1949
1950 Options which start with @samp{no} will override those with the same
1951 name that do not start with @samp{no} and vice verse.  Special handling
1952 is given to inverted options such as @samp{soft} and @samp{hard},
1953 @samp{bg} and @samp{fg}, @samp{ro} and @samp{rw}, etc.
1954
1955 For example, if the default options specified were
1956 @example
1957 opts:=rw,nosuid,intr,rsize=1024,wsize=1024,quota,posix
1958 @end example
1959
1960 and the ones specified in a map entry were
1961
1962 @example
1963 addopts:=grpid,suid,ro,rsize=2048,quota,nointr
1964 @end example
1965
1966 then the actual options used would be
1967
1968 @example
1969 wsize=1024,posix,grpid,suid,ro,rsize=2048,quota,nointr
1970 @end example
1971
1972 @node delay Option, fs Option, addopts Option, Map Options
1973 @comment  node-name,  next,  previous,  up
1974 @subsubsection delay Option
1975 @cindex Setting a delay on a mount location
1976 @cindex Delaying mounts from specific locations
1977 @cindex Primary server
1978 @cindex Secondary server
1979 @cindex delay, mount option
1980 @cindex Mount option; delay
1981
1982 The delay, in seconds, before an attempt will be made to mount from the
1983 current location.  Auxiliary data, such as network address, file handles
1984 and so on are computed regardless of this value.
1985
1986 A delay can be used to implement the notion of primary and secondary
1987 file servers.  The secondary servers would have a delay of a few
1988 seconds, thus giving the primary servers a chance to respond first.
1989
1990 @node fs Option, opts Option, delay Option, Map Options
1991 @comment  node-name,  next,  previous,  up
1992 @subsubsection fs Option
1993 @cindex Setting the local mount point
1994 @cindex Overriding the default mount point
1995 @cindex fs, mount option
1996 @cindex Mount option; fs
1997
1998 The local mount point.  The semantics of this option vary between
1999 filesystems.
2000
2001 For NFS and UFS filesystems the value of @code{$@{fs@}} is used as the
2002 local mount point.  For other filesystem types it has other meanings
2003 which are described in the section describing the respective filesystem
2004 type.  It is important that this string uniquely identifies the
2005 filesystem being mounted.  To satisfy this requirement, it should
2006 contain the name of the host on which the filesystem is resident and the
2007 pathname of the filesystem on the local or remote host.
2008
2009 The reason for requiring the hostname is clear if replicated filesystems
2010 are considered.  If a fileserver goes down and a replacement filesystem
2011 is mounted then the @dfn{local} mount point @dfn{must} be different from
2012 that of the filesystem which is hung.  Some encoding of the filesystem
2013 name is required if more than one filesystem is to be mounted from any
2014 given host.
2015
2016 If the hostname is first in the path then all mounts from a particular
2017 host will be gathered below a single directory.  If that server goes
2018 down then the hung mount points are less likely to be accidentally
2019 referenced, for example when @b{getcwd}(3) traverses the namespace to
2020 find the pathname of the current directory.
2021
2022 The @samp{fs} option defaults to
2023 @code{$@{autodir@}/$@{rhost@}$@{rfs@}}.  In addition,
2024 @samp{rhost} defaults to the local host name (@code{$@{host@}}) and
2025 @samp{rfs} defaults to the value of @code{$@{path@}}, which is the full
2026 path of the requested file; @samp{/home/foo} in the example above
2027 (@pxref{Selectors}).  @code{$@{autodir@}} defaults to @samp{/a} but may
2028 be changed with the @code{-a} command line option.  Sun's automounter
2029 defaults to @samp{/tmp_mnt}.  Note that there is no @samp{/} between
2030 the @code{$@{rhost@}} and @code{$@{rfs@}} since @code{$@{rfs@}} begins
2031 with a @samp{/}.@refill
2032
2033 @node opts Option, remopts Option, fs Option, Map Options
2034 @comment  node-name,  next,  previous,  up
2035 @subsubsection opts Option
2036 @cindex Setting system mount options
2037 @cindex Passing parameters to the mount system call
2038 @cindex mount system call
2039 @cindex mount system call flags
2040 @cindex The mount system call
2041 @cindex opts, mount option
2042 @cindex Mount option; opts
2043
2044 The options to pass to the mount system call.  A leading @samp{-} is
2045 silently ignored.  The mount options supported generally correspond to
2046 those used by @b{mount}(8) and are listed below.  Some additional
2047 pseudo-options are interpreted by @i{Amd} and are also listed.
2048
2049 Unless specifically overridden, each of the system default mount options
2050 applies.  Any options not recognized are ignored.  If no options list is
2051 supplied the string @samp{rw,defaults} is used and all the system
2052 default mount options apply.  Options which are not applicable for a
2053 particular operating system are silently ignored.  For example, only 4.4BSD
2054 is known to implement the @code{compress} and @code{spongy} options.
2055
2056 @table @code
2057
2058 @item acdirmax=@var{n}
2059 @cindex Mount flags; acdirmax
2060 Set the maximum directory attribute cache timeout to @var{n}.
2061
2062 @item acdirmin=@var{n}
2063 @cindex Mount flags; acdirmin
2064 Set the minimum directory attribute cache timeout to @var{n}.
2065
2066 @item acregmax=@var{n}
2067 @cindex Mount flags; acregmax
2068 Set the maximum file attribute cache timeout to @var{n}.
2069
2070 @item acregmin=@var{n}
2071 @cindex Mount flags; acregmin
2072 Set the minimum file attribute cache timeout to @var{n}.
2073
2074 @item actimeo=@var{n}
2075 @cindex Mount flags; actimeo
2076 Set the overall attribute cache timeout to @var{n}.
2077
2078 @item auto
2079 @cindex Mount flags; auto
2080 @itemx ignore
2081 @cindex Mount flags; ignore
2082 Ignore this mount by @b{df}(1).
2083
2084 @item cache
2085 @cindex Mount flags; cache
2086 Allow data to be cached from a remote server for this mount.
2087
2088 @item closesession
2089 @cindex Mount flags; closesession
2090 For UDF mounts, close the session when unmounting.
2091
2092 @item compress
2093 @cindex Mount flags; compress
2094 Use NFS compression protocol.
2095
2096 @item defperm
2097 @cindex Mount flags; defperm
2098 Ignore the permission mode bits, and default file permissions to 0555,
2099 UID 0, and GID 0.  Useful for CD-ROMs formatted as ISO-9660.
2100
2101 @item dev
2102 @cindex Mount flags; dev
2103 Allow local special devices on this filesystem.
2104
2105 @item dirmask=@var{n}
2106 @cindex Mount flags; dirmask
2107 For PCFS mounts, specify the maximum file permissions for directories
2108 in the file system.  See the @samp{mask} option's description for more
2109 details.  The mask value of @var{n} can be specified in decimal,
2110 octal, or hexadecimal.
2111
2112 @item dumbtimr
2113 @cindex Mount flags; dumbtimr
2114 Turn off the dynamic retransmit timeout estimator.  This may be useful
2115 for UDP mounts that exhibit high retry rates, since it is possible that
2116 the dynamically estimated timeout interval is too short.
2117
2118 @item extatt
2119 @cindex Mount flags; extatt
2120 Enable extended attributes in ISO-9660 file systems.
2121
2122 @item fsid
2123 @cindex Mount flags; fsid
2124 Set ID of filesystem.
2125
2126 @item gens
2127 @cindex Mount flags; gens
2128 Enable generations in ISO-9660 file systems.  Generations allow you to
2129 see all versions of a given file.
2130
2131 @item gmtoff=@var{n}
2132 @cindex Mount flags; gmtoff
2133 For UDF mounts, set the time zone offset from UTC to @var{n} seconds,
2134 with positive values indicating east of the Prime Meridian.  If not
2135 set, the user's current time zone will be used.
2136
2137 @item group=@var{n}
2138 @cindex Mount flags; group
2139 For PCFS and UDF mounts, set the group of the files in the file system
2140 to @var{n} (which can either be a group name or a GID number).  The
2141 default group is the group of the directory on which the file system
2142 is being mounted.
2143
2144 @item grpid
2145 @cindex Mount flags; grpid
2146 Use BSD directory group-id semantics.
2147
2148 @item int
2149 @cindex Mount flags; int
2150 @itemx intr
2151 @cindex Mount flags; intr
2152 Allow keyboard interrupts on hard mounts.
2153
2154 @item lock
2155 @cindex Mount flags; lock
2156 Use the NFS locking protocol (default)
2157
2158 @item longname
2159 @cindex Mount Flags; longname
2160 For PCFS mounts, force Win95 long names.
2161
2162 @item mask=@var{n}
2163 @cindex Mount flags; mask
2164 For PCFS mounts, specify the maximum file permissions for files in the
2165 file system.  For example, a mask of 755 specifies that, by default,
2166 the owner should have read, write, and execute permissions for files,
2167 but others should only have read and execute permissions.  Only the
2168 nine low-order bits of mask are used.  The default mask is taken from
2169 the directory on which the file system is being mounted.  The mask
2170 value of @var{n} can be specified in decimal, octal, or hexadecimal.
2171
2172 @item multi
2173 @cindex Mount flags; multi
2174 Perform multi-component lookup on files.
2175
2176 @item maxgroups
2177 @cindex Mount flags; maxgroups
2178 Set the maximum number of groups to allow for this mount.
2179
2180 @item nfsv3
2181 @cindex Mount flags; nfsv3
2182 Use NFS Version 3 for this mount.
2183
2184 @item noac
2185 @cindex Mount flags; noac
2186 Turn off the attribute cache.
2187
2188 @item noauto
2189 @cindex Mount flags; noauto
2190 This option is used by the mount command in @samp{/etc/fstab} or
2191 @samp{/etc/vfstab} and means not to mount this file system when mount -a
2192 is used.
2193
2194 @item nocache
2195 @cindex Mount flags; nocache
2196 Do not allow data to be cached from a remote server for this
2197 mount.
2198
2199 @item nocasetrans
2200 @cindex Mount flags; nocasetrans
2201 Don't do case translation. Useful for CD-ROMS formatted as
2202 ISO-9660.
2203
2204 @item noconn
2205 @cindex Mount flags; noconn
2206 Don't make a connection on datagram transports.
2207
2208 @item nocto
2209 @cindex Mount flags; nocto
2210 No close-to-open consistency.
2211
2212 @item nodefperm
2213 @cindex Mount flags; nodefperm
2214 Do not ignore the permission mode bits.  Useful for CD-ROMS formatted as
2215 ISO-9660.
2216
2217 @item nodev
2218 @cindex Mount flags; nodev
2219 @itemx nodevs
2220 @cindex Mount flags; nodevs
2221 Don't allow local special devices on this filesystem.
2222
2223 @item noexec
2224 @cindex Mount flags; noexec
2225 Don't allow program execution.
2226
2227 @item noint
2228 @cindex Mount flags; noint
2229 Do not allow keyboard interrupts for this mount
2230
2231 @item nojoliet
2232 @cindex Mount flags; nojoliet
2233 Turn off the Joliet extensions.  Useful for CD-ROMS formatted as ISO-9660.
2234
2235 @item nolock
2236 @cindex Mount flags; nolock
2237 Do not use the NFS locking protocol
2238
2239 @item nomnttab
2240 @cindex Mount flags; nomnttab
2241 This option is used internally to tell Amd that a Solaris 8 system using
2242 mntfs is in use.
2243
2244 @item norrip
2245 @cindex Mount flags; norrip
2246 Turn off using of the Rock Ridge Interchange Protocol (RRIP) extensions
2247 to ISO-9660.
2248
2249 @item nosub
2250 @cindex Mount flags; nosub
2251 Disallow mounts beneath this mount.
2252
2253 @item nosuid
2254 @cindex Mount flags; nosuid
2255 Don't allow set-uid or set-gid executables on this filesystem.
2256
2257 @item noversion
2258 @cindex Mount flags; noversion
2259 Strip the extension @samp{;#} from the version string of files recorded
2260 on an ISO-9660 CD-ROM.
2261
2262 @item nowin95
2263 @cindex Mount Flags; nowin95
2264 For PCFS mounts, completely ignore Win95 entries.
2265
2266 @item optionstr
2267 @cindex Mount flags; optionstr
2268 Under Solaris 8, provide the kernel a string of options to parse and
2269 show as part of the special in-kernel mount file system.
2270
2271 @item overlay
2272 @cindex Mount flags; overlay
2273 Overlay this mount on top of an existing mount, if any.
2274
2275 @item pgthresh=@var{n}
2276 @cindex Mount flags; pgthresh
2277 Set the paging threshold to @var{n} kilobytes.
2278
2279 @item port=@var{n}
2280 @cindex Mount flags; port
2281 Set the NFS port to @var{n}.
2282
2283 @item posix
2284 @cindex Mount flags; posix
2285 Turn on POSIX static pathconf for mounts.
2286
2287 @item private
2288 @cindex Mount flags; private
2289 Use local locking instead of the NLM protocol, useful for IRIX 6 only.
2290
2291 @item proplist
2292 @cindex Mount flags; proplist
2293 Support property lists (ACLs) for this mount, useful primarily for Tru64
2294 UNIX.
2295
2296 @item proto=@var{s}
2297 @cindex Mount flags; proto
2298 Use transport protocol @var{s} for NFS (can be @code{"tcp"} or @code{"udp"}).
2299
2300 @item quota
2301 @cindex Mount flags; quota
2302 Enable quota checking on this mount.
2303
2304 @item rdonly
2305 @cindex Mount flags; rdonly
2306 @itemx ro
2307 @cindex Mount flags; ro
2308 Mount this filesystem readonly.
2309
2310 @item resvport
2311 @cindex Mount flags; resvport
2312 Use a reserved port (smaller than 1024) for remote NFS mounts.  Most
2313 systems assume that, but some allow for mounts to occur on non-reserved
2314 ports.   This causes problems when such a system tries to NFS mount one
2315 that requires reserved ports.  It is recommended that this option always
2316 be on.
2317
2318 @item retrans=@i{n}
2319 @cindex Mount flags; retrans
2320 The number of NFS retransmits made before a user error is generated by a
2321 @samp{soft} mounted filesystem, and before a @samp{hard} mounted
2322 filesystem reports @samp{NFS server @dfn{yoyo} not responding still
2323 trying}.
2324
2325 @item retry
2326 @cindex Mount flags; retry
2327 Set the NFS retry counter.
2328
2329 @item rrcaseins
2330 @cindex Mount flags; rrcaseins
2331 Enable the Rock Ridge Interchange Protocol (RRIP) case insensitive extensions.
2332 Useful for CD-ROMS formatted as ISO-9660.
2333
2334 @item rrip
2335 @cindex Mount flags; rrip
2336 Uses the Rock Ridge Interchange Protocol (RRIP) extensions to ISO-9660.
2337
2338 @item rsize=@var{n}
2339 @cindex Mount flags; rsize
2340 The NFS read packet size.  You may need to set this if you are using
2341 NFS/UDP through a gateway or a slow link.
2342
2343 @item rw
2344 @cindex Mount flags; rw
2345 Allow reads and writes on this filesystem.
2346
2347 @item sessionnr=@var{n}
2348 @cindex Mount Flags; sessionnr
2349 For multisession UDF mounts, use session number @var{n} when mounting.
2350
2351 @item shortname
2352 @cindex Mount Flags; longname
2353 For PCFS mounts, force old DOS short names only.
2354
2355 @item soft
2356 @cindex Mount flags; soft
2357 Give up after @dfn{retrans} retransmissions.
2358
2359 @item spongy
2360 @cindex Mount flags; spongy
2361 Like @samp{soft} for status requests, and @samp{hard} for data transfers.
2362
2363 @item suid
2364 @cindex Mount flags; suid
2365 Allow set-uid programs on this mount.
2366
2367 @item symttl
2368 @cindex Mount flags; symttl
2369 Turn off the symbolic link cache time-to-live.
2370
2371 @item sync
2372 @cindex Mount flags; sync
2373 Perform synchronous filesystem operations on this mount.
2374
2375 @item tcp
2376 @cindex Mount flags; tcp
2377 Use TCP/IP instead of UDP/IP, ignored if the NFS implementation does not
2378 support TCP/IP mounts.
2379
2380 @item timeo=@var{n}
2381 @cindex Mount flags; timeo
2382 The NFS timeout, in tenth-seconds, before a request is retransmitted.
2383
2384 @item user=@var{n}
2385 @cindex Mount flags; user
2386 For PCFS and UDF mounts, set the owner of the files in the file system
2387 to @var{n} (which can either be a user name or a UID number).  The
2388 default owner is the owner of the directory on which the file system
2389 is being mounted.
2390
2391 @item vers=@var{n}
2392 @cindex Mount flags; vers
2393 Use NFS protocol version number @var{n} (can be 2 or 3).
2394
2395 @item wsize=@var{n}
2396 @cindex Mount flags; wsize
2397 The NFS write packet size.  You may need to set this if you are using
2398 NFS/UDP through a gateway or a slow link.
2399
2400 @end table
2401
2402 The following options are implemented by @i{Amd}, rather than being
2403 passed to the kernel.
2404
2405 @table @code
2406
2407 @item nounmount
2408 @cindex Mount flags; nounmount
2409 Configures the mount so that its time-to-live will never expire.  This
2410 is the default for non-network based filesystem types (such as
2411 mounting local disks, floppies, and CD-ROMs).  See also the related
2412 @i{unmount} option.
2413 @c
2414 @c Implementation broken:
2415
2416 @item ping=@var{n}
2417 @cindex Mount flags; ping
2418 The interval, in seconds, between keep-alive pings.  When four
2419 consecutive pings have failed the mount point is marked as hung.  This
2420 interval defaults to 30 seconds; if the ping interval is set to zero,
2421 @i{Amd} will use the default 30-second interval.  If the interval is
2422 set to -1 (or any other negative value), no pings are sent and the
2423 host is assumed to be always up, which can cause unmounts to hang See
2424 the @i{softlookup} option for a better alternative.  Turning pings off
2425 can be useful in NFS-HA (High-Availability) sites where the NFS
2426 service rarely goes down.  Setting the ping value to a large value can
2427 reduce the amount of NFS_NULL chatter on your network considerably,
2428 especially in large sites.
2429
2430 Note that if you have multiple @i{Amd} entries using the same file
2431 server, and each entry sets a different value of N, then each time Amd
2432 mounts a new entry, the ping value will be re-evaluated (and updated,
2433 turned off, or turned back on as needed).  Finally, note that NFS_NULL
2434 pings are sent for both UDP and TCP mounts, because even a hung TCP
2435 mount can cause user processes to hang.
2436
2437 @item public
2438 @cindex Mount flags; public
2439 Use WebNFS multi-component lookup on the public file handle instead of
2440 the mount protocol to obtain NFS file handles, as documented in the
2441 WebNFS Client Specification, RFC 2054.  This means that @i{Amd} will not
2442 attempt to contact the remote portmapper or remote mountd daemon, and
2443 will only connect to the well-known NFS port 2049 or the port specified
2444 with the @i{port} mount option, thus making it easier to use NFS through
2445 a firewall.
2446
2447 @item retry=@var{n}
2448 @cindex Mount flags; retry=@var{n}
2449 The number of times to retry the mount system call.
2450
2451 @item softlookup
2452 @cindex Mount flags; softlookup
2453 Configures @i{Amd}'s behavior with respect to already-mounted shares from
2454 NFS fileservers that are unreachable.  If softlookup is specified,
2455 trying to access such a share will result in an error (EIO, which is
2456 changed from the ENOENT 6.0 used to return).  If it is not specified, a
2457 regular symlink is provided and the access will probably hang
2458 in the NFS filesystem.
2459
2460 The default behavior depends on whether the mount is 'soft' or 'hard';
2461 softlookup can be used to change this default. This is changed from 6.0
2462 which always behaved as if softlookup was specified.
2463
2464 @item unmount
2465 @cindex Mount flags; unmount
2466 Configures the mount so that its time-to-live will indeed expire (and
2467 thus may be automatically unmounted).  This is also the default for
2468 network-based filesystem types (e.g., NFS).  This option is useful for
2469 removable local media such as CD-ROMs, USB drives, etc. so they can
2470 expire when not in use, and get unmounted (such drives can get work
2471 out when they keep spinning).  See also the related @i{nounmount}
2472 option.
2473
2474 @item utimeout=@var{n}
2475 @cindex Mount flags; utimeout=@var{n}
2476 The interval, in seconds, that looked up and mounted map entries are
2477 cached.  After that period of time, @i{Amd} will attempt to unmount
2478 the entries.  If, however, the unmount fails (with EBUSY), then
2479 @i{Amd} will extend the mount's time-to-live by the @i{utimeout} value
2480 before the next unmount attempt is made.  In fact the interval is
2481 extended before the unmount is attempted, to avoid thrashing.  The
2482 default value is 120 seconds (two minutes) or as set by the @code{-w}
2483 command line option.
2484
2485 @item xlatecookie
2486 @cindex Mount flags; xlatecookie
2487 Translate directory cookies between 32-long and 64-long lengths.
2488
2489 @end table
2490
2491 @node remopts Option, sublink Option, opts Option, Map Options
2492 @comment  node-name,  next,  previous,  up
2493 @subsubsection remopts Option
2494 @cindex Setting system mount options for non-local networks
2495 @cindex remopts, mount option
2496 @cindex Mount option; remopts
2497
2498 This option has the same use as @code{$@{opts@}} but applies only when
2499 the remote host is on a non-local network.  For example, when using NFS
2500 across a gateway it is often necessary to use smaller values for the
2501 data read and write sizes.  This can simply be done by specifying the
2502 small values in @var{remopts}.  When a non-local host is accessed, the
2503 smaller sizes will automatically be used.
2504
2505 @i{Amd} determines whether a host is local by examining the network
2506 interface configuration at startup.  Any interface changes made after
2507 @i{Amd} has been started will not be noticed.  The likely effect will
2508 be that a host may incorrectly be declared non-local.
2509
2510 Unless otherwise set, the value of @code{$@{remopts@}} is the same as
2511 the value of @code{$@{opts@}}.
2512
2513 @node sublink Option, type Option, remopts Option, Map Options
2514 @comment  node-name,  next,  previous,  up
2515 @subsubsection sublink Option
2516 @cindex Setting the sublink option
2517 @cindex sublink, mount option
2518 @cindex Mount option; sublink
2519
2520 The subdirectory within the mounted filesystem to which the reference
2521 should point.  This can be used to prevent duplicate mounts in cases
2522 where multiple directories in the same mounted filesystem are used.
2523
2524 @node type Option, , sublink Option, Map Options
2525 @comment  node-name,  next,  previous,  up
2526 @subsubsection type Option
2527 @cindex Setting the filesystem type option
2528 @cindex type, mount option
2529 @cindex Mount option; type
2530
2531 The filesystem type to be used.  @xref{Filesystem Types}, for a full
2532 description of each type.@refill
2533
2534 @c ################################################################
2535 @node Amd Command Line Options, Filesystem Types, Mount Maps, Top
2536 @comment  node-name,  next,  previous,  up
2537 @chapter @i{Amd} Command Line Options
2538 @cindex Command line options, Amd
2539 @cindex Amd command line options
2540 @cindex Overriding defaults on the command line
2541
2542 Many of @i{Amd}'s parameters can be set from the command line.  The
2543 command line is also used to specify automount points and maps.
2544
2545 The general format of a command line is
2546
2547 @example
2548 amd [@i{options}] [@{ @i{directory} @i{map-name} [-@i{map-options}] @} ...]
2549 @end example
2550
2551 For each directory and map-name given or specified in the
2552 @file{amd.conf} file, @i{Amd} establishes an automount point.  The
2553 @dfn{map-options} may be any sequence of options or
2554 selectors---@pxref{Location Format}.  The @dfn{map-options} apply only
2555 to @i{Amd}'s mount point.
2556
2557 @samp{type:=toplvl;cache:=mapdefault;fs:=$@{map@}} is the default value for the
2558 map options.  Default options for a map are read from a special entry in
2559 the map whose key is the string @samp{/defaults}.  When default options
2560 are given they are prepended to any options specified in the mount-map
2561 locations as explained in @ref{Map Defaults}.
2562
2563 The @dfn{options} are any combination of those listed below.
2564
2565 Once the command line has been parsed, the automount points are mounted.
2566 The mount points are created if they do not already exist, in which case they
2567 will be removed when @i{Amd} exits.
2568 Finally, @i{Amd} disassociates itself from its controlling terminal and
2569 forks into the background.
2570
2571 Note: Even if @i{Amd} has been built with @samp{-DDEBUG} (via
2572 @code{configure --enable-debug}), it will still background itself and
2573 disassociate itself from the controlling terminal.  To use a debugger it
2574 is necessary to specify @samp{-D daemon} on the command line.
2575 However, even with all of this, mounts and unmounts are performed in the
2576 background, and @i{Amd} will always fork before doing them.  Therefore,
2577 debugging what happens closely during un/mounts is more challenging.
2578
2579 @emph{All} of @i{Amd}'s command options (save @code{-F} and @code{-T})
2580 can be specified in the @file{amd.conf} file. @xref{Amd Configuration
2581 File}.  If @i{Amd} is invoked without any command line options, it will
2582 default to using the configuration file @file{/etc/amd.conf}, if one
2583 exists.
2584
2585 @menu
2586 * -a Option::   Automount directory.
2587 * -c Option::   Cache timeout interval.
2588 * -d Option::   Domain name.
2589 * -k Option::   Kernel architecture.
2590 * -l Option::   Log file.
2591 * -n Option::   Hostname normalization.
2592 * -o Option::   Operating system version.
2593 * -p Option::   Output process id.
2594 * -r Option::   Restart existing mounts.
2595 * -t Option::   Kernel RPC timeout.
2596 * -v Option::   Version information.
2597 * -w Option::   Wait interval after failed unmount.
2598 * -x Option::   Log options.
2599 * -y Option::   NIS domain.
2600 * -A Option::   Operating system Architecture.
2601 * -C Option::   Cluster name.
2602 * -D Option::   Debug flags.
2603 * -F Option::   Amd configuration file.
2604 * -H Option::   Show brief help.
2605 * -O Option::   Operating system name.
2606 * -S Option::   Lock executable pages in memory.
2607 * -T Option::   Set tag for configuration file.
2608 @end menu
2609
2610 @c ----------------------------------------------------------------
2611 @node -a Option, -c Option, Amd Command Line Options, Amd Command Line Options
2612 @comment  node-name,  next,  previous,  up
2613 @section @code{-a} @var{directory}
2614 @cindex Automount directory
2615 @cindex Setting the default mount directory
2616
2617 Specifies the default mount directory.  This option changes the variable
2618 @code{$@{autodir@}} which otherwise defaults to @file{/a}.  For example,
2619 some sites prefer @file{/amd} or @file{/n}.
2620
2621 @example
2622 amd -a /amd ...
2623 @end example
2624
2625 @c ----------------------------------------------------------------
2626 @node -c Option, -d Option, -a Option, Amd Command Line Options
2627 @comment  node-name,  next,  previous,  up
2628 @section @code{-c} @var{cache-interval}
2629 @cindex Cache interval
2630 @cindex Interval before a filesystem times out
2631 @cindex Setting the interval before a filesystem times out
2632 @cindex Changing the interval before a filesystem times out
2633
2634 Selects the period, in seconds, for which a name is cached by @i{Amd}.
2635 If no reference is made to the volume in this period, @i{Amd} discards
2636 the volume name to filesystem mapping.
2637
2638 Once the last reference to a filesystem has been removed, @i{Amd}
2639 attempts to unmount the filesystem.  If the unmount fails the interval
2640 is extended by a further period as specified by the @samp{-w} command
2641 line option or by the @samp{utimeout} mount option.
2642
2643 The default @dfn{cache-interval} is 300 seconds (five minutes).
2644
2645 @c ----------------------------------------------------------------
2646 @node -d Option, -k Option, -c Option, Amd Command Line Options
2647 @comment  node-name,  next,  previous,  up
2648 @section @code{-d} @var{domain}
2649 @cindex Domain name
2650 @cindex Setting the local domain name
2651 @cindex Overriding the local domain name
2652
2653 Specifies the host's domain.  This sets the internal variable
2654 @code{$@{domain@}} and affects the @code{$@{hostd@}} variable.
2655
2656 If this option is not specified and the hostname already contains the
2657 local domain then that is used, otherwise the default value of
2658 @code{$@{domain@}} is @samp{unknown.domain}.
2659
2660 For example, if the local domain was @samp{doc.ic.ac.uk}, @i{Amd} could
2661 be started as follows:
2662
2663 @example
2664 amd -d doc.ic.ac.uk ...
2665 @end example
2666
2667 @c ----------------------------------------------------------------
2668 @node -k Option, -l Option, -d Option, Amd Command Line Options
2669 @comment  node-name,  next,  previous,  up
2670 @section @code{-k} @var{kernel-architecture}
2671 @cindex Setting the Kernel architecture
2672
2673 Specifies the kernel architecture of the system.  This is usually the
2674 output of @samp{uname -m} (the ``machine'' value gotten from
2675 @b{uname}(2)).  If the @b{uname}(2) system call is not available, the
2676 value of @code{$@{karch@}} defaults to that of @code{$@{arch@}}.
2677
2678 The only effect of this option is to set the variable @code{$@{karch@}}.
2679
2680 This option would be used as follows:
2681
2682 @example
2683 amd -k `arch -k` ...
2684 @end example
2685
2686 @c ----------------------------------------------------------------
2687 @node -l Option, -n Option, -k Option, Amd Command Line Options
2688 @comment  node-name,  next,  previous,  up
2689 @section @code{-l} @var{log-option}
2690 @cindex Log filename
2691 @cindex Setting the log file
2692 @cindex Using syslog to log errors
2693 @cindex syslog
2694
2695 Selects the form of logging to be made.  Several special @dfn{log-options}
2696 are recognized.
2697
2698 @enumerate
2699 @item
2700 If @dfn{log-option} is the string @samp{syslog}, @i{Amd} will use the
2701 @b{syslog}(3) mechanism.  If your system supports syslog facilities, then
2702 the default facility used is @samp{LOG_DAEMON}.
2703
2704 @item
2705 @cindex syslog facility; specifying an alternate
2706 When using syslog, if you wish to change the facility, append its name
2707 to the log option name, delimited by a single colon.  For example, if
2708 @dfn{log-options} is the string @samp{syslog:local7} then @b{Amd} will
2709 log messages via @b{syslog}(3) using the @samp{LOG_LOCAL7} facility.  If
2710 the facility name specified is not recognized, @i{Amd} will default to
2711 @samp{LOG_DAEMON}.  Note: while you can use any syslog facility
2712 available on your system, it is generally a bad idea to use those
2713 reserved for other services such as @samp{kern}, @samp{lpr},
2714 @samp{cron}, etc.
2715
2716 @item
2717 If @dfn{log-option} is the string @samp{/dev/stderr}, @i{Amd} will use
2718 standard error, which is also the default target for log messages.  To
2719 implement this, @i{Amd} simulates the effect of the @samp{/dev/fd}
2720 driver.
2721 @end enumerate
2722
2723 Any other string is taken as a filename to use for logging.  Log
2724 messages are appended to the file if it already exists, otherwise a new
2725 file is created.  The file is opened once and then held open, rather
2726 than being re-opened for each message.
2727
2728 Normally, when long-running daemons hold an open file descriptor on a
2729 log file, it is impossible to ``rotate'' the log file and compress older
2730 logs on a daily basis.  The daemon needs to be told to discard (via
2731 @b{close}(2)) its file handle, and re-open the log file.  This is done
2732 using @code{amq -l} @i{log-option}. @xref{Amq -l option}.
2733
2734 If the @samp{syslog} option is specified but the system does not support
2735 syslog or if the named file cannot be opened or created, @i{Amd} will
2736 use standard error.  Error messages generated before @i{Amd} has
2737 finished parsing the command line are printed on standard error.
2738
2739 Since @i{Amd} tends to generate a lot of logging information (especially
2740 if debugging was turned on), and due to it being an important program
2741 running on the system, it is usually best to log to a separate disk
2742 file.  In that case @i{Amd} would be started as follows:
2743
2744 @example
2745 amd -l /var/log/amd ...
2746 @end example
2747
2748 @c ----------------------------------------------------------------
2749 @node -n Option, -o Option, -l Option, Amd Command Line Options
2750 @comment  node-name,  next,  previous,  up
2751 @section @code{-n}
2752 @cindex Hostname normalization
2753 @cindex Aliased hostnames
2754 @cindex Resolving aliased hostnames
2755 @cindex Normalizing hostnames
2756
2757 Normalizes the remote hostname before using it.  Normalization is done
2758 by replacing the value of @code{$@{rhost@}} with the (generally fully
2759 qualified) primary name returned by a hostname lookup.
2760
2761 This option should be used if several names are used to refer to a
2762 single host in a mount map.
2763
2764 @c ----------------------------------------------------------------
2765 @node -o Option, -p Option, -n Option, Amd Command Line Options
2766 @comment  node-name,  next,  previous,  up
2767 @section @code{-o} @var{op-sys-ver}
2768 @cindex Operating System version
2769 @cindex Setting the Operating System version
2770
2771 Overrides the compiled-in version number of the operating system, with
2772 @var{op-sys-ver}.  Useful when the built-in version is not desired for
2773 backward compatibility reasons.  For example, if the built-in version is
2774 @samp{2.5.1}, you can override it to @samp{5.5.1}, and use older maps
2775 that were written with the latter in mind.
2776
2777 @c ----------------------------------------------------------------
2778 @node -p Option, -r Option, -o Option, Amd Command Line Options
2779 @comment  node-name,  next,  previous,  up
2780 @section @code{-p}
2781 @cindex Process id
2782 @cindex Displaying the process id
2783 @cindex process id of Amd daemon
2784 @cindex pid file, creating with -p option
2785 @cindex Creating a pid file
2786
2787 Causes @i{Amd}'s process id to be printed on standard output.
2788 This can be redirected to a suitable file for use with kill:
2789
2790 @example
2791 amd -p > /var/run/amd.pid ...
2792 @end example
2793
2794 This option only has an affect if @i{Amd} is running in daemon mode.
2795 If @i{Amd} is started with the @code{-D daemon} debug flag, this
2796 option is ignored.
2797
2798 @c ----------------------------------------------------------------
2799 @node -r Option, -t Option, -p Option, Amd Command Line Options
2800 @comment  node-name,  next,  previous,  up
2801 @section @code{-r}
2802 @cindex Restarting existing mounts
2803 @cindex Picking up existing mounts
2804
2805 Tells @i{Amd} to restart existing mounts (@pxref{Inheritance Filesystem}).
2806 @c @dfn{This option will be made the default in the next release.}
2807
2808 @c ----------------------------------------------------------------
2809 @node -t Option, -v Option, -r Option, Amd Command Line Options
2810 @comment  node-name,  next,  previous,  up
2811 @section @code{-t} @var{timeout.retransmit}
2812 @cindex Setting Amd's RPC parameters
2813
2814 Specifies the RPC @dfn{timeout} interval and the @dfn{retransmit}
2815 counter used by the kernel to communicate to @i{Amd}.  These are used to
2816 set the @samp{timeo} and @samp{retrans} mount options, respectively.
2817 The default timeout is 0.8 seconds, and the default number of
2818 retransmissions is 11.
2819
2820 @i{Amd} relies on the kernel RPC retransmit mechanism to trigger mount
2821 retries.  The values of these parameters change the overall retry
2822 interval.  Too long an interval gives poor interactive response; too
2823 short an interval causes excessive retries.
2824
2825 @c ----------------------------------------------------------------
2826 @node -v Option, -w Option, -t Option, Amd Command Line Options
2827 @comment  node-name,  next,  previous,  up
2828 @section @code{-v}
2829 @cindex Version information
2830 @cindex Discovering version information
2831 @cindex How to discover your version of Amd
2832
2833 Print version information on standard error and then exit.  The output
2834 is of the form:
2835
2836 @example
2837 Copyright (c) 1997-1999 Erez Zadok
2838 Copyright (c) 1990 Jan-Simon Pendry
2839 Copyright (c) 1990 Imperial College of Science, Technology & Medicine
2840 Copyright (c) 1990 The Regents of the University of California.
2841 am-utils version 6.0a15 (build 61).
2842 Built by ezk@@example.com on date Wed Oct 22 15:21:03 EDT 1997.
2843 cpu=sparc (big-endian), arch=sun4, karch=sun4u.
2844 full_os=solaris2.5.1, os=sos5, osver=5.5.1, vendor=sun.
2845 Map support for: root, passwd, union, nisplus, nis, ndbm, file, error.
2846 AMFS: nfs, link, nfsx, nfsl, host, linkx, program, union, inherit,
2847       ufs, lofs, hsfs, pcfs, auto, direct, toplvl, error.
2848 FS: autofs, cachefs, cdfs, lofs, nfs, nfs3, pcfs, tfs, tmpfs, udf, ufs.
2849 Network 1: wire="mcl-lab-net.cs.columbia.edu" (netnumber=128.59.13).
2850 Network 2: wire="14-net.cs.columbia.edu" (netnumber=128.59.14).
2851 Network 3: wire="old-net.cs.columbia.edu" (netnumber=128.59.16).
2852 @end example
2853
2854 The information includes the version number, number of times @i{Amd} was
2855 compiled on the local system, release date and name of the release.
2856 Following come the cpu type, byte ordering, and the architecture and
2857 kernel architecture as @code{$@{arch@}} and @code{$@{karch@}},
2858 respectively.  The next line lists the operating system full name, short
2859 name, version, and vendor.  These four values correspond to the
2860 variables @code{$@{full_os@}}, @code{$@{os@}}, @code{$@{osver@}}, and
2861 @code{$@{vendor@}}, respectively.  @xref{Supported Platforms}.
2862
2863 Then come a list of map types supported, filesystems internally
2864 supported by @i{Amd} (AMFS), and generic filesystems available (FS).
2865 Finally all known networks (if any) of this host are listed by name
2866 and number.  They are available via the variables
2867 @code{$@{wire@}} or @code{$@{network@}}, and
2868 @code{$@{netnumber@}} (@pxref{Selectors}) or the @samp{in_network}
2869 selector function (@pxref{in_network Selector Function}).
2870
2871 @c ----------------------------------------------------------------
2872 @node -w Option, -x Option, -v Option, Amd Command Line Options
2873 @comment  node-name,  next,  previous,  up
2874 @section @code{-w} @var{wait-timeout}
2875 @cindex Setting the interval between unmount attempts
2876 @cindex unmount attempt backoff interval
2877
2878 Selects the interval in seconds between unmount attempts after the
2879 initial time-to-live has expired.
2880
2881 This defaults to 120 seconds (two minutes).
2882
2883 @c ----------------------------------------------------------------
2884 @node -x Option, -y Option, -w Option, Amd Command Line Options
2885 @comment  node-name,  next,  previous,  up
2886 @section @code{-x} @var{opts}
2887 @cindex Log message selection
2888 @cindex Selecting specific log messages
2889 @cindex How to select log messages
2890 @cindex syslog priorities
2891
2892 Specifies the type and verbosity of log messages.  @dfn{opts} is
2893 a comma separated list selected from the following options:
2894
2895 @table @code
2896 @item fatal
2897 Fatal errors (cannot be turned off)
2898 @item error
2899 Non-fatal errors (cannot be turned off)
2900 @item user
2901 Non-fatal user errors
2902 @item warn
2903 Recoverable errors
2904 @item warning
2905 Alias for @code{warn}
2906 @item info
2907 Information messages
2908 @item map
2909 Mount map usage
2910 @item stats
2911 Additional statistics
2912 @item all
2913 All of the above
2914 @item defaults
2915 An alias for "fatal,error,user,warning,info".
2916 @end table
2917
2918 Initially a set of default logging flags is enabled.  This is as if
2919 @samp{-x defaults}
2920 or
2921 @samp{-x fatal,error,user,warning,info}
2922 had been selected.  The command line is
2923 parsed and logging is controlled by the @code{-x} option.  The very first
2924 set of logging flags is saved and can not be subsequently disabled using
2925 @i{Amq}.  This default set of options is useful for general production
2926 use.@refill
2927
2928 The @samp{info} messages include details of what is mounted and
2929 unmounted and when filesystems have timed out.  If you want to have the
2930 default set of messages without the @samp{info} messages then you simply
2931 need @samp{-x noinfo}.  The messages given by @samp{user} relate to
2932 errors in the mount maps, so these are useful when new maps are
2933 installed.  The following table lists the syslog priorities used for each
2934 of the message types.@refill
2935
2936 @table @code
2937 @item fatal
2938 @samp{LOG_CRIT}
2939 @item error
2940 @samp{LOG_ERR}
2941 @item user
2942 @samp{LOG_WARNING}
2943 @item warning
2944 @samp{LOG_WARNING}
2945 @item info
2946 @samp{LOG_INFO}
2947 @item debug
2948 @samp{LOG_DEBUG}
2949 @item map
2950 @samp{LOG_DEBUG}
2951 @item stats
2952 @samp{LOG_INFO}
2953 @end table
2954
2955 The options can be prefixed by the string @samp{no} to indicate
2956 that this option should be turned off.  For example, to obtain all
2957 but @samp{info} messages the option @samp{-x all,noinfo} would be used.
2958
2959 If @i{Amd} was built with debugging enabled the @code{debug} option is
2960 automatically enabled regardless of the command line options.
2961
2962 @c ----------------------------------------------------------------
2963 @node -y Option, -A Option, -x Option, Amd Command Line Options
2964 @comment  node-name,  next,  previous,  up
2965 @section @code{-y} @var{NIS-domain}
2966 @cindex NIS (YP) domain name
2967 @cindex Overriding the NIS (YP) domain name
2968 @cindex Setting the NIS (YP) domain name
2969 @cindex YP domain name
2970
2971 Selects an alternate NIS domain.  This is useful for debugging and
2972 cross-domain shared mounting.  If this flag is specified, @i{Amd}
2973 immediately attempts to bind to a server for this domain.
2974 @c @i{Amd} refers to NIS maps when it starts, unless the @code{-m} option
2975 @c is specified, and whenever required in a mount map.
2976
2977 @c ----------------------------------------------------------------
2978 @node -A Option, -C Option, -y Option, Amd Command Line Options
2979 @comment  node-name,  next,  previous,  up
2980 @section @code{-A} @var{architecture}
2981 @cindex Setting the operating system architecture
2982
2983 Specifies the OS architecture of the system.
2984 The only effect of this option is to set the variable @code{$@{arch@}}.
2985
2986 This option would be used as follows:
2987
2988 @example
2989 amd -A i386 ...
2990 @end example
2991
2992 @c ----------------------------------------------------------------
2993 @node -C Option, -D Option, -A Option, Amd Command Line Options
2994 @comment  node-name,  next,  previous,  up
2995 @section @code{-C} @var{cluster-name}
2996 @cindex Cluster names
2997 @cindex Setting the cluster name
2998
2999 Specifies the name of the cluster of which the local machine is a member.
3000 The only effect is to set the variable @code{$@{cluster@}}.
3001 The @dfn{cluster-name} is will usually obtained by running another command which uses
3002 a database to map the local hostname into a cluster name.
3003 @code{$@{cluster@}} can then be used as a selector to restrict mounting of
3004 replicated data.
3005 If this option is not given, @code{$@{cluster@}} has the same value as @code{$@{domain@}}.
3006 This would be used as follows:
3007
3008 @example
3009 amd -C `clustername` ...
3010 @end example
3011
3012 @c ----------------------------------------------------------------
3013 @node -D Option, -F Option, -C Option, Amd Command Line Options
3014 @comment  node-name,  next,  previous,  up
3015 @section @code{-D} @var{opts}
3016 @cindex Debug options
3017 @cindex Setting debug flags
3018
3019 Controls the verbosity and coverage of the debugging trace; @dfn{opts}
3020 is a comma separated list of debugging options.  The @code{-D} option is
3021 only available if @i{Amd} was compiled with @samp{-DDEBUG}, or
3022 configured with @code{configure --enable-debug}.  The memory debugging
3023 facilities (@samp{mem}) are only available if @i{Amd} was compiled with
3024 @samp{-DDEBUG_MEM} (in addition to @samp{-DDEBUG}), or configured with
3025 @code{configure --enable-debug=mem}.
3026
3027 The most common options to use are @samp{-D trace} and @samp{-D test}
3028 (which turns on all the useful debug options).  As usual, every option
3029 can be prefixed with @samp{no} to turn it off.
3030
3031 @table @code
3032 @item all
3033 all options (excluding hrtime and mtab)
3034 @item defaults
3035 ``sensible'' default options (all--excluding hrtime, mtab, and xdrtrace)
3036 @item test
3037 full debug options plus mtab,nodaemon,nofork,noamq
3038 @item amq
3039 register @i{Amd} with the RPC portmapper, for @i{Amq}
3040 @item daemon
3041 enter daemon mode
3042 @item fork
3043 fork child worker (hlfsd only)
3044 @item full
3045 program trace
3046 @item hrtime
3047 print high resolution time stamps (only if @b{syslog}(3) is not used)
3048 @item info
3049 @cindex debugging hesiod resolver service
3050 @cindex Hesiod; turning on RES_DEBUG
3051 info service specific debugging (hesiod, nis, etc.)  In the case of
3052 hesiod maps, turns on the hesiod RES_DEBUG internal debugging option.
3053 @item mem
3054 trace memory allocations.  Needs to be explicitly enabled at compile
3055 time with --enable-debug=mem.
3056 @item mtab
3057 use local mount-table file (defaults to @file{/tmp/mtab}, @pxref{debug_mtab_file Parameter})
3058 @item readdir
3059 show readdir progress
3060 @item str
3061 debug string munging
3062 @item trace
3063 trace RPC protocol and NFS mount arguments
3064 @item xdrtrace
3065 trace XDR routines
3066 @end table
3067
3068 You may also refer to the program source for a more detailed explanation
3069 of the available options.
3070
3071 @c ----------------------------------------------------------------
3072 @node -F Option, -H Option, -D Option, Amd Command Line Options
3073 @comment  node-name,  next,  previous,  up
3074 @section @code{-F} @var{conf-file}
3075 @cindex Amd configuration file; specifying name
3076 @cindex Amd configuration file
3077 @cindex amd.conf file
3078
3079 Specify an @i{Amd} configuration file @var{conf-file} to use.  For a
3080 description of the format and syntax, @pxref{Amd Configuration File}.
3081 This configuration file is used to specify any options in lieu of typing
3082 many of them on the command line.  The @file{amd.conf} file includes
3083 directives for every command line option @i{Amd} has, and many more that
3084 are only available via the configuration file facility.  The
3085 configuration file specified by this option is processed after all other
3086 options had been processed, regardless of the actual location of this
3087 option on the command line.
3088
3089 @c ----------------------------------------------------------------
3090 @node -H Option, -O Option, -F Option, Amd Command Line Options
3091 @comment  node-name,  next,  previous,  up
3092 @section @code{-H}
3093 @cindex Displaying brief help
3094 @cindex Help; showing from Amd
3095
3096 Print a brief help and usage string.
3097
3098 @c ----------------------------------------------------------------
3099 @node -O Option, -S Option, -H Option, Amd Command Line Options
3100 @comment  node-name,  next,  previous,  up
3101 @section @code{-O} @var{op-sys-name}
3102 @cindex Operating System name
3103 @cindex Setting the Operating System name
3104
3105 Overrides the compiled-in name of the operating system, with
3106 @var{op-sys-name}.  Useful when the built-in name is not desired for
3107 backward compatibility reasons.  For example, if the build in name is
3108 @samp{sunos5}, you can override it to the old name @samp{sos5}, and use
3109 older maps which were written with the latter in mind.
3110
3111 @c ----------------------------------------------------------------
3112 @node -S Option, -T Option, -O Option, Amd Command Line Options
3113 @comment  node-name,  next,  previous,  up
3114 @section @code{-S}
3115 @cindex plock; using
3116 @cindex mlockall; using
3117 @cindex locking executable pages in memory
3118
3119 Do @emph{not} lock the running executable pages of @i{Amd} into memory.
3120 To improve @i{Amd}'s performance, systems that support the @b{plock}(3)
3121 or @b{mlockall}(2)
3122 call lock the @i{Amd} process into memory.  This way there is less
3123 chance the operating system will schedule, page out, and swap the
3124 @i{Amd} process as needed.  This tends to improve @i{Amd}'s performance,
3125 at the cost of reserving the memory used by the @i{Amd} process (making
3126 it unavailable for other processes).  If this behavior is not desired,
3127 use the @code{-S} option.
3128
3129 @c ----------------------------------------------------------------
3130 @node -T Option, , -S Option, Amd Command Line Options
3131 @comment  node-name,  next,  previous,  up
3132 @section @code{-T} @var{tag}
3133 @cindex Tags for Amd configuration file
3134 @cindex Configuration file; tags
3135
3136 Specify a tag to use with @file{amd.conf}.  All map entries tagged with
3137 @var{tag} will be processed.  Map entries that are not tagged are always
3138 processed.  Map entries that are tagged with a tag other than @var{tag}
3139 will not be processed.
3140
3141 @c ################################################################
3142 @node Filesystem Types, Amd Configuration File, Amd Command Line Options, Top
3143 @comment  node-name,  next,  previous,  up
3144 @chapter Filesystem Types
3145 @cindex Filesystem types
3146 @cindex Mount types
3147 @cindex Types of filesystem
3148
3149 To mount a volume, @i{Amd} must be told the type of filesystem to be
3150 used.  Each filesystem type typically requires additional information
3151 such as the fileserver name for NFS.
3152
3153 From the point of view of @i{Amd}, a @dfn{filesystem} is anything that
3154 can resolve an incoming name lookup.  An important feature is support
3155 for multiple filesystem types.  Some of these filesystems are
3156 implemented in the local kernel and some on remote fileservers, whilst
3157 the others are implemented internally by @i{Amd}.@refill
3158
3159 The two common filesystem types are UFS and NFS.  Four other user
3160 accessible filesystems (@samp{link}, @samp{program}, @samp{auto} and
3161 @samp{direct}) are also implemented internally by @i{Amd} and these are
3162 described below.  There are two additional filesystem types internal to
3163 @i{Amd} which are not directly accessible to the user (@samp{inherit}
3164 and @samp{error}).  Their use is described since they may still have an
3165 effect visible to the user.@refill
3166
3167 @menu
3168 * Network Filesystem::          A single NFS filesystem.
3169 * Network Host Filesystem::     NFS mount a host's entire export tree.
3170 * Network Filesystem Group::    An atomic group of NFS filesystems.
3171 * Unix Filesystem::             Native disk filesystem.
3172 * Caching Filesystem::          Caching from remote server filesystem.
3173 * CD-ROM Filesystem::           ISO9660 CD ROM.
3174 * UDF Filesystem::              Universal Disk Format filesystem.
3175 * Loopback Filesystem::         Local loopback-mount filesystem.
3176 * Memory/RAM Filesystem::       A memory or RAM-based filesystem.
3177 * Null Filesystem::             4.4BSD's loopback-mount filesystem.
3178 * Floppy Filesystem::           MS-DOS Floppy filesystem.
3179 * Translucent Filesystem::      The directory merging filesystem.
3180 * Shared Memory+Swap Filesystem:: Sun's tmpfs filesystem.
3181 * User ID Mapping Filesystem::  4.4BSD's umapfs filesystem.
3182 * Program Filesystem::          Generic Program mounts.
3183 * Symbolic Link Filesystem::    Local link.
3184 * Symbolic Link Filesystem II:: Local link referencing existing filesystem.
3185 * NFS-Link Filesystem::         Link if path exists, NFS otherwise.
3186 * Automount Filesystem::
3187 * Direct Automount Filesystem::
3188 * Union Filesystem::
3189 * Error Filesystem::
3190 * Top-level Filesystem::
3191 * Root Filesystem::
3192 * Inheritance Filesystem::
3193 @end menu
3194
3195 @c ----------------------------------------------------------------
3196 @node Network Filesystem, Network Host Filesystem, Filesystem Types, Filesystem Types
3197 @comment  node-name,  next,  previous,  up
3198 @section Network Filesystem (@samp{nfs})
3199 @cindex NFS
3200 @cindex Mounting an NFS filesystem
3201 @cindex How to mount and NFS filesystem
3202 @cindex nfs, filesystem type
3203 @cindex Filesystem type; nfs
3204
3205 The @dfn{nfs} (@samp{type:=nfs}) filesystem type provides access to Sun's NFS.
3206
3207 @noindent
3208 The following options must be specified:
3209
3210 @table @code
3211 @cindex rhost, mount option
3212 @cindex Mount option; rhost
3213 @item rhost
3214 the remote fileserver.  This must be an entry in the hosts database.  IP
3215 addresses are not accepted.  The default value is taken
3216 from the local host name (@code{$@{host@}}) if no other value is
3217 specified.
3218
3219 @cindex rfs, mount option
3220 @cindex Mount option; rfs
3221 @item rfs
3222 the remote filesystem.
3223 If no value is specified for this option, an internal default of
3224 @code{$@{path@}} is used.
3225 @end table
3226
3227 NFS mounts require a two stage process.  First, the @dfn{file handle} of
3228 the remote file system must be obtained from the server.  Then a mount
3229 system call must be done on the local system.  @i{Amd} keeps a cache
3230 of file handles for remote file systems.  The cache entries have a
3231 lifetime of a few minutes.
3232
3233 If a required file handle is not in the cache, @i{Amd} sends a request
3234 to the remote server to obtain it.
3235 @c  @i{Amd} @dfn{does not} wait for
3236 @c a response; it notes that one of the locations needs retrying, but
3237 @c continues with any remaining locations.  When the file handle becomes
3238 @c available, and assuming none of the other locations was successfully
3239 @c mounted, @i{Amd} will retry the mount.  This mechanism allows several
3240 @c NFS filesystems to be mounted in parallel.
3241 @c @footnote{The mechanism
3242 @c is general, however NFS is the only filesystem
3243 @c for which the required hooks have been written.}
3244 @c The first one which responds with a valid file handle will be used.
3245
3246 Historically, this documentation has maintained that @i{Amd} will try
3247 all the locations in parallel and use the first one which responds
3248 with a valid file handle. This has not been the case for quite some
3249 time, however. Instead, @i{Amd} will go through each location, one by
3250 one, and will only skip to the next one if the previous one either
3251 fails or times out.
3252
3253 @noindent
3254 An NFS entry might be:
3255
3256 @example
3257 jsp  host!=charm;type:=nfs;rhost:=charm;rfs:=/home/charm;sublink:=jsp
3258 @end example
3259
3260 The mount system call and any unmount attempts are always done
3261 in a new task to avoid the possibility of blocking @i{Amd}.
3262
3263 @c ----------------------------------------------------------------
3264 @node Network Host Filesystem, Network Filesystem Group, Network Filesystem, Filesystem Types
3265 @comment  node-name,  next,  previous,  up
3266 @section Network Host Filesystem (@samp{host})
3267 @cindex Network host filesystem
3268 @cindex Mounting entire export trees
3269 @cindex How to mount all NFS exported filesystems
3270 @cindex host, filesystem type
3271 @cindex Filesystem type; host
3272
3273 @c NOTE: the current implementation of the @dfn{host} filesystem type
3274 @c sometimes fails to maintain a consistent view of the remote mount tree.
3275 @c This happens when the mount times out and only some of the remote mounts
3276 @c are successfully unmounted.  To prevent this from occurring, use the
3277 @c @samp{nounmount} mount option.
3278
3279 The @dfn{host} (@samp{type:=host}) filesystem allows access to the entire export tree of an
3280 NFS server.  The implementation is layered above the @samp{nfs}
3281 implementation so keep-alives work in the same way.  The only option
3282 which needs to be specified is @samp{rhost} which is the name of the
3283 fileserver to mount.
3284
3285 The @samp{host} filesystem type works by querying the mount daemon on
3286 the given fileserver to obtain its export list.  @i{Amd} then obtains
3287 filehandles for each of the exported filesystems.  Any errors at this
3288 stage cause that particular filesystem to be ignored.  Finally each
3289 filesystem is mounted.  Again, errors are logged but ignored.  One
3290 common reason for mounts to fail is that the mount point does not exist.
3291 Although @i{Amd} attempts to automatically create the mount point, it
3292 may be on a remote filesystem to which @i{Amd} does not have write
3293 permission.
3294
3295 When an attempt to unmount a @samp{host} filesystem mount fails, @i{Amd}
3296 remounts any filesystems which had successfully been unmounted.  To do
3297 this @i{Amd} queries the mount daemon again and obtains a fresh copy of
3298 the export list.  @i{Amd} then tries to mount any exported filesystems
3299 which are not currently mounted.
3300
3301 Sun's automounter provides a special @samp{-hosts} map.  To achieve the
3302 same effect with @i{Amd} requires two steps.  First a mount map must
3303 be created as follows:
3304
3305 @example
3306 *       type:=host;rhost:=$@{key@};fs:=$@{autodir@}/$@{rhost@}/root
3307 @end example
3308
3309 @noindent
3310 and then start @i{Amd} with the following command
3311
3312 @example
3313 amd /net net.map
3314 @end example
3315
3316 @noindent
3317 where @samp{net.map} is the name of map described above.  Note that the
3318 value of @code{$@{fs@}} is overridden in the map.  This is done to avoid
3319 a clash between the mount tree and any other filesystem already mounted
3320 from the same fileserver.
3321
3322 If different mount options are needed for different hosts then
3323 additional entries can be added to the map, for example
3324
3325 @example
3326 host2       opts:=ro,nosuid,soft
3327 @end example
3328
3329 @noindent
3330 would soft mount @samp{host2} read-only.
3331
3332 @c ----------------------------------------------------------------
3333 @node Network Filesystem Group, Unix Filesystem, Network Host Filesystem, Filesystem Types
3334 @comment  node-name,  next,  previous,  up
3335 @section Network Filesystem Group (@samp{nfsx})
3336 @cindex Network filesystem group
3337 @cindex Atomic NFS mounts
3338 @cindex Mounting an atomic group of NFS filesystems
3339 @cindex How to mount an atomic group of NFS filesystems
3340 @cindex nfsx, filesystem type
3341 @cindex Filesystem type; nfsx
3342
3343 The @dfn{nfsx} (@samp{type:=nfsx}) filesystem allows a group of filesystems to be mounted
3344 from a single NFS server.  The implementation is layered above the
3345 @samp{nfs} implementation so keep-alives work in the same way.
3346
3347 @emph{WARNING}: @samp{nfsx} is meant to be a ``last resort'' kind of
3348 solution. It is racy and poorly supported. The authors @emph{highly}
3349 recommend that other solutions be considered before relying on it.
3350
3351 The options are the same as for the @samp{nfs} filesystem with one
3352 difference for @samp{rfs}, as explained below.
3353
3354 @noindent
3355 The following options should be specified:
3356
3357 @table @code
3358 @item rhost
3359 the remote fileserver.  The default value is taken from the local
3360 host name (@code{$@{host@}}) if no other value is specified.
3361
3362 @item rfs
3363 is a list of filesystems to mount, and must be specified.
3364 The list is in the form of a comma separated strings.
3365 @end table
3366
3367 @noindent
3368 For example:
3369
3370 @example
3371 pub  type:=nfsx;rhost:=gould;\
3372      rfs:=/public,/,graphics,usenet;fs:=$@{autodir@}/$@{rhost@}/root
3373 @end example
3374
3375 The first string defines the root of the tree, and is applied as a
3376 prefix to the remaining members of the list which define the individual
3377 filesystems.  The first string is @emph{not} used as a filesystem name.
3378 A serial operation is used to determine the local mount points to
3379 ensure a consistent layout of a tree of mounts.
3380
3381 Here, the @emph{three} filesystems, @samp{/public},
3382 @samp{/public/graphics} and @samp{/public/usenet}, would be mounted.@refill
3383
3384 A local mount point, @code{$@{fs@}}, @emph{must} be specified.  The
3385 default local mount point will not work correctly in the general case.
3386 A suggestion is to use @samp{fs:=$@{autodir@}/$@{rhost@}/root}.@refill
3387
3388 @c ----------------------------------------------------------------
3389 @node Unix Filesystem, Caching Filesystem, Network Filesystem Group, Filesystem Types
3390 @comment  node-name,  next,  previous,  up
3391 @section Unix Filesystem (@samp{ufs}, @samp{xfs}, or @samp{efs})
3392 @cindex Unix filesystem
3393 @cindex UFS
3394 @cindex XFS
3395 @cindex EFS
3396 @cindex Mounting a UFS filesystem
3397 @cindex Mounting a local disk
3398 @cindex How to mount a UFS filesystems
3399 @cindex How to mount a local disk
3400 @cindex Disk filesystems
3401 @cindex ufs, filesystem type
3402 @cindex Filesystem type; ufs
3403 @cindex xfs, filesystem type
3404 @cindex Filesystem type; xfs
3405 @cindex efs, filesystem type
3406 @cindex Filesystem type; efs
3407
3408 The @dfn{ufs} (@samp{type:=ufs}) filesystem type provides access to the system's standard
3409 disk filesystem---usually a derivative of the Berkeley Fast Filesystem.
3410
3411 @noindent
3412 The following option must be specified:
3413
3414 @table @code
3415 @cindex dev, mount option
3416 @cindex Mount option; dev
3417 @item dev
3418 the block special device to be mounted.
3419 @end table
3420
3421 A UFS entry might be:
3422
3423 @example
3424 jsp   host==charm;type:=ufs;dev:=/dev/sd0d;sublink:=jsp
3425 @end example
3426
3427 UFS is the default Unix disk-based file system, which Am-utils picks up
3428 during the autoconfiguration phase.  Some systems have more than one
3429 type, such as IRIX, that comes with EFS (Extent File System) and XFS
3430 (Extended File System).  In those cases, you may explicitly set the file
3431 system type, by using entries such:
3432
3433 @example
3434 ez1   type:=efs;dev:=/dev/xd0a
3435 ez2   type:=xfs;dev:=/dev/sd3c
3436 @end example
3437
3438 The UFS/XFS/EFS filesystems are never timed out by default, i.e. they
3439 will never be unmounted by @i{Amd}. If automatic unmounting is
3440 desired, the ``unmount'' option should be added to the mount options
3441 for the entry.
3442
3443 @c ----------------------------------------------------------------
3444 @node Caching Filesystem, CD-ROM Filesystem, Unix Filesystem, Filesystem Types
3445 @comment  node-name,  next,  previous,  up
3446 @section Caching Filesystem (@samp{cachefs})
3447 @cindex Caching Filesystem
3448 @cindex cachefs, filesystem type
3449 @cindex Filesystem type; cachefs
3450
3451 The @dfn{cachefs} (@samp{type:=cachefs}) filesystem caches files from
3452 one location onto another, presumably providing faster access.  It is
3453 particularly useful to cache from a larger and remote (slower) NFS
3454 partition to a smaller and local (faster) UFS directory.
3455
3456 @noindent
3457 The following options must be specified:
3458
3459 @table @code
3460 @cindex cachedir, mount option
3461 @cindex Mount option; cachedir
3462 @item cachedir
3463 the directory where the cache is stored.
3464 @item rfs
3465 the path name to the ``back file system'' to be cached from.
3466 @item fs
3467 the ``front file system'' mount point to the cached files, where @i{Amd}
3468 will set a symbolic link pointing to.
3469 @end table
3470
3471 A CacheFS entry for, say, the @file{/import} @i{Amd} mount point, might
3472 be:
3473
3474 @example
3475 copt  type:=cachefs;cachedir:=/cache;rfs:=/import/opt;fs:=/n/import/copt
3476 @end example
3477
3478 Access to the pathname @file{/import/copt} will follow a symbolic link
3479 to @file{/n/import/copt}.  The latter is the mount point for a caching
3480 file system, that caches from @file{/import/opt} to @file{/cache}.
3481
3482 The cachefs filesystem is never timed out by default, i.e. it will
3483 never be unmounted by @i{Amd}. If automatic unmounting is desired, the
3484 ``unmount'' option should be added to the mount options for the entry.
3485
3486 @b{Caveats}:
3487 @enumerate
3488 @item This file system is currently only implemented for Solaris 2.x!
3489 @item Before being used for the first time, the cache directory @i{must} be
3490 initialized with @samp{cfsadmin -c @var{cachedir}}.  See the manual page for
3491 @b{cfsadmin}(1M) for more information.
3492 @item The ``back file system'' mounted must be a complete file system, not
3493 a subdirectory thereof; otherwise you will get an error ``Invalid Argument''.
3494 @item If @i{Amd} aborts abnormally, the state of the cache may be
3495 inconsistent, requiring running the command @file{fsck -F cachefs
3496 @var{cachedir}}.  Otherwise you will get the error ``No Space Left on Device''.
3497 @end enumerate
3498
3499 @c ----------------------------------------------------------------
3500 @node CD-ROM Filesystem, UDF Filesystem, Caching Filesystem, Filesystem Types
3501 @comment  node-name,  next,  previous,  up
3502 @section CD-ROM Filesystem (@samp{cdfs})
3503 @cindex CD-ROM Filesystem
3504 @cindex cdfs, filesystem type
3505 @cindex Filesystem type; cdfs
3506
3507 The @dfn{cdfs} (@samp{type:=cdfs}) filesystem mounts a CD-ROM with an
3508 ISO9660 format filesystem on it.
3509
3510 @noindent
3511 The following option must be specified:
3512
3513 @table @code
3514 @cindex dev, mount option
3515 @cindex Mount option; dev
3516 @item dev
3517 the block special device to be mounted.
3518 @end table
3519
3520 Some operating systems will fail to mount read-only CDs unless the
3521 @samp{ro} option is specified.  A cdfs entry might be:
3522
3523 @example
3524 cdfs      os==sunos4;type:=cdfs;dev:=/dev/sr0 \
3525           os==sunos5;addopts:=ro;type:=cdfs;dev:=/dev/dsk/c0t6d0s2
3526 @end example
3527
3528 @c ----------------------------------------------------------------
3529 @node UDF Filesystem, Loopback Filesystem, CD-ROM Filesystem, Filesystem Types
3530 @comment  node-name,  next,  previous,  up
3531 @section CD-ROM Filesystem (@samp{udf})
3532 @cindex CD-ROM Filesystem
3533 @cindex udf, filesystem type
3534 @cindex Filesystem type; udf
3535
3536 The @dfn{udf} (@samp{type:=udf}) filesystem mounts media with a
3537 Universal Disk Format (UDF) filesystem on it, e.g., a video DVD.
3538
3539 @noindent
3540 The following option must be specified:
3541
3542 @table @code
3543 @cindex dev, mount option
3544 @cindex Mount option; dev
3545 @item dev
3546 the block special device to be mounted.
3547 @end table
3548
3549 Some operating systems will fail to mount read-only media unless the
3550 @samp{ro} option is specified.  A udf entry might be:
3551
3552 @example
3553 udf      os==sunos4;type:=udf;dev:=/dev/sr0 \
3554          os==sunos5;addopts:=ro;type:=udf;dev:=/dev/dsk/c0t6d0s2
3555 @end example
3556
3557 @c ----------------------------------------------------------------
3558 @node Loopback Filesystem, Memory/RAM Filesystem, UDF Filesystem, Filesystem Types
3559 @comment  node-name,  next,  previous,  up
3560 @section Loopback Filesystem (@samp{lofs})
3561 @cindex Loopback Filesystem
3562 @cindex lofs, filesystem type
3563 @cindex Filesystem type; lofs
3564
3565 The @dfn{lofs} (@samp{type:=lofs}) filesystem is also called the
3566 loopback filesystem.  It mounts a local directory on another, thus
3567 providing mount-time binding to another location (unlike symbolic
3568 links).
3569
3570 The loopback filesystem is particularly useful within the context of a
3571 chroot-ed directory (via @b{chroot}(2)), to provide access to
3572 directories otherwise inaccessible.
3573
3574 @noindent
3575 The following option must be specified:
3576
3577 @table @code
3578 @cindex rfs, mount option
3579 @cindex Mount option; rfs
3580 @item rfs
3581 the pathname to be mounted on top of @code{$@{fs@}}.
3582 @end table
3583
3584 Usually, the FTP server runs in a chroot-ed environment, for security
3585 reasons.  In this example, lofs is used to provide a subdirectory within
3586 a user's home directory, also available for public ftp.
3587
3588 @example
3589 lofs      type:=lofs;rfs:=/home/ezk/myftpdir;fs:=/usr/ftp/pub/ezk
3590 @end example
3591
3592 @c ----------------------------------------------------------------
3593 @node Memory/RAM Filesystem, Null Filesystem, Loopback Filesystem, Filesystem Types
3594 @comment  node-name,  next,  previous,  up
3595 @section Memory/RAM Filesystem (@samp{mfs})
3596 @cindex Memory/RAM Filesystem
3597 @cindex mfs, filesystem type
3598 @cindex Filesystem type; mfs
3599
3600 The @dfn{mfs} (@samp{type:=mfs}) filesystem is available in 4.4BSD,
3601 Linux, and other systems.  It creates a filesystem in a portion of the
3602 system's memory, thus providing very fast file (volatile) access.
3603
3604 XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3605
3606 @c ----------------------------------------------------------------
3607 @node Null Filesystem, Floppy Filesystem, Memory/RAM Filesystem, Filesystem Types
3608 @comment  node-name,  next,  previous,  up
3609 @section Null Filesystem (@samp{nullfs})
3610 @cindex Null Filesystem
3611 @cindex nullfs, filesystem type
3612 @cindex Filesystem type; nullfs
3613
3614 The @dfn{nullfs} (@samp{type:=nullfs}) filesystem is available from 4.4BSD,
3615 and is very similar to the loopback filesystem, @dfn{lofs}.
3616
3617 XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3618
3619 @c ----------------------------------------------------------------
3620 @node Floppy Filesystem, Translucent Filesystem, Null Filesystem, Filesystem Types
3621 @comment  node-name,  next,  previous,  up
3622 @section Floppy Filesystem (@samp{pcfs})
3623 @cindex Floppy Filesystem
3624 @cindex pcfs, filesystem type
3625 @cindex Filesystem type; pcfs
3626
3627 The @dfn{pcfs} (@samp{type:=pcfs}) filesystem mounts a floppy previously
3628 formatted for the MS-DOS format.
3629
3630 @noindent
3631 The following option must be specified:
3632
3633 @table @code
3634 @cindex dev, mount option
3635 @cindex Mount option; dev
3636 @item dev
3637 the block special device to be mounted.
3638 @end table
3639
3640 A pcfs entry might be:
3641
3642 @example
3643 pcfs      os==sunos4;type:=pcfs;dev:=/dev/fd0 \
3644           os==sunos5;type:=pcfs;dev:=/dev/diskette
3645 @end example
3646
3647 @c ----------------------------------------------------------------
3648 @node Translucent Filesystem, Shared Memory+Swap Filesystem, Floppy Filesystem, Filesystem Types
3649 @comment  node-name,  next,  previous,  up
3650 @section Translucent Filesystem (@samp{tfs})
3651 @cindex Translucent Filesystem
3652 @cindex tfs, filesystem type
3653 @cindex Filesystem type; tfs
3654
3655 The @dfn{tfs} (@samp{type:=tfs}) filesystem is an older version of the
3656 4.4BSD @dfn{unionfs}.
3657
3658 XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3659
3660 @c ----------------------------------------------------------------
3661 @node Shared Memory+Swap Filesystem, User ID Mapping Filesystem, Translucent Filesystem, Filesystem Types
3662 @comment  node-name,  next,  previous,  up
3663 @section Shared Memory+Swap Filesystem (@samp{tmpfs})
3664 @cindex Shared Memory and Swap Filesystem
3665 @cindex tmpfs, filesystem type
3666 @cindex Filesystem type; tmpfs
3667
3668 The @dfn{tmpfs} (@samp{type:=tmpfs}) filesystem shares memory between a
3669 the swap device and the rest of the system.  It is generally used to
3670 provide a fast access @file{/tmp} directory, one that uses memory that
3671 is otherwise unused.  This filesystem is available in SunOS 4.x and 5.x.
3672
3673 XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3674
3675 @c ----------------------------------------------------------------
3676 @node User ID Mapping Filesystem, Program Filesystem, Shared Memory+Swap Filesystem, Filesystem Types
3677 @comment  node-name,  next,  previous,  up
3678 @section User ID Mapping Filesystem (@samp{umapfs})
3679 @cindex User ID Mapping Filesystem
3680 @cindex umapfs, filesystem type
3681 @cindex Filesystem type; umapfs
3682
3683 The @dfn{umapfs} (@samp{type:=umapfs}) filesystem maps User IDs of file
3684 ownership, and is available from 4.4BSD.
3685
3686 XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3687
3688 @c ----------------------------------------------------------------
3689 @node Program Filesystem, Symbolic Link Filesystem, User ID Mapping Filesystem, Filesystem Types
3690 @comment  node-name,  next,  previous,  up
3691 @section Program Filesystem (@samp{program})
3692 @cindex Program filesystem
3693 @cindex Mount a filesystem under program control
3694 @cindex program, filesystem type
3695 @cindex Filesystem type; program
3696
3697 The @dfn{program} (@samp{type:=program}) filesystem type allows a
3698 program to be run whenever a mount or unmount is required.  This allows
3699 easy addition of support for other filesystem types, such as MIT's
3700 Remote Virtual Disk (RVD) which has a programmatic interface via the
3701 commands @samp{rvdmount} and @samp{rvdunmount}.
3702
3703 @noindent
3704 Both of the following options must be specified:
3705
3706 @table @code
3707 @cindex mount, mount option
3708 @cindex Mount option; mount
3709 @item mount
3710 the program which will perform the mount.
3711
3712 @cindex unmount, mount option
3713 @cindex umount, mount option
3714 @cindex Mount option; unmount
3715 @cindex Mount option; umount
3716 @item unmount
3717 @item umount
3718 the program which will perform the unmount.  For convenience, you may
3719 use either @samp{unmount} or @samp{umount} but not both.  If neither
3720 is defined, @i{Amd} will default to @samp{umount $@{fs@}} (the actual
3721 unmount program pathname will be automatically determined at the time
3722 GNU @code{configure} runs.)
3723 @end table
3724
3725 The exit code from these two programs is interpreted as a Unix error
3726 code.  As usual, exit code zero indicates success.  To execute the
3727 program, @i{Amd} splits the string on whitespace to create an array of
3728 substrings.  Single quotes @samp{'} can be used to quote whitespace
3729 if that is required in an argument.  There is no way to escape or change
3730 the single quote character.
3731
3732 To run e.g. the program @samp{rvdmount} with a host name and filesystem as
3733 arguments, it would be specified by
3734 @samp{fs:=$@{autodir@}$@{path@};type:=program;mount:="/etc/rvdmount
3735 rvdmount fserver $@{fs@}";unmount:="/etc/rdvumount rvdumount $@{fs@}"}.
3736
3737 The first element in the array is taken as the pathname of the program
3738 to execute.  The other members of the array form the argument vector
3739 to be passed to the program, @dfn{including argument zero}.  The array
3740 is exactly the same as the array passed to the execv() system call
3741 (man execv for details).  The split string must have at least two
3742 elements.  The programs are directly executed by @i{Amd}, not via a
3743 shell.  Therefore, if a script is to be used as a mount/umount
3744 program, it @dfn{must} begin with a @code{#!} interpreter specification.
3745
3746 Often, this program mount type is used for Samba mounts, where you
3747 need a double slash in pathnames.  However, @i{Amd} normalizes
3748 sequences of slashes into one slash.  Therefore, you must use an
3749 escaped slash, preceded by an escaped backslash.  So to get a double
3750 slash in the mount command, you need the eight character sequence
3751 @samp{\\\/\\\/} in your map.  For example:
3752
3753 @samp{mount="/sbin/mount mount -r -t smbfs -o-N,-Ihostname \\\/\\\/guest@@venus/mp3"}
3754
3755 If a filesystem type is to be heavily used, it may be worthwhile adding
3756 a new filesystem type into @i{Amd}, but for most uses the program
3757 filesystem should suffice.
3758
3759 When the program is run, standard input and standard error are inherited
3760 from the current values used by @i{Amd}.  Standard output is a
3761 duplicate of standard error.  The value specified with the @code{-l}
3762 command line option has no effect on standard error.
3763
3764 @i{Amd} guarantees that the mountpoint will be created before calling
3765 the mount program, and that it will be removed after the umount
3766 program returns success.
3767
3768 @c ----------------------------------------------------------------
3769 @node Symbolic Link Filesystem, Symbolic Link Filesystem II, Program Filesystem, Filesystem Types
3770 @comment  node-name,  next,  previous,  up
3771 @section Symbolic Link Filesystem (@samp{link})
3772 @cindex Symbolic link filesystem
3773 @cindex Referencing part of the local name space
3774 @cindex Mounting part of the local name space
3775 @cindex How to reference part of the local name space
3776 @cindex link, filesystem type
3777 @cindex symlink, link filesystem type
3778 @cindex Filesystem type; link
3779
3780 Each filesystem type creates a symbolic link to point from the volume
3781 name to the physical mount point.  The @samp{link} filesystem does the
3782 same without any other side effects.  This allows any part of the
3783 machines name space to be accessed via @i{Amd}.
3784
3785 One common use for the symlink filesystem is @file{/homes} which can be
3786 made to contain an entry for each user which points to their
3787 (auto-mounted) home directory.  Although this may seem rather expensive,
3788 it provides a great deal of administrative flexibility.
3789
3790 @noindent
3791 The following option must be defined:
3792
3793 @table @code
3794 @item fs
3795 The value of @var{fs} option specifies the destination of the link, as
3796 modified by the @var{sublink} option.  If @var{sublink} is non-null, it
3797 is appended to @code{$@{fs@}}@code{/} and the resulting string is used
3798 as the target.
3799 @end table
3800
3801 The @samp{link} filesystem can be thought of as identical to the
3802 @samp{ufs} filesystem but without actually mounting anything.
3803
3804 An example entry might be:
3805
3806 @example
3807 jsp   host==charm;type:=link;fs:=/home/charm;sublink:=jsp
3808 @end example
3809 which would return a symbolic link pointing to @file{/home/charm/jsp}.
3810
3811 @c ----------------------------------------------------------------
3812 @node Symbolic Link Filesystem II, NFS-Link Filesystem, Symbolic Link Filesystem, Filesystem Types
3813 @comment  node-name,  next,  previous,  up
3814 @section Symbolic Link Filesystem II (@samp{linkx})
3815 @cindex Symbolic link filesystem II
3816 @cindex Referencing an existing part of the local name space
3817 @cindex Mounting an existing part of the local name space
3818 @cindex How to reference an existing part of the local name space
3819 @cindex linkx, filesystem type
3820 @cindex symlink, linkx filesystem type
3821 @cindex Filesystem type; linkx
3822
3823 The @dfn{linkx} (@samp{type:=linkx}) filesystem type is identical to @samp{link} with the
3824 exception that the target of the link must exist.  Existence is checked
3825 with the @b{lstat}(2) system call.
3826
3827 The @samp{linkx} filesystem type is particularly useful for wildcard map
3828 entries.  In this case, a list of possible targets can be given and
3829 @i{Amd} will choose the first one which exists on the local machine.
3830
3831 @c ----------------------------------------------------------------
3832 @node NFS-Link Filesystem, Automount Filesystem, Symbolic Link Filesystem II, Filesystem Types
3833 @comment  node-name,  next,  previous,  up
3834 @section NFS-Link Filesystem (@samp{nfsl})
3835 @cindex NFS-Link filesystem II
3836 @cindex Referencing an existing part of the name space if target exists
3837 @cindex Mounting a remote part of the name space if target is missing
3838 @cindex Symlink if target exists, NFS otherwise
3839 @cindex nfsl, filesystem type
3840 @cindex symlink, nfsl filesystem type
3841 @cindex Filesystem type; nfsl
3842
3843 The @dfn{nfsl} (@samp{type:=nfsl}) filesystem type is a combination of two others:
3844 @samp{link} and @samp{nfs}.  If the local host name is equal to the
3845 value of @code{$@{rhost@}} @emph{and} the target pathname listed in
3846 @code{$@{fs@}} exists, @samp{nfsl} will behave exactly as
3847 @samp{type:=link}, and refer to the target as a symbolic link.  If the
3848 local host name is not equal to the value of @code{$@{rhost@}}, or if
3849 the target of the link does not exist, @i{Amd} will treat it as
3850 @samp{type:=nfs}, and will mount a remote pathname for it.
3851
3852 The @samp{nfsl} filesystem type is particularly useful as a shorthand
3853 for the more cumbersome and yet one of the most popular @i{Amd}
3854 entries.  For example, you can simplify all map entries that look like:
3855
3856 @example
3857 zing    -fs:=/n/shekel/u/zing \
3858         host!=shekel;type:=nfs;rhost:=shekel;rfs:=$@{fs@} \
3859         host==shekel;type:=link
3860 @end example
3861
3862 or
3863
3864 @example
3865 zing    -fs:=/n/shekel/u/zing \
3866         exists($@{fs@});type:=link \
3867         !exists($@{fs@});type:=nfs;rhost:=shekel;rfs:=$@{fs@}
3868 @end example
3869
3870 into a shorter form
3871
3872 @example
3873 zing    type:=nfsl;fs:=/n/shekel/u/zing;rhost:=shekel;rfs:=$@{fs@}
3874 @end example
3875
3876 Not just does it make the maps smaller and simpler, but it avoids
3877 possible mistakes that often happen when forgetting to set up the two
3878 entries (one for @samp{type:=nfs} and the other for @samp{type:=link})
3879 necessary to perform transparent mounts of existing or remote mounts.
3880
3881 @c ----------------------------------------------------------------
3882 @node Automount Filesystem, Direct Automount Filesystem, NFS-Link Filesystem, Filesystem Types
3883 @comment  node-name,  next,  previous,  up
3884 @section Automount Filesystem (@samp{auto})
3885 @cindex Automount filesystem
3886 @cindex Map cache types
3887 @cindex Setting map cache parameters
3888 @cindex How to set map cache parameters
3889 @cindex How to start an indirect automount point
3890 @cindex auto, filesystem type
3891 @cindex Filesystem type; auto
3892 @cindex SIGHUP signal
3893 @cindex Map cache synchronizing
3894 @cindex Synchronizing the map cache
3895 @cindex Map cache options
3896 @cindex Regular expressions in maps
3897
3898 The @dfn{auto} (@samp{type:=auto}) filesystem type creates a new automount point below an
3899 existing automount point.  Top-level automount points appear as system
3900 mount points.  An automount mount point can also appear as a
3901 sub-directory of an existing automount point.  This allows some
3902 additional structure to be added, for example to mimic the mount tree of
3903 another machine.
3904
3905 The following options may be specified:
3906
3907 @table @code
3908 @cindex cache, mount map option
3909 @cindex Mount map option; cache
3910 @item cache
3911 specifies whether the data in this mount-map should be
3912 cached.  The default value is @samp{none}, in which case
3913 no caching is done in order to conserve memory.
3914
3915 However, better performance and reliability can be obtained by caching
3916 some or all of a mount-map.
3917
3918 If the cache option specifies @samp{all},
3919 the entire map is enumerated when the mount point is created.
3920
3921 If the cache option specifies @samp{inc}, caching is done incrementally
3922 as and when data is required.
3923 Some map types do not support cache mode @samp{all}, in which case @samp{inc}
3924 is used whenever @samp{all} is requested.
3925
3926 Caching can be entirely disabled by using cache mode @samp{none}.
3927
3928 If the cache option specifies @samp{regexp} then the entire map will be
3929 enumerated and each key will be treated as an egrep-style regular
3930 expression.  The order in which a cached map is searched does not
3931 correspond to the ordering in the source map so the regular expressions
3932 should be mutually exclusive to avoid confusion.
3933
3934 Each mount map type has a default cache type, usually @samp{inc}, which
3935 can be selected by specifying @samp{mapdefault}.
3936
3937 The cache mode for a mount map can only be selected on the command line.
3938 Starting @i{Amd} with the command:
3939
3940 @example
3941 amd /homes hesiod.homes -cache:=inc
3942 @end example
3943
3944 will cause @samp{/homes} to be automounted using the @dfn{Hesiod} name
3945 server with local incremental caching of all successfully resolved names.
3946
3947 All cached data is forgotten whenever @i{Amd} receives a @samp{SIGHUP}
3948 signal and, if cache @samp{all} mode was selected, the cache will be
3949 reloaded.  This can be used to inform @i{Amd} that a map has been
3950 updated.  In addition, whenever a cache lookup fails and @i{Amd} needs
3951 to examine a map, the map's modify time is examined.  If the cache is
3952 out of date with respect to the map then it is flushed as if a
3953 @samp{SIGHUP} had been received.
3954
3955 An additional option (@samp{sync}) may be specified to force @i{Amd} to
3956 check the map's modify time whenever a cached entry is being used.  For
3957 example, an incremental, synchronized cache would be created by the
3958 following command:
3959
3960 @example
3961 amd /homes hesiod.homes -cache:=inc,sync
3962 @end example
3963
3964 @item fs
3965 specifies the name of the mount map to use for the new mount point.
3966
3967 Arguably this should have been specified with the @code{$@{rfs@}} option but
3968 we are now stuck with it due to historical accident.
3969
3970 @c %If the string @samp{.} is used then the same map is used;
3971 @c %in addition the lookup prefix is set to the name of the mount point followed
3972 @c %by a slash @samp{/}.
3973 @c %This is the same as specifying @samp{fs:=\$@{map@};pref:=\$@{key@}/}.
3974 @c
3975
3976 @item pref
3977 alters the name that is looked up in the mount map.  If
3978 @code{$@{pref@}}, the @dfn{prefix}, is non-null then it is prepended
3979 to the name requested by the kernel @dfn{before} the map is
3980 searched. The default prefix is the prefix of the parent map (if any)
3981 with name of the auto node appended to it. That means if you want no
3982 prefix you must say so in the map: @samp{pref:=null}.
3983
3984 @item opts
3985 Normally, @samp{auto} style maps are not browsable even if you turn on
3986 directory browsability (@pxref{browsable_dirs Parameter}).  To enable
3987 browsing entries in @samp{auto} maps, specify @samp{opts:=browsable}
3988 or @samp{opts:=fullybrowsable} in
3989 the description of this map.
3990
3991 @end table
3992
3993 The server @samp{dylan.doc.ic.ac.uk} has two user disks:
3994 @samp{/dev/dsk/2s0} and @samp{/dev/dsk/5s0}.  These are accessed as
3995 @samp{/home/dylan/dk2} and @samp{/home/dylan/dk5} respectively.  Since
3996 @samp{/home} is already an automount point, this naming is achieved with
3997 the following map entries:@refill
3998
3999 @example
4000 dylan        type:=auto;fs:=$@{map@};pref:=$@{key@}/
4001 dylan/dk2    type:=ufs;dev:=/dev/dsk/2s0
4002 dylan/dk5    type:=ufs;dev:=/dev/dsk/5s0
4003 @end example
4004
4005 @c ----------------------------------------------------------------
4006 @node Direct Automount Filesystem, Union Filesystem, Automount Filesystem, Filesystem Types
4007 @comment  node-name,  next,  previous,  up
4008 @section Direct Automount Filesystem (@samp{direct})
4009 @cindex Direct automount filesystem
4010 @cindex How to start a direct automount point
4011 @cindex direct, filesystem type
4012 @cindex Filesystem type; direct
4013
4014 The @dfn{direct} (@samp{type:=direct}) filesystem is almost identical to
4015 the automount filesystem.  Instead of appearing to be a directory of
4016 mount points, it appears as a symbolic link to a mounted filesystem.
4017 The mount is done at the time the link is accessed.  @xref{Automount
4018 Filesystem}, for a list of required options.
4019
4020 Direct automount points are created by specifying the @samp{direct}
4021 filesystem type on the command line:
4022
4023 @example
4024 amd ... /usr/man auto.direct -type:=direct
4025 @end example
4026
4027 where @samp{auto.direct} would contain an entry such as:
4028
4029 @example
4030 usr/man    -type:=nfs;rfs:=/usr/man \
4031            rhost:=man-server1  rhost:=man-server2
4032 @end example
4033
4034 In this example, @samp{man-server1} and @samp{man-server2} are file
4035 servers which export copies of the manual pages.  Note that the key
4036 which is looked up is the name of the automount point without the
4037 leading @samp{/}.
4038
4039 Note that the implementation of the traditional @dfn{direct} filesystem is
4040 essentially a hack (pretending that the root of an NFS filesystem is a
4041 symlink) and many modern operating systems get very unhappy about
4042 it. For example, Linux kernel 2.4+ completely disallows it, and Solaris
4043 2.8 fails to unmount it when @i{Amd} shuts down. Therefore, the use of
4044 the traditional @dfn{direct} filesystem is strongly discouraged; it is
4045 only semi-supported, at best.
4046
4047 The autofs implementations that permit direct mounts are fully
4048 supported, however. That currently includes all versions of
4049 Solaris. Linux autofs does NOT support direct mounts at all.
4050
4051 @c ----------------------------------------------------------------
4052 @node Union Filesystem, Error Filesystem, Direct Automount Filesystem, Filesystem Types
4053 @comment  node-name,  next,  previous,  up
4054 @section Union Filesystem (@samp{union})
4055 @cindex Union filesystem
4056 @cindex union, filesystem type
4057 @cindex Filesystem type; union
4058
4059 The @dfn{union} (@samp{type:=union}) filesystem type allows the contents of several
4060 directories to be merged and made visible in a single directory.  This
4061 can be used to overcome one of the major limitations of the Unix mount
4062 mechanism which only allows complete directories to be mounted.
4063
4064 For example, supposing @file{/tmp} and @file{/var/tmp} were to be merged
4065 into a new directory called @file{/mtmp}, with files in @file{/var/tmp}
4066 taking precedence.  The following command could be used to achieve this
4067 effect:
4068
4069 @example
4070 amd ... /mtmp union:/tmp:/var/tmp -type:=union
4071 @end example
4072
4073 Currently, the unioned directories must @emph{not} be automounted.  That
4074 would cause a deadlock.  This seriously limits the current usefulness of
4075 this filesystem type and the problem will be addressed in a future
4076 release of @i{Amd}.
4077
4078 Files created in the union directory are actually created in the last
4079 named directory.  This is done by creating a wildcard entry which points
4080 to the correct directory.  The wildcard entry is visible if the union
4081 directory is listed, so allowing you to see which directory has
4082 priority.
4083
4084 The files visible in the union directory are computed at the time
4085 @i{Amd} is started, and are not kept up-to-date with respect to the
4086 underlying directories.  Similarly, if a link is removed, for example
4087 with the @samp{rm} command, it will be lost forever.
4088
4089 @c ----------------------------------------------------------------
4090 @node Error Filesystem, Top-level Filesystem, Union Filesystem, Filesystem Types
4091 @comment  node-name,  next,  previous,  up
4092 @section Error Filesystem (@samp{error})
4093 @cindex Error filesystem
4094 @cindex error, filesystem type
4095 @cindex Filesystem type; error
4096
4097 The @dfn{error} (@samp{type:=error}) filesystem type is used internally as a catch-all in the
4098 case where none of the other filesystems was selected, or some other
4099 error occurred.  Lookups and mounts always fail with ``No such file or
4100 directory''.  All other operations trivially succeed.
4101
4102 The error filesystem is not directly accessible.
4103
4104 @c ----------------------------------------------------------------
4105 @node Top-level Filesystem, Root Filesystem, Error Filesystem, Filesystem Types
4106 @comment  node-name,  next,  previous,  up
4107 @section Top-level Filesystem (@samp{toplvl})
4108 @cindex Top level filesystem
4109 @cindex toplvl, filesystem type
4110 @cindex Filesystem type; toplvl
4111
4112 The @dfn{toplvl} (@samp{type:=toplvl}) filesystems is derived from the @samp{auto} filesystem
4113 and is used to mount the top-level automount nodes.  Requests of this
4114 type are automatically generated from the command line arguments.
4115
4116 @c ----------------------------------------------------------------
4117 @node Root Filesystem, Inheritance Filesystem, Top-level Filesystem, Filesystem Types
4118 @comment  node-name,  next,  previous,  up
4119 @section Root Filesystem (@samp{root})
4120 @cindex Root filesystem
4121 @cindex root, filesystem type
4122 @cindex Filesystem type; root
4123
4124 The @dfn{root} (@samp{type:=root}) filesystem type acts as an internal
4125 placeholder onto which @i{Amd} can pin @samp{toplvl} mounts.  Only one
4126 node of this type need ever exist and one is created automatically
4127 during startup.  The effect of having more than one root node is
4128 undefined.
4129
4130 The root filesystem is not directly accessible.
4131
4132 @c ----------------------------------------------------------------
4133 @node Inheritance Filesystem, , Root Filesystem, Filesystem Types
4134 @comment  node-name,  next,  previous,  up
4135 @section Inheritance Filesystem (@samp{inherit})
4136 @cindex Inheritance filesystem
4137 @cindex Nodes generated on a restart
4138 @cindex inherit, filesystem type
4139 @cindex Filesystem type; inherit
4140
4141 The @dfn{inheritance} (@samp{type:=inherit}) filesystem is not directly
4142 accessible.  Instead, internal mount nodes of this type are
4143 automatically generated when @i{Amd} is started with the @code{-r} option.
4144 At this time the system mount table is scanned to locate any filesystems
4145 which are already mounted.  If any reference to these filesystems is
4146 made through @i{Amd} then instead of attempting to mount it, @i{Amd}
4147 simulates the mount and @dfn{inherits} the filesystem.  This allows a
4148 new version of @i{Amd} to be installed on a live system simply by
4149 killing the old daemon with @samp{SIGTERM} and starting the new one.@refill
4150
4151 This filesystem type is not generally visible externally, but it is
4152 possible that the output from @samp{amq -m} may list @samp{inherit} as
4153 the filesystem type.  This happens when an inherit operation cannot
4154 be completed for some reason, usually because a fileserver is down.
4155
4156 @c ################################################################
4157 @node Amd Configuration File, Run-time Administration, Filesystem Types, Top
4158 @comment  node-name,  next,  previous,  up
4159 @chapter Amd Configuration File
4160 @cindex  Amd Configuration File
4161 @cindex amd.conf
4162
4163 The @samp{amd.conf} file is the configuration file for @i{Amd}, as part
4164 of the am-utils suite.  This file contains runtime configuration
4165 information for the @i{Amd} automounter program.
4166
4167 @menu
4168 * File Format::
4169 * The Global Section::
4170 * Regular Map Sections::
4171 * Common Parameters::
4172 * Global Parameters::
4173 * Regular Map Parameters::
4174 * amd.conf Examples::
4175 @end menu
4176
4177 @c ================================================================
4178 @node File Format, The Global Section, Amd Configuration File, Amd Configuration File
4179 @comment  node-name,  next,  previous,  up
4180 @section File Format
4181 @cindex amd.conf file format
4182
4183 The @samp{amd.conf} file consists of sections and parameters.  A section
4184 begins with the name of the section in square brackets @samp{[]} and
4185 continues until the next section begins or the end of the file is reached.
4186 Sections contain parameters of the form @samp{name = value}.
4187
4188 The file is line-based --- that is, each newline-terminated line
4189 represents either a comment, a section name or a parameter.  No
4190 line-continuation syntax is available.
4191
4192 Section names, parameter names and their values are case sensitive.
4193
4194 Only the first equals sign in a parameter is significant.  Whitespace
4195 before or after the first equals sign is discarded.  Leading, trailing
4196 and internal whitespace in section and parameter names is irrelevant.
4197 Leading and trailing whitespace in a parameter value is discarded.
4198 Internal whitespace within a parameter value is not allowed, unless the
4199 whole parameter value is quoted with double quotes as in @samp{name =
4200 "some value"}.
4201
4202 Any line beginning with a pound sign @samp{#} is ignored, as are lines
4203 containing only whitespace.
4204
4205 The values following the equals sign in parameters are all either a
4206 string (no quotes needed if string does not include spaces) or a
4207 boolean, which may be given as @samp{yes}/@samp{no}.  Case is significant in all
4208 values.  Some items such as cache timeouts are numeric.
4209
4210 @c ================================================================
4211 @node The Global Section, Regular Map Sections, File Format, Amd Configuration File
4212 @comment  node-name,  next,  previous,  up
4213 @section The Global Section
4214 @cindex amd.conf global section
4215
4216 The global section must be specified as @samp{[global]}.  Parameters in
4217 this section either apply to @i{Amd} as a whole, or to all other regular map
4218 sections which follow.  There should be only one global section defined
4219 in one configuration file.
4220
4221 It is highly recommended that this section be specified first in the
4222 configuration file.  If it is not, then regular map sections which
4223 precede it will not use global values defined later.
4224
4225 @c ================================================================
4226 @node Regular Map Sections, Common Parameters, The Global Section, Amd Configuration File
4227 @comment  node-name,  next,  previous,  up
4228 @section Regular Map Sections
4229 @cindex amd.conf regular map sections
4230
4231 Parameters in regular (non-global) sections apply to a single map entry.
4232 For example, if the map section @samp{[/homes]} is defined, then all
4233 parameters following it will be applied to the @file{/homes}
4234 @i{Amd}-managed mount point.
4235
4236 @c ================================================================
4237 @node Common Parameters, Global Parameters, Regular Map Sections, Amd Configuration File
4238 @comment  node-name,  next,  previous,  up
4239 @section Common Parameters
4240 @cindex amd.conf common parameters
4241
4242 These parameters can be specified either in the global or a map-specific
4243 section.  Entries specified in a map-specific section override the default
4244 value or one defined in the global section.   If such a common parameter is
4245 specified only in the global section, it is applicable to all regular map
4246 sections that follow.
4247
4248 @menu
4249 * autofs_use_lofs Parameter::
4250 * browsable_dirs Parameter::
4251 * map_defaults Parameter::
4252 * map_options Parameter::
4253 * map_type Parameter::
4254 * mount_type Parameter::
4255 * search_path Parameter::
4256 * selectors_in_defaults Parameter::
4257 * sun_map_syntax Parameter::
4258 @end menu
4259
4260 @c ----------------------------------------------------------------
4261 @node autofs_use_lofs Parameter, browsable_dirs Parameter, Common Parameters, Common Parameters
4262 @comment  node-name,  next,  previous,  up
4263 @subsection @t{autofs_use_lofs} Parameter
4264 @cindex autofs_use_lofs Parameter
4265
4266 (type=string, default=@samp{yes}).
4267 When set to @samp{yes}, @i{Amd}'s autofs code will use lofs-type
4268 (loopback) mounts for @code{type:=link} mounts, as well as several
4269 other cases that require local references.  This has the advantage
4270 that @i{Amd} does not use a secondary mount point and users do not see
4271 external pathnames (the infamous @code{/bin/pwd} problem, where it
4272 reports a different path than the user chdir'ed into).  One of the
4273 disadvantages of using this option is that the autofs code is
4274 relatively new and the in-place mounts have not been throughly tested.
4275
4276 If this option is set to @samp{no}, then @i{Amd}'s autofs code will
4277 use symlinks instead of lofs-type mounts for local references.  This
4278 has the advantage of using simpler (more stable) code, but at the
4279 expense of negating one of autofs's big advantages: the hiding of
4280 @i{Amd}'s internal paths.  Note that symlinks are not supported in all
4281 autofs implementations, especially those derived from Solaris Autofs
4282 v1.  Also, on Solaris 2.6 and newer, autofs symlinks are not cached,
4283 resulting in repeated up-call requests to @i{Amd}.
4284
4285 @c ----------------------------------------------------------------
4286 @node browsable_dirs Parameter, map_defaults Parameter, autofs_use_lofs Parameter, Common Parameters
4287 @comment  node-name,  next,  previous,  up
4288 @subsection @t{browsable_dirs} Parameter
4289 @cindex browsable_dirs Parameter
4290
4291 (type=string, default=@samp{no}).  If @samp{yes}, then @i{Amd}'s top-level
4292 mount points will be browsable to @b{readdir}(3) calls.  This means you
4293 could run for example @b{ls}(1) and see what keys are available to mount
4294 in that directory.  Not all entries are made visible to @b{readdir}(3):
4295 the @samp{/defaults} entry, wildcard entries, and those with a @file{/}
4296 in them are not included.  If you specify @samp{full} to this option,
4297 all but the @samp{/defaults} entry will be visible.  Note that if you run
4298 a command which will attempt to @b{stat}(2) the entries, such as often
4299 done by @samp{ls -l} or @samp{ls -F}, @i{Amd} will attempt to mount
4300 @i{every} entry in that map.  This is often called a ``mount storm''.
4301
4302 Note that mount storms are mostly avoided by using autofs mounts
4303 (@samp{mount_type = autofs}).
4304
4305 @c ----------------------------------------------------------------
4306 @node map_defaults Parameter, map_options Parameter, browsable_dirs Parameter, Common Parameters
4307 @comment  node-name,  next,  previous,  up
4308 @subsection @t{map_defaults} Parameter
4309 @cindex map_defaults Parameter
4310
4311 (type=string, default to empty).  This option sets a string to be used
4312 as the map's @code{/defaults} entry, overriding any @code{/defaults}
4313 specified in the map.  This allows local users to override a given
4314 map's defaults without modifying maps globally (which is impossible in
4315 sites where the maps are managed by a different administrative group).
4316
4317 @c ----------------------------------------------------------------
4318 @node map_options Parameter, map_type Parameter, map_defaults Parameter, Common Parameters
4319 @comment  node-name,  next,  previous,  up
4320 @subsection @t{map_options} Parameter
4321 @cindex map_options Parameter
4322
4323 (type=string, default no options).  This option is the same as
4324 specifying map options on the command line to @i{Amd}, such as
4325 @samp{cache:=all}.
4326
4327 @c ----------------------------------------------------------------
4328 @node map_type Parameter, mount_type Parameter, map_options Parameter, Common Parameters
4329 @comment  node-name,  next,  previous,  up
4330 @subsection @t{map_type} Parameter
4331 @cindex map_type Parameter
4332
4333 (type=string, default search all map types).  If specified, @i{Amd} will
4334 initialize the map only for the type given.  This is useful to avoid the
4335 default map search type used by @i{Amd} which takes longer and can have
4336 undesired side-effects such as initializing NIS even if not used.
4337 Possible values are
4338
4339 @table @samp
4340 @item file
4341 plain files
4342 @item hesiod
4343 Hesiod name service from MIT
4344 @item ldap
4345 Lightweight Directory Access Protocol
4346 @item ndbm
4347 (New) dbm style hash files
4348 @item nis
4349 Network Information Services (version 2)
4350 @item nisplus
4351 Network Information Services Plus (version 3)
4352 @item passwd
4353 local password files
4354 @item union
4355 union maps
4356 @end table
4357
4358 @c ----------------------------------------------------------------
4359 @node mount_type Parameter, search_path Parameter, map_type Parameter, Common Parameters
4360 @comment  node-name,  next,  previous,  up
4361 @subsection @t{mount_type} Parameter
4362 @cindex mount_type Parameter
4363
4364 (type=string, default=@samp{nfs}).  All @i{Amd} mount types default to NFS.
4365 That is, @i{Amd} is an NFS server on the map mount points, for the local
4366 host it is running on.  If @samp{autofs} is specified, @i{Amd} will be
4367 an autofs server for those mount points.
4368
4369 @c ----------------------------------------------------------------
4370 @node search_path Parameter, selectors_in_defaults Parameter, mount_type Parameter, Common Parameters
4371 @comment  node-name,  next,  previous,  up
4372 @subsection @t{search_path} Parameter
4373 @cindex search_path Parameter
4374
4375 (type=string, default no search path).  This provides a
4376 (colon-delimited) search path for file maps.  Using a search path,
4377 sites can allow for local map customizations and overrides, and can
4378 distributed maps in several locations as needed.
4379
4380 @c ----------------------------------------------------------------
4381 @node selectors_in_defaults Parameter, sun_map_syntax Parameter, search_path Parameter, Common Parameters
4382 @comment  node-name,  next,  previous,  up
4383 @subsection @t{selectors_in_defaults} Parameter
4384 @cindex selectors_in_defaults Parameter
4385
4386 (type=boolean, default=@samp{no}).  If @samp{yes}, then the
4387 @samp{/defaults} entry of maps will search for and process any
4388 selectors before setting defaults for all other keys in that map.
4389 Useful when you want to set different options for a complete map based
4390 on some parameters.  For example, you may want to better the NFS
4391 performance over slow slip-based networks as follows:
4392
4393 @example
4394 /defaults \
4395     wire==slip-net;opts:=intr,rsize=1024,wsize=1024 \
4396     wire!=slip-net;opts:=intr,rsize=8192,wsize=8192
4397 @end example
4398
4399 Deprecated form: selectors_on_default.
4400
4401 @c ----------------------------------------------------------------
4402 @node sun_map_syntax Parameter, , selectors_in_defaults Parameter, Common Parameters
4403 @comment  node-name,  next,  previous,  up
4404 @subsection @t{sun_map_syntax} Parameter
4405 @cindex sun_map_syntax Parameter
4406
4407 (type=boolean, default=@samp{no}).  If @samp{yes}, then @i{Amd} will
4408 parse the map according to the Sun Automount syntax.
4409
4410
4411 @c ================================================================
4412 @node Global Parameters, Regular Map Parameters, Common Parameters, Amd Configuration File
4413 @comment  node-name,  next,  previous,  up
4414 @section Global Parameters
4415 @cindex amd.conf global parameters
4416
4417 The following parameters are applicable to the @samp{[global]} section only.
4418
4419 @menu
4420 * arch Parameter::
4421 * auto_attrcache Parameter::
4422 * auto_dir Parameter::
4423 * cache_duration Parameter::
4424 * cluster Parameter::
4425 * debug_mtab_file Parameter::
4426 * debug_options Parameter::
4427 * dismount_interval Parameter::
4428 * domain_strip Parameter::
4429 * exec_map_timeout Parameter::
4430 * forced_unmounts Parameter::
4431 * full_os Parameter::
4432 * fully_qualified_hosts Parameter::
4433 * hesiod_base Parameter::
4434 * karch Parameter::
4435 * ldap_base Parameter::
4436 * ldap_cache_maxmem Parameter::
4437 * ldap_cache_seconds Parameter::
4438 * ldap_hostports Parameter::
4439 * ldap_proto_version Parameter::
4440 * local_domain Parameter::
4441 * localhost_address Parameter::
4442 * log_file Parameter::
4443 * log_options Parameter::
4444 * map_reload_interval Parameter::
4445 * nfs_allow_any_interface Parameter::
4446 * nfs_allow_insecure_port Parameter::
4447 * nfs_proto Parameter::
4448 * nfs_retransmit_counter Parameter::
4449 * nfs_retransmit_counter_udp Parameter::
4450 * nfs_retransmit_counter_tcp Parameter::
4451 * nfs_retransmit_counter_toplvl Parameter::
4452 * nfs_retry_interval Parameter::
4453 * nfs_retry_interval_udp Parameter::
4454 * nfs_retry_interval_tcp Parameter::
4455 * nfs_retry_interval_toplvl Parameter::
4456 * nfs_vers Parameter::
4457 * nis_domain Parameter::
4458 * normalize_hostnames Parameter::
4459 * normalize_slashes Parameter::
4460 * os Parameter::
4461 * osver Parameter::
4462 * pid_file Parameter::
4463 * plock Parameter::
4464 * portmap_program Parameter::
4465 * preferred_amq_port Parameter::
4466 * print_pid Parameter::
4467 * print_version Parameter::
4468 * restart_mounts Parameter::
4469 * show_statfs_entries Parameter::
4470 * truncate_log Parameter::
4471 * unmount_on_exit Parameter::
4472 * use_tcpwrappers Parameter::
4473 * vendor Parameter::
4474 @end menu
4475
4476 @c ----------------------------------------------------------------
4477 @node arch Parameter, auto_attrcache Parameter, Global Parameters, Global Parameters
4478 @comment  node-name,  next,  previous,  up
4479 @subsection @t{arch} Parameter
4480 @cindex arch Parameter
4481
4482 (type=string, default to compiled in value).  Same as the @code{-A}
4483 option to @i{Amd}.  Allows you to override the value of the @i{arch}
4484 @i{Amd} variable.
4485
4486 @c ----------------------------------------------------------------
4487 @node auto_attrcache Parameter, auto_dir Parameter, arch Parameter, Global Parameters
4488 @comment  node-name,  next,  previous,  up
4489 @subsection @t{auto_attrcache} Parameter
4490 @cindex auto_attrcache Parameter
4491
4492 (type=numeric, default=0).  Specify in seconds (or units of 0.1
4493 seconds, depending on the OS), what is the (kernel-side) NFS attribute
4494 cache timeout for @i{Amd}'s own automount points.  A value of 0 is
4495 supposed to turn off attribute caching, meaning that @i{Amd} will be
4496 consulted via a kernel-RPC each time someone stat()'s the mount point
4497 (which could be abused as a denial-of-service attack).
4498
4499 @emph{WARNING}: @i{Amd} depends on being able to turn off the NFS
4500 attribute cache of the client OS.  If it cannot be turned off, then
4501 users may get ESTALE errors or symlinks that point to the wrong
4502 places.  This is more likely under heavy use of @i{Amd}, for example
4503 if your system is experiencing frequent map changes or frequent
4504 mounts/unmounts.  Therefore, under normal circumstances, this
4505 parameter should remain set to 0, to ensure that the attribute cache
4506 is indeed off.
4507
4508 Unfortunately, some kernels (e.g., certain BSDs) don't have a way to
4509 turn off the NFS attribute cache.  Setting this parameter to 0 is
4510 supposed to turn off attribute caching entirely, but unfortunately it
4511 does not; instead, the attribute cache is set to some internal
4512 hard-coded default (usually anywhere from 5-30 seconds).  If you
4513 suspect that your OS doesn't have a reliable way of turning off the
4514 attribute cache, then it is better to set this parameter to the
4515 smallest possible non-zero value (set @samp{auto_attrcache=1} in your
4516 @code{amd.conf}).  This will not eliminate the problem, but reduce the
4517 risk window somewhat.  The best solutions are (1) to use @i{Amd} in
4518 Autofs mode, if it's supported in your OS, and (2) talk to your OS
4519 vendor to support a true @samp{noac} flag.  See the
4520 @uref{http://www.am-utils.org/docs/am-utils/attrcache.txt,README.attrcache}
4521 document for more details.
4522
4523 If you are able to turn off the attribute cache on your OS, alas,
4524 @i{Amd}'s performance may degrade (when not using Autofs) because
4525 every traversal of an automounter-controlled pathname will result in a
4526 lookup request from the kernel to @i{Amd}.  Under heavy loads, for
4527 example when using recursive tools like @samp{find}, @samp{rdist}, or
4528 @samp{rsync}, this performance degradation can be noticeable.  There
4529 are two possible solutions that some administrators have chosen to
4530 improve performance:
4531
4532 @enumerate
4533
4534 @item
4535 First, you can turn off unmounting using the @samp{nounmount} mount
4536 option.  This will ensure that no @i{Amd} symlink could ever change,
4537 thereby the kernel's attribute cache and @i{Amd} will always be in
4538 sync.  However, this method will cause the number of mounts to keep
4539 growing, even if some are no longer in use; this has the disadvantage
4540 that your system could be more susceptible to hangs if even one of
4541 those accumulating mounts hangs due to a downed server.
4542
4543 @item
4544 Second, you can turn on attribute caching carefully by setting a small
4545 automounter attribute cache value (say, one second), and a relatively
4546 large dismount interval (say, one hour).  (@xref{dismount_interval
4547 Parameter}.)  For example, you can set this in your @code{amd.conf}:
4548
4549 @example
4550 [global]
4551 auto_attrcache = 1
4552 dismount_interval = 3600
4553 @end example
4554
4555 This has the benefit of using the kernel's attribute cache and thus
4556 improving performance.  The disadvantage with this option is that the
4557 window of vulnerability is not eliminated entirely: it is only made
4558 smaller.
4559
4560 @end enumerate
4561
4562 @c ----------------------------------------------------------------
4563 @node auto_dir Parameter, cache_duration Parameter, auto_attrcache Parameter, Global Parameters
4564 @comment  node-name,  next,  previous,  up
4565 @subsection @t{auto_dir} Parameter
4566 @cindex auto_dir Parameter
4567
4568 (type=string, default=@samp{/a}).  Same as the @code{-a} option to @i{Amd}.
4569 This sets the private directory where @i{Amd} will create
4570 sub-directories for its real mount points.
4571
4572 @c ----------------------------------------------------------------
4573 @node cache_duration Parameter, cluster Parameter, auto_dir Parameter, Global Parameters
4574 @comment  node-name,  next,  previous,  up
4575 @subsection @t{cache_duration} Parameter
4576 @cindex cache_duration Parameter
4577
4578 (type=numeric, default=300).  Same as the @code{-c} option to @i{Amd}.
4579 Sets the duration in seconds that looked-up or mounted map entries
4580 remain in the cache.
4581
4582 @c ----------------------------------------------------------------
4583 @node cluster Parameter, debug_mtab_file Parameter, cache_duration Parameter, Global Parameters
4584 @comment  node-name,  next,  previous,  up
4585 @subsection @t{cluster} Parameter
4586 @cindex cluster Parameter
4587
4588 (type=string, default no cluster).  Same as the @code{-C} option to
4589 @i{Amd}.  Specifies the alternate HP-UX cluster to use.
4590
4591 @c ----------------------------------------------------------------
4592 @node debug_mtab_file Parameter, debug_options Parameter, cluster Parameter, Global Parameters
4593 @comment  node-name,  next,  previous,  up
4594 @subsection @t{debug_mtab_file} Parameter
4595 @cindex debug_mtab_file Parameter
4596
4597 (type=string, default="/tmp/mtab").  Path to mtab file that is used
4598 by @i{Amd} to store a list of mounted file systems during debug-mtab mode.
4599 This option only applies to systems that store mtab information on disk.
4600
4601 @c ----------------------------------------------------------------
4602 @node debug_options Parameter, dismount_interval Parameter, debug_mtab_file Parameter, Global Parameters
4603 @comment  node-name,  next,  previous,  up
4604 @subsection @t{debug_options} Parameter
4605 @cindex debug_options Parameter
4606
4607 (type=string, default no debug options).  Same as the @code{-D} option
4608 to @i{Amd}.  Specify any debugging options for @i{Amd}.  Works only if
4609 am-utils was configured for debugging using the @code{--enable-debug}
4610 option.  The additional @samp{mem} option can be turned on via
4611 @code{--enable-debug=mem}.  Otherwise debugging options are ignored.
4612 Options are comma delimited, and can be preceded by the string
4613 @samp{no} to negate their meaning.  You can get the list of supported
4614 debugging and logging options by running @code{amd -H}.  Possible
4615 values those listed for the -D option.  @xref{-D Option}.
4616
4617 @c ----------------------------------------------------------------
4618 @node dismount_interval Parameter, domain_strip Parameter, debug_options Parameter, Global Parameters
4619 @comment  node-name,  next,  previous,  up
4620 @subsection @t{dismount_interval} Parameter
4621 @cindex dismount_interval Parameter
4622
4623 (type=numeric, default=120).  Same as the @code{-w} option to
4624 @i{Amd}.  Specify in seconds, the time between attempts to dismount file
4625 systems that have exceeded their cached times.
4626
4627 @c ----------------------------------------------------------------
4628 @node domain_strip Parameter, exec_map_timeout Parameter, dismount_interval Parameter, Global Parameters
4629 @comment  node-name,  next,  previous,  up
4630 @subsection @t{domain_strip} Parameter
4631 @cindex domain_strip Parameter
4632
4633 (type=boolean, default=@samp{yes}).  If @samp{yes}, then the domain
4634 name part referred to by @code{$@{rhost@}} is stripped off.  This is
4635 useful to keep logs and smaller.  If @samp{no}, then the domain name
4636 part is left changed.  This is useful when using multiple domains with
4637 the same maps (as you may have hosts whose domain-stripped name is
4638 identical).
4639
4640 @c ----------------------------------------------------------------
4641 @node exec_map_timeout Parameter, forced_unmounts Parameter, domain_strip Parameter, Global Parameters
4642 @comment  node-name,  next,  previous,  up
4643 @subsection @t{exec_map_timeout} Parameter
4644 @cindex exec_map_timeout Parameter
4645
4646 (type=numeric, default=10).  The timeout in seconds that @i{Amd} will
4647 wait for an executable map program before an answer is returned from
4648 that program (or script).  This value should be set to as small as
4649 possible while still allowing normal replies to be returned before the
4650 timer expires, because during the time that the executable map program
4651 is queried, @i{Amd} is essentially waiting and is thus not responding
4652 to any other queries.  @xref{Executable maps}.
4653
4654 @c ----------------------------------------------------------------
4655 @node forced_unmounts Parameter, full_os Parameter, exec_map_timeout Parameter, Global Parameters
4656 @comment  node-name,  next,  previous,  up
4657 @subsection @t{forced_unmounts} Parameter
4658 @cindex forced_unmounts Parameter
4659
4660 (type=boolean, default=@samp{no}).
4661 Sometimes, mount points are hung due to unrecoverable conditions, such
4662 as when NFS servers migrate, change their IP address, are down
4663 permanently, or due to hardware failures, and more.  In this case,
4664 attempting to unmount an existing mount point, or even just to
4665 @b{stat}(2) it, results in one of three fatal errors: EIO, ESTALE, or
4666 EBUSY.  At that point, @i{Amd} can do little to recover that hung
4667 point (in fact, the OS cannot automatically recover either).  For that
4668 reason, some OSs support special kinds of forced unmounts, which must
4669 be used very carefully: they will force an unmount immediately (or
4670 lazily on Linux), which could result in application data loss.
4671 However, that may be the only way to recover the entire host (without
4672 rebooting).  Once a hung mount point is forced out, @i{Amd} can then
4673 re-mount a replacement one (if available), bringing a mostly-hung
4674 system back to operation and avoiding a potentially costly reboot.
4675
4676 If the @samp{forced_unmounts} option is set to @samp{yes}, and the
4677 client OS supports forced or lazy unmounts, then @i{Amd} will attempt
4678 to use them if it gets any of the three serious error conditions
4679 listed above.  Note that @i{Amd} will force the unmount of mount
4680 points that returned EBUSY only for @samp{type:=toplvl} mounts
4681 (@pxref{Top-level Filesystem}): that is, @i{Amd}'s own mount points.
4682 This is useful to recover from a previously hung @i{Amd}, and to
4683 ensure that an existing @i{Amd} can shutdown cleanly even if some
4684 processes are keeping its mount points busy (i.e., when a user's shell
4685 process uses @code{cd} to set its CWD to @i{Amd}'s own mount point).
4686
4687 If this option is set to @samp{no} (the default), then @i{Amd} will
4688 not attempt this special recovery procedure.
4689
4690 @c ----------------------------------------------------------------
4691 @node full_os Parameter, fully_qualified_hosts Parameter, forced_unmounts Parameter, Global Parameters
4692 @comment  node-name,  next,  previous,  up
4693 @subsection @t{full_os} Parameter
4694 @cindex full_os Parameter
4695
4696 (type=string, default to compiled in value).  The full name of the
4697 operating system, along with its version.  Allows you to override the
4698 compiled-in full name and version of the operating system.  Useful when
4699 the compiled-in name is not desired.  For example, the full operating
4700 system name on linux comes up as @samp{linux}, but you can override it
4701 to @samp{linux-2.2.5}.
4702
4703 @c ----------------------------------------------------------------
4704 @node fully_qualified_hosts Parameter, hesiod_base Parameter, full_os Parameter, Global Parameters
4705 @comment  node-name,  next,  previous,  up
4706 @subsection @t{fully_qualified_hosts} Parameter
4707 @cindex fully_qualified_hosts Parameter
4708
4709 (type=string, default=@samp{no}).  If @samp{yes}, @i{Amd} will perform RPC
4710 authentication using fully-qualified host names.  This is necessary for
4711 some systems, and especially when performing cross-domain mounting.  For
4712 this function to work, the @i{Amd} variable @samp{$@{hostd@}} is used,
4713 requiring that @samp{$@{domain@}} not be null.
4714
4715 @c ----------------------------------------------------------------
4716 @node hesiod_base Parameter, karch Parameter, fully_qualified_hosts Parameter, Global Parameters
4717 @comment  node-name,  next,  previous,  up
4718 @subsection @t{hesiod_base} Parameter
4719 @cindex hesiod_base Parameter
4720
4721 (type=string, default=@samp{automount}).  Specify the base name for
4722 hesiod maps.
4723
4724 @c ----------------------------------------------------------------
4725 @node karch Parameter, ldap_base Parameter, hesiod_base Parameter, Global Parameters
4726 @comment  node-name,  next,  previous,  up
4727 @subsection @t{karch} Parameter
4728 @cindex karch Parameter
4729
4730 (type=string, default to karch of the system).  Same as the @code{-k}
4731 option to @i{Amd}.  Allows you to override the kernel-architecture of
4732 your system.  Useful for example on Sun (Sparc) machines, where you can
4733 build one @i{Amd} binary, and run it on multiple machines, yet you want
4734 each one to get the correct @i{karch} variable set (for example, sun4c,
4735 sun4m, sun4u, etc.)  Note that if not specified, @i{Amd} will use
4736 @b{uname}(2) to figure out the kernel architecture of the machine.
4737
4738 @c ----------------------------------------------------------------
4739 @node ldap_base Parameter, ldap_cache_maxmem Parameter, karch Parameter, Global Parameters
4740 @comment  node-name,  next,  previous,  up
4741 @subsection @t{ldap_base} Parameter
4742 @cindex ldap_base Parameter
4743
4744 (type=string, default not set).
4745 Specify the base name for LDAP.  This often includes LDAP-specific
4746 values such as country and organization.
4747
4748 @c ----------------------------------------------------------------
4749 @node ldap_cache_maxmem Parameter, ldap_cache_seconds Parameter, ldap_base Parameter, Global Parameters
4750 @comment  node-name,  next,  previous,  up
4751 @subsection @t{ldap_cache_maxmem} Parameter
4752 @cindex ldap_cache_maxmem Parameter
4753
4754 (type=numeric, default=131072).  Specify the maximum memory @i{Amd}
4755 should use to cache LDAP entries.
4756
4757 @c ----------------------------------------------------------------
4758 @node ldap_cache_seconds Parameter, ldap_hostports Parameter, ldap_cache_maxmem Parameter, Global Parameters
4759 @comment  node-name,  next,  previous,  up
4760 @subsection @t{ldap_cache_seconds} Parameter
4761 @cindex ldap_cache_seconds Parameter
4762
4763 (type=numeric, default=0).  Specify the number of seconds to keep
4764 entries in the cache.
4765
4766 @c ----------------------------------------------------------------
4767 @node ldap_hostports Parameter, ldap_proto_version Parameter, ldap_cache_seconds Parameter, Global Parameters
4768 @comment  node-name,  next,  previous,  up
4769 @subsection @t{ldap_hostports} Parameter
4770 @cindex ldap_hostports Parameter
4771
4772 (type=string, default not set).
4773 Specify the LDAP host and port values.
4774
4775 @c ----------------------------------------------------------------
4776 @node ldap_proto_version Parameter, local_domain Parameter, ldap_hostports Parameter, Global Parameters
4777 @comment  node-name,  next,  previous,  up
4778 @subsection @t{ldap_proto_version} Parameter
4779 @cindex ldap_proto_version Parameter
4780
4781 (type=numeric, default=2).  Specify the LDAP protocol version to use.
4782 With a value of 3 will use LDAPv3 protocol.
4783
4784 @c ----------------------------------------------------------------
4785 @node local_domain Parameter, localhost_address Parameter, ldap_proto_version Parameter, Global Parameters
4786 @comment  node-name,  next,  previous,  up
4787 @subsection @t{local_domain} Parameter
4788 @cindex local_domain Parameter
4789
4790 (type=string, default no sub-domain).  Same as the @code{-d} option
4791 to @i{Amd}.  Specify the local domain name.  If this option is not given
4792 the domain name is determined from the hostname, by removing the first
4793 component of the fully-qualified host name.
4794
4795 @c ----------------------------------------------------------------
4796 @node localhost_address Parameter, log_file Parameter, local_domain Parameter, Global Parameters
4797 @comment  node-name,  next,  previous,  up
4798 @subsection @t{localhost_address} Parameter
4799 @cindex localhost_address Parameter
4800
4801 (type=string, default to localhost or 127.0.0.1).  Specify the name or
4802 IP address for @i{Amd} to use when connecting the sockets for the
4803 local NFS server and the RPC server.  This defaults to 127.0.0.1 or
4804 whatever the host reports as its local address.  This parameter is
4805 useful on hosts with multiple addresses where you want to force
4806 @i{Amd} to connect to a specific address.
4807
4808 @c ----------------------------------------------------------------
4809 @node log_file Parameter, log_options Parameter, localhost_address Parameter, Global Parameters
4810 @comment  node-name,  next,  previous,  up
4811 @subsection @t{log_file} Parameter
4812 @cindex log_file Parameter
4813
4814 (type=string, default=@samp{stderr}).  Same as the @code{-l} option to
4815 @i{Amd}.  Specify a file name to log @i{Amd} events to.
4816 If the string @samp{/dev/stderr} is specified,
4817 @i{Amd} will send its events to the standard error file descriptor.
4818
4819 If the string @samp{syslog} is given, @i{Amd} will record its events
4820 with the system logger @b{syslogd}(8).  If your system supports syslog
4821 facilities, then the default facility used is @samp{LOG_DAEMON}.
4822
4823 When using syslog, if you wish to change the facility, append its name
4824 to the option name, delimited by a single colon.  For example, if it is
4825 the string @samp{syslog:local7} then @i{Amd} will log messages via
4826 @b{syslog}(3) using the @samp{LOG_LOCAL7} facility.  If the facility
4827 name specified is not recognized, @i{Amd} will default to @samp{LOG_DAEMON}.
4828 Note: while you can use any syslog facility available on your system, it
4829 is generally a bad idea to use those reserved for other services such as
4830 @samp{kern}, @samp{lpr}, @samp{cron}, etc.
4831
4832 @c ----------------------------------------------------------------
4833 @node log_options Parameter, map_reload_interval Parameter, log_file Parameter, Global Parameters
4834 @comment  node-name,  next,  previous,  up
4835 @subsection @t{log_options} Parameter
4836 @cindex log_options Parameter
4837
4838 (type=string, default=``defaults'').  Same as the @code{-x}
4839 option to @i{Amd}.  Specify any logging options for @i{Amd}.  Options
4840 are comma delimited, and can be preceded by the string @samp{no} to
4841 negate their meaning.  The @samp{debug} logging option is only available
4842 if am-utils was configured with @code{--enable-debug}.  You can get the
4843 list of supported debugging options by running @code{amd -H}.  Possible
4844 values are:
4845
4846 @table @samp
4847 @item all
4848 all messages
4849 @item defaults
4850 an alias for "fatal,error,user,warning,info"
4851 @item debug
4852 debug messages
4853 @item error
4854 non-fatal system errors (cannot be turned off)
4855 @item fatal
4856 fatal errors (cannot be turned off)
4857 @item info
4858 information
4859 @item map
4860 map errors
4861 @item stats
4862 additional statistical information
4863 @item user
4864 non-fatal user errors
4865 @item warn
4866 warnings
4867 @item warning
4868 warnings
4869 @end table
4870
4871 @c ----------------------------------------------------------------
4872 @node map_reload_interval Parameter, nfs_allow_any_interface Parameter, log_options Parameter, Global Parameters
4873 @comment  node-name,  next,  previous,  up
4874 @subsection @t{map_reload_interval} Parameter
4875 @cindex map_reload_interval Parameter
4876
4877 (type=numeric, default=3600).  The number of seconds that @i{Amd} will
4878 wait before it checks to see if any maps have changed at their source
4879 (NIS servers, LDAP servers, files, etc.).  @i{Amd} will reload only
4880 those maps that have changed.
4881
4882 @c ----------------------------------------------------------------
4883 @node nfs_allow_any_interface Parameter, nfs_allow_insecure_port Parameter, map_reload_interval Parameter, Global Parameters
4884 @comment  node-name,  next,  previous,  up
4885 @subsection @t{nfs_allow_any_interface} Parameter
4886 @cindex nfs_allow_any_interface Parameter
4887
4888 (type=string, default=@samp{no}).  Normally @i{Amd} accepts local NFS
4889 packets only from 127.0.0.1.  If this parameter is set to @samp{yes},
4890 then @i{amd} will accept local NFS packets from any local interface;
4891 this is useful on hosts that may have multiple interfaces where the
4892 system is forced to send all outgoing packets (even those bound to the
4893 same host) via an address other than 127.0.0.1.
4894
4895 @c ----------------------------------------------------------------
4896 @node nfs_allow_insecure_port Parameter, nfs_proto Parameter, nfs_allow_any_interface Parameter, Global Parameters
4897 @comment  node-name,  next,  previous,  up
4898 @subsection @t{nfs_allow_insecure_port} Parameter
4899 @cindex nfs_allow_insecure_port Parameter
4900
4901 (type=string, default=@samp{no}).  Normally @i{Amd} will refuse requests
4902 coming from unprivileged ports (i.e., ports >= 1024 on Unix systems),
4903 so that only privileged users and the kernel can send NFS requests to
4904 it.  However, some kernels (certain versions of Darwin, MacOS X, and
4905 Linux) have bugs that cause them to use unprivileged ports in certain
4906 situations, which causes @i{Amd} to stop dead in its tracks.  This
4907 parameter allows @i{Amd} to operate normally even on such systems, at the
4908 expense of a slight decrease in the security of its operations.  If
4909 you see messages like ``ignoring request from foo:1234, port not
4910 reserved'' in your @i{Amd} log, try enabling this parameter and give it
4911 another go.
4912
4913 @c ----------------------------------------------------------------
4914 @node nfs_proto Parameter, nfs_retransmit_counter Parameter, nfs_allow_insecure_port Parameter, Global Parameters
4915 @comment  node-name,  next,  previous,  up
4916 @subsection @t{nfs_proto} Parameter
4917 @cindex nfs_proto Parameter
4918
4919 (type=string, default to trying version tcp then udp).  By default,
4920 @i{Amd} tries @code{tcp} and then @code{udp}.  This option forces the
4921 overall NFS protocol used to TCP or UDP.  It overrides what is in the
4922 @i{Amd} maps, and is useful when @i{Amd} is compiled with TCP support
4923 in NFSv2/NFSv3 that may not be stable.  With this option you can turn
4924 off the complete usage of TCP for NFS dynamically (without having to
4925 recompile @i{Amd}), and use UDP only, until such time as TCP support
4926 is desired again.
4927
4928 @c ----------------------------------------------------------------
4929 @node nfs_retransmit_counter Parameter, nfs_retransmit_counter_udp Parameter, nfs_proto Parameter, Global Parameters
4930 @comment  node-name,  next,  previous,  up
4931 @subsection @t{nfs_retransmit_counter} Parameter
4932 @cindex nfs_retransmit_counter Parameter
4933
4934 (type=numeric, default=11).  Same as the @i{retransmit} part of the
4935 @code{-t} @i{timeout.retransmit} option to @i{Amd}.  Specifies the
4936 number of NFS retransmissions that the kernel will use to communicate
4937 with @i{Amd} using either UDP or TCP mounts.  @xref{-t Option}.
4938
4939 @c ----------------------------------------------------------------
4940 @node nfs_retransmit_counter_udp Parameter, nfs_retransmit_counter_tcp Parameter, nfs_retransmit_counter Parameter, Global Parameters
4941 @comment  node-name,  next,  previous,  up
4942 @subsection @t{nfs_retransmit_counter_udp} Parameter
4943 @cindex nfs_retransmit_counter_udp Parameter
4944 @cindex nfs_retransmit_counter Parameter
4945 @cindex UDP
4946
4947 (type=numeric, default=11).  Same as the @i{nfs_retransmit_counter}
4948 parameter, but applied globally only to UDP mounts.
4949 @xref{nfs_retransmit_counter Parameter}.
4950
4951 @c ----------------------------------------------------------------
4952 @node nfs_retransmit_counter_tcp Parameter, nfs_retransmit_counter_toplvl Parameter, nfs_retransmit_counter_udp Parameter, Global Parameters
4953 @comment  node-name,  next,  previous,  up
4954 @subsection @t{nfs_retransmit_counter_tcp} Parameter
4955 @cindex nfs_retransmit_counter_tcp Parameter
4956 @cindex nfs_retransmit_counter Parameter
4957 @cindex TCP
4958
4959 (type=numeric, default=11).  Same as the @i{nfs_retransmit_counter}
4960 parameter, but applied globally only to TCP mounts.
4961 @xref{nfs_retransmit_counter Parameter}.
4962
4963 @c ----------------------------------------------------------------
4964 @node nfs_retransmit_counter_toplvl Parameter, nfs_retry_interval Parameter, nfs_retransmit_counter_tcp Parameter, Global Parameters
4965 @comment  node-name,  next,  previous,  up
4966 @subsection @t{nfs_retransmit_counter_toplvl} Parameter
4967 @cindex nfs_retransmit_counter_toplvl Parameter
4968 @cindex nfs_retransmit_counter Parameter
4969 @cindex UDP
4970
4971 (type=numeric, default=11).  Same as the @i{nfs_retransmit_counter}
4972 parameter, applied only for @i{Amd}'s top-level UDP mounts.  On some
4973 systems it is useful to set this differently than the OS default, so
4974 as to better tune @i{Amd}'s responsiveness under heavy scheduler
4975 loads.  @xref{nfs_retransmit_counter Parameter}.
4976
4977 @c ----------------------------------------------------------------
4978 @node nfs_retry_interval Parameter, nfs_retry_interval_udp Parameter, nfs_retransmit_counter_toplvl Parameter, Global Parameters
4979 @comment  node-name,  next,  previous,  up
4980 @subsection @t{nfs_retry_interval} Parameter
4981 @cindex nfs_retry_interval Parameter
4982
4983 (type=numeric, default=8).  Same as the @i{timeout} part of the
4984 @code{-t} @i{timeout.retransmit} option to @i{Amd}.  Specifies the NFS
4985 timeout interval, in @emph{tenths} of seconds, between NFS/RPC retries
4986 (for UDP or TCP).  This is the value that the kernel will use to
4987 communicate with @i{Amd}.  @xref{-t Option}.
4988
4989 @i{Amd} relies on the kernel RPC retransmit mechanism to trigger mount
4990 retries.  The values of the @i{nfs_retransmit_counter} and the
4991 @i{nfs_retry_interval} parameters change the overall retry interval.
4992 Too long an interval gives poor interactive response; too short an
4993 interval causes excessive retries.
4994
4995 @c ----------------------------------------------------------------
4996 @node nfs_retry_interval_udp Parameter, nfs_retry_interval_tcp Parameter, nfs_retry_interval Parameter, Global Parameters
4997 @comment  node-name,  next,  previous,  up
4998 @subsection @t{nfs_retry_interval_udp} Parameter
4999 @cindex nfs_retry_interval_udp Parameter
5000 @cindex nfs_retry_interval Parameter
5001 @cindex UDP
5002
5003 (type=numeric, default=8).  Same as the @i{nfs_retry_interval}
5004 parameter, but applied globally only to UDP mounts.
5005 @xref{nfs_retry_interval Parameter}.
5006
5007 @c ----------------------------------------------------------------
5008 @node nfs_retry_interval_tcp Parameter, nfs_retry_interval_toplvl Parameter, nfs_retry_interval_udp Parameter, Global Parameters
5009 @comment  node-name,  next,  previous,  up
5010 @subsection @t{nfs_retry_interval_tcp} Parameter
5011 @cindex nfs_retry_interval_tcp Parameter
5012 @cindex nfs_retry_interval Parameter
5013 @cindex TCP
5014
5015 (type=numeric, default=8).  Same as the @i{nfs_retry_interval}
5016 parameter, but applied globally only to TCP mounts.
5017 @xref{nfs_retry_interval Parameter}.
5018
5019 @c ----------------------------------------------------------------
5020 @node nfs_retry_interval_toplvl Parameter, nfs_vers Parameter, nfs_retry_interval_tcp Parameter, Global Parameters
5021 @comment  node-name,  next,  previous,  up
5022 @subsection @t{nfs_retry_interval_toplvl} Parameter
5023 @cindex nfs_retry_interval_toplvl Parameter
5024 @cindex nfs_retry_interval Parameter
5025 @cindex UDP
5026
5027 (type=numeric, default=8).  Same as the @i{nfs_retry_interval}
5028 parameter, applied only for @i{Amd}'s top-level UDP mounts.  On some
5029 systems it is useful to set this differently than the OS default, so
5030 as to better tune @i{Amd}'s responsiveness under heavy scheduler
5031 loads.  @xref{nfs_retry_interval Parameter}.
5032
5033 @c ----------------------------------------------------------------
5034 @node nfs_vers Parameter, nis_domain Parameter, nfs_retry_interval_toplvl Parameter, Global Parameters
5035 @comment  node-name,  next,  previous,  up
5036 @subsection @t{nfs_vers} Parameter
5037 @cindex nfs_vers Parameter
5038
5039 (type=numeric, default to trying version 3 then 2).  By default,
5040 @i{Amd} tries version 3 and then version 2.  This option forces the
5041 overall NFS protocol used to version 3 or 2.  It overrides what is in
5042 the @i{Amd} maps, and is useful when @i{Amd} is compiled with NFSv3
5043 support that may not be stable.  With this option you can turn off the
5044 complete usage of NFSv3 dynamically (without having to recompile
5045 @i{Amd}), and use NFSv2 only, until such time as NFSv3 support is
5046 desired again.
5047
5048 @c ----------------------------------------------------------------
5049 @node nis_domain Parameter, normalize_hostnames Parameter, nfs_vers Parameter, Global Parameters
5050 @comment  node-name,  next,  previous,  up
5051 @subsection @t{nis_domain} Parameter
5052 @cindex nis_domain Parameter
5053
5054 (type=string, default to local NIS domain name).  Same as the
5055 @code{-y} option to @i{Amd}.  Specify an alternative NIS domain from
5056 which to fetch the NIS maps.  The default is the system domain name.
5057 This option is ignored if NIS support is not available.
5058
5059 @c ----------------------------------------------------------------
5060 @node normalize_hostnames Parameter, normalize_slashes Parameter, nis_domain Parameter, Global Parameters
5061 @comment  node-name,  next,  previous,  up
5062 @subsection @t{normalize_hostnames} Parameter
5063 @cindex normalize_hostnames Parameter
5064
5065 (type=boolean, default=@samp{no}).  Same as the @code{-n} option to @i{Amd}.
5066 If @samp{yes}, then the name referred to by @code{$@{rhost@}} is normalized
5067 relative to the host database before being used.  The effect is to
5068 translate aliases into ``official'' names.
5069
5070 @c ----------------------------------------------------------------
5071 @node normalize_slashes Parameter, os Parameter, normalize_hostnames Parameter, Global Parameters
5072 @comment  node-name,  next,  previous,  up
5073 @subsection @t{normalize_slashes} Parameter
5074 @cindex normalize_slashes Parameter
5075
5076 (type=boolean, default=@samp{yes}).  If @samp{yes} then amd will
5077 condense all multiple @code{/} (slash) characters into one and remove
5078 all trailing slashes.  If @samp{no}, then amd will not touch strings
5079 that may contain repeated or trailing slashes.  The latter is
5080 sometimes useful with SMB mounts, which often require multiple slash
5081 characters in pathnames.
5082
5083 @c ----------------------------------------------------------------
5084 @node os Parameter, osver Parameter, normalize_slashes Parameter, Global Parameters
5085 @comment  node-name,  next,  previous,  up
5086 @subsection @t{os} Parameter
5087 @cindex os Parameter
5088
5089 (type=string, default to compiled in value).  Same as the @code{-O}
5090 option to @i{Amd}.  Allows you to override the compiled-in name of the
5091 operating system.  Useful when the built-in name is not desired for
5092 backward compatibility reasons.  For example, if the built-in name is
5093 @samp{sunos5}, you can override it to @samp{sos5}, and use older maps
5094 which were written with the latter in mind.
5095
5096
5097 @c ----------------------------------------------------------------
5098 @node osver Parameter, pid_file Parameter, os Parameter, Global Parameters
5099 @comment  node-name,  next,  previous,  up
5100 @subsection @t{osver} Parameter
5101 @cindex osver Parameter
5102
5103 (type=string, default to compiled in value).  Same as the @code{-o}
5104 option to @i{Amd}.  Allows you to override the compiled-in version
5105 number of the operating system.  Useful when the built-in version is not
5106 desired for backward compatibility reasons.  For example, if the build
5107 in version is @samp{2.5.1}, you can override it to @samp{5.5.1}, and use
5108 older maps that were written with the latter in mind.
5109
5110 @c ----------------------------------------------------------------
5111 @node pid_file Parameter, plock Parameter, osver Parameter, Global Parameters
5112 @comment  node-name,  next,  previous,  up
5113 @subsection @t{pid_file} Parameter
5114 @cindex pid_file Parameter
5115
5116 (type=string, default=@samp{/dev/stdout}).  Specify a file to store the process
5117 ID of the running daemon into.  If not specified, @i{Amd} will print its
5118 process id onto the standard output.  Useful for killing @i{Amd} after
5119 it had run.  Note that the PID of a running @i{Amd} can also be
5120 retrieved via @i{Amq} (@pxref{Amq -p option}).
5121
5122 This file is used only if the @samp{print_pid} option is on
5123 (@pxref{print_pid Parameter}).
5124
5125 @c ----------------------------------------------------------------
5126 @node plock Parameter, portmap_program Parameter, pid_file Parameter, Global Parameters
5127 @comment  node-name,  next,  previous,  up
5128 @subsection @t{plock} Parameter
5129 @cindex plock Parameter
5130
5131 (type=boolean, default=@samp{yes}).  Same as the @code{-S} option to @i{Amd}.
5132 If @samp{yes}, lock the running executable pages of @i{Amd} into memory.
5133 To improve @i{Amd}'s performance, systems that support the @b{plock}(3)
5134 or @b{mlockall}(2)
5135 call can lock the @i{Amd} process into memory.  This way there is less
5136 chance the operating system will schedule, page out, and swap the
5137 @i{Amd} process as needed.  This improves @i{Amd}'s performance, at the
5138 cost of reserving the memory used by the @i{Amd} process (making it
5139 unavailable for other processes).
5140
5141 @c ----------------------------------------------------------------
5142 @node portmap_program Parameter, preferred_amq_port Parameter, plock Parameter, Global Parameters
5143 @comment  node-name,  next,  previous,  up
5144 @subsection @t{portmap_program} Parameter
5145 @cindex portmap_program Parameter
5146
5147 (type=numeric, default=300019).  Specify an alternate Port-mapper RPC
5148 program number, other than the official number.  This is useful when
5149 running multiple @i{Amd} processes.  For example, you can run another
5150 @i{Amd} in ``test'' mode, without affecting the primary @i{Amd} process
5151 in any way.  For safety reasons, the alternate program numbers that can
5152 be specified must be in the range 300019-300029, inclusive.  @i{Amq} has
5153 an option @code{-P} which can be used to specify an alternate program
5154 number of an @i{Amd} to contact.  In this way, amq can fully control any
5155 number of @i{Amd} processes running on the same host.
5156
5157 @c ----------------------------------------------------------------
5158 @node preferred_amq_port Parameter, print_pid Parameter, portmap_program Parameter, Global Parameters
5159 @comment  node-name,  next,  previous,  up
5160 @subsection @t{preferred_amq_port} Parameter
5161 @cindex preferred_amq_port Parameter
5162
5163 (type=numeric, default=0).  Specify an alternate Port-mapper RPC port
5164 number for @i{Amd}'s @i{Amq} service.  This is used for both UDP and
5165 TCP.  Setting this value to 0 (or not defining it) will cause @i{Amd}
5166 to select an arbitrary port number.  Setting the @i{Amq} RPC service
5167 port to a specific number is useful in firewalled or NAT'ed
5168 environments, where you need to know which port @i{Amd} will listen
5169 on.
5170
5171 @c ----------------------------------------------------------------
5172 @node print_pid Parameter, print_version Parameter, preferred_amq_port Parameter, Global Parameters
5173 @comment  node-name,  next,  previous,  up
5174 @subsection @t{print_pid} Parameter
5175 @cindex print_pid Parameter
5176
5177 (type=boolean, default=@samp{no}).  Same as the @code{-p} option to @i{Amd}.
5178 If @samp{yes}, @i{Amd} will print its process ID upon starting.
5179
5180 @c ----------------------------------------------------------------
5181 @node print_version Parameter, restart_mounts Parameter, print_pid Parameter, Global Parameters
5182 @comment  node-name,  next,  previous,  up
5183 @subsection @t{print_version} Parameter
5184 @cindex print_version Parameter
5185
5186 (type=boolean, default=@samp{no}).  Same as the @code{-v} option to @i{Amd},
5187 but the version prints and @i{Amd} continues to run.  If @samp{yes}, @i{Amd}
5188 will print its version information string, which includes some
5189 configuration and compilation values.
5190
5191 @c ----------------------------------------------------------------
5192 @node restart_mounts Parameter, show_statfs_entries Parameter, print_version Parameter, Global Parameters
5193 @comment  node-name,  next,  previous,  up
5194 @subsection @t{restart_mounts} Parameter
5195 @cindex restart_mounts Parameter
5196
5197 (type=boolean, default=@samp{no}).  Same as the @code{-r} option to @i{Amd}.
5198 If @samp{yes} @i{Amd} will scan the mount table to determine which file
5199 systems are currently mounted.  Whenever one of these would have been
5200 auto-mounted, @i{Amd} inherits it.
5201
5202 @c ----------------------------------------------------------------
5203 @node show_statfs_entries Parameter, truncate_log Parameter, restart_mounts Parameter, Global Parameters
5204 @comment  node-name,  next,  previous,  up
5205 @subsection @t{show_statfs_entries} Parameter
5206 @cindex show_statfs_entries Parameter
5207
5208 (type=boolean), default=@samp{no}).  If @samp{yes}, then all maps which are
5209 browsable will also show the number of entries (keys) they have when
5210 @b{df}(1) runs. (This is accomplished by returning non-zero values to
5211 the @b{statfs}(2) system call).
5212
5213 @c ----------------------------------------------------------------
5214 @node truncate_log Parameter, unmount_on_exit Parameter, show_statfs_entries Parameter, Global Parameters
5215 @comment  node-name,  next,  previous,  up
5216 @subsection @t{truncate_log} Parameter
5217 @cindex truncate_log Parameter
5218
5219 (type=boolean), default=@samp{no}).  If @samp{yes}, then @i{Amd} will
5220 truncate the log file (if it's a regular file) on startup.  This could
5221 be useful when conducting extensive testing on @i{Amd} maps (or
5222 @i{Amd} itself) and you don't want to see log data from a previous run
5223 in the same file.
5224
5225 @c ----------------------------------------------------------------
5226 @node unmount_on_exit Parameter, use_tcpwrappers Parameter, truncate_log Parameter, Global Parameters
5227 @comment  node-name,  next,  previous,  up
5228 @subsection @t{unmount_on_exit} Parameter
5229 @cindex unmount_on_exit Parameter
5230
5231 (type=boolean, default=@samp{no}).  If @samp{yes}, then @i{Amd} will attempt
5232 to unmount all file systems which it knows about.  Normally it leaves
5233 all (esp. NFS) mounted file systems intact.  Note that @i{Amd} does not
5234 know about file systems mounted before it starts up, unless the
5235 @samp{restart_mounts} option is used (@pxref{restart_mounts Parameter}).
5236
5237 @c ----------------------------------------------------------------
5238 @node use_tcpwrappers Parameter, vendor Parameter, unmount_on_exit Parameter, Global Parameters
5239 @comment  node-name,  next,  previous,  up
5240 @subsection @t{use_tcpwrappers} Parameter
5241 @cindex use_tcpwrappers Parameter
5242
5243 (type=boolean), default=@samp{yes}).  If @samp{yes}, then amd will use
5244 the tcpwrappers (tcpd/librwap) library (if available) to control
5245 access to @i{Amd} via the @code{/etc/hosts.allow} and
5246 @code{/etc/hosts.deny} files.  @i{Amd} will verify that the host
5247 running @i{Amq} is authorized to connect.  The @code{amd} service name
5248 must used in the @code{/etc/hosts.allow} and @code{/etc/hosts.deny}
5249 files.  For example, to allow only localhost to connect to @i{Amd},
5250 add this line to @code{/etc/hosts.allow}:
5251
5252 @example
5253 amd: localhost
5254 @end example
5255
5256 and this line to @code{/etc/hosts.deny}:
5257
5258 @example
5259 amd: ALL
5260 @end example
5261
5262 Consult the man pages for @b{hosts_access}(5) for more information on using
5263 the tcpwrappers access-control library.
5264
5265 Note that in particular, you should not configure your @code{hosts.allow}
5266 file to spawn a command for @i{Amd}: that will cause @i{Amd} to not be able
5267 to @code{waitpid} on the child process ID of any background un/mount that
5268 @i{Amd} issued, resulting in a confused @i{Amd} that does not know what
5269 happened to those background un/mount requests.
5270
5271 @c ----------------------------------------------------------------
5272 @node vendor Parameter, , use_tcpwrappers Parameter, Global Parameters
5273 @comment  node-name,  next,  previous,  up
5274 @subsection @t{vendor} Parameter
5275 @cindex vendor Parameter
5276
5277 (type=string, default to compiled in value).  The name of the vendor of
5278 the operating system.  Overrides the compiled-in vendor name.  Useful
5279 when the compiled-in name is not desired.  For example, most Intel based
5280 systems set the vendor name to @samp{unknown}, but you can set it to
5281 @samp{redhat}.
5282
5283 @c ================================================================
5284 @node Regular Map Parameters, amd.conf Examples, Global Parameters, Amd Configuration File
5285 @comment  node-name,  next,  previous,  up
5286 @section Regular Map Parameters
5287 @cindex amd.conf regular map parameters
5288
5289 The following parameters are applicable only to regular map sections.
5290
5291 @menu
5292 * map_name Parameter::
5293 * tag Parameter::
5294 @end menu
5295
5296 @c ----------------------------------------------------------------
5297 @node map_name Parameter, tag Parameter, Regular Map Parameters, Regular Map Parameters
5298 @comment  node-name,  next,  previous,  up
5299 @subsection map_name Parameter
5300 @cindex map_name Parameter
5301
5302 (type=string, must be specified).  Name of the map where the keys are
5303 located.
5304
5305 @c ----------------------------------------------------------------
5306 @node tag Parameter, , map_name Parameter, Regular Map Parameters
5307 @comment  node-name,  next,  previous,  up
5308 @subsection tag Parameter
5309 @cindex tag Parameter
5310
5311 (type=string, default no tag).  Each map entry in the configuration file
5312 can be tagged.  If no tag is specified, that map section will always be
5313 processed by @i{Amd}.  If it is specified, then @i{Amd} will process the map
5314 if the @code{-T} option was given to @i{Amd}, and the value given to that
5315 command-line option matches that in the map section.
5316
5317 @c ================================================================
5318 @node amd.conf Examples, , Regular Map Parameters, Amd Configuration File
5319 @comment  node-name,  next,  previous,  up
5320 @section amd.conf Examples
5321 @cindex amd.conf examples
5322
5323 The following is the actual @code{amd.conf} file I used at the
5324 Computer Science Department of Columbia University.
5325
5326 @example
5327 # GLOBAL OPTIONS SECTION
5328 [ global ]
5329 normalize_hostnames =    no
5330 print_pid =              no
5331 #pid_file =              /var/run/amd.pid
5332 restart_mounts =         yes
5333 #unmount_on_exit =       yes
5334 auto_dir =               /n
5335 log_file =               /var/log/amd
5336 log_options =            all
5337 #debug_options =         defaults
5338 plock =                  no
5339 selectors_in_defaults =  yes
5340 # config.guess picks up "sunos5" and I don't want to edit my maps yet
5341 os =                     sos5
5342 # if you print_version after setting up "os", it will show it.
5343 print_version =          no
5344 map_type =               file
5345 search_path =            /etc/amdmaps:/usr/lib/amd:/usr/local/AMD/lib
5346 browsable_dirs =         yes
5347 fully_qualified_hosts =  no
5348
5349 # DEFINE AN AMD MOUNT POINT
5350 [ /u ]
5351 map_name =               amd.u
5352
5353 [ /proj ]
5354 map_name =               amd.proj
5355
5356 [ /src ]
5357 map_name =               amd.src
5358
5359 [ /misc ]
5360 map_name =               amd.misc
5361
5362 [ /import ]
5363 map_name =               amd.import
5364
5365 [ /tftpboot/.amd ]
5366 tag =                    tftpboot
5367 map_name =               amd.tftpboot
5368 @end example
5369
5370 @c ################################################################
5371 @node Run-time Administration, FSinfo, Amd Configuration File, Top
5372 @comment  node-name,  next,  previous,  up
5373 @chapter Run-time Administration
5374 @cindex Run-time administration
5375 @cindex Amq command
5376
5377 @menu
5378 * Starting Amd::
5379 * Stopping Amd::
5380 * Restarting Amd::
5381 * Controlling Amd::
5382 @end menu
5383
5384 @node Starting Amd, Stopping Amd, Run-time Administration, Run-time Administration
5385 @comment  node-name,  next,  previous,  up
5386 @section Starting @i{Amd}
5387 @cindex Starting Amd
5388 @cindex Additions to /etc/rc.local
5389 @cindex /etc/rc.local additions
5390 @cindex ctl-amd
5391
5392 @i{Amd} is best started from @samp{/etc/rc.local} on BSD systems, or
5393 from the appropriate start-level script in @samp{/etc/init.d} on System V
5394 systems.
5395
5396 @example
5397 if [ -f /usr/local/sbin/ctl-amd ]; then
5398     /usr/local/sbin/ctl-amd start; (echo -n ' amd') > /dev/console
5399 fi
5400 @end example
5401
5402 @noindent
5403 The shell script, @samp{ctl-amd} is used to start, stop, or restart
5404 @i{Amd}.  It is a relatively generic script.  All options you want to
5405 set should not be made in this script, but rather updated in the
5406 @file{amd.conf} file. @xref{Amd Configuration File}.
5407
5408 If you do not wish to use an @i{Amd} configuration file, you may start
5409 @i{Amd} manually.  For example, getting the map entries via NIS:
5410
5411 @example
5412 amd -r -l /var/log/amd `ypcat -k auto.master`
5413 @end example
5414
5415 @node Stopping Amd, Restarting Amd, Starting Amd, Run-time Administration
5416 @comment  node-name,  next,  previous,  up
5417 @section Stopping @i{Amd}
5418 @cindex Stopping Amd
5419 @cindex SIGTERM signal
5420 @cindex SIGINT signal
5421
5422 @i{Amd} stops in response to two signals.
5423
5424 @table @samp
5425 @item SIGTERM
5426 causes the top-level automount points to be unmounted and then @i{Amd}
5427 to exit.  Any automounted filesystems are left mounted.  They can be
5428 recovered by restarting @i{Amd} with the @code{-r} command line option.@refill
5429
5430 @item SIGINT
5431 causes @i{Amd} to attempt to unmount any filesystems which it has
5432 automounted, in addition to the actions of @samp{SIGTERM}.  This signal
5433 is primarily used for debugging.@refill
5434 @end table
5435
5436 Actions taken for other signals are undefined.
5437
5438 The easiest and safest way to stop @i{Amd}, without having to find its
5439 process ID by hand, is to use the @file{ctl-amd} script, as with:
5440
5441 @example
5442 ctl-amd stop
5443 @end example
5444
5445 @node Restarting Amd, Controlling Amd, Stopping Amd, Run-time Administration
5446 @comment  node-name,  next,  previous,  up
5447 @section Restarting @i{Amd}
5448 @cindex Restarting Amd
5449 @cindex Killing and starting Amd
5450
5451 Before @i{Amd} can be started, it is vital to ensure that no other
5452 @i{Amd} processes are managing any of the mount points, and that the
5453 previous process(es) have terminated cleanly.  When a terminating signal
5454 is set to @i{Amd}, the automounter does @emph{not} terminate right then.
5455 Rather, it starts by unmounting all of its managed mount mounts in the
5456 background, and then terminates.  It usually takes a few seconds for
5457 this process to happen, but it can take an arbitrarily longer time.  If
5458 two or more @i{Amd} processes attempt to manage the same mount point, it
5459 usually will result in a system lockup.
5460
5461 The easiest and safest way to restart @i{Amd}, without having to find
5462 its process ID by hand, sending it the @samp{SIGTERM} signal, waiting for @i{Amd}
5463 to die cleanly, and verifying so, is to use the @file{ctl-amd} script,
5464 as with:
5465
5466 @example
5467 ctl-amd restart
5468 @end example
5469
5470 The script will locate the process ID of @i{Amd}, kill it, and wait for
5471 it to die cleanly before starting a new instance of the automounter.
5472 @file{ctl-amd} will wait for a total of 30 seconds for @i{Amd} to die,
5473 and will check once every 5 seconds if it had.
5474
5475 @node Controlling Amd, , Restarting Amd, Run-time Administration
5476 @comment  node-name,  next,  previous,  up
5477 @section Controlling @i{Amd}
5478 @cindex Controlling Amd
5479 @cindex Discovering what is going on at run-time
5480 @cindex Listing currently mounted filesystems
5481
5482 It is sometimes desirable or necessary to exercise external control
5483 over some of @i{Amd}'s internal state.  To support this requirement,
5484 @i{Amd} implements an RPC interface which is used by the @dfn{Amq} program.
5485 A variety of information is available.
5486
5487 @i{Amq} generally applies an operation, specified by a single letter option,
5488 to a list of mount points.  The default operation is to obtain statistics
5489 about each mount point.  This is similar to the output shown above
5490 but includes information about the number and type of accesses to each
5491 mount point.
5492
5493 @menu
5494 * Amq default::       Default command behavior.
5495 * Amq -f option::     Flushing the map cache.
5496 * Amq -h option::     Controlling a non-local host.
5497 * Amq -H option::     Print help message.
5498 * Amq -l option::     Controlling the log file.
5499 * Amq -m option::     Obtaining mount statistics.
5500 * Amq -p option::     Getting Amd's process ID.
5501 * Amq -P option::     Contacting alternate Amd processes.
5502 * Amq -q option::     Suppress synchronous unmounting errors.
5503 * Amq -s option::     Obtaining global statistics.
5504 * Amq -T option::     Use TCP transport.
5505 * Amq -U option::     Use UDP transport.
5506 * Amq -u option::     Forcing volumes to time out.
5507 * Amq -v option::     Version information.
5508 * Amq -w option::     Print Amd current working directory.
5509 * Other Amq options:: Three other special options.
5510 @end menu
5511
5512 @c ----------------------------------------------------------------
5513 @node Amq default, Amq -f option, Controlling Amd, Controlling Amd
5514 @comment  node-name,  next,  previous,  up
5515 @subsection @i{Amq} default information
5516
5517 With no arguments, @dfn{Amq} obtains a brief list of all existing
5518 mounts created by @i{Amd}.  This is different from the list displayed by
5519 @b{df}(1) since the latter only includes system mount points.
5520
5521 @noindent
5522 The output from this option includes the following information:
5523
5524 @itemize @bullet
5525 @item
5526 the automount point,
5527 @item
5528 the filesystem type,
5529 @item
5530 the mount map or mount information,
5531 @item
5532 the internal, or system mount point.
5533 @end itemize
5534
5535 @noindent
5536 For example:
5537
5538 @example
5539 /            root   "root"                    sky:(pid75)
5540 /homes       toplvl /usr/local/etc/amd.homes  /homes
5541 /home        toplvl /usr/local/etc/amd.home   /home
5542 /homes/jsp   nfs    charm:/home/charm         /a/charm/home/charm/jsp
5543 /homes/phjk  nfs    toytown:/home/toytown     /a/toytown/home/toytown/ai/phjk
5544 @end example
5545
5546 @noindent
5547 If an argument is given then statistics for that volume name will
5548 be output.  For example:
5549
5550 @example
5551 What         Uid   Getattr Lookup RdDir   RdLnk   Statfs Mounted@@
5552 /homes       0     1196    512    22      0       30     90/09/14 12:32:55
5553 /homes/jsp   0     0       0      0       1180    0      90/10/13 12:56:58
5554 @end example
5555
5556 @table @code
5557 @item What
5558 the volume name.
5559
5560 @item Uid
5561 ignored.
5562
5563 @item Getattr
5564 the count of NFS @dfn{getattr} requests on this node.  This should only be
5565 non-zero for directory nodes.
5566
5567 @item Lookup
5568 the count of NFS @dfn{lookup} requests on this node.  This should only be
5569 non-zero for directory nodes.
5570
5571 @item RdDir
5572 the count of NFS @dfn{readdir} requests on this node.  This should only
5573 be non-zero for directory nodes.
5574
5575 @item RdLnk
5576 the count of NFS @dfn{readlink} requests on this node.  This should be
5577 zero for directory nodes.
5578
5579 @item Statfs
5580 the count of NFS @dfn{statfs} requests on this node.  This should only
5581 be non-zero for top-level automount points.
5582
5583 @item Mounted@@
5584 the date and time the volume name was first referenced.
5585 @end table
5586
5587 @c ----------------------------------------------------------------
5588 @node Amq -f option, Amq -h option, Amq default, Controlling Amd
5589 @comment  node-name,  next,  previous,  up
5590 @subsection @i{Amq} @code{-f} option
5591 @cindex Flushing the map cache
5592 @cindex Map cache, flushing
5593
5594 The @code{-f} option causes @i{Amd} to flush the internal mount map cache.
5595 This is useful for example in Hesiod maps since @i{Amd} will not
5596 automatically notice when they have been updated.  The map cache can
5597 also be synchronized with the map source by using the @samp{sync} option
5598 (@pxref{Automount Filesystem}).@refill
5599
5600 @c ----------------------------------------------------------------
5601 @node Amq -h option, Amq -H option, Amq -f option, Controlling Amd
5602 @comment  node-name,  next,  previous,  up
5603 @subsection @i{Amq} @code{-h} option
5604 @cindex Querying an alternate host
5605
5606 By default the local host is used.  In an HP-UX cluster the root server
5607 is used since that is the only place in the cluster where @i{Amd} will
5608 be running.  To query @i{Amd} on another host the @code{-h} option should
5609 be used.
5610
5611 @c ----------------------------------------------------------------
5612 @node Amq -H option, Amq -l option, Amq -h option, Controlling Amd
5613 @comment  node-name,  next,  previous,  up
5614 @subsection @i{Amq} @code{-H} option
5615 @cindex Displaying brief help
5616 @cindex Help; showing from Amq
5617
5618 Print a brief help and usage string.
5619
5620 @c ----------------------------------------------------------------
5621 @node Amq -l option, Amq -m option, Amq -H option, Controlling Amd
5622 @comment  node-name,  next,  previous,  up
5623 @subsection @i{Amq} @code{-l} option
5624 @cindex Resetting the Amd log file
5625 @cindex Setting the Amd log file via Amq
5626 @cindex Log file, resetting
5627
5628 Tell @i{Amd} to use @i{log_file} as the log file name.  For security
5629 reasons, this @emph{must} be the same log file which @i{Amd} used when
5630 started.  This option is therefore only useful to refresh @i{Amd}'s open
5631 file handle on the log file, so that it can be rotated and compressed
5632 via daily cron jobs.
5633
5634 @c ----------------------------------------------------------------
5635 @node Amq -m option, Amq -p option, Amq -l option, Controlling Amd
5636 @comment  node-name,  next,  previous,  up
5637 @subsection @i{Amq} @code{-m} option
5638
5639 The @code{-m} option displays similar information about mounted
5640 filesystems, rather than automount points.  The output includes the
5641 following information:
5642
5643 @itemize @bullet
5644 @item
5645 the mount information,
5646 @item
5647 the mount point,
5648 @item
5649 the filesystem type,
5650 @item
5651 the number of references to this filesystem,
5652 @item
5653 the server hostname,
5654 @item
5655 the state of the file server,
5656 @item
5657 any error which has occurred.
5658 @end itemize
5659
5660 For example:
5661
5662 @example
5663 "root"           truth:(pid602)     root   1 localhost is up
5664 hesiod.home      /home              toplvl 1 localhost is up
5665 hesiod.vol       /vol               toplvl 1 localhost is up
5666 hesiod.homes     /homes             toplvl 1 localhost is up
5667 amy:/home/amy    /a/amy/home/amy    nfs    5 amy is up
5668 swan:/home/swan  /a/swan/home/swan  nfs    0 swan is up (Permission denied)
5669 ex:/home/ex      /a/ex/home/ex      nfs    0 ex is down
5670 @end example
5671
5672 When the reference count is zero the filesystem is not mounted but
5673 the mount point and server information is still being maintained
5674 by @i{Amd}.
5675
5676 @c ----------------------------------------------------------------
5677 @ignore
5678 @comment Retained for future consideration: from the description of the
5679 @comment amq -M option removed in amd 6.0.5.
5680
5681 A future release of @i{Amd} will include code to allow the @b{mount}(8)
5682 command to mount automount points:
5683
5684 @example
5685 mount -t amd /vol hesiod.vol
5686 @end example
5687
5688 This will then allow @i{Amd} to be controlled from the standard system
5689 filesystem mount list.
5690
5691 @end ignore
5692
5693 @c ----------------------------------------------------------------
5694 @node Amq -p option, Amq -P option, Amq -m option, Controlling Amd
5695 @comment  node-name,  next,  previous,  up
5696 @subsection @i{Amq} @code{-p} option
5697 @cindex Process ID; Amd
5698 @cindex Amd's process ID
5699 @cindex Amd's PID
5700 @cindex PID; Amd
5701
5702 Return the process ID of the remote or locally running @i{Amd}.  Useful
5703 when you need to send a signal to the local @i{Amd} process, and would
5704 rather not have to search through the process table.  This option is
5705 used in the @file{ctl-amd} script.
5706
5707 @c ----------------------------------------------------------------
5708 @node Amq -P option, Amq -q option, Amq -p option, Controlling Amd
5709 @comment  node-name,  next,  previous,  up
5710 @subsection @i{Amq} @code{-P} option
5711 @cindex Multiple Amd processes
5712 @cindex Running multiple Amd
5713 @cindex Debugging a new Amd configuration
5714 @cindex RPC Program numbers; Amd
5715
5716 Contact an alternate running @i{Amd} that had registered itself on a
5717 different RPC @var{program_number} and apply all other operations to
5718 that instance of the automounter.  This is useful when you run multiple
5719 copies of @i{Amd}, and need to manage each one separately.  If not
5720 specified, @i{Amq} will use the default program number for @i{Amd}, 300019.
5721 For security reasons, the only alternate program numbers @i{Amd} can use
5722 range from 300019 to 300029, inclusive.
5723
5724 For example, to kill an alternate running @i{Amd}:
5725
5726 @example
5727 kill `amq -p -P 300020`
5728 @end example
5729
5730 @c ----------------------------------------------------------------
5731 @node Amq -q option, Amq -s option, Amq -P option, Controlling Amd
5732 @comment  node-name,  next,  previous,  up
5733 @subsection @i{Amq} @code{-q} option
5734 @cindex Unmounting a filesystem
5735
5736 Suppress any error messages produced when a synchronous unmount fails.
5737 See @ref{Amq -u option}.
5738
5739 @c ----------------------------------------------------------------
5740 @node Amq -s option, Amq -T option, Amq -q option, Controlling Amd
5741 @comment  node-name,  next,  previous,  up
5742 @subsection @i{Amq} @code{-s} option
5743 @cindex Global statistics
5744 @cindex Statistics
5745
5746 The @code{-s} option displays global statistics.  If any other options are specified
5747 or any filesystems named then this option is ignored.  For example:
5748
5749 @example
5750 requests  stale     mount     mount     unmount
5751 deferred  fhandles  ok        failed    failed
5752 1054      1         487       290       7017
5753 @end example
5754
5755 @table @samp
5756 @item Deferred requests
5757 are those for which an immediate reply could not be constructed.  For
5758 example, this would happen if a background mount was required.
5759
5760 @item Stale filehandles
5761 counts the number of times the kernel passes a stale filehandle to @i{Amd}.
5762 Large numbers indicate problems.
5763
5764 @item Mount ok
5765 counts the number of automounts which were successful.
5766
5767 @item Mount failed
5768 counts the number of automounts which failed.
5769
5770 @item Unmount failed
5771 counts the number of times a filesystem could not be unmounted.  Very
5772 large numbers here indicate that the time between unmount attempts
5773 should be increased.
5774 @end table
5775
5776 @c ----------------------------------------------------------------
5777 @node Amq -T option, Amq -U option, Amq -s option, Controlling Amd
5778 @comment  node-name,  next,  previous,  up
5779 @subsection @i{Amq} @code{-T} option
5780 @cindex Forcing Amq to use a TCP transport
5781 @cindex TCP; using with Amq
5782
5783 The @code{-T} option causes the @i{Amq} to contact @i{Amd} using the TCP
5784 transport only (connection oriented).  Normally, @i{Amq} will use TCP
5785 first, and if that failed, will try UDP.
5786
5787 @c ----------------------------------------------------------------
5788 @node Amq -U option, Amq -u option, Amq -T option, Controlling Amd
5789 @comment  node-name,  next,  previous,  up
5790 @subsection @i{Amq} @code{-U} option
5791 @cindex Forcing Amq to use a UDP transport
5792 @cindex UDP; using with Amq
5793
5794 The @code{-U} option causes the @i{Amq} to contact @i{Amd} using the UDP
5795 transport only (connectionless).  Normally, @i{Amq} will use TCP first,
5796 and if that failed, will try UDP.
5797
5798 @c ----------------------------------------------------------------
5799 @node Amq -u option, Amq -v option, Amq -U option, Controlling Amd
5800 @comment  node-name,  next,  previous,  up
5801 @subsection @i{Amq} @code{-u} option
5802 @cindex Forcing filesystem to time out
5803 @cindex Unmounting a filesystem
5804
5805 The @code{-u} option causes the time-to-live interval of the named
5806 mount points to be expired, thus causing an unmount attempt.  This is
5807 the only safe way to unmount an automounted filesystem.  If @code{-u}
5808 is repeated, then @i{Amd} will attempt to unmount the filesystem
5809 synchronously.  This makes things like
5810
5811 @example
5812 amq -uu /t/cd0d && eject cd0
5813 @end example
5814
5815 @noindent
5816 work as expected.  Any error messages this might produce can be
5817 suppressed with the @code{-q} option.  See @ref{Amq -q option}.
5818
5819 @c The @code{-H} option informs @i{Amd} that the specified mount point
5820 @c has hung - as if its keepalive timer had expired.
5821
5822 @c ----------------------------------------------------------------
5823 @node Amq -v option, Amq -w option, Amq -u option, Controlling Amd
5824 @comment  node-name,  next,  previous,  up
5825 @subsection @i{Amq} @code{-v} option
5826 @cindex Version information at run-time
5827
5828 The @code{-v} option displays the version of @i{Amd} in a similar way to
5829 @i{Amd}'s @code{-v} option.
5830
5831 @c ----------------------------------------------------------------
5832 @node Amq -w option, Other Amq options, Amq -v option, Controlling Amd
5833 @comment  node-name,  next,  previous,  up
5834 @subsection @i{Amq} @code{-w} option
5835 @cindex Getting real working directory
5836
5837 The @code{-w} option translates a full pathname as returned by
5838 @b{getpwd}(3) into a short @i{Amd} pathname that goes through its mount
5839 points.  This option requires that @i{Amd} is running.
5840
5841 @c ----------------------------------------------------------------
5842 @node Other Amq options, , Amq -w option, Controlling Amd
5843 @comment  node-name,  next,  previous,  up
5844 @subsection Other @i{Amq} options
5845 @cindex Logging options via Amq
5846 @cindex Debugging options via Amq
5847
5848 Two other operations are implemented.  These modify the state of @i{Amd}
5849 as a whole, rather than any particular filesystem.  The @code{-x} and
5850 @code{-D} options have exactly the same effect as @i{Amd}'s corresponding
5851 command line options.
5852
5853 When @i{Amd} receives the @code{-x} flag, it disallows turning off the
5854 @samp{fatal} or @samp{error} flags.  Both are on by default.  They are
5855 mandatory so that @i{Amd} could report important errors, including
5856 errors relating to turning flags on/off.
5857
5858 @c ################################################################
5859 @node FSinfo, Hlfsd, Run-time Administration, Top
5860 @comment  node-name,  next,  previous,  up
5861 @chapter FSinfo
5862 @cindex FSinfo
5863 @cindex Filesystem info package
5864
5865 XXX: this chapter should be reviewed by someone knowledgeable with
5866 fsinfo.
5867
5868 @menu
5869 * FSinfo Overview::                 Introduction to FSinfo.
5870 * Using FSinfo::                    Basic concepts.
5871 * FSinfo Grammar::                  Language syntax, semantics and examples.
5872 * FSinfo host definitions::         Defining a new host.
5873 * FSinfo host attributes::          Definable host attributes.
5874 * FSinfo filesystems::              Defining locally attached filesystems.
5875 * FSinfo static mounts::            Defining additional static mounts.
5876 * FSinfo automount definitions::
5877 * FSinfo Command Line Options::
5878 * FSinfo errors::
5879 @end menu
5880
5881 @node FSinfo Overview, Using FSinfo, FSinfo, FSinfo
5882 @comment  node-name,  next,  previous,  up
5883 @section @i{FSinfo} overview
5884 @cindex FSinfo overview
5885
5886 @i{FSinfo} is a filesystem management tool.  It has been designed to
5887 work with @i{Amd} to help system administrators keep track of the ever
5888 increasing filesystem namespace under their control.
5889
5890 The purpose of @i{FSinfo} is to generate all the important standard
5891 filesystem data files from a single set of input data.  Starting with a
5892 single data source guarantees that all the generated files are
5893 self-consistent.  One of the possible output data formats is a set of
5894 @i{Amd} maps which can be used among the set of hosts described in the
5895 input data.
5896
5897 @i{FSinfo} implements a declarative language.  This language is
5898 specifically designed for describing filesystem namespace and physical
5899 layouts.  The basic declaration defines a mounted filesystem including
5900 its device name, mount point, and all the volumes and access
5901 permissions.  @i{FSinfo} reads this information and builds an internal
5902 map of the entire network of hosts.  Using this map, many different data
5903 formats can be produced including @file{/etc/fstab},
5904 @file{/etc/exports}, @i{Amd} mount maps and
5905 @file{/etc/bootparams}.@refill
5906
5907 @node Using FSinfo, FSinfo Grammar, FSinfo Overview, FSinfo
5908 @comment  node-name,  next,  previous,  up
5909 @section Using @i{FSinfo}
5910 @cindex Using FSinfo
5911
5912 The basic strategy when using @i{FSinfo} is to gather all the
5913 information about all disks on all machines into one set of
5914 declarations.  For each machine being managed, the following data is
5915 required:
5916
5917 @itemize @bullet
5918 @item
5919 Hostname
5920 @item
5921 List of all filesystems and, optionally, their mount points.
5922 @item
5923 Names of volumes stored on each filesystem.
5924 @item
5925 NFS export information for each volume.
5926 @item
5927 The list of static filesystem mounts.
5928 @end itemize
5929
5930 The following information can also be entered into the same
5931 configuration files so that all data can be kept in one place.
5932
5933 @itemize @bullet
5934 @item
5935 List of network interfaces
5936 @item
5937 IP address of each interface
5938 @item
5939 Hardware address of each interface
5940 @item
5941 Dumpset to which each filesystem belongs
5942 @item
5943 and more @dots{}
5944 @end itemize
5945
5946 To generate @i{Amd} mount maps, the automount tree must also be defined
5947 (@pxref{FSinfo automount definitions}).  This will have been designed at
5948 the time the volume names were allocated.  Some volume names will not be
5949 automounted, so @i{FSinfo} needs an explicit list of which volumes
5950 should be automounted.@refill
5951
5952 Hostnames are required at several places in the @i{FSinfo} language.  It
5953 is important to stick to either fully qualified names or unqualified
5954 names.  Using a mixture of the two will inevitably result in confusion.
5955
5956 Sometimes volumes need to be referenced which are not defined in the set
5957 of hosts being managed with @i{FSinfo}.  The required action is to add a
5958 dummy set of definitions for the host and volume names required.  Since
5959 the files generated for those particular hosts will not be used on them,
5960 the exact values used is not critical.
5961
5962 @node FSinfo Grammar, FSinfo host definitions, Using FSinfo, FSinfo
5963 @comment  node-name,  next,  previous,  up
5964 @section @i{FSinfo} grammar
5965 @cindex FSinfo grammar
5966 @cindex Grammar, FSinfo
5967
5968 @i{FSinfo} has a relatively simple grammar.  Distinct syntactic
5969 constructs exist for each of the different types of data, though they
5970 share a common flavor.  Several conventions are used in the grammar
5971 fragments below.
5972
5973 The notation, @i{list(}@t{xxx}@i{)}, indicates a list of zero or more
5974 @t{xxx}'s.  The notation, @i{opt(}@t{xxx}@i{)}, indicates zero or one
5975 @t{xxx}.  Items in double quotes, @i{eg} @t{"host"}, represent input
5976 tokens.  Items in angle brackets, @i{eg} @var{<hostname>}, represent
5977 strings in the input.  Strings need not be in double quotes, except to
5978 differentiate them from reserved words.  Quoted strings may include the
5979 usual set of C ``@t{\}'' escape sequences with one exception: a
5980 backslash-newline-whitespace sequence is squashed into a single space
5981 character.  To defeat this feature, put a further backslash at the start
5982 of the second line.
5983
5984 At the outermost level of the grammar, the input consists of a
5985 sequence of host and automount declarations.  These declarations are
5986 all parsed before they are analyzed.  This means they can appear in
5987 any order and cyclic host references are possible.
5988
5989 @example
5990 fsinfo      : @i{list(}fsinfo_attr@i{)} ;
5991
5992 fsinfo_attr : host | automount ;
5993 @end example
5994
5995 @menu
5996 * FSinfo host definitions::
5997 * FSinfo automount definitions::
5998 @end menu
5999
6000 @node FSinfo host definitions, FSinfo host attributes, FSinfo Grammar, FSinfo
6001 @comment  node-name,  next,  previous,  up
6002 @section @i{FSinfo} host definitions
6003 @cindex FSinfo host definitions
6004 @cindex Defining a host, FSinfo
6005
6006 A host declaration consists of three parts: a set of machine attribute
6007 data, a list of filesystems physically attached to the machine, and a
6008 list of additional statically mounted filesystems.
6009
6010 @example
6011 host        : "host" host_data @i{list(}filesystem@i{@i{)}} @i{list(}mount@i{@i{)}} ;
6012 @end example
6013
6014 Each host must be declared in this way exactly once.  Such things as the
6015 hardware address, the architecture and operating system types and the
6016 cluster name are all specified within the @dfn{host data}.
6017
6018 All the disks the machine has should then be described in the @dfn{list
6019 of filesystems}.  When describing disks, you can specify what
6020 @dfn{volname} the disk/partition should have and all such entries are
6021 built up into a dictionary which can then be used for building the
6022 automounter maps.
6023
6024 The @dfn{list of mounts} specifies all the filesystems that should be
6025 statically mounted on the machine.
6026
6027 @menu
6028 * FSinfo host attributes::
6029 * FSinfo filesystems::
6030 * FSinfo static mounts::
6031 @end menu
6032
6033 @node FSinfo host attributes, FSinfo filesystems, FSinfo host definitions , FSinfo host definitions
6034 @comment  node-name,  next,  previous,  up
6035 @section @i{FSinfo} host attributes
6036 @cindex FSinfo host attributes
6037 @cindex Defining host attributes, FSinfo
6038
6039 The host data, @dfn{host_data}, always includes the @dfn{hostname}.  In
6040 addition, several other host attributes can be given.
6041
6042 @example
6043 host_data   : @var{<hostname>}
6044             | "@{" @i{list(}host_attrs@i{)} "@}" @var{<hostname>}
6045             ;
6046
6047 host_attrs  : host_attr "=" @var{<string>}
6048             | netif
6049             ;
6050
6051 host_attr   : "config"
6052             | "arch"
6053             | "os"
6054             | "cluster"
6055             ;
6056 @end example
6057
6058 The @dfn{hostname} is, typically, the fully qualified hostname of the
6059 machine.
6060
6061 Examples:
6062
6063 @example
6064 host dylan.doc.ic.ac.uk
6065
6066 host @{
6067     os = hpux
6068     arch = hp300
6069 @} dougal.doc.ic.ac.uk
6070 @end example
6071
6072 The options that can be given as host attributes are shown below.
6073
6074 @menu
6075 * FSinfo netif Option::         FSinfo host netif.
6076 * FSinfo config Option::        FSinfo host config.
6077 * FSinfo arch Option::          FSinfo host arch.
6078 * FSinfo os Option::            FSinfo host os.
6079 * FSinfo cluster Option::       FSinfo host cluster.
6080 @end menu
6081
6082 @node FSinfo netif Option, FSinfo config Option, , FSinfo host attributes
6083 @comment  node-name,  next,  previous,  up
6084 @subsection netif Option
6085
6086 This defines the set of network interfaces configured on the machine.
6087 The interface attributes collected by @i{FSinfo} are the IP address,
6088 subnet mask and hardware address.  Multiple interfaces may be defined
6089 for hosts with several interfaces by an entry for each interface.  The
6090 values given are sanity checked, but are currently unused for anything
6091 else.
6092
6093 @example
6094 netif       : "netif" @var{<string>} "@{" @i{list(}netif_attrs@i{)} "@}" ;
6095
6096 netif_attrs : netif_attr "=" @var{<string>} ;
6097
6098 netif_attr  : "inaddr" | "netmask" | "hwaddr" ;
6099 @end example
6100
6101 Examples:
6102
6103 @example
6104 netif ie0 @{
6105     inaddr  = 129.31.81.37
6106     netmask = 0xfffffe00
6107     hwaddr  = "08:00:20:01:a6:a5"
6108 @}
6109
6110 netif ec0 @{ @}
6111 @end example
6112
6113 @node FSinfo config Option, FSinfo arch Option, FSinfo netif Option, FSinfo host attributes
6114 @comment  node-name,  next,  previous,  up
6115 @subsection config Option
6116 @cindex FSinfo config host attribute
6117 @cindex config, FSinfo host attribute
6118
6119 This option allows you to specify configuration variables for the
6120 startup scripts (@file{rc} scripts).  A simple string should immediately
6121 follow the keyword.
6122
6123 Example:
6124
6125 @example
6126 config "NFS_SERVER=true"
6127 config "ZEPHYR=true"
6128 @end example
6129
6130 This option is currently unsupported.
6131
6132 @node FSinfo arch Option, FSinfo os Option, FSinfo config Option, FSinfo host attributes
6133 @comment  node-name,  next,  previous,  up
6134 @subsection arch Option
6135 @cindex FSinfo arch host attribute
6136 @cindex arch, FSinfo host attribute
6137
6138 This defines the architecture of the machine.  For example:
6139
6140 @example
6141 arch = hp300
6142 @end example
6143
6144 This is intended to be of use when building architecture specific
6145 mountmaps, however, the option is currently unsupported.
6146
6147 @node FSinfo os Option, FSinfo cluster Option, FSinfo arch Option, FSinfo host attributes
6148 @comment  node-name,  next,  previous,  up
6149 @subsection os Option
6150 @cindex FSinfo os host attribute
6151 @cindex os, FSinfo host attribute
6152
6153 This defines the operating system type of the host.  For example:
6154
6155 @example
6156 os = hpux
6157 @end example
6158
6159 This information is used when creating the @file{fstab} files, for
6160 example in choosing which format to use for the @file{fstab} entries
6161 within the file.
6162
6163 @node FSinfo cluster Option, , FSinfo os Option, FSinfo host attributes
6164 @comment  node-name,  next,  previous,  up
6165 @subsection cluster Option
6166 @cindex FSinfo cluster host attribute
6167 @cindex cluster, FSinfo host attribute
6168
6169 This is used for specifying in which cluster the machine belongs.  For
6170 example:
6171
6172 @example
6173 cluster = "theory"
6174 @end example
6175
6176 The cluster is intended to be used when generating the automount maps,
6177 although it is currently unsupported.
6178
6179 @node FSinfo filesystems, FSinfo static mounts, FSinfo host attributes, FSinfo host definitions
6180 @comment  node-name,  next,  previous,  up
6181 @section @i{FSinfo} filesystems
6182 @cindex FSinfo filesystems
6183
6184 The list of physically attached filesystems follows the machine
6185 attributes.  These should define all the filesystems available from this
6186 machine, whether exported or not.  In addition to the device name,
6187 filesystems have several attributes, such as filesystem type, mount
6188 options, and @samp{fsck} pass number which are needed to generate
6189 @file{fstab} entries.
6190
6191 @example
6192 filesystem  : "fs" @var{<device>} "@{" @i{list(}fs_data@i{)} "@}" ;
6193
6194 fs_data     : fs_data_attr "=" @var{<string>}
6195             | mount
6196             ;
6197
6198 fs_data_attr
6199             : "fstype" | "opts" | "passno"
6200             | "freq" | "dumpset" | "log"
6201             ;
6202 @end example
6203
6204 Here, @var{<device>} is the device name of the disk (for example,
6205 @file{/dev/dsk/2s0}).  The device name is used for building the mount
6206 maps and for the @file{fstab} file.  The attributes that can be
6207 specified are shown in the following section.
6208
6209 The @i{FSinfo} configuration file for @code{dylan.doc.ic.ac.uk} is listed below.
6210
6211 @example
6212 host dylan.doc.ic.ac.uk
6213
6214 fs /dev/dsk/0s0 @{
6215         fstype = swap
6216 @}
6217
6218 fs /dev/dsk/0s0 @{
6219         fstype = hfs
6220         opts = rw,noquota,grpid
6221         passno = 0;
6222         freq = 1;
6223         mount / @{ @}
6224 @}
6225
6226 fs /dev/dsk/1s0 @{
6227         fstype = hfs
6228         opts = defaults
6229         passno = 1;
6230         freq = 1;
6231         mount /usr @{
6232                 local @{
6233                         exportfs "dougal eden dylan zebedee brian"
6234                         volname /nfs/hp300/local
6235                 @}
6236         @}
6237 @}
6238
6239 fs /dev/dsk/2s0 @{
6240         fstype = hfs
6241         opts = defaults
6242         passno = 1;
6243         freq = 1;
6244         mount default @{
6245                 exportfs "toytown_clients hangers_on"
6246                 volname /home/dylan/dk2
6247         @}
6248 @}
6249
6250 fs /dev/dsk/3s0 @{
6251         fstype = hfs
6252         opts = defaults
6253         passno = 1;
6254         freq = 1;
6255         mount default @{
6256                 exportfs "toytown_clients hangers_on"
6257                 volname /home/dylan/dk3
6258         @}
6259 @}
6260
6261 fs /dev/dsk/5s0 @{
6262         fstype = hfs
6263         opts = defaults
6264         passno = 1;
6265         freq = 1;
6266         mount default @{
6267                 exportfs "toytown_clients hangers_on"
6268                 volname /home/dylan/dk5
6269         @}
6270 @}
6271 @end example
6272
6273 @menu
6274 * FSinfo fstype Option::        FSinfo filesystems fstype.
6275 * FSinfo opts Option::          FSinfo filesystems opts.
6276 * FSinfo passno Option::        FSinfo filesystems passno.
6277 * FSinfo freq Option::          FSinfo filesystems freq.
6278 * FSinfo mount Option::         FSinfo filesystems mount.
6279 * FSinfo dumpset Option::       FSinfo filesystems dumpset.
6280 * FSinfo log Option::           FSinfo filesystems log.
6281 @end menu
6282
6283 @node FSinfo fstype Option, FSinfo opts Option, , FSinfo filesystems
6284 @comment  node-name,  next,  previous,  up
6285 @subsection fstype Option
6286 @cindex FSinfo fstype filesystems option
6287 @cindex fstype, FSinfo filesystems option
6288 @cindex export, FSinfo special fstype
6289
6290 This specifies the type of filesystem being declared and will be placed
6291 into the @file{fstab} file as is.  The value of this option will be
6292 handed to @code{mount} as the filesystem type---it should have such
6293 values as @code{4.2}, @code{nfs} or @code{swap}.  The value is not
6294 examined for correctness.
6295
6296 There is one special case.  If the filesystem type is specified as
6297 @samp{export} then the filesystem information will not be added to the
6298 host's @file{fstab} information, but it will still be visible on the
6299 network.  This is useful for defining hosts which contain referenced
6300 volumes but which are not under full control of @i{FSinfo}.
6301
6302 Example:
6303
6304 @example
6305 fstype = swap
6306 @end example
6307
6308 @node FSinfo opts Option, FSinfo passno Option, FSinfo fstype Option, FSinfo filesystems
6309 @comment  node-name,  next,  previous,  up
6310 @subsection opts Option
6311 @cindex FSinfo opts filesystems option
6312 @cindex opts, FSinfo filesystems option
6313
6314 This defines any options that should be given to @b{mount}(8) in the
6315 @file{fstab} file.  For example:
6316
6317 @example
6318 opts = rw,nosuid,grpid
6319 @end example
6320
6321 @node FSinfo passno Option, FSinfo freq Option, FSinfo opts Option, FSinfo filesystems
6322 @comment  node-name,  next,  previous,  up
6323 @subsection passno Option
6324 @cindex FSinfo passno filesystems option
6325 @cindex passno, FSinfo filesystems option
6326
6327 This defines the @b{fsck}(8) pass number in which to check the
6328 filesystem.  This value will be placed into the @file{fstab} file.
6329
6330 Example:
6331
6332 @example
6333 passno = 1
6334 @end example
6335
6336 @node FSinfo freq Option, FSinfo mount Option, FSinfo passno Option, FSinfo filesystems
6337 @comment  node-name,  next,  previous,  up
6338 @subsection freq Option
6339 @cindex FSinfo freq filesystems option
6340 @cindex freq, FSinfo filesystems option
6341
6342 This defines the interval (in days) between dumps.  The value is placed
6343 as is into the @file{fstab} file.
6344
6345 Example:
6346
6347 @example
6348 freq = 3
6349 @end example
6350
6351 @node FSinfo mount Option, FSinfo dumpset Option, FSinfo freq Option, FSinfo filesystems
6352 @comment  node-name,  next,  previous,  up
6353 @subsection mount Option
6354 @cindex FSinfo mount filesystems option
6355 @cindex mount, FSinfo filesystems option
6356 @cindex exportfs, FSinfo mount option
6357 @cindex volname, FSinfo mount option
6358 @cindex sel, FSinfo mount option
6359
6360 This defines the mountpoint at which to place the filesystem.  If the
6361 mountpoint of the filesystem is specified as @code{default}, then the
6362 filesystem will be mounted in the automounter's tree under its volume
6363 name and the mount will automatically be inherited by the automounter.
6364
6365 Following the mountpoint, namespace information for the filesystem may
6366 be described.  The options that can be given here are @code{exportfs},
6367 @code{volname} and @code{sel}.
6368
6369 The format is:
6370
6371 @example
6372 mount       : "mount" vol_tree ;
6373
6374 vol_tree    : @i{list(}vol_tree_attr@i{)} ;
6375
6376 vol_tree_attr
6377             :  @var{<string>} "@{" @i{list(}vol_tree_info@i{)} vol_tree "@}" ;
6378
6379 vol_tree_info
6380             : "exportfs" @var{<export-data>}
6381             | "volname" @var{<volname>}
6382             | "sel" @var{<selector-list>}
6383             ;
6384 @end example
6385
6386 Example:
6387
6388 @example
6389 mount default @{
6390     exportfs "dylan dougal florence zebedee"
6391     volname /vol/andrew
6392 @}
6393 @end example
6394
6395 In the above example, the filesystem currently being declared will have
6396 an entry placed into the @file{exports} file allowing the filesystem to
6397 be exported to the machines @code{dylan}, @code{dougal}, @code{florence}
6398 and @code{zebedee}.  The volume name by which the filesystem will be
6399 referred to remotely, is @file{/vol/andrew}.  By declaring the
6400 mountpoint to be @code{default}, the filesystem will be mounted on the
6401 local machine in the automounter tree, where @i{Amd} will automatically
6402 inherit the mount as @file{/vol/andrew}.@refill
6403
6404 @table @samp
6405 @item exportfs
6406 a string defining which machines the filesystem may be exported to.
6407 This is copied, as is, into the @file{exports} file---no sanity checking
6408 is performed on this string.@refill
6409
6410 @item volname
6411 a string which declares the remote name by which to reference the
6412 filesystem.  The string is entered into a dictionary and allows you to
6413 refer to this filesystem in other places by this volume name.@refill
6414
6415 @item sel
6416 a string which is placed into the automounter maps as a selector for the
6417 filesystem.@refill
6418
6419 @end table
6420
6421 @node FSinfo dumpset Option, FSinfo log Option, FSinfo mount Option, FSinfo filesystems
6422 @comment  node-name,  next,  previous,  up
6423 @subsection dumpset Option
6424 @cindex FSinfo dumpset filesystems option
6425 @cindex dumpset, FSinfo filesystems option
6426
6427 This provides support for Imperial College's local file backup tools and
6428 is not documented further here.
6429
6430 @node FSinfo log Option, , FSinfo dumpset Option, FSinfo filesystems
6431 @comment  node-name,  next,  previous,  up
6432 @subsection log Option
6433 @cindex FSinfo log filesystems option
6434 @cindex log, FSinfo filesystems option
6435
6436 Specifies the log device for the current filesystem. This is ignored if
6437 not required by the particular filesystem type.
6438
6439 @node FSinfo static mounts, FSinfo automount definitions , FSinfo filesystems, FSinfo host definitions
6440 @comment  node-name,  next,  previous,  up
6441 @section @i{FSinfo} static mounts
6442 @cindex FSinfo static mounts
6443 @cindex Statically mounts filesystems, FSinfo
6444
6445 Each host may also have a number of statically mounted filesystems.  For
6446 example, the host may be a diskless workstation in which case it will
6447 have no @code{fs} declarations.  In this case the @code{mount}
6448 declaration is used to determine from where its filesystems will be
6449 mounted.  In addition to being added to the @file{fstab} file, this
6450 information can also be used to generate a suitable @file{bootparams}
6451 file.@refill
6452
6453 @example
6454 mount       : "mount" @var{<volname>} @i{list(}localinfo@i{)} ;
6455
6456 localinfo   : localinfo_attr @var{<string>} ;
6457
6458 localinfo_attr
6459             : "as"
6460             | "from"
6461             | "fstype"
6462             | "opts"
6463             ;
6464 @end example
6465
6466 The filesystem specified to be mounted will be searched for in the
6467 dictionary of volume names built when scanning the list of hosts'
6468 definitions.
6469
6470 The attributes have the following semantics:
6471 @table @samp
6472 @item from @var{machine}
6473 mount the filesystem from the machine with the hostname of
6474 @dfn{machine}.@refill
6475
6476 @item as @var{mountpoint}
6477 mount the filesystem locally as the name given, in case this is
6478 different from the advertised volume name of the filesystem.
6479
6480 @item opts @var{options}
6481 native @b{mount}(8) options.
6482
6483 @item fstype @var{type}
6484 type of filesystem to be mounted.
6485 @end table
6486
6487 An example:
6488
6489 @example
6490 mount /export/exec/hp300/local as /usr/local
6491 @end example
6492
6493 If the mountpoint specified is either @file{/} or @file{swap}, the
6494 machine will be considered to be booting off the net and this will be
6495 noted for use in generating a @file{bootparams} file for the host which
6496 owns the filesystems.
6497
6498 @node FSinfo automount definitions, FSinfo Command Line Options, FSinfo static mounts, FSinfo
6499 @comment  node-name,  next,  previous,  up
6500 @section Defining an @i{Amd} Mount Map in @i{FSinfo}
6501 @cindex FSinfo automount definitions
6502 @cindex Defining an Amd mount map, FSinfo
6503
6504 The maps used by @i{Amd} can be constructed from @i{FSinfo} by defining
6505 all the automount trees.  @i{FSinfo} takes all the definitions found and
6506 builds one map for each top level tree.
6507
6508 The automount tree is usually defined last.  A single automount
6509 configuration will usually apply to an entire management domain.  One
6510 @code{automount} declaration is needed for each @i{Amd} automount point.
6511 @i{FSinfo} determines whether the automount point is @dfn{direct}
6512 (@pxref{Direct Automount Filesystem}) or @dfn{indirect}
6513 (@pxref{Top-level Filesystem}).  Direct automount points are
6514 distinguished by the fact that there is no underlying
6515 @dfn{automount_tree}.@refill
6516
6517 @example
6518 automount   : "automount" @i{opt(}auto_opts@i{)} automount_tree ;
6519
6520 auto_opts   : "opts" @var{<mount-options>} ;
6521
6522 automount_tree
6523             : @i{list(}automount_attr@i{)}
6524             ;
6525
6526 automount_attr
6527             : @var{<string>} "=" @var{<volname>}
6528             | @var{<string>} "->" @var{<symlink>}
6529             | @var{<string>} "@{" automount_tree "@}"
6530             ;
6531 @end example
6532
6533 If @var{<mount-options>} is given, then it is the string to be placed in
6534 the maps for @i{Amd} for the @code{opts} option.
6535
6536 A @dfn{map} is typically a tree of filesystems, for example @file{home}
6537 normally contains a tree of filesystems representing other machines in
6538 the network.
6539
6540 A map can either be given as a name representing an already defined
6541 volume name, or it can be a tree.  A tree is represented by placing
6542 braces after the name.  For example, to define a tree @file{/vol}, the
6543 following map would be defined:
6544
6545 @example
6546 automount /vol @{ @}
6547 @end example
6548
6549 Within a tree, the only items that can appear are more maps.
6550 For example:
6551
6552 @example
6553 automount /vol @{
6554     andrew @{ @}
6555     X11 @{ @}
6556 @}
6557 @end example
6558
6559 In this case, @i{FSinfo} will look for volumes named @file{/vol/andrew}
6560 and @file{/vol/X11} and a map entry will be generated for each.  If the
6561 volumes are defined more than once, then @i{FSinfo} will generate
6562 a series of alternate entries for them in the maps.@refill
6563
6564 Instead of a tree, either a link (@var{name} @code{->}
6565 @var{destination}) or a reference can be specified (@var{name} @code{=}
6566 @var{destination}).  A link creates a symbolic link to the string
6567 specified, without further processing the entry.  A reference will
6568 examine the destination filesystem and optimize the reference.  For
6569 example, to create an entry for @code{njw} in the @file{/homes} map,
6570 either of the two forms can be used:@refill
6571
6572 @example
6573 automount /homes @{
6574     njw -> /home/dylan/njw
6575 @}
6576 @end example
6577
6578 or
6579
6580 @example
6581 automount /homes @{
6582     njw = /home/dylan/njw
6583 @}
6584 @end example
6585
6586 In the first example, when @file{/homes/njw} is referenced from @i{Amd},
6587 a link will be created leading to @file{/home/dylan/njw} and the
6588 automounter will be referenced a second time to resolve this filename.
6589 The map entry would be:
6590
6591 @example
6592 njw type:=link;fs:=/home/dylan/njw
6593 @end example
6594
6595 In the second example, the destination directory is analyzed and found
6596 to be in the filesystem @file{/home/dylan} which has previously been
6597 defined in the maps. Hence the map entry will look like:
6598
6599 @example
6600 njw rhost:=dylan;rfs:=/home/dylan;sublink:=njw
6601 @end example
6602
6603 Creating only one symbolic link, and one access to @i{Amd}.
6604
6605 @node FSinfo Command Line Options, FSinfo errors, FSinfo automount definitions, FSinfo
6606 @comment  node-name,  next,  previous,  up
6607 @section @i{FSinfo} Command Line Options
6608 @cindex FSinfo command line options
6609 @cindex Command line options, FSinfo
6610
6611 @i{FSinfo} is started from the command line by using the command:
6612
6613 @example
6614 fsinfo [@i{options}] @i{files} ...
6615 @end example
6616
6617 The input to @i{FSinfo} is a single set of definitions of machines and
6618 automount maps.  If multiple files are given on the command-line, then
6619 the files are concatenated together to form the input source.  The files
6620 are passed individually through the C pre-processor before being parsed.
6621
6622 Several options define a prefix for the name of an output file.  If the
6623 prefix is not specified no output of that type is produced.  The suffix
6624 used will correspond either to the hostname to which a file belongs, or
6625 to the type of output if only one file is produced.  Dumpsets and the
6626 @file{bootparams} file are in the latter class.  To put the output into
6627 a subdirectory simply put a @file{/} at the end of the prefix, making
6628 sure that the directory has already been made before running
6629 @i{Fsinfo}.
6630
6631 @menu
6632 * -a FSinfo Option::    Amd automount directory:
6633 * -b FSinfo Option::    Prefix for bootparams files.
6634 * -d FSinfo Option::    Prefix for dumpset data files.
6635 * -e FSinfo Option::    Prefix for exports files.
6636 * -f FSinfo Option::    Prefix for fstab files.
6637 * -h FSinfo Option::    Local hostname.
6638 * -m FSinfo Option::    Prefix for automount maps.
6639 * -q FSinfo Option::    Ultra quiet mode.
6640 * -v FSinfo Option::    Verbose mode.
6641 * -I FSinfo Option::    Define new #include directory.
6642 * -D-FSinfo Option::    Define macro.
6643 * -U FSinfo Option::    Undefine macro.
6644 @end menu
6645
6646 @node -a FSinfo Option, -b FSinfo Option, FSinfo Command Line Options, FSinfo Command Line Options
6647 @comment  node-name,  next,  previous,  up
6648 @subsection @code{-a} @var{autodir}
6649
6650 Specifies the directory name in which to place the automounter's
6651 mountpoints.  This defaults to @file{/a}.  Some sites have the autodir set
6652 to be @file{/amd}, and this would be achieved by:
6653
6654 @example
6655 fsinfo -a /amd ...
6656 @end example
6657
6658 @node -b FSinfo Option, -d FSinfo Option, -a FSinfo Option, FSinfo Command Line Options
6659 @comment  node-name,  next,  previous,  up
6660 @subsection @code{-b} @var{bootparams}
6661 @cindex bootparams, FSinfo prefix
6662
6663 This specifies the prefix for the @file{bootparams} filename.  If it is
6664 not given, then the file will not be generated.  The @file{bootparams}
6665 file will be constructed for the destination machine and will be placed
6666 into a file named @file{bootparams} and prefixed by this string.  The
6667 file generated contains a list of entries describing each diskless
6668 client that can boot from the destination machine.
6669
6670 As an example, to create a @file{bootparams} file in the directory
6671 @file{generic}, the following would be used:
6672
6673 @example
6674 fsinfo -b generic/ ...
6675 @end example
6676
6677 @node -d FSinfo Option, -e FSinfo Option, -b FSinfo Option, FSinfo Command Line Options
6678 @comment  node-name,  next,  previous,  up
6679 @subsection @code{-d} @var{dumpsets}
6680 @cindex dumpset, FSinfo prefix
6681
6682 This specifies the prefix for the @file{dumpsets} file.  If it is not
6683 specified, then the file will not be generated.  The file will be for
6684 the destination machine and will be placed into a filename
6685 @file{dumpsets}, prefixed by this string.  The @file{dumpsets} file is
6686 for use by Imperial College's local backup system.
6687
6688 For example, to create a @file{dumpsets} file in the directory @file{generic},
6689 then you would use the following:
6690
6691 @example
6692 fsinfo -d generic/ ...
6693 @end example
6694
6695 @node -e FSinfo Option, -f FSinfo Option, -d FSinfo Option, FSinfo Command Line Options
6696 @comment  node-name,  next,  previous,  up
6697 @subsection @code{-e} @var{exportfs}
6698 @cindex exports, FSinfo prefix
6699
6700 Defines the prefix for the @file{exports} files.  If it is not given,
6701 then the file will not be generated.  For each machine defined in the
6702 configuration files as having disks, an @file{exports} file is
6703 constructed and given a filename determined by the name of the machine,
6704 prefixed with this string.  If a machine is defined as diskless, then no
6705 @file{exports} file will be created for it.  The files contain entries
6706 for directories on the machine that may be exported to clients.
6707
6708 Example: To create the @file{exports} files for each diskfull machine
6709 and place them into the directory @file{exports}:
6710
6711 @example
6712 fsinfo -e exports/ ...
6713 @end example
6714
6715 @node -f FSinfo Option, -h FSinfo Option, -e FSinfo Option, FSinfo Command Line Options
6716 @comment  node-name,  next,  previous,  up
6717 @subsection @code{-f} @var{fstab}
6718 @cindex fstab, FSinfo prefix
6719
6720 This defines the prefix for the @file{fstab} files.  The files will only
6721 be created if this prefix is defined.  For each machine defined in the
6722 configuration files, a @file{fstab} file is created with the filename
6723 determined by prefixing this string with the name of the machine.  These
6724 files contain entries for filesystems and partitions to mount at boot
6725 time.
6726
6727 Example, to create the files in the directory @file{fstabs}:
6728
6729 @example
6730 fsinfo -f fstabs/ ...
6731 @end example
6732
6733 @node -h FSinfo Option, -m FSinfo Option, -f FSinfo Option, FSinfo Command Line Options
6734 @comment  node-name,  next,  previous,  up
6735 @subsection @code{-h} @var{hostname}
6736 @cindex hostname, FSinfo command line option
6737
6738 Defines the hostname of the destination machine to process for.  If this
6739 is not specified, it defaults to the local machine name, as returned by
6740 @b{gethostname}(2).
6741
6742 Example:
6743
6744 @example
6745 fsinfo -h dylan.doc.ic.ac.uk ...
6746 @end example
6747
6748 @node -m FSinfo Option, -q FSinfo Option, -h FSinfo Option, FSinfo Command Line Options
6749 @comment  node-name,  next,  previous,  up
6750 @subsection @code{-m} @var{mount-maps}
6751 @cindex maps, FSinfo command line option
6752
6753 Defines the prefix for the automounter files.  The maps will only be
6754 produced if this prefix is defined.  The mount maps suitable for the
6755 network defined by the configuration files will be placed into files
6756 with names calculated by prefixing this string to the name of each map.
6757
6758 For example, to create the automounter maps and place them in the
6759 directory @file{automaps}:
6760
6761 @example
6762 fsinfo -m automaps/ ...
6763 @end example
6764
6765 @node -q FSinfo Option, -v FSinfo Option, -m FSinfo Option, FSinfo Command Line Options
6766 @comment  node-name,  next,  previous,  up
6767 @subsection @code{-q}
6768 @cindex quiet, FSinfo command line option
6769
6770 Selects quiet mode.  @i{FSinfo} suppress the ``running commentary'' and
6771 only outputs any error messages which are generated.
6772
6773 @node -v FSinfo Option, -D-FSinfo Option, -q FSinfo Option, FSinfo Command Line Options
6774 @comment  node-name,  next,  previous,  up
6775 @subsection @code{-v}
6776 @cindex verbose, FSinfo command line option
6777
6778 Selects verbose mode.  When this is activated, the program will display
6779 more messages, and display all the information discovered when
6780 performing the semantic analysis phase.  Each verbose message is output
6781 to @file{stdout} on a line starting with a @samp{#} character.
6782
6783 @node -D-FSinfo Option, -I FSinfo Option, -v FSinfo Option, FSinfo Command Line Options
6784 @comment  node-name,  next,  previous,  up
6785 @subsection @code{-D} @var{name}@i{[=defn]}
6786
6787 Defines a symbol @dfn{name} for the preprocessor when reading the
6788 configuration files.  Equivalent to @code{#define} directive.
6789
6790 @node -I FSinfo Option, -U FSinfo Option, -D-FSinfo Option, FSinfo Command Line Options
6791 @comment  node-name,  next,  previous,  up
6792 @subsection @code{-I} @var{directory}
6793
6794 This option is passed into the preprocessor for the configuration files.
6795 It specifies directories in which to find include files
6796
6797 @node -U FSinfo Option, , -I FSinfo Option, FSinfo Command Line Options
6798 @comment  node-name,  next,  previous,  up
6799 @subsection @code{-U} @var{name}
6800
6801 Removes any initial definition of the symbol @dfn{name}.  Inverse of the
6802 @code{-D} option.
6803
6804 @node FSinfo errors, , FSinfo Command Line Options, FSinfo
6805 @comment  node-name,  next,  previous,  up
6806 @section Errors produced by @i{FSinfo}
6807 @cindex FSinfo error messages
6808
6809 The following table documents the errors and warnings which @i{FSinfo} may produce.
6810
6811 @table @t
6812
6813 @item " expected
6814 Occurs if an unescaped newline is found in a quoted string.
6815
6816 @item ambiguous mount: @var{volume} is a replicated filesystem
6817 If several filesystems are declared as having the same volume name, they
6818 will be considered replicated filesystems.  To mount a replicated
6819 filesystem statically, a specific host will need to be named, to say
6820 which particular copy to try and mount, else this error will
6821 result.
6822
6823 @item can't open @var{filename} for writing
6824 Occurs if any errors are encountered when opening an output file.
6825
6826 @item cannot determine localname since volname @var{volume} is not uniquely defined
6827 If a volume is replicated and an attempt is made to mount the filesystem
6828 statically without specifying a local mountpoint, @i{FSinfo} cannot
6829 calculate a mountpoint, as the desired pathname would be
6830 ambiguous.
6831
6832 @item @var{device} has duplicate exportfs data
6833 Produced if the @samp{exportfs} option is used multiple times within the
6834 same branch of a filesystem definition. For example, if you attempt to
6835 set the @samp{exportfs} data at different levels of the mountpoint
6836 directory tree.
6837
6838 @item dump frequency for @var{host}:@var{device} is non-zero
6839 Occurs if @var{device} has its @samp{fstype} declared to be @samp{swap}
6840 or @samp{export} and the @samp{dump} option is set to a value greater
6841 than zero.  Swap devices should not be dumped.
6842
6843 @item duplicate host @var{hostname}!
6844 If a host has more than one definition.
6845
6846 @item end of file within comment
6847 A comment was unterminated before the end of one of the configuration
6848 files.
6849
6850 @item @var{filename}: cannot open for reading
6851 If a file specified on the command line as containing configuration data
6852 could not be opened.
6853
6854 @item @var{filesystem} has a volname but no exportfs data
6855 Occurs when a volume name is declared for a file system, but the string
6856 specifying what machines the filesystem can be exported to is
6857 missing.
6858
6859 @item fs field "@var{field-name}" already set
6860 Occurs when multiple definitions are given for one of the attributes of a
6861 host's filesystem.
6862
6863 @item host field "@var{field-name}" already set
6864 If duplicate definitions are given for any of the fields with a host
6865 definition.
6866
6867 @item @var{host}:@var{device} has more than one mount point
6868 Occurs if the mount option for a host's filesystem specifies multiple
6869 trees at which to place the mountpoint.
6870
6871 @item @var{host}:@var{device} has no mount point
6872 Occurs if the @samp{mount} option is not specified for a host's
6873 filesystem.
6874
6875 @item @var{host}:@var{device} needs field "@var{field-name}"
6876 Occurs when a filesystem is missing a required field. @var{field-name} could
6877 be one of @samp{fstype}, @samp{opts}, @samp{passno} or
6878 @samp{mount}.
6879
6880 @item @var{host}:mount field specified for swap partition
6881 Occurs if a mountpoint is given for a filesystem whose type is declared
6882 to be @samp{swap}.
6883
6884 @item malformed IP dotted quad: @var{address}
6885 If the Internet address of an interface is incorrectly specified.  An
6886 Internet address definition is handled to @b{inet_addr}(3N) to see if it
6887 can cope.  If not, then this message will be displayed.
6888
6889 @item malformed netmask: @var{netmask}
6890 If the netmask cannot be decoded as though it were a hexadecimal number,
6891 then this message will be displayed.  It will typically be caused by
6892 incorrect characters in the @var{netmask} value.
6893
6894 @item mount field "@var{field-name}" already set
6895 Occurs when a static mount has multiple definitions of the same field.
6896
6897 @item mount tree field "@var{field-name}" already set
6898 Occurs when the @var{field-name} is defined more than once during the
6899 definition of a filesystems mountpoint.
6900
6901 @item netif field @var{field-name} already set
6902 Occurs if you attempt to define an attribute of an interface more than
6903 once.
6904
6905 @item network booting requires both root and swap areas
6906 Occurs if a machine has mount declarations for either the root partition
6907 or the swap area, but not both.  You cannot define a machine to only
6908 partially boot via the network.
6909
6910 @item no disk mounts on @var{hostname}
6911 If there are no static mounts, nor local disk mounts specified for a
6912 machine, this message will be displayed.
6913
6914 @item no volname given for @var{host}:@var{device}
6915 Occurs when a filesystem is defined to be mounted on @file{default}, but
6916 no volume name is given for the file system, then the mountpoint cannot
6917 be determined.
6918
6919 @item not allowed '/' in a directory name
6920 Occurs when a pathname with multiple directory elements is specified as
6921 the name for an automounter tree.  A tree should only have one name at
6922 each level.
6923
6924 @item pass number for @var{host}:@var{device} is non-zero
6925 Occurs if @var{device} has its @samp{fstype} declared to be @samp{swap}
6926 or @samp{export} and the @b{fsck}(8) pass number is set. Swap devices
6927 should not be fsck'd.  @xref{FSinfo fstype Option}.
6928
6929 @item sub-directory @var{directory} of @var{directory-tree} starts with '/'
6930 Within the filesystem specification for a host, if an element
6931 @var{directory} of the mountpoint begins with a @samp{/} and it is not
6932 the start of the tree.
6933
6934 @item sub-directory of @var{directory-tree} is named "default"
6935 @samp{default} is a keyword used to specify if a mountpoint should be
6936 automatically calculated by @i{FSinfo}.  If you attempt to specify a
6937 directory name as this, it will use the filename of @file{default} but
6938 will produce this warning.
6939
6940 @item unknown \ sequence
6941 Occurs if an unknown escape sequence is found inside a string.  Within a
6942 string, you can give the standard C escape sequences for strings, such
6943 as newlines and tab characters.
6944
6945 @item unknown directory attribute
6946 If an unknown keyword is found while reading the definition of a host's
6947 filesystem mount option.
6948
6949 @item unknown filesystem attribute
6950 Occurs if an unrecognized keyword is used when defining a host's
6951 filesystems.
6952
6953 @item unknown host attribute
6954 Occurs if an unrecognized keyword is used when defining a host.
6955
6956 @item unknown mount attribute
6957 Occurs if an unrecognized keyword is found while parsing the list of
6958 static mounts.
6959
6960 @item unknown volname @var{volume} automounted @i{[} on @i{name} @i{]}
6961 Occurs if @var{volume} is used in a definition of an automount map but the volume
6962 name has not been declared during the host filesystem definitions.
6963
6964 @item volname @var{volume} is unknown
6965 Occurs if an attempt is made to mount or reference a volume name which
6966 has not been declared during the host filesystem definitions.
6967
6968 @item volname @var{volume} not exported from @var{machine}
6969 Occurs if you attempt to mount the volume @var{volume} from a machine
6970 which has not declared itself to have such a filesystem
6971 available.
6972
6973 @end table
6974
6975 @c ################################################################
6976 @node Hlfsd, Assorted Tools, FSinfo, Top
6977 @comment  node-name,  next,  previous,  up
6978 @chapter Hlfsd
6979 @pindex Hlfsd
6980 @cindex Home-Link Filesystem
6981
6982 @i{Hlfsd} is a daemon which implements a filesystem containing a
6983 symbolic link to subdirectory within a user's home directory, depending
6984 on the user which accessed that link.  It was primarily designed to
6985 redirect incoming mail to users' home directories, so that it can be read
6986 from anywhere.  It was designed and implemented by
6987 @uref{http://www.cs.sunysb.edu/~ezk,Erez Zadok} and
6988 @email{dupuy AT cs.columbia.edu,Alexander Dupuy}, at the
6989 @uref{http://www.cs.columbia.edu/,Computer Science Department} of
6990 @uref{http://www.columbia.edu/,Columbia University}.  A
6991 @uref{http://www.fsl.cs.sunysb.edu/docs/hlfsd/hlfsd.html,paper}
6992 on @i{Hlfsd} was presented at the Usenix LISA VII conference in 1993.
6993
6994 @i{Hlfsd} operates by mounting itself as an NFS server for the directory
6995 containing @i{linkname}, which defaults to @file{/hlfs/home}.  Lookups
6996 within that directory are handled by @i{Hlfsd}, which uses the
6997 password map to determine how to resolve the lookup.  The directory will
6998 be created if it doesn't already exist.  The symbolic link will be to
6999 the accessing user's home directory, with @i{subdir} appended to it.  If
7000 not specified, @i{subdir} defaults to @file{.hlfsdir}.  This directory
7001 will also be created if it does not already exist.
7002
7003 A @samp{SIGTERM} sent to @i{Hlfsd} will cause it to shutdown.  A
7004 @samp{SIGHUP} will flush the internal caches, and reload the password
7005 map.  It will also close and reopen the log file, to enable the original
7006 log file to be removed or rotated.  A @samp{SIGUSR1} will cause it to
7007 dump its internal table of user IDs and home directories to the file
7008 @file{/tmp/hlfsddump}.
7009
7010 @menu
7011 * Introduction to Hlfsd::
7012 * Background to Mail Delivery::
7013 * Using Hlfsd::
7014 @end menu
7015
7016 @c ================================================================
7017 @node Introduction to Hlfsd, Background to Mail Delivery, Hlfsd, Hlfsd
7018 @comment  node-name,  next,  previous,  up
7019 @section Introduction to Hlfsd
7020 @cindex Introduction to Hlfsd
7021 @cindex Hlfsd; introduction
7022
7023 Electronic mail has become one of the major applications for many
7024 computer networks, and use of this service is expected to increase over
7025 time, as networks proliferate and become faster.  Providing a convenient
7026 environment for users to read, compose, and send electronic mail has
7027 become a requirement for systems administrators (SAs).
7028
7029 Widely used methods for handling mail usually require users to be logged
7030 into a designated ``home'' machine, where their mailbox files reside.
7031 Only on that one machine can they read newly arrived mail.  Since users
7032 have to be logged into that system to read their mail, they often find
7033 it convenient to run all of their other processes on that system as
7034 well, including memory and CPU-intensive jobs.  For example, in our
7035 department, we have allocated and configured several multi-processor
7036 servers to handle such demanding CPU/memory applications, but these were
7037 underutilized, in large part due to the inconvenience of not being able
7038 to read mail on those machines.  (No home directories were located on
7039 these designated CPU-servers, since we did not want NFS service for
7040 users' home directories to have to compete with CPU-intensive jobs.  At the
7041 same time, we discouraged users from running demanding applications on
7042 their home machines.)
7043
7044 Many different solutions have been proposed to allow users to read their
7045 mail on any host.  However, all of these solutions fail in one or more
7046 of several ways:
7047
7048 @itemize @bullet
7049
7050 @item
7051 they introduce new single points of failure
7052
7053 @item
7054 they require using different mail transfer agents (MTAs) or user agents
7055 (UAs)
7056
7057 @item
7058 they do not solve the problem for all cases, i.e.  the solution is only
7059 partially successful for a particular environment.
7060
7061 @end itemize
7062
7063 We have designed a simple filesystem, called the @dfn{Home-Link File
7064 System}, to provide the ability to deliver mail to users' home
7065 directories, without modification to mail-related applications. We have
7066 endeavored to make it as stable as possible.  Of great importance to us
7067 was to make sure the HLFS daemon, @file{hlfsd} , would not hang under
7068 any circumstances, and would take the next-best action when faced with
7069 problems.  Compared to alternative methods, @i{Hlfsd} is a stable, more
7070 general solution, and easier to install/use.  In fact, in some ways, we
7071 have even managed to improve the reliability and security of mail
7072 service.
7073
7074 Our server implements a small filesystem containing a symbolic link
7075 to a subdirectory of the invoking user's home directory, and named symbolic
7076 links to users' mailbox files.
7077
7078 The @i{Hlfsd} server finds out the @var{uid} of the process that is
7079 accessing its mount point, and resolves the pathname component @samp{home} as a
7080 symbolic link to a subdirectory within the home directory given by the
7081 @var{uid}'s entry in the password file.  If the @var{gid} of the process
7082 that attempts to access a mailbox file is a special one (called
7083 HLFS_GID), then the server maps the name of the @emph{next} pathname
7084 component directly to the user's mailbox.  This is necessary so that
7085 access to a mailbox file by users other than the owner can succeed.  The
7086 server has safety features in case of failures such as hung filesystems
7087 or home directory filesystems that are inaccessible or full.
7088
7089 On most of our machines, mail gets delivered to the directory
7090 @file{/var/spool/mail}. Many programs, including UAs, depend on that
7091 path.  @i{Hlfsd} creates a directory @file{/mail}, and mounts itself on
7092 top of that directory.  @i{Hlfsd} implements the path name component
7093 called @samp{home}, pointing to a subdirectory of the user's home directory.
7094 We have made @file{/var/spool/mail} a symbolic link to
7095 @file{/mail/home}, so that accessing @file{/var/spool/mail} actually
7096 causes access to a subdirectory within a user's home directory.
7097
7098 The following table shows an example of how resolving the pathname
7099 @file{/var/mail/@i{NAME}} to @file{/users/ezk/.mailspool/@i{NAME}} proceeds.
7100
7101 @multitable {Resolving Component} {Pathname left to resolve} {Value if symbolic link}
7102
7103 @item @b{Resolving Component}
7104 @tab @b{Pathname left to resolve}
7105 @tab @b{Value if symbolic link}
7106
7107 @item @t{/}
7108 @tab @t{var/mail/}@i{NAME}
7109
7110 @item @t{var/}
7111 @tab @t{mail/}@i{NAME}
7112
7113 @item @t{mail}@@
7114 @tab @t{/mail/home/}@i{NAME}
7115 @tab @t{mail}@@ -> @t{/mail/home}
7116
7117 @item @t{/}
7118 @tab @t{mail/home/}@i{NAME}
7119
7120 @item @t{mail/}
7121 @tab @t{home/}@i{NAME}
7122
7123 @item @t{home}@@
7124 @tab @i{NAME}
7125 @tab @t{home}@@ -> @t{/users/ezk/.mailspool}
7126
7127 @item @t{/}
7128 @tab @t{users/ezk/.mailspool/}@i{NAME}
7129
7130 @item @t{users/}
7131 @tab @t{ezk/.mailspool/}@i{NAME}
7132
7133 @item @t{ezk/}
7134 @tab @t{.mailspool/}@i{NAME}
7135
7136 @item @t{.mailspool/}
7137 @tab @i{NAME}
7138
7139 @item @i{NAME}
7140
7141 @end multitable
7142
7143 @c ================================================================
7144 @node Background to Mail Delivery, Using Hlfsd, Introduction to Hlfsd, Hlfsd
7145 @comment  node-name,  next,  previous,  up
7146 @section Background to Mail Delivery
7147 @cindex Background to Mail Delivery
7148 @cindex Hlfsd; background
7149
7150 This section provides an in-depth discussion of why available methods
7151 for delivering mail to home directories are not as good as the one used
7152 by @i{Hlfsd}.
7153
7154 @menu
7155 * Single-Host Mail Spool Directory::
7156 * Centralized Mail Spool Directory::
7157 * Distributed Mail Spool Service::
7158 * Why Deliver Into the Home Directory?::
7159 @end menu
7160
7161 @c ----------------------------------------------------------------
7162 @node Single-Host Mail Spool Directory, Centralized Mail Spool Directory, Background to Mail Delivery, Background to Mail Delivery
7163 @comment  node-name,  next,  previous,  up
7164 @subsection Single-Host Mail Spool Directory
7165 @cindex Single-Host Mail Spool Directory
7166
7167 The most common method for mail delivery is for mail to be appended to a
7168 mailbox file in a standard spool directory on the designated ``mail
7169 home'' machine of the user. The greatest advantage of this method is
7170 that it is the default method most vendors provide with their systems,
7171 thus very little (if any) configuration is required on the SA's part.
7172 All they need to set up are mail aliases directing mail to the host on
7173 which the user's mailbox file is assigned.  (Otherwise, mail is
7174 delivered locally, and users find mailboxes on many machines.)
7175
7176 As users become more sophisticated, and aided by windowing systems, they
7177 find themselves logging in on multiple hosts at once, performing several
7178 tasks concurrently.  They ask to be able to read their mail on any host
7179 on the network, not just the one designated as their ``mail home''.
7180
7181 @c ----------------------------------------------------------------
7182 @node Centralized Mail Spool Directory, Distributed Mail Spool Service, Single-Host Mail Spool Directory, Background to Mail Delivery
7183 @comment  node-name,  next,  previous,  up
7184 @subsection Centralized Mail Spool Directory
7185 @cindex Centralized Mail Spool Directory
7186
7187 A popular method for providing mail readability from any host is to have
7188 all mail delivered to a mail spool directory on a designated
7189 ``mail-server'' which is exported via NFS to all of the hosts on the
7190 network.  Configuring such a system is relatively easy.  On most
7191 systems, the bulk of the work is a one-time addition to one or two
7192 configuration files in @file{/etc}.  The file-server's spool directory
7193 is then hard-mounted across every machine on the local network.  In
7194 small environments with only a handful of hosts this can be an
7195 acceptable solution.  In our department, with a couple of hundred active
7196 hosts and thousands of mail messages processed daily, this was deemed
7197 completely unacceptable, as it introduced several types of problems:
7198
7199 @table @b
7200
7201 @item Scalability and Performance
7202
7203 As more and more machines get added to the network, more mail traffic
7204 has to go over NFS to and from the mail-server. Users like to run
7205 mail-watchers, and read their mail often. The stress on the shared
7206 infrastructure increases with every user and host added; loads on the
7207 mail server would most certainly be high since all mail delivery goes
7208 through that one machine.@footnote{ Delivery via NFS-mounted filesystems
7209 may require usage of @samp{rpc.lockd} and @samp{rpc.statd} to provide
7210 distributed file-locking, both of which are widely regarded as unstable
7211 and unreliable.  Furthermore, this will degrade performance, as local
7212 processes as well as remote @samp{nfsd} processes are kept busy.}  This
7213 leads to lower reliability and performance.  To reduce the number of
7214 concurrent connections between clients and the server host, some SAs
7215 have resorted to automounting the mail-spool directory.  But this
7216 solution only makes things worse: since users often run mail watchers,
7217 and many popular applications such as @samp{trn}, @samp{emacs},
7218 @samp{csh} or @samp{ksh} check periodically for new mail, the
7219 automounted directory would be effectively permanently mounted.  If it
7220 gets unmounted automatically by the automounter program, it is most
7221 likely to get mounted shortly afterwards, consuming more I/O resources
7222 by the constant cycle of mount and umount calls.
7223
7224 @item Reliability
7225
7226 The mail-server host and its network connectivity must be very reliable.
7227 Worse, since the spool directory has to be hard-mounted,@footnote{No SA
7228 in their right minds would soft-mount read/write partitions --- the
7229 chances for data loss are too great.} many processes which access the
7230 spool directory (various shells, @samp{login}, @samp{emacs}, etc.)
7231 would be hung as long as connectivity to the mail-server is severed. To
7232 improve reliability, SAs may choose to backup the mail-server's spool
7233 partition several times a day.  This may make things worse since reading
7234 or delivering mail while backups are in progress may cause backups to be
7235 inconsistent; more backups consume more backup-media resources, and
7236 increase the load on the mail-server host.
7237
7238 @end table
7239
7240 @c ----------------------------------------------------------------
7241 @node Distributed Mail Spool Service, Why Deliver Into the Home Directory?, Centralized Mail Spool Directory, Background to Mail Delivery
7242 @comment  node-name,  next,  previous,  up
7243 @subsection Distributed Mail Spool Service
7244 @cindex Distributed Mail Spool Service
7245
7246 Despite the existence of a few systems that support delivery to users'
7247 home directories, mail delivery to home directories hasn't caught on.
7248 We believe the main reason is that there are too many programs that
7249 ``know'' where mailbox files reside.  Besides the obvious (the delivery
7250 program @file{/bin/mail} and mail readers like @file{/usr/ucb/Mail},
7251 @samp{mush}, @samp{mm}, etc.), other programs that know mailbox location
7252 are login, from, almost every shell, @samp{xbiff}, @samp{xmailbox}, and
7253 even some programs not directly related to mail, such as @samp{emacs}
7254 and @samp{trn}.  Although some of these programs can be configured to
7255 look in different directories with the use of environment variables and
7256 other resources, many of them cannot.  The overall porting work is
7257 significant.
7258
7259 Other methods that have yet to catch on require the use of a special
7260 mail-reading server, such as IMAP or POP.  The main disadvantage of
7261 these systems is that UAs need to be modified to use these services ---
7262 a long and involved task.  That is why they are not popular at this
7263 time.
7264
7265 Several other ideas have been proposed and even used in various
7266 environments.  None of them is robust.  They are mostly very
7267 specialized, inflexible, and do not extend to the general case.  Some of
7268 the ideas are plain bad, potentially leading to lost or corrupt mail:
7269
7270 @table @b
7271
7272 @item automounters
7273
7274 Using an automounter such as @i{Amd} to provide a set of symbolic links
7275 from the normal spool directory to user home directories is not
7276 sufficient.  UAs rename, unlink, and recreate the mailbox as a regular
7277 file, therefore it must be a real file, not a symbolic link.
7278 Furthermore, it must reside in a real directory which is writable by the
7279 UAs and MTAs.  This method may also require populating
7280 @file{/var/spool/mail} with symbolic links and making sure they are
7281 updated.  Making @i{Amd} manage that directory directly fails, since
7282 many various lock files need to be managed as well.  Also, @i{Amd} does
7283 not provide all of the NFS operations which are required to write mail
7284 such as write, create, remove, and unlink.
7285
7286 @item @code{$MAIL}
7287
7288 Setting this variable to an automounted directory pointing to the user's
7289 mail spool host only solves the problem for those programs which know
7290 and use @code{$MAIL}.  Many programs don't, therefore this solution is partial
7291 and of limited flexibility.  Also, it requires the SAs or the users to
7292 set it themselves --- an added level of inconvenience and possible
7293 failures.
7294
7295 @item @t{/bin/mail}
7296
7297 Using a different mail delivery agent could be the solution.  One such
7298 example is @samp{hdmail}.  However, @samp{hdmail} still requires
7299 modifying all UAs, the MTA's configuration, installing new daemons, and
7300 changing login scripts.  This makes the system less upgradable or
7301 compatible with others, and adds one more complicated system for SAs to
7302 deal with.  It is not a complete solution because it still requires each
7303 user have their @code{$MAIL} variable setup correctly, and that every program
7304 use this variable.
7305
7306 @end table
7307
7308 @c ----------------------------------------------------------------
7309 @node Why Deliver Into the Home Directory?, , Distributed Mail Spool Service, Background to Mail Delivery
7310 @comment  node-name,  next,  previous,  up
7311 @subsection Why Deliver Into the Home Directory?
7312 @cindex Why Deliver Into the Home Directory?
7313 @cindex Hlfsd; Why Deliver Into the Home Directory?
7314
7315 There are several major reasons why SAs might want to deliver mail
7316 directly into the users' home directories:
7317
7318 @table @b
7319
7320 @item Location
7321
7322 Many mail readers need to move mail from the spool directory to the
7323 user's home directory.  It speeds up this operation if the two are on
7324 the same filesystem.  If for some reason the user's home directory is
7325 inaccessible, it isn't that useful to be able to read mail, since there
7326 is no place to move it to.  In some cases, trying to move mail to a
7327 non-existent or hung filesystem may result in mail loss.
7328
7329 @item Distribution
7330
7331 Having all mail spool directories spread among the many more filesystems
7332 minimizes the chances that complete environments will grind to a halt
7333 when a single server is down.  It does increase the chance that there
7334 will be someone who is not able to read their mail when a machine is
7335 down, but that is usually preferred to having no one be able to read
7336 their mail because a centralized mail server is down.  The problem of
7337 losing some mail due to the (presumably) higher chances that a user's
7338 machine is down is minimized in HLFS.
7339
7340 @item Security
7341
7342 Delivering mail to users' home directories has another advantage ---
7343 enhanced security and privacy.  Since a shared system mail spool
7344 directory has to be world-readable and searchable, any user can see
7345 whether other users have mail, when they last received new mail, or when
7346 they last read their mail.  Programs such as @samp{finger} display this
7347 information, which some consider an infringement of privacy.  While it
7348 is possible to disable this feature of @samp{finger} so that remote
7349 users cannot see a mailbox file's status, this doesn't prevent local
7350 users from getting the information.  Furthermore, there are more
7351 programs which make use of this information.  In shared environments,
7352 disabling such programs has to be done on a system-wide basis, but with
7353 mail delivered to users' home directories, users less concerned with
7354 privacy who do want to let others know when they last received or read
7355 mail can easily do so using file protection bits.
7356
7357 @c Lastly, on systems that do not export their NFS filesystem with
7358 @c @t{anon=0}, superusers are less likely to snoop around others' mail, as
7359 @c they become ``nobodies'' across NFS.
7360
7361 @end table
7362
7363 In summary, delivering mail to home directories provides users the
7364 functionality sought, and also avoids most of the problems just
7365 discussed.
7366
7367 @c ================================================================
7368 @node Using Hlfsd, , Background to Mail Delivery, Hlfsd
7369 @comment  node-name,  next,  previous,  up
7370 @section Using Hlfsd
7371 @cindex Using Hlfsd
7372 @cindex Hlfsd; using
7373
7374 @menu
7375 * Controlling Hlfsd::
7376 * Hlfsd Options::
7377 * Hlfsd Files::
7378 @end menu
7379
7380 @c ----------------------------------------------------------------
7381 @node Controlling Hlfsd, Hlfsd Options, Using Hlfsd, Using Hlfsd
7382 @comment  node-name,  next,  previous,  up
7383 @subsection Controlling Hlfsd
7384 @cindex Controlling Hlfsd
7385 @cindex Hlfsd; controlling
7386 @pindex ctl-hlfsd
7387
7388 Much the same way @i{Amd} is controlled by @file{ctl-amd}, so does
7389 @i{Hlfsd} get controlled by the @file{ctl-hlfsd} script:
7390
7391 @table @t
7392
7393 @item ctl-hlfsd start
7394 Start a new @i{Hlfsd}.
7395
7396 @item ctl-hlfsd stop
7397 Stop a running @i{Hlfsd}.
7398
7399 @item ctl-hlfsd restart
7400 Stop a running @i{Hlfsd}, wait for 10 seconds, and then start a new
7401 one.  It is hoped that within 10 seconds, the previously running
7402 @i{Hlfsd} terminate properly; otherwise, starting a second one could
7403 cause system lockup.
7404
7405 @end table
7406
7407 For example, on our systems, we start @i{Hlfsd} within @file{ctl-hlfsd}
7408 as follows on Solaris 2 systems:
7409
7410 @example
7411 hlfsd -a /var/alt_mail -x all -l /var/log/hlfsd /mail/home .mailspool
7412 @end example
7413
7414 The directory @file{/var/alt_mail} is a directory in the root partition
7415 where alternate mail will be delivered into, when it cannot be delivered
7416 into the user's home directory.
7417
7418 Normal mail gets delivered into @file{/var/mail}, but on our systems,
7419 that is a symbolic link to @file{/mail/home}.  @file{/mail} is managed
7420 by @i{Hlfsd}, which creates a dynamic symlink named @samp{home},
7421 pointing to the subdirectory @file{.mailspool} @emph{within} the
7422 accessing user's home directory.  This results in mail which normally
7423 should go to @file{/var/mail/@code{$USER}}, to go to
7424 @file{@code{$HOME}/.mailspool/@code{$USER}}.
7425
7426 @i{Hlfsd} does not create the @file{/var/mail} symlink.  This needs to
7427 be created (manually) once on each host, by the system administrators,
7428 as follows:
7429
7430 @example
7431 mv /var/mail /var/alt_mail
7432 ln -s /mail/home /var/mail
7433 @end example
7434
7435 @i{Hlfsd} also responds to the following signals:
7436
7437 A @samp{SIGHUP} signal sent to @i{Hlfsd} will force it to reload the
7438 password map immediately.
7439
7440 A @samp{SIGUSR1} signal sent to @i{Hlfsd} will cause it to dump its
7441 internal password map to the file @file{/usr/tmp/hlfsd.dump.XXXXXX},
7442 where @samp{XXXXXX} will be replaced by a random string generated by
7443 @b{mktemp}(3) or (the more secure) @b{mkstemp}(3).
7444
7445 @c ----------------------------------------------------------------
7446 @node Hlfsd Options, Hlfsd Files, Controlling Hlfsd, Using Hlfsd
7447 @comment  node-name,  next,  previous,  up
7448 @subsection Hlfsd Options
7449 @cindex Hlfsd Options
7450 @cindex Hlfsd; Options
7451
7452 @table @t
7453
7454 @item -a @var{alt_dir}
7455 Alternate directory.  The name of the directory to which the symbolic
7456 link returned by @i{Hlfsd} will point, if it cannot access the home
7457 directory of the user.  This defaults to @file{/var/hlfs}.  This
7458 directory will be created if it doesn't exist.  It is expected that
7459 either users will read these files, or the system administrators will
7460 run a script to resend this ``lost mail'' to its owner.
7461
7462 @item -c @var{cache-interval}
7463 Caching interval.  @i{Hlfsd} will cache the validity of home directories
7464 for this interval, in seconds.  Entries which have been verified within
7465 the last @var{cache-interval} seconds will not be verified again, since
7466 the operation could be expensive, and the entries are most likely still
7467 valid.  After the interval has expired, @i{Hlfsd} will re-verify the
7468 validity of the user's home directory, and reset the cache time-counter.
7469 The default value for @var{cache-interval} is 300 seconds (5 minutes).
7470
7471 @item -f
7472 Force fast startup.  This option tells @i{Hlfsd} to skip startup-time
7473 consistency checks such as existence of mount directory, alternate spool
7474 directory, symlink to be hidden under the mount directory, their
7475 permissions and validity.
7476
7477 @item -g @var{group}
7478 Set the special group HLFS_GID to @var{group}.  Programs such as
7479 @file{/usr/ucb/from} or @file{/usr/sbin/in.comsat}, which access the
7480 mailboxes of other users, must be setgid @samp{HLFS_GID} to work properly.  The
7481 default group is @samp{hlfs}.  If no group is provided, and there is no
7482 group @samp{hlfs}, this feature is disabled.
7483
7484 @item -h
7485 Help.  Print a brief help message, and exit.
7486
7487 @item -i @var{reload-interval}
7488 Map-reloading interval.  Each @var{reload-interval} seconds, @i{Hlfsd}
7489 will reload the password map.  @i{Hlfsd} needs the password map for the
7490 UIDs and home directory pathnames.  @i{Hlfsd} schedules a @samp{SIGALRM} to
7491 reload the password maps.  A @samp{SIGHUP} sent to @i{Hlfsd} will force it to
7492 reload the maps immediately.  The default value for
7493 @var{reload-interval} is 900 seconds (15 minutes.)
7494
7495 @item -l @var{logfile}
7496 Specify a log file to which @i{Hlfsd} will record events.  If
7497 @var{logfile} is the string @samp{syslog} then the log messages will be
7498 sent to the system log daemon by @b{syslog}(3), using the @samp{LOG_DAEMON}
7499 facility.  This is also the default.
7500
7501 @item -n
7502 No verify.  @i{Hlfsd} will not verify the validity of the symbolic link
7503 it will be returning, or that the user's home directory contains
7504 sufficient disk-space for spooling.  This can speed up @i{Hlfsd} at the
7505 cost of possibly returning symbolic links to home directories which are
7506 not currently accessible or are full.  By default, @i{Hlfsd} validates
7507 the symbolic-link in the background.  The @code{-n} option overrides the
7508 meaning of the @code{-c} option, since no caching is necessary.
7509
7510 @item -o @var{mount-options}
7511 Mount options which @i{Hlfsd} will use to mount itself on top of
7512 @var{dirname}.  By default, @var{mount-options} is set to @samp{ro}.  If
7513 the system supports symbolic-link caching, default options are set
7514 to @samp{ro,nocache}.
7515
7516 @item -p
7517 Print PID.  Outputs the process-id of @i{Hlfsd} to standard output where
7518 it can be saved into a file.
7519
7520 @item -v
7521 Version.  Displays version information to standard error.
7522
7523 @item -x @var{log-options}
7524 Specify run-time logging options.  The options are a comma separated
7525 list chosen from: @samp{fatal}, @samp{error}, @samp{user}, @samp{warn}, @samp{info}, @samp{map}, @samp{stats}, @samp{all}.
7526
7527 @item -C
7528 Force @i{Hlfsd} to run on systems that cannot turn off the NFS
7529 attribute-cache.  Use of this option on those systems is discouraged, as
7530 it may result in loss or misdelivery of mail.  The option is ignored on
7531 systems that can turn off the attribute-cache.
7532
7533 @item -D @var{log-options}
7534 Select from a variety of debugging options.  Prefixing an option with
7535 the string @samp{no} reverses the effect of that option.  Options are
7536 cumulative.  The most useful option is @samp{all}.  Since this option is
7537 only used for debugging other options are not documented here.  A fuller
7538 description is available in the program source.
7539
7540 @item -P @var{password-file}
7541 Read the user-name, user-id, and home directory information from the
7542 file @var{password-file}.  Normally, @i{Hlfsd} will use @b{getpwent}(3)
7543 to read the password database.  This option allows you to override the
7544 default database, and is useful if you want to map users' mail files to
7545 a directory other than their home directory.  Only the username, uid,
7546 and home-directory fields of the file @var{password-file} are read and
7547 checked.  All other fields are ignored.  The file @var{password-file}
7548 must otherwise be compliant with Unix Version 7 colon-delimited format
7549 @b{passwd}(4).
7550
7551 @end table
7552
7553 @c ----------------------------------------------------------------
7554 @node Hlfsd Files, , Hlfsd Options, Using Hlfsd
7555 @comment  node-name,  next,  previous,  up
7556 @subsection Hlfsd Files
7557 @cindex Hlfsd Files
7558 @cindex Hlfsd; Files
7559
7560 The following files are used by @i{Hlfsd}:
7561
7562 @table @file
7563
7564 @item /hlfs
7565 directory under which @i{Hlfsd} mounts itself and manages the symbolic
7566 link @file{home}.
7567
7568 @item .hlfsdir
7569 default sub-directory in the user's home directory, to which the
7570 @file{home} symbolic link returned by @i{Hlfsd} points.
7571
7572 @item /var/hlfs
7573 directory to which @file{home} symbolic link returned by @i{Hlfsd}
7574 points if it is unable to verify the that user's home directory is
7575 accessible.
7576
7577 @item /usr/tmp/hlfsd.dump.XXXXXX
7578 file to which @i{Hlfsd} will dump its internal password map when it
7579 receives the @samp{SIGUSR1} signal. @samp{XXXXXX} will be replaced by
7580 a random string generated by @b{mktemp}(3) or (the more secure)
7581 @b{mkstemp}(3).
7582
7583 @end table
7584
7585 For discussion on other files used by @i{Hlfsd}, see @xref{lostaltmail}, and
7586 @ref{lostaltmail.conf-sample}.
7587
7588 @c ################################################################
7589 @node Assorted Tools, Examples, Hlfsd, Top
7590 @comment  node-name,  next,  previous,  up
7591 @chapter Assorted Tools
7592 @cindex  Assorted Tools
7593
7594 The following are additional utilities and scripts included with
7595 am-utils, and get installed.
7596
7597 @menu
7598 * am-eject::
7599 * amd.conf-sample::
7600 * amd2ldif::
7601 * amd2sun::
7602 * automount2amd::
7603 * ctl-amd::
7604 * ctl-hlfsd::
7605 * fix-amd-map::
7606 * fixmount::
7607 * fixrmtab::
7608 * lostaltmail::
7609 * lostaltmail.conf-sample::
7610 * mk-amd-map::
7611 * pawd::
7612 * redhat-ctl-amd::
7613 * wait4amd::
7614 * wait4amd2die::
7615 * wire-test::
7616 @end menu
7617
7618 @c ----------------------------------------------------------------
7619 @node am-eject, amd.conf-sample, Assorted Tools, Assorted Tools
7620 @comment  node-name,  next,  previous,  up
7621 @section am-eject
7622 @pindex am-eject
7623
7624 A shell script unmounts a floppy or CD-ROM that is automounted, and
7625 then attempts to eject the removable device.
7626
7627 @c ----------------------------------------------------------------
7628 @node amd.conf-sample, amd2ldif, am-eject, Assorted Tools
7629 @comment  node-name,  next,  previous,  up
7630 @section amd.conf-sample
7631 @pindex amd.conf-sample
7632
7633 A sample @i{Amd} configuration file. @xref{Amd Configuration File}.
7634
7635 @c ----------------------------------------------------------------
7636 @node amd2ldif, amd2sun, amd.conf-sample, Assorted Tools
7637 @comment  node-name,  next,  previous,  up
7638 @section amd2ldif
7639 @pindex amd2ldif
7640
7641 A script to convert @i{Amd} maps to LDAP input files.  Use it as follows:
7642
7643 @example
7644 amd2ldif @i{mapname} @i{base} < @i{amd.mapfile} > @i{mapfile.ldif}
7645 @end example
7646
7647 @c ----------------------------------------------------------------
7648 @node amd2sun, automount2amd, amd2ldif, Assorted Tools
7649 @comment  node-name,  next,  previous,  up
7650 @section amd2sun
7651 @pindex amd2sun
7652
7653 A script to convert @i{Amd} maps to Sun Automounter maps.  Use it as
7654 follows
7655
7656 @example
7657 amd2sun < @i{amd.mapfile} > @i{auto_mapfile}
7658 @end example
7659
7660 @c ----------------------------------------------------------------
7661 @node automount2amd, ctl-amd, amd2sun, Assorted Tools
7662 @comment  node-name,  next,  previous,  up
7663 @section automount2amd
7664 @pindex automount2amd
7665
7666 A script to convert old Sun Automounter maps to @i{Amd} maps.
7667
7668 Say you have the Sun automount file @i{auto.foo}, with these two lines:
7669 @example
7670 home                  earth:/home
7671 moon  -ro,intr        server:/proj/images
7672 @end example
7673 Running
7674 @example
7675 automount2amd auto.foo > amd.foo
7676 @end example
7677
7678 will produce the @i{Amd} map @i{amd.foo} with this content:
7679
7680 @example
7681 # generated by automount2amd on Sat Aug 14 17:59:32 US/Eastern 1999
7682
7683 /defaults \\
7684   type:=nfs;opts:=rw,grpid,nosuid,utimeout=600
7685
7686 home \
7687   host==earth;type:=link;fs:=/home \\
7688   rhost:=earth;rfs:=/home
7689
7690 moon \
7691   -addopts:=ro,intr \\
7692   host==server;type:=link;fs:=/proj/images \\
7693   rhost:=server;rfs:=/proj/images
7694 @end example
7695
7696 This perl script will use the following @i{/default} entry
7697 @example
7698 type:=nfs;opts:=rw,grpid,nosuid,utimeout=600
7699 @end example
7700 If you wish to override that, define the @b{$DEFAULTS} environment
7701 variable, or modify the script.
7702
7703 If you wish to generate Amd maps using the @i{hostd} (@pxref{hostd
7704 Selector Variable}) @i{Amd} map syntax, then define the environment
7705 variable @b{$DOMAIN} or modify the script.
7706
7707 Note that automount2amd does not understand the syntax in newer Sun
7708 Automount maps, those used with autofs.
7709
7710 @c ----------------------------------------------------------------
7711 @node ctl-amd, ctl-hlfsd, automount2amd, Assorted Tools
7712 @comment  node-name,  next,  previous,  up
7713 @section ctl-amd
7714 @pindex ctl-amd
7715
7716 A script to start, stop, or restart @i{Amd}.  Use it as follows:
7717
7718 @table @t
7719 @item ctl-amd start
7720 Start a new @i{Amd} process.
7721 @item ctl-amd stop
7722 Stop the running @i{Amd}.
7723 @item ctl-amd restart
7724 Stop the running @i{Amd} (if any), safely wait for it to terminate, and
7725 then start a new process --- only if the previous one died cleanly.
7726 @end table
7727
7728 @xref{Run-time Administration}, for more details.
7729
7730 @c ----------------------------------------------------------------
7731 @node ctl-hlfsd, fix-amd-map, ctl-amd, Assorted Tools
7732 @comment  node-name,  next,  previous,  up
7733 @section ctl-hlfsd
7734 @pindex ctl-hlfsd
7735
7736 A script for controlling @i{Hlfsd}, much the same way @file{ctl-amd}
7737 controls @i{Amd}.  Use it as follows:
7738
7739 @table @t
7740 @item ctl-hlfsd start
7741 Start a new @i{Hlfsd} process.
7742 @item ctl-hlfsd stop
7743 Stop the running @i{Hlfsd}.
7744 @item ctl-hlfsd restart
7745 Stop the running @i{Hlfsd} (if any), wait for 10 seconds for it to
7746 terminate, and then start a new process --- only if the previous one
7747 died cleanly.
7748 @end table
7749
7750 @xref{Hlfsd}, for more details.
7751
7752 @c ----------------------------------------------------------------
7753 @node fix-amd-map, fixmount, ctl-hlfsd, Assorted Tools
7754 @comment  node-name,  next,  previous,  up
7755 @section fix-amd-map
7756 @pindex fix-amd-map
7757
7758 Am-utils changed some of the syntax and default values of some
7759 variables.  For example, the default value for @samp{$@{os@}} for
7760 Solaris 2.x (aka SunOS 5.x) systems used to be @samp{sos5}, it is now
7761 more automatically generated from @file{config.guess} and its value is
7762 @samp{sunos5}.
7763
7764 This script converts older @i{Amd} maps to new ones.  Use it as follows:
7765
7766 @example
7767 fix-amd-map < @i{old.map} > @i{new.map}
7768 @end example
7769
7770 @c ----------------------------------------------------------------
7771 @node fixmount, fixrmtab, fix-amd-map, Assorted Tools
7772 @comment  node-name,  next,  previous,  up
7773 @section fixmount
7774 @pindex fixmount
7775
7776 @samp{fixmount} is a variant of @b{showmount}(8) that can delete bogus
7777 mount entries in remote @b{mountd}(8) daemons.  This is useful to
7778 cleanup otherwise ever-accumulating ``junk''.  Use it for example:
7779
7780 @example
7781 fixmount -r @i{host}
7782 @end example
7783
7784 See the online manual page for @samp{fixmount} for more details of its
7785 usage.
7786
7787 @c ----------------------------------------------------------------
7788 @node fixrmtab, lostaltmail, fixmount, Assorted Tools
7789 @comment  node-name,  next,  previous,  up
7790 @section fixrmtab
7791 @pindex fixrmtab
7792
7793 A script to invalidate @file{/etc/rmtab} entries for hosts named.  Also
7794 restart mountd for changes to take effect.  Use it for example:
7795
7796 @example
7797 fixrmtab @i{host1} @i{host2} @i{...}
7798 @end example
7799
7800 @c ----------------------------------------------------------------
7801 @node lostaltmail, lostaltmail.conf-sample, fixrmtab, Assorted Tools
7802 @comment  node-name,  next,  previous,  up
7803 @section lostaltmail
7804 @pindex lostaltmail
7805
7806 A script used with @i{Hlfsd} to resend any ``lost'' mail.  @i{Hlfsd}
7807 redirects mail which cannot be written into the user's home directory to
7808 an alternate directory.  This is useful to continue delivering mail,
7809 even if the user's file system was unavailable, full, or over quota.
7810 But, the mail which gets delivered to  the alternate directory needs to
7811 be resent to its respective users.  This is what the @samp{lostaltmail}
7812 script does.
7813
7814 Use it as follows:
7815
7816 @example
7817 lostaltmail
7818 @end example
7819
7820 This script needs a configuration file @samp{lostaltmail.conf} set up
7821 with the right parameters to properly work.  @xref{Hlfsd}, for more
7822 details.
7823
7824 @c ----------------------------------------------------------------
7825 @node lostaltmail.conf-sample, mk-amd-map, lostaltmail, Assorted Tools
7826 @comment  node-name,  next,  previous,  up
7827 @section lostaltmail.conf-sample
7828 @pindex lostaltmail.conf-sample
7829 @cindex lostaltmail; configuration file
7830
7831 This is a text file with configuration parameters needed for the
7832 @samp{lostaltmail} script.  The script includes comments explaining each
7833 of the configuration variables.  See it for more information.  Also
7834 @pxref{Hlfsd} for general information.
7835
7836 @c ----------------------------------------------------------------
7837 @node mk-amd-map, pawd, lostaltmail.conf-sample, Assorted Tools
7838 @comment  node-name,  next,  previous,  up
7839 @section mk-amd-map
7840 @pindex mk-amd-map
7841
7842 This program converts a normal @i{Amd} map file into an ndbm database
7843 with the same prefix as the named file.  Use it as follows:
7844
7845 @example
7846 mk-amd-map @i{mapname}
7847 @end example
7848
7849 @c ----------------------------------------------------------------
7850 @node pawd, redhat-ctl-amd, mk-amd-map, Assorted Tools
7851 @comment  node-name,  next,  previous,  up
7852 @section pawd
7853 @pindex pawd
7854
7855 @i{Pawd} is used to print the current working directory, adjusted to
7856 reflect proper paths that can be reused to go through the automounter
7857 for the shortest possible path.  In particular, the path printed back
7858 does not include any of @i{Amd}'s local mount points.  Using them is
7859 unsafe, because @i{Amd} may unmount managed file systems from the mount
7860 points, and thus including them in paths may not always find the files
7861 within.
7862
7863 Without any arguments, @i{Pawd} will print the automounter adjusted
7864 current working directory.  With any number of arguments, it will print
7865 the adjusted path of each one of the arguments.
7866
7867 @c ----------------------------------------------------------------
7868 @node redhat-ctl-amd, wait4amd, pawd, Assorted Tools
7869 @comment  node-name,  next,  previous,  up
7870 @section redhat-ctl-amd
7871 @pindex redhat-ctl-amd
7872
7873 This script is similar to @i{ctl-amd} (@pxref{ctl-amd}) but is intended
7874 for Red Hat Linux systems.  You can safely copy @i{redhat-ctl-amd} onto
7875 @file{/etc/rc.d/init.d/amd}.  The script supplied by @i{Am-utils} is
7876 usually better than the one provided by Red Hat, because the Red Hat
7877 script does not correctly kill @i{Amd} processes: it is too quick to
7878 kill the wrong processes, leaving stale or hung mount points behind.
7879
7880 @c ----------------------------------------------------------------
7881 @node wait4amd, wait4amd2die, redhat-ctl-amd, Assorted Tools
7882 @comment  node-name,  next,  previous,  up
7883 @section wait4amd
7884 @pindex wait4amd
7885
7886 A script to wait for @i{Amd} to start on a particular host before
7887 performing an arbitrary command.  The command is executed repeatedly,
7888 with 1 second intervals in between.  You may interrupt the script using
7889 @samp{^C} (or whatever keyboard sequence your terminal's @samp{intr} function
7890 is bound to).
7891
7892 Examples:
7893
7894 @table @t
7895 @item wait4amd saturn amq -p -h saturn
7896 When @i{Amd} is up on host @samp{saturn}, get the process ID of that
7897 running @i{Amd}.
7898 @item wait4amd pluto rlogin pluto
7899 Remote login to host @samp{pluto} when @i{Amd} is up on that host.  It
7900 is generally necessary to wait for @i{Amd} to properly start and
7901 initialize on a remote host before logging in to it, because otherwise
7902 user home directories may not be accessible across the network.
7903 @item wait4amd pluto
7904 A short-hand version of the previous command, since the most useful
7905 reason for this script is to login to a remote host.  I use it very
7906 often when testing out new versions of @i{Amd}, and need to reboot hung
7907 hosts.
7908 @end table
7909
7910 @c ----------------------------------------------------------------
7911 @node wait4amd2die, wire-test, wait4amd, Assorted Tools
7912 @comment  node-name,  next,  previous,  up
7913 @section wait4amd2die
7914 @pindex wait4amd2die
7915
7916 This script is used internally by @samp{ctl-amd} when used to restart
7917 @i{Amd}.  It waits for @i{Amd} to terminate.  If it detected that
7918 @i{Amd} terminated cleanly, this script will return an exist status of
7919 zero.  Otherwise, it will return a non-zero exit status.
7920
7921 The script tests for @i{Amd}'s existence once every 5 seconds, six
7922 times, for a total of 30 seconds.  It will return a zero exist status as
7923 soon as it detects that @i{Amd} dies.
7924
7925 @c ----------------------------------------------------------------
7926 @node wire-test, , wait4amd2die, Assorted Tools
7927 @comment  node-name,  next,  previous,  up
7928 @section wire-test
7929 @pindex wire-test
7930
7931 A simple program to test if some of the most basic networking functions
7932 in am-util's library @file{libamu} work.  It also tests the combination
7933 of NFS protocol and version number that are supported from the current
7934 host, to a remote one.
7935
7936 For example, in this test a machine which only supports NFS Version 2 is
7937 contacting a remote host that can support the same version, but using
7938 both UDP and TCP.  If no host name is specified, @samp{wire-test} will
7939 try @file{localhost}.
7940
7941 @example
7942 $ wire-test moisil
7943 Network name is "mcl-lab-net.cs.columbia.edu"
7944 Network number is "128.59.13"
7945 Network name is "old-net.cs.columbia.edu"
7946 Network number is "128.59.16"
7947 My IP address is 0x7f000001.
7948 NFS Version and protocol tests to host "moisil"...
7949         testing vers=2, proto="udp" -> found version 2.
7950         testing vers=3, proto="udp" -> failed!
7951         testing vers=2, proto="tcp" -> found version 2.
7952         testing vers=3, proto="tcp" -> failed!
7953 @end example
7954
7955 @c ################################################################
7956 @node Examples, Internals, Assorted Tools, Top
7957 @comment  node-name,  next,  previous,  up
7958 @chapter Examples
7959
7960 @menu
7961 * User Filesystems::
7962 * Home Directories::
7963 * Architecture Sharing::
7964 * Wildcard Names::
7965 * rwho servers::
7966 * /vol::
7967 * /defaults with selectors::
7968 * /tftpboot in a chroot-ed environment::
7969
7970 @end menu
7971
7972 @node User Filesystems, Home Directories, Examples, Examples
7973 @comment  node-name,  next,  previous,  up
7974 @section User Filesystems
7975 @cindex User filesystems
7976 @cindex Mounting user filesystems
7977
7978 With more than one fileserver, the directories most frequently
7979 cross-mounted are those containing user home directories.  A common
7980 convention used at Imperial College is to mount the user disks under
7981 @t{/home/}@i{machine}.
7982
7983 Typically, the @samp{/etc/fstab} file contained a long list of entries
7984 such as:
7985
7986 @example
7987 @i{machine}:/home/@i{machine} /home/@i{machine} nfs ...
7988 @end example
7989
7990 for each fileserver on the network.
7991
7992 There are numerous problems with this system.  The mount list can become
7993 quite large and some of the machines may be down when a system is
7994 booted.  When a new fileserver is installed, @samp{/etc/fstab} must be
7995 updated on every machine, the mount directory created and the filesystem
7996 mounted.
7997
7998 In many environments most people use the same few workstations, but
7999 it is convenient to go to a colleague's machine and access your own
8000 files.  When a server goes down, it can cause a process on a client
8001 machine to hang.  By minimizing the mounted filesystems to only include
8002 those actively being used, there is less chance that a filesystem will
8003 be mounted when a server goes down.
8004
8005 The following is a short extract from a map taken from a research fileserver
8006 at Imperial College.
8007
8008 Note the entry for @samp{localhost} which is used for users such as
8009 the operator (@samp{opr}) who have a home directory on most machine as
8010 @samp{/home/localhost/opr}.
8011
8012 @example
8013 /defaults       opts:=rw,intr,grpid,nosuid
8014 charm           host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \
8015                 host==$@{key@};type:=ufs;dev:=/dev/xd0g
8016 #
8017 ...
8018
8019 #
8020 localhost       type:=link;fs:=$@{host@}
8021 ...
8022 #
8023 # dylan has two user disks so have a
8024 # top directory in which to mount them.
8025 #
8026 dylan           type:=auto;fs:=$@{map@};pref:=$@{key@}/
8027 #
8028 dylan/dk2       host!=dylan;type:=nfs;rhost:=dylan;rfs:=/home/$@{key@} \
8029                 host==dylan;type:=ufs;dev:=/dev/dsk/2s0
8030 #
8031 dylan/dk5       host!=dylan;type:=nfs;rhost:=dylan;rfs:=/home/$@{key@} \
8032                 host==dylan;type:=ufs;dev:=/dev/dsk/5s0
8033 ...
8034 #
8035 toytown         host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \
8036                 host==$@{key@};type:=ufs;dev:=/dev/xy1g
8037 ...
8038 #
8039 zebedee         host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \
8040                 host==$@{key@};type:=ufs;dev:=/dev/dsk/1s0
8041 #
8042 # Just for access...
8043 #
8044 gould           type:=auto;fs:=$@{map@};pref:=$@{key@}/
8045 gould/staff     host!=gould;type:=nfs;rhost:=gould;rfs:=/home/$@{key@}
8046 #
8047 gummo           host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@}
8048 ...
8049 @end example
8050
8051 This map is shared by most of the machines listed so on those
8052 systems any of the user disks is accessible via a consistent name.
8053 @i{Amd} is started with the following command
8054
8055 @example
8056 amd /home amd.home
8057 @end example
8058
8059 Note that when mounting a remote filesystem, the @dfn{automounted}
8060 mount point is referenced, so that the filesystem will be mounted if
8061 it is not yet (at the time the remote @samp{mountd} obtains the file handle).
8062
8063 @node Home Directories, Architecture Sharing, User Filesystems, Examples
8064 @comment  node-name,  next,  previous,  up
8065 @section Home Directories
8066 @cindex Home directories
8067 @cindex Example of mounting home directories
8068 @cindex Mount home directories
8069
8070 One convention for home directories is to locate them in @samp{/homes}
8071 so user @samp{jsp}'s home directory is @samp{/homes/jsp}.  With more
8072 than a single fileserver it is convenient to spread user files across
8073 several machines.  All that is required is a mount-map which converts
8074 login names to an automounted directory.
8075
8076 Such a map might be started by the command:
8077
8078 @example
8079 amd /homes amd.homes
8080 @end example
8081
8082 where the map @samp{amd.homes} contained the entries:
8083
8084 @example
8085 /defaults   type:=link   # All the entries are of type:=link
8086 jsp         fs:=/home/charm/jsp
8087 njw         fs:=/home/dylan/dk5/njw
8088 ...
8089 phjk        fs:=/home/toytown/ai/phjk
8090 sjv         fs:=/home/ganymede/sjv
8091 @end example
8092
8093 Whenever a login name is accessed in @samp{/homes} a symbolic link
8094 appears pointing to the real location of that user's home directory.  In
8095 this example, @samp{/homes/jsp} would appear to be a symbolic link
8096 pointing to @samp{/home/charm/jsp}.  Of course, @samp{/home} would also
8097 be an automount point.
8098
8099 This system causes an extra level of symbolic links to be used.
8100 Although that turns out to be relatively inexpensive, an alternative is
8101 to directly mount the required filesystems in the @samp{/homes}
8102 map.  The required map is simple, but long, and its creation is best automated.
8103 The entry for @samp{jsp} could be:
8104
8105 @example
8106 jsp   -sublink:=$@{key@};rfs:=/home/charm \
8107                host==charm;type:=ufs;dev:=/dev/xd0g \
8108                host!=charm;type:=nfs;rhost:=charm
8109 @end example
8110
8111 This map can become quite big if it contains a large number of entries.
8112 By combining two other features of @i{Amd} it can be greatly simplified.
8113
8114 First the UFS partitions should be mounted under the control of
8115 @samp{/etc/fstab}, taking care that they are mounted in the same place
8116 that @i{Amd} would have automounted them.  In most cases this would be
8117 something like @samp{/a/@dfn{host}/home/@dfn{host}} and
8118 @samp{/etc/fstab} on host @samp{charm} would have a line:@refill
8119
8120 @example
8121 /dev/xy0g /a/charm/home/charm 4.2 rw,nosuid,grpid 1 5
8122 @end example
8123
8124 The map can then be changed to:
8125
8126 @example
8127 /defaults    type:=nfs;sublink:=$@{key@};opts:=rw,intr,nosuid,grpid
8128 jsp          rhost:=charm;rfs:=/home/charm
8129 njw          rhost:=dylan;rfs:=/home/dylan/dk5
8130 ...
8131 phjk         rhost:=toytown;rfs:=/home/toytown;sublink:=ai/$@{key@}
8132 sjv          rhost:=ganymede;rfs:=/home/ganymede
8133 @end example
8134
8135 This map operates as usual on a remote machine (@i{ie} @code{$@{host@}}
8136 not equal to @code{$@{rhost@}}).  On the machine where the filesystem is
8137 stored (@i{ie} @code{$@{host@}} equal to @code{$@{rhost@}}), @i{Amd}
8138 will construct a local filesystem mount point which corresponds to the
8139 name of the locally mounted UFS partition.  If @i{Amd} is started with
8140 the @code{-r} option then instead of attempting an NFS mount, @i{Amd} will
8141 simply inherit the UFS mount (@pxref{Inheritance Filesystem}).  If
8142 @code{-r} is not used then a loopback NFS mount will be made.  This type of
8143 mount is known to cause a deadlock on many systems.
8144
8145 @node Architecture Sharing, Wildcard Names, Home Directories, Examples
8146 @comment  node-name,  next,  previous,  up
8147 @section Architecture Sharing
8148 @cindex Architecture sharing
8149 @cindex Sharing a fileserver between architectures
8150 @cindex Architecture dependent volumes
8151
8152 @c %At the moment some of the research machines have sets of software
8153 @c %mounted in @samp{/vol}.  This contains subdirectories for \TeX,
8154 @c %system sources, local sources, prolog libraries and so on.
8155 Often a filesystem will be shared by machines of different architectures.
8156 Separate trees can be maintained for the executable images for each
8157 architecture, but it may be more convenient to have a shared tree,
8158 with distinct subdirectories.
8159
8160 A shared tree might have the following structure on the fileserver (called
8161 @samp{fserver} in the example):
8162
8163 @example
8164 local/tex
8165 local/tex/fonts
8166 local/tex/lib
8167 local/tex/bin
8168 local/tex/bin/sun3
8169 local/tex/bin/sun4
8170 local/tex/bin/hp9000
8171 ...
8172 @end example
8173
8174 In this example, the subdirectories of @samp{local/tex/bin} should be
8175 hidden when accessed via the automount point (conventionally @samp{/vol}).
8176 A mount-map for @samp{/vol} to achieve this would look like:
8177
8178 @example
8179 /defaults   sublink:=$@{/key@};rhost:=fserver;type:=link
8180 tex         type:=auto;fs:=$@{map@};pref:=$@{key@}/
8181 tex/fonts   host!=fserver;type:=nfs;rfs:=/vol/tex \
8182             host==fserver;fs:=/usr/local/tex
8183 tex/lib     host!=fserver;type:=nfs;rfs:=/vol/tex \
8184             host==fserver;fs:=/usr/local/tex
8185 tex/bin     -sublink:=$@{/key@}/$@{arch@} \
8186             host!=fserver;type:=nfs;rfs:=/vol/tex \
8187             host:=fserver;fs:=/usr/local/tex
8188 @end example
8189
8190 When @samp{/vol/tex/bin} is referenced, the current machine architecture
8191 is automatically appended to the path by the @code{$@{sublink@}}
8192 variable.  This means that users can have @samp{/vol/tex/bin} in their
8193 @samp{PATH} without concern for architecture dependencies.
8194
8195 @node Wildcard Names, rwho servers, Architecture Sharing, Examples
8196 @comment  node-name,  next,  previous,  up
8197 @section Wildcard Names & Replicated Servers
8198
8199 By using the wildcard facility, @i{Amd} can @dfn{overlay} an existing
8200 directory with additional entries.
8201 The system files are usually mounted under @samp{/usr}.  If instead,
8202 @i{Amd} is mounted on @samp{/usr}, additional
8203 names can be overlayed to augment or replace names in the ``master'' @samp{/usr}.
8204 A map to do this would have the form:
8205
8206 @example
8207 local  type:=auto;fs:=local-map
8208 share  type:=auto;fs:=share-map
8209 *      -type:=nfs;rfs:=/export/exec/$@{arch@};sublink:="$@{key@}" \
8210         rhost:=fserv1  rhost:=fserv2  rhost:=fserv3
8211 @end example
8212
8213 Note that the assignment to @code{$@{sublink@}} is surrounded by double
8214 quotes to prevent the incoming key from causing the map to be
8215 misinterpreted.  This map has the effect of directing any access to
8216 @samp{/usr/local} or @samp{/usr/share} to another automount point.
8217
8218 In this example, it is assumed that the @samp{/usr} files are replicated
8219 on three fileservers: @samp{fserv1}, @samp{fserv2} and @samp{fserv3}.
8220 For any references other than to @samp{local} and @samp{share} one of
8221 the servers is used and a symbolic link to
8222 @t{$@{autodir@}/$@{rhost@}/export/exec/$@{arch@}/@i{whatever}} is
8223 returned once an appropriate filesystem has been mounted.@refill
8224
8225 @node rwho servers, /vol, Wildcard Names, Examples
8226 @comment  node-name,  next,  previous,  up
8227 @section @samp{rwho} servers
8228 @cindex rwho servers
8229 @cindex Architecture specific mounts
8230 @cindex Example of architecture specific mounts
8231
8232 The @samp{/usr/spool/rwho} directory is a good candidate for automounting.
8233 For efficiency reasons it is best to capture the rwho data on a small
8234 number of machines and then mount that information onto a large number
8235 of clients.  The data written into the rwho files is byte order dependent
8236 so only servers with the correct byte ordering can be used by a client:
8237
8238 @example
8239 /defaults         type:=nfs
8240 usr/spool/rwho    -byte==little;rfs:=/usr/spool/rwho \
8241                       rhost:=vaxA  rhost:=vaxB \
8242                   || -rfs:=/usr/spool/rwho \
8243                       rhost:=sun4  rhost:=hp300
8244 @end example
8245
8246 @node /vol, /defaults with selectors, rwho servers, Examples
8247 @comment  node-name,  next,  previous,  up
8248 @section @samp{/vol}
8249 @cindex /vol
8250 @cindex Catch-all mount point
8251 @cindex Generic volume name
8252
8253 @samp{/vol} is used as a catch-all for volumes which do not have other
8254 conventional names.
8255
8256 Below is part of the @samp{/vol} map for the domain @samp{doc.ic.ac.uk}.
8257 The @samp{r+d} tree is used for new or experimental software that needs
8258 to be available everywhere without installing it on all the fileservers.
8259 Users wishing to try out the new software then simply include
8260 @samp{/vol/r+d/@{bin,ucb@}} in their path.@refill
8261
8262 The main tree resides on one host @samp{gould.doc.ic.ac.uk}, which has
8263 different @samp{bin}, @samp{etc}, @samp{lib} and @samp{ucb}
8264 sub-directories for each machine architecture.  For example,
8265 @samp{/vol/r+d/bin} for a Sun-4 would be stored in the sub-directory
8266 @samp{bin/sun4} of the filesystem @samp{/usr/r+d}.  When it was accessed
8267 a symbolic link pointing to @samp{/a/gould/usr/r+d/bin/sun4} would be
8268 returned.@refill
8269
8270 @example
8271 /defaults    type:=nfs;opts:=rw,grpid,nosuid,intr,soft
8272 wp           -opts:=rw,grpid,nosuid;rhost:=charm \
8273              host==charm;type:=link;fs:=/usr/local/wp \
8274              host!=charm;type:=nfs;rfs:=/vol/wp
8275 ...
8276 #
8277 src          -opts:=rw,grpid,nosuid;rhost:=charm \
8278              host==charm;type:=link;fs:=/usr/src \
8279              host!=charm;type:=nfs;rfs:=/vol/src
8280 #
8281 r+d          type:=auto;fs:=$@{map@};pref:=r+d/
8282 # per architecture bin,etc,lib&ucb...
8283 r+d/bin      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
8284 r+d/etc      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
8285 r+d/include  rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}
8286 r+d/lib      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
8287 r+d/man      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}
8288 r+d/src      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}
8289 r+d/ucb      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
8290 # hades pictures
8291 pictures     -opts:=rw,grpid,nosuid;rhost:=thpfs \
8292              host==thpfs;type:=link;fs:=/nbsd/pictures \
8293              host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=pictures
8294 # hades tools
8295 hades        -opts:=rw,grpid,nosuid;rhost:=thpfs \
8296              host==thpfs;type:=link;fs:=/nbsd/hades \
8297              host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=hades
8298 # bsd tools for hp.
8299 bsd          -opts:=rw,grpid,nosuid;arch==hp9000;rhost:=thpfs \
8300              host==thpfs;type:=link;fs:=/nbsd/bsd \
8301              host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=bsd
8302 @end example
8303
8304 @node /defaults with selectors, /tftpboot in a chroot-ed environment, /vol, Examples
8305 @comment  node-name,  next,  previous,  up
8306 @section @samp{/defaults} with selectors
8307 @cindex /defaults with selectors
8308 @cindex selectors on default
8309
8310 It is sometimes useful to have different defaults for a given map.  To
8311 achieve this, the @samp{/defaults} entry must be able to process normal
8312 selectors.  This feature is turned on by setting
8313 @samp{selectors_in_defaults = yes} in the @file{amd.conf} file.
8314 @xref{selectors_in_defaults Parameter}.
8315
8316 In this example, I set different default NFS mount options for hosts
8317 which are running over a slower network link.  By setting a smaller size
8318 for the NFS read and write buffer sizes, you can greatly improve remote
8319 file service performance.
8320
8321 @example
8322 /defaults \
8323   wire==slip-net;opts:=rw,intr,rsize=1024,wsize=1024,timeo=20,retrans=10 \
8324   wire!=slip-net;opts:=rw,intr
8325 @end example
8326
8327 @node /tftpboot in a chroot-ed environment, , /defaults with selectors, Examples
8328 @comment  node-name,  next,  previous,  up
8329 @section @samp{/tftpboot} in a chroot-ed environment
8330 @cindex /tftpboot in a chroot-ed environment
8331 @cindex chroot; /tftpboot example
8332
8333 In this complex example, we attempt to run an @i{Amd} process
8334 @emph{inside} a chroot-ed environment.  @samp{tftpd} (Trivial FTP) is
8335 used to trivially retrieve files used to boot X-Terminals, Network
8336 Printers, Network routers, diskless workstations, and other such
8337 devices.  For security reasons, @samp{tftpd} (and also @samp{ftpd})
8338 processes are run using the @b{chroot}(2) system call.  This provides an
8339 environment for these processes, where access to any files outside the
8340 directory where the chroot-ed process runs is denied.
8341
8342 For example, if you start @samp{tftpd} on your system with
8343
8344 @example
8345 chroot /tftpboot /usr/sbin/tftpd
8346 @end example
8347
8348 @noindent
8349 then the @samp{tftpd} process will not be able to access any files
8350 outside @file{/tftpboot}.  This ensures that no one can retrieve files
8351 such as @file{/etc/passwd} and run password crackers on it.
8352
8353 Since the TFTP service works by broadcast, it is necessary to have at
8354 least one TFTP server running on each subnet.  If you have lots of files
8355 that you need to make available for @samp{tftp}, and many subnets, it
8356 could take significant amounts of disk space on each host serving them.
8357
8358 A solution we implemented at Columbia University was to have every host
8359 run @samp{tftpd}, but have those servers retrieve the boot files from
8360 two replicated servers.  Those replicated servers have special
8361 partitions dedicated to the many network boot files.
8362
8363 We start @i{Amd} as follows:
8364
8365 @example
8366 amd /tftpboot/.amd amd.tftpboot
8367 @end example
8368
8369 That is, @i{Amd} is serving the directory @file{/tftpboot/.amd}.  The
8370 @samp{tftp} server runs inside @file{/tftpboot} and is chroot-ed in that
8371 directory too.  The @file{amd.tftpboot} map looks like:
8372
8373 @example
8374 #
8375 # Amd /tftpboot directory -> host map
8376 #
8377
8378 /defaults  opts:=nosuid,ro,intr,soft;fs:=/tftpboot/import;type:=nfs
8379
8380 tp         host==lol;rfs:=/n/lol/import/tftpboot;type:=lofs \
8381            host==ober;rfs:=/n/ober/misc/win/tftpboot;type:=lofs \
8382            rhost:=ober;rfs:=/n/ober/misc/win/tftpboot \
8383            rhost:=lol;rfs:=/n/lol/import/tftpboot
8384 @end example
8385
8386 To help understand this example, I list a few of the file entries that
8387 are created inside @file{/tftpboot}:
8388
8389 @example
8390 $ ls -la /tftpboot
8391 dr-xr-xr-x   2 root   512 Aug 30 23:11 .amd
8392 drwxrwsr-x  12 root   512 Aug 30 08:00 import
8393 lrwxrwxrwx   1 root    33 Feb 27  1997 adminpr.cfg -> ./.amd/tp/hplj/adminpr.cfg
8394 lrwxrwxrwx   1 root    22 Dec  5  1996 tekxp -> ./.amd/tp/xterms/tekxp
8395 lrwxrwxrwx   1 root     1 Dec  5  1996 tftpboot -> .
8396 @end example
8397
8398 Here is an explanation of each of the entries listed above:
8399
8400 @table @code
8401
8402 @item .amd
8403 This is the @i{Amd} mount point.  Note that you do not need to run a
8404 separate @i{Amd} process for the TFTP service.  The @b{chroot}(2) system
8405 call only protects against file access, but the same process can still
8406 serve files and directories inside and outside the chroot-ed
8407 environment, because @i{Amd} itself was not run in chroot-ed mode.
8408
8409 @item import
8410 This is the mount point where @i{Amd} will mount the directories
8411 containing the boot files.  The map is designed so that remote
8412 directories will be NFS mounted (even if they are already mounted
8413 elsewhere), and local directories are loopback mounted (since they are
8414 not accessible outside the chroot-ed @file{/tftpboot} directory).
8415
8416 @item adminpr.cfg
8417 @itemx tekxp
8418 Two manually created symbolic links to directories @emph{inside} the
8419 @i{Amd}-managed directory.  The crossing of the component @file{tp} will
8420 cause @i{Amd} to automount one of the remote replicas.  Once crossed,
8421 access to files inside proceeds as usual.  The @samp{adminpr.cfg} is a
8422 configuration file for an HP Laser-Jet 4si printer, and the @samp{tekxp}
8423 is a directory for Tektronix X-Terminal boot files.
8424
8425 @item tftpboot
8426 This innocent looking symlink is important.  Usually, when devices boot
8427 via the TFTP service, they perform the @samp{get file} command to
8428 retrieve @var{file}.  However, some devices assume that @samp{tftpd}
8429 does not run in a chroot-ed environment, but rather ``unprotected'', and
8430 thus use a full pathname for files to retrieve, as in @samp{get
8431 /tftpboot/file}.  This symlink effectively strips out the leading
8432 @file{/tftpboot/}.
8433
8434 @end table
8435
8436 @c ################################################################
8437 @node Internals, Acknowledgments & Trademarks, Examples, Top
8438 @comment  node-name,  next,  previous,  up
8439 @chapter Internals
8440
8441 Note that there are more error and logging messages possible than are
8442 listed here.  Most of them are self-explanatory.  Refer to the program
8443 sources for more details on the rest.
8444
8445 @menu
8446 * Log Messages::
8447 @end menu
8448
8449 @node Log Messages, , Internals, Internals
8450 @comment  node-name,  next,  previous,  up
8451 @section Log Messages
8452
8453 In the following sections a brief explanation is given of some of the
8454 log messages made by @i{Amd}.  Where the message is in @samp{typewriter}
8455 font, it corresponds exactly to the message produced by @i{Amd}.  Words
8456 in @dfn{italic} are replaced by an appropriate string.  Variables,
8457 @code{$@{@i{var}@}}, indicate that the value of the appropriate variable is
8458 output.
8459
8460 Log messages are either sent directly to a file,
8461 or logged via the @b{syslog}(3) mechanism.  @xref{log_file Parameter}.
8462 In either case, entries in the file are of the form:
8463 @example
8464 @i{date-string}  @i{hostname} @t{amd[}@i{pid}@t{]}  @i{message}
8465 @end example
8466
8467 @menu
8468 * Fatal errors::
8469 * Info messages::
8470 @end menu
8471
8472 @node Fatal errors, Info messages, Log Messages, Log Messages
8473 @comment  node-name,  next,  previous,  up
8474 @subsection Fatal errors
8475
8476 @i{Amd} attempts to deal with unusual events.  Whenever it is not
8477 possible to deal with such an error, @i{Amd} will log an appropriate
8478 message and, if it cannot possibly continue, will either exit or abort.
8479 These messages are selected by @samp{-x fatal} on the command line.
8480 When @b{syslog}(3) is being used, they are logged with level
8481 @samp{LOG_FATAL}.  Even if @i{Amd} continues to operate it is likely to
8482 remain in a precarious state and should be restarted at the earliest
8483 opportunity.
8484
8485 @table @t
8486
8487 @item Attempting to inherit not-a-filesystem
8488 The prototype mount point created during a filesystem restart did not
8489 contain a reference to the restarted filesystem.  This error ``should
8490 never happen''.
8491
8492 @item Can't bind to domain "@i{NIS-domain}"
8493 A specific NIS domain was requested on the command line, but no server
8494 for that domain is available on the local net.
8495
8496 @item Can't determine IP address of this host (@i{hostname})
8497 When @i{Amd} starts it determines its own IP address.  If this lookup
8498 fails then @i{Amd} cannot continue.  The hostname it looks up is that
8499 obtained returned by @b{gethostname}(2) system call.
8500
8501 @item Can't find root file handle for @i{automount point}
8502 @i{Amd} creates its own file handles for the automount points.  When it
8503 mounts itself as a server, it must pass these file handles to the local
8504 kernel.  If the filehandle is not obtainable the mount point is ignored.
8505 This error ``should never happen''.
8506
8507 @item Must be root to mount filesystems (euid = @i{euid})
8508 To prevent embarrassment, @i{Amd} makes sure it has appropriate system
8509 privileges.  This amounts to having an euid of 0.  The check is made
8510 after argument processing complete to give non-root users a chance to
8511 access the @code{-v} option.
8512
8513 @item No work to do - quitting
8514 No automount points were given on the command line and so there is no
8515 work to do.
8516
8517 @item Out of memory
8518 While attempting to malloc some memory, the memory space available to
8519 @i{Amd} was exhausted.  This is an unrecoverable error.
8520
8521 @item Out of memory in realloc
8522 While attempting to realloc some memory, the memory space available to
8523 @i{Amd} was exhausted.  This is an unrecoverable error.
8524
8525 @item cannot create rpc/udp service
8526 Either the NFS or AMQ endpoint could not be created.
8527
8528 @item gethostname: @i{description}
8529 The @b{gethostname}(2) system call failed during startup.
8530
8531 @item host name is not set
8532 The @b{gethostname}(2) system call returned a zero length host name.
8533 This can happen if @i{Amd} is started in single user mode just after
8534 booting the system.
8535
8536 @item ifs_match called!
8537 An internal error occurred while restarting a pre-mounted filesystem.
8538 This error ``should never happen''.
8539
8540 @item mount_afs: @i{description}
8541 An error occurred while @i{Amd} was mounting itself.
8542
8543 @item run_rpc failed
8544 Somehow the main NFS server loop failed.  This error ``should never
8545 happen''.
8546
8547 @item unable to free rpc arguments in amqprog_1
8548 The incoming arguments to the AMQ server could not be free'ed.
8549
8550 @item unable to free rpc arguments in nfs_program_1
8551 The incoming arguments to the NFS server could not be free'ed.
8552
8553 @item unable to register (AMQ_PROGRAM, AMQ_VERSION, udp)
8554 The AMQ server could not be registered with the local portmapper or the
8555 internal RPC dispatcher.
8556
8557 @item unable to register (NFS_PROGRAM, NFS_VERSION, 0)
8558 The NFS server could not be registered with the internal RPC dispatcher.
8559
8560 @end table
8561
8562 XXX: This section needs to be updated
8563
8564 @node Info messages, , Fatal errors, Log Messages
8565 @comment  node-name,  next,  previous,  up
8566 @subsection Info messages
8567
8568 @i{Amd} generates information messages to record state changes.  These
8569 messages are selected by @samp{-x info} on the command line.  When
8570 @b{syslog}(3) is being used, they are logged with level @samp{LOG_INFO}.
8571
8572 The messages listed below can be generated and are in a format suitable
8573 for simple statistical analysis.  @dfn{mount-info} is the string
8574 that is displayed by @dfn{Amq} in its mount information column and
8575 placed in the system mount table.
8576
8577 @table @t
8578
8579 @item "@t{$@{@i{path}@}}" forcibly timed out
8580 An automount point has been timed out by the @i{Amq} command.
8581
8582 @item "@t{$@{@i{path}@}}" has timed out
8583 No access to the automount point has been made within the timeout
8584 period.
8585
8586 @item Filehandle denied for "$@{@i{rhost}@}:$@{@i{rfs}@}"
8587 The mount daemon refused to return a file handle for the requested filesystem.
8588
8589 @item Filehandle error for "$@{@i{rhost}@}:$@{@i{rfs}@}": @i{description}
8590 The mount daemon gave some other error for the requested filesystem.
8591
8592 @item Finishing with status @i{exit-status}
8593 @i{Amd} is about to exit with the given exit status.
8594
8595 @item Re-synchronizing cache for map @t{$@{@i{map}@}}
8596 The named map has been modified and the internal cache is being re-synchronized.
8597
8598 @item file server @t{$@{@i{rhost}@}} is down - timeout of "@t{$@{@i{path}@}}" ignored
8599 An automount point has timed out, but the corresponding file server is
8600 known to be down.  This message is only produced once for each mount
8601 point for which the server is down.
8602
8603 @item file server @t{$@{@i{rhost}@}} type nfs is down
8604 An NFS file server that was previously up is now down.
8605
8606 @item file server @t{$@{@i{rhost}@}} type nfs is up
8607 An NFS file server that was previously down is now up.
8608
8609 @item file server @t{$@{@i{rhost}@}} type nfs starts down
8610 A new NFS file server has been referenced and is known to be down.
8611
8612 @item file server @t{$@{@i{rhost}@}} type nfs starts up
8613 A new NFS file server has been referenced and is known to be up.
8614
8615 @item mount of "@t{$@{@i{path}@}}" on @t{$@{@i{fs}@}} timed out
8616 Attempts to mount a filesystem for the given automount point have failed
8617 to complete within 30 seconds.
8618
8619 @item @i{mount-info} mounted fstype @t{$@{@i{type}@}} on @t{$@{@i{fs}@}}
8620 A new file system has been mounted.
8621
8622 @item @i{mount-info} restarted fstype @t{$@{@i{type}@}} on @t{$@{@i{fs}@}}
8623 @i{Amd} is using a pre-mounted filesystem to satisfy a mount request.
8624
8625 @item @i{mount-info} unmounted fstype @t{$@{@i{type}@}} from @t{$@{@i{fs}@}}
8626 A file system has been unmounted.
8627
8628 @item @i{mount-info} unmounted fstype @t{$@{@i{type}@}} from @t{$@{@i{fs}@}} link @t{$@{@i{fs}@}}/@t{$@{@i{sublink}@}}
8629 A file system of which only a sub-directory was in use has been unmounted.
8630
8631 @item restarting @i{mount-info} on @t{$@{@i{fs}@}}
8632 A pre-mounted file system has been noted.
8633
8634 @end table
8635
8636 XXX: This section needs to be updated
8637
8638 @c ################################################################
8639 @node Acknowledgments & Trademarks, Index, Internals, Top
8640 @comment  node-name,  next,  previous,  up
8641 @unnumbered Acknowledgments & Trademarks
8642
8643 Many thanks to the Am-Utils Users
8644 mailing list through the months developing am-utils.  These members
8645 have contributed to the discussions, ideas, code and documentation,
8646 and subjected their systems to alpha quality code.  Special thanks go
8647 to those @uref{http://www.am-utils.org/docs/am-utils/AUTHORS.txt,authors} who have
8648 submitted patches, and especially to the maintainers:
8649
8650 @itemize @bullet
8651 @item @uref{http://www.cs.sunysb.edu/~ezk,Erez Zadok}
8652 @item @email{ionut AT badula.org,Ion Badulescu}
8653 @item @email{ro AT techfak.uni-bielefeld.de,Rainer Orth}
8654 @item @email{nick.williams AT morganstanley.com,Nick Williams}
8655 @end itemize
8656
8657 Thanks to the Formal Methods Group at Imperial College for suffering
8658 patiently while @i{Amd} was being developed on their machines.
8659
8660 Thanks to the many people who have helped with the development of
8661 @i{Amd}, especially Piete Brooks at the Cambridge University Computing
8662 Lab for many hours of testing, experimentation and discussion.
8663
8664 Thanks to the older @email{amd-workers AT majordomo.glue.umd.edu,Amd
8665 Workers} mailing list (now defunct) members for many suggestions and
8666 bug reports to @i{Amd}.
8667
8668 @itemize @bullet
8669 @item
8670 @b{DEC}, @b{VAX} and @b{Ultrix} are registered trademarks of Digital
8671 Equipment Corporation.
8672 @item
8673 @b{AIX} and @b{IBM} are registered trademarks of International Business
8674 Machines Corporation.
8675 @item
8676 @b{Sun}, @b{NFS} and @b{SunOS} are registered trademarks of Sun
8677 Microsystems, Inc.
8678 @item
8679 @b{UNIX} is a registered trademark in the USA and other countries,
8680 exclusively licensed through X/Open Company, Ltd.
8681 @item
8682 All other registered trademarks are owned by their respective owners.
8683 @end itemize
8684
8685 @c ################################################################
8686 @node Index, , Acknowledgments & Trademarks, Top
8687 @comment  node-name,  next,  previous,  up
8688 @unnumbered Index
8689
8690 @printindex cp
8691
8692 @contents
8693 @bye
8694
8695 @c ====================================================================
8696 @c ISPELL LOCAL WORDS:
8697 @c LocalWords:  setfilename amdref overfullrule settitle titlepage titlefont nz
8698 @c LocalWords:  authorfont vskip ifinfo iftex cindex unnumberedsec dfn xref vol
8699 @c LocalWords:  locationN pxref jpo nott concentrix Sjoerd sjoerd cwi Eitan vuw
8700 @c LocalWords:  Mizrotsky eitan shumuji dgux fpx scp hcx metcalf masala hlh OTS
8701 @c LocalWords:  Presnell srp cgl Trost trost ogi pyrOSx OSx tubsibr riscix iX
8702 @c LocalWords:  Piete pb Lindblad cjl ai umax utek xinu Mitchum D'Souza dsouza
8703 @c LocalWords:  mrc apu alliant aviion AViiON fps macII multimax tahoe vax emph
8704 @c LocalWords:  mapdefault valA valB valC YPTSDIR ETCDIR substr MAKEDBM YPDBDIR
8705 @c LocalWords:  NOPUSH njw dylan dk dylan njw anydir domN achilles mjh pref sel
8706 @c LocalWords:  gdef loc loc loc ldots autodir remopts rwho rwho styx styx yoyo
8707 @c LocalWords:  noindent gould rvdmount rvdunmount fserver mtmp unioned logfile
8708 @c LocalWords:  dmn esac phjk toytown toytown toytown toytown phjk RdDir RdLnk
8709 @c LocalWords:  volname attrs netif dougal inaddr hwaddr ec mountmaps passno xy
8710 @c LocalWords:  freq dumpset hfs brian florence localinfo fstabs automaps defn
8711 @c LocalWords:  localname fsck'd opr gummo sjv ganymede sjv fserv fserv fserv
8712 @c LocalWords:  vaxA vaxB wp thpfs nbsd asis ifs amqprog free'ed printindex gov
8713 @c LocalWords:  LocalWords syncodeindex Distrib bsdnet lanl AutoMounter acis ic
8714 @c LocalWords:  ac uk aix bsd Mullender nl il DG lcs hpux irix ucsf NeXT cse cl
8715 @c LocalWords:  mt FX hp ibm mips utils def def Domainname eg hostd getwd tmp
8716 @c LocalWords:  subsubsection rw grpid intr noconn nocto nodevs nosuid retrans
8717 @c LocalWords:  rsize tcp timeo nounmount utimeout DDEBUG nodaemon fd hostnames
8718 @c LocalWords:  pid Amd's pendry vangogh nfsx backoff stats nomap nostats CRIT
8719 @c LocalWords:  noinfo clustername RVD dsk dsk amq hostports osver statfs str
8720 @c LocalWords:  ou counter's amdmaps proj src tftpboot sh mv cd sbin ypcat inet
8721 @c LocalWords:  Getattr getattr localhost fhandles netmask fstype noquota addr
8722 @c LocalWords:  exportfs Dumpsets dumpsets pindex ldif fixmount fixrmtab euid
8723 @c LocalWords:  lostaltmail realloc netnumber itemx primnetnum primnetname ARG
8724 @c LocalWords:  subsnetname subsnetnum netgrp netgroup multitable Shlib dec osf
8725 @c LocalWords:  hppa pc bsdi freebsd netbsd openbsd ncr sysv rs acdirmax fsid
8726 @c LocalWords:  acdirmin acregmax acregmin actimeo dumbtimr nfsv noac noauto sd
8727 @c LocalWords:  nocache nodev noint nosub pgthresh posix rdonly suid symttl mfs
8728 @c LocalWords:  AMFS umapfs myftpdir unionfs es mapname mapfile mapfile slocal
8729 @c LocalWords:  mailspool saturn saturn notknown lol ober dr xr xr drwxrwsr cfg
8730 @c LocalWords:  lrwxrwxrwx adminpr hplj adminpr cfg tekxp xterms tekxp Dupuy tp
8731 @c LocalWords:  linkname hlfsddump dirname rmtab pluto rlogin direntry pg vr dn
8732 @c LocalWords:  maxmem hlfsdir xmailbox showmount cn amdmap amdmapName resvport
8733 @c LocalWords:  objectClass amdmapKey amdmapValue ln powerpc amdmapTimestamp ez
8734 @c LocalWords:  moisil FSinfo Libtool Unmounting sublink fileservers NullProc
8735 @c LocalWords:  gethostname mount's unmounts linkx remounts unmounting UAs SA's
8736 @c LocalWords:  mountpoint mountpoints unescaped UIDs util's overlayed uref EFS
8737 @c LocalWords:  serv maxgroups nfsl cachedir copt cfsadmin efs addopts fg ROMs
8738 @c LocalWords:  nointr extatt setchapternewpage columnfractions alphaev gnulibc
8739 @c LocalWords:  freebsdelf gnuoldld ifhtml defperm nodefperm norrip RRIP rrip
8740 @c LocalWords:  noversion attr XXXXXX netgrpd rh mkstemp uid gid noexec mntfs
8741 @c LocalWords:  nomnttab optionstr hrtime xdrtrace getpwd proplist redhat ctl
8742 @c LocalWords:  texinfo texi ib sp cartouche ified xlatecookie dircategory sc
8743 @c LocalWords:  AddInfo suse Novell softlookup ENOENT USB fullybrowsable LDAPv
8744 @c LocalWords:  amy ie xfffffe zebedee andrew diskfull hdmail searchable si
8745 @c LocalWords:  Orth ESTALE