1 \input texinfo @c -*-texinfo-*-
2 @c $NetBSD: am-utils.texi,v 1.1.1.2 2009/03/20 20:26:52 christos Exp $
4 @c Copyright (c) 1997-2009 Erez Zadok
5 @c Copyright (c) 1989 Jan-Simon Pendry
6 @c Copyright (c) 1989 Imperial College of Science, Technology & Medicine
7 @c Copyright (c) 1989 The Regents of the University of California.
8 @c All rights reserved.
10 @c This code is derived from software contributed to Berkeley by
11 @c Jan-Simon Pendry at Imperial College, London.
13 @c Redistribution and use in source and binary forms, with or without
14 @c modification, are permitted provided that the following conditions
16 @c 1. Redistributions of source code must retain the above copyright
17 @c notice, this list of conditions and the following disclaimer.
18 @c 2. Redistributions in binary form must reproduce the above copyright
19 @c notice, this list of conditions and the following disclaimer in the
20 @c documentation and/or other materials provided with the distribution.
21 @c 3. All advertising materials mentioning features or use of this software
22 @c must display the following acknowledgment:
23 @c This product includes software developed by the University of
24 @c California, Berkeley and its contributors.
25 @c 4. Neither the name of the University nor the names of its contributors
26 @c may be used to endorse or promote products derived from this software
27 @c without specific prior written permission.
29 @c THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
30 @c ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 @c IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 @c ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
33 @c FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 @c DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 @c OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 @c HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 @c LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 @c OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
41 @c File: am-utils/doc/am-utils.texi
43 @setfilename am-utils.info
47 @c info directory entry
48 @dircategory Administration
50 * Am-utils: (am-utils). The Amd automounter suite of utilities
53 @settitle Am-utils (4.4BSD Automounter Utilities)
54 @setchapternewpage odd
57 @title Am-utils (4.4BSD Automounter Utilities)
58 @subtitle For version @value{VERSION}, @value{UPDATED}
61 (Originally by Jan-Simon Pendry and Nick Williams)
64 Copyright @copyright{} 1997-2009 Erez Zadok
66 Copyright @copyright{} 1989 Jan-Simon Pendry
68 Copyright @copyright{} 1989 Imperial College of Science, Technology & Medicine
70 Copyright @copyright{} 1989 The Regents of the University of California.
74 Permission to copy this document, or any portion of it, as
75 necessary for use of this software is granted provided this
76 copyright notice and statement of permission are included.
80 @c Define a new index for options.
86 @c ################################################################
87 @node Top, License, , (DIR)
89 @b{Am-utils (4.4BSD Automounter Utilities) User Manual}
91 For version @value{VERSION}, @value{UPDATED}
95 (Originally by Jan-Simon Pendry and Nick Williams)
97 Copyright @copyright{} 1997-2009 Erez Zadok
99 Copyright @copyright{} 1989 Jan-Simon Pendry
101 Copyright @copyright{} 1989 Imperial College of Science, Technology & Medicine
103 Copyright @copyright{} 1989 The Regents of the University of California.
107 Permission to copy this document, or any portion of it, as
108 necessary for use of this software is granted provided this
109 copyright notice and statement of permission are included.
111 Am-utils is the 4.4BSD Automounter Tool Suite, which includes the Amd
112 automounter, the Amq query and control program, the Hlfsd daemon, and
113 other tools. This Info file describes how to use and understand the
114 tools within Am-utils.
118 * License:: Explains the terms and conditions for using
119 and distributing Am-utils.
120 * Distrib:: How to get the latest Am-utils distribution.
121 * AddInfo:: How to get additional information.
122 * Intro:: An introduction to Automounting concepts.
123 * History:: History of am-utils' development.
124 * Overview:: An overview of Amd.
125 * Supported Platforms:: Machines and Systems supported by Amd.
126 * Mount Maps:: Details of mount maps.
127 * Amd Command Line Options:: All the Amd command line options explained.
128 * Filesystem Types:: The different mount types supported by Amd.
129 * Amd Configuration File:: The amd.conf file syntax and meaning.
130 * Run-time Administration:: How to start, stop and control Amd.
131 * FSinfo:: The FSinfo filesystem management tool.
132 * Hlfsd:: The Home-Link Filesystem server.
133 * Assorted Tools:: Other tools which come with am-utils.
134 * Examples:: Some examples showing how Amd might be used.
135 * Internals:: Implementation details.
136 * Acknowledgments & Trademarks:: Legal Notes.
139 * Index:: An item for each concept.
145 This manual documents the use of the 4.4BSD automounter tool suite,
146 which includes @i{Amd}, @i{Amq}, @i{Hlfsd}, and other programs. This is
147 primarily a reference manual. While no tutorial exists, there are
148 examples available. @xref{Examples}.
150 This manual comes in two forms: the published form and the Info form.
151 The Info form is for on-line perusal with the INFO program which is
152 distributed along with GNU texinfo package (a version of which is
153 available for GNU Emacs).@footnote{GNU packages can be found in
154 @url{ftp://ftp.gnu.org/pub/gnu/}.} Both forms contain substantially
155 the same text and are generated from a common source file, which is
156 distributed with the @i{Am-utils} source.
159 @c ################################################################
160 @node License, Distrib, Top, Top
162 @cindex License Information
164 @i{Am-utils} is not in the public domain; it is copyrighted and there are
165 restrictions on its distribution.
167 Redistribution and use in source and binary forms, with or without
168 modification, are permitted provided that the following conditions are
174 Redistributions of source code must retain the above copyright notice,
175 this list of conditions and the following disclaimer.
178 Redistributions in binary form must reproduce the above copyright
179 notice, this list of conditions and the following disclaimer in the
180 documentation and/or other materials provided with the distribution.
183 All advertising materials mentioning features or use of this software
184 must display the following acknowledgment:
187 ``This product includes software developed by the University of
188 California, Berkeley and its contributors, as well as the Trustees of
189 Columbia University.''
193 Neither the name of the University nor the names of its contributors may
194 be used to endorse or promote products derived from this software
195 without specific prior written permission.
199 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
200 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
201 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
202 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
203 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
204 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
205 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
206 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
207 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
208 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
209 THE POSSIBILITY OF SUCH DAMAGE.
211 @c ################################################################
212 @node Distrib, AddInfo, License, Top
213 @unnumbered Source Distribution
214 @cindex Source code distribution
215 @cindex Obtaining the source code
217 The @i{Am-utils} home page is located in
219 @url{http://www.am-utils.org/}
222 You can get the latest distribution version of @i{Am-utils} from
224 @url{ftp://ftp.am-utils.org/pub/am-utils/am-utils.tar.gz}
227 Additional alpha, beta, and release distributions are available in
229 @url{ftp://ftp.am-utils.org/pub/am-utils/}.
232 Revision 5.2 was part of the 4.3BSD Reno distribution.
234 Revision 5.3bsdnet, a late alpha version of 5.3, was part
235 of the BSD network version 2 distribution
237 Revision 6.0 was made independently by
238 Erez Zadok at the Computer Science
239 Department of @uref{http://www.cs.columbia.edu/,Columbia University},
241 @uref{http://www.fsl.cs.sunysb.edu/docs/zadok-thesis-proposal/,PhD
242 thesis work}. Am-utils (especially version 6.1) continues to be
243 developed and maintained at the
244 @uref{http://www.cs.sunysb.edu/,Computer Science Department} of
245 @uref{http://www.stonybrook.edu/,Stony Brook University}, as a service
246 to the user community.
249 @xref{History}, for more details.
251 @c ################################################################
252 @node AddInfo, Intro, Distrib, Top
253 @unnumbered Getting Additional Information
254 @cindex Getting Additional Information
256 @unnumberedsec Bug Reports
259 Before reporting a bug, see if it is a known one in the
260 @uref{http://www.am-utils.org/docs/am-utils/BUGS.txt,bugs} file.
262 If you find a problem and hopefully you can reproduce it, please
263 describe it in detail and
264 @uref{https://bugzilla.filesystems.org/,submit a bug report} via
265 @uref{http://www.bugzilla.org/,Bugzilla}. Alternatively, you can send
266 your bug report to the ``am-utils'' list (see
267 @url{http://www.am-utils.org/} under ``Mailing Lists'') quoting the details
268 of the release and your configuration. These details can be obtained
269 by running the command @samp{amd -v}. It would greatly help if you
270 could provide a reproducible procedure for detecting the bug you are
273 Providing working patches is highly encouraged. Every patch
274 incorporated, however small, will get its author an honorable mention in
275 the @uref{http://www.am-utils.org/docs/am-utils/AUTHORS.txt,authors
278 @unnumberedsec Mailing Lists
279 @cindex Mailing lists
281 There are several mailing lists for people interested in keeping up-to-date
289 The users mailing list, @samp{am-utils} is for
293 announcements of alpha and beta releases of am-utils
295 reporting of bugs and patches
297 discussions of new features for am-utils
299 implementation and porting issues
302 To subscribe, visit @url{http://www.am-utils.org/} under ``Mailing
303 Lists.'' After subscribing, you can post a message to this list. To
304 avoid as much spam as possible, only subscribers to this list may post
307 Subscribers of @samp{am-utils} are most helpful if they have the time
308 and resources to test new and development versions of amd, on as many
309 different platforms as possible. They should also be prepared to
310 learn and use the GNU Autoconf, Automake, and Libtool packages, as
311 needed; and of course, become familiar with the complex code in the
312 am-utils package. In other words, subscribers on this list should
313 hopefully be able to contribute meaningfully to the development of
316 Note that this @samp{am-utils} list used to be called @samp{amd-dev}
317 before January 1st, 2004. Please use the new name, @samp{am-utils}.
320 The announcements mailing list, @samp{am-utils-announce} is for
321 announcements only (mostly new releases). To subscribe, visit
322 @url{http://www.am-utils.org/} under ``Mailing Lists.''
323 This list is read-only: only am-utils developers may post to it.
326 We distribute nightly CVS snapshots in
327 @url{ftp://ftp.am-utils.org/pub/am-utils/snapshots/daily/}. If you
328 like to get email notices of commits to the am-utils CVS repository,
329 subscribe to the CVS logs mailing list, @samp{am-utils-cvs} at
330 @url{http://www.am-utils.org/} under ``Mailing Lists.''
333 The older list which was used to user discussions, @samp{amd-workers},
334 is defunct as of January 2004. (Its last address was
335 @email{amd-workers AT majordomo.glue.umd.edu}.) Don't use
336 @samp{amd-workers}: use the newer, more active @samp{am-utils} list.
339 For completeness, there's a developers-only closed list called
340 @samp{am-utils-developers} (see @url{http://www.am-utils.org/} under
345 @unnumberedsec Am-utils Book
346 @cindex Am-utils book
348 @cindex Automounter book
351 @uref{http://www.cs.sunysb.edu/~ezk,Erez Zadok} wrote a
352 @uref{http://www.fsl.cs.sunysb.edu/docs/amd-book/,book}, titled @i{Linux NFS and
353 Automounter Administration}, ISBN 0-7821-2739-8, (Sybex, 2001). The
354 book is full of details and examples that go beyond what this manual
355 has. The book also covers NFS in great detail. Although the book is
356 geared toward Linux users, it is general enough for any Unix
357 administrator and contains specific sections for non-Linux systems.
359 @c ################################################################
360 @node Intro, History, AddInfo, Top
361 @unnumbered Introduction
364 An @dfn{automounter} maintains a cache of mounted filesystems.
365 Filesystems are mounted on demand when they are first referenced,
366 and unmounted after a period of inactivity.
368 @i{Amd} may be used as a replacement for Sun's automounter. The choice
369 of which filesystem to mount can be controlled dynamically with
370 @dfn{selectors}. Selectors allow decisions of the form ``hostname is
371 @var{this},'' or ``architecture is not @var{that}.'' Selectors may be
372 combined arbitrarily. @i{Amd} also supports a variety of filesystem
373 types, including NFS, UFS and the novel @dfn{program} filesystem. The
374 combination of selectors and multiple filesystem types allows identical
375 configuration files to be used on all machines thus reducing the
376 administrative overhead.
378 @i{Amd} ensures that it will not hang if a remote server goes down.
379 Moreover, @i{Amd} can determine when a remote server has become
380 inaccessible and then mount replacement filesystems as and when they
383 @i{Amd} contains no proprietary source code and has been ported to
384 numerous flavors of Unix.
386 @c ################################################################
387 @node History, Overview, Intro, Top
391 The @i{Amd} package has been without an official maintainer since 1992.
392 Several people have stepped in to maintain it unofficially. Most
393 notable were the `upl' (Unofficial Patch Level) releases of @i{Amd},
394 created by me (@uref{http://www.cs.sunysb.edu/~ezk,Erez Zadok}), and available from
395 @url{ftp://ftp.am-utils.org/pub/amd/}. The last such unofficial
396 release was `upl102'.
398 Through the process of patching and aging, it was becoming more and more
399 apparent that @i{Amd} was in much need of revitalizing. Maintaining
400 @i{Amd} had become a difficult task. I took it upon myself to cleanup
401 the code, so that it would be easier to port to new platforms, add new
402 features, keep up with the many new feature requests, and deal with the
403 never ending stream of bug reports.
405 I have been working on such a release of @i{Amd} on and off since
406 January of 1996. The new suite of tools is currently named "am-utils"
407 (AutoMounter Utilities), in line with GNU naming conventions, befitting
408 the contents of the package. In October of 1996 I had received enough
409 offers to help me with this task that I decided to make a mailing list
410 for this group of people. Around the same time, @i{Amd} had become a
411 necessary part of my PhD thesis work, resulting in more work performed
414 Am-utils version 6.0 was numbered with a major new release number to
415 distinguish it from the last official release of @i{Amd} (5.x). Many
416 new features have been added such as a GNU @code{configure} system, NFS
417 Version 3, a run-time configuration file (`amd.conf'), many new ports,
418 more scripts and programs, as well as numerous bug fixes. Another
419 reason for the new major release number was to alert users of am-utils
420 that user-visible interfaces may have changed. In order to make @i{Amd}
421 work well for the next 10 years, and be easier to maintain, it was
422 necessary to remove old or unused features, change various syntax files,
423 etc. However, great care was taken to ensure the maximum possible
424 backwards compatibility.
426 Am-utils version 6.1 has autofs support for Linux and Solaris 2.5+ as
427 @i{the} major new feature, in addition to several other minor new
428 features. The autofs support is completely transparent to the
429 end-user, aside from the fact that @code{/bin/pwd} now always returns
430 the correct amd-ified path. The administrator can easily switch
431 between NFS and autofs mounts by changing one parameter in
432 @code{amd.conf}. Autofs support and maintenance was developed in
433 conjunction with @email{ionut AT badula.org,Ion Badulescu}.
435 @c ################################################################
436 @node Overview, Supported Platforms, History, Top
439 @i{Amd} maintains a cache of mounted filesystems. Filesystems are
440 @dfn{demand-mounted} when they are first referenced, and unmounted after
441 a period of inactivity. @i{Amd} may be used as a replacement for Sun's
442 @b{automount}(8) program. It contains no proprietary source code and
443 has been ported to numerous flavors of Unix. @xref{Supported
446 @i{Amd} was designed as the basis for experimenting with filesystem
447 layout and management. Although @i{Amd} has many direct applications it
448 is loaded with additional features which have little practical use. At
449 some point the infrequently used components may be removed to streamline
450 the production system.
452 @i{Amd} supports the notion of @dfn{replicated} filesystems by evaluating
453 each member of a list of possible filesystem locations one by one.
454 @i{Amd} checks that each cached mapping remains valid. Should a mapping be
455 lost -- such as happens when a fileserver goes down -- @i{Amd} automatically
456 selects a replacement should one be available.
460 * Filesystems and Volumes::
463 * Operational Principles::
464 * Mounting a Volume::
465 * Automatic Unmounting::
467 * Non-blocking Operation::
470 @node Fundamentals, Filesystems and Volumes, Overview, Overview
471 @comment node-name, next, previous, up
472 @section Fundamentals
473 @cindex Automounter fundamentals
475 The fundamental concept behind @i{Amd} is the ability to separate the
476 name used to refer to a file from the name used to refer to its physical
477 storage location. This allows the same files to be accessed with the
478 same name regardless of where in the network the name is used. This is
479 very different from placing @file{/n/hostname} in front of the pathname
480 since that includes location dependent information which may change if
481 files are moved to another machine.
483 By placing the required mappings in a centrally administered database,
484 filesystems can be re-organized without requiring changes to
485 configuration files, shell scripts and so on.
487 @node Filesystems and Volumes, Volume Naming, Fundamentals, Overview
488 @comment node-name, next, previous, up
489 @section Filesystems and Volumes
495 @i{Amd} views the world as a set of fileservers, each containing one or
496 more filesystems where each filesystem contains one or more
497 @dfn{volumes}. Here the term @dfn{volume} is used to refer to a
498 coherent set of files such as a user's home directory or a @TeX{}
501 In order to access the contents of a volume, @i{Amd} must be told in
502 which filesystem the volume resides and which host owns the filesystem.
503 By default the host is assumed to be local and the volume is assumed to
504 be the entire filesystem. If a filesystem contains more than one
505 volume, then a @dfn{sublink} is used to refer to the sub-directory
506 within the filesystem where the volume can be found.
508 @node Volume Naming, Volume Binding, Filesystems and Volumes, Overview
509 @comment node-name, next, previous, up
510 @section Volume Naming
512 @cindex Network-wide naming
513 @cindex Replicated volumes
514 @cindex Duplicated volumes
515 @cindex Replacement volumes
517 Volume names are defined to be unique across the entire network. A
518 volume name is the pathname to the volume's root as known by the users
519 of that volume. Since this name uniquely identifies the volume
520 contents, all volumes can be named and accessed from each host, subject
521 to administrative controls.
523 Volumes may be replicated or duplicated. Replicated volumes contain
524 identical copies of the same data and reside at two or more locations in
525 the network. Each of the replicated volumes can be used
526 interchangeably. Duplicated volumes each have the same name but contain
527 different, though functionally identical, data. For example,
528 @samp{/vol/tex} might be the name of a @TeX{} distribution which varied
529 for each machine architecture.@refill
531 @i{Amd} provides facilities to take advantage of both replicated and
532 duplicated volumes. Configuration options allow a single set of
533 configuration data to be shared across an entire network by taking
534 advantage of replicated and duplicated volumes.
536 @i{Amd} can take advantage of replacement volumes by mounting them as
537 required should an active fileserver become unavailable.
539 @node Volume Binding, Operational Principles, Volume Naming, Overview
540 @comment node-name, next, previous, up
541 @section Volume Binding
542 @cindex Volume binding
543 @cindex Unix namespace
545 @cindex Binding names to filesystems
547 Unix implements a namespace of hierarchically mounted filesystems. Two
548 forms of binding between names and files are provided. A @dfn{hard
549 link} completes the binding when the name is added to the filesystem. A
550 @dfn{soft link} delays the binding until the name is accessed. An
551 @dfn{automounter} adds a further form in which the binding of name to
552 filesystem is delayed until the name is accessed.@refill
554 The target volume, in its general form, is a tuple (host, filesystem,
555 sublink) which can be used to name the physical location of any volume
558 When a target is referenced, @i{Amd} ignores the sublink element and
559 determines whether the required filesystem is already mounted. This is
560 done by computing the local mount point for the filesystem and checking
561 for an existing filesystem mounted at the same place. If such a
562 filesystem already exists then it is assumed to be functionally
563 identical to the target filesystem. By default there is a one-to-one
564 mapping between the pair (host, filesystem) and the local mount point so
565 this assumption is valid.
567 @node Operational Principles, Mounting a Volume, Volume Binding, Overview
568 @comment node-name, next, previous, up
569 @section Operational Principles
570 @cindex Operational principles
572 @i{Amd} operates by introducing new mount points into the namespace.
573 These are called @dfn{automount} points. The kernel sees these
574 automount points as NFS filesystems being served by @i{Amd}. Having
575 attached itself to the namespace, @i{Amd} is now able to control the
576 view the rest of the system has of those mount points. RPC calls are
577 received from the kernel one at a time.
579 When a @dfn{lookup} call is received @i{Amd} checks whether the name is
580 already known. If it is not, the required volume is mounted. A
581 symbolic link pointing to the volume root is then returned. Once the
582 symbolic link is returned, the kernel will send all other requests
583 direct to the mounted filesystem.
585 If a volume is not yet mounted, @i{Amd} consults a configuration
586 @dfn{mount-map} corresponding to the automount point. @i{Amd} then
587 makes a runtime decision on what and where to mount a filesystem based
588 on the information obtained from the map.
590 @i{Amd} does not implement all the NFS requests; only those relevant
591 to name binding such as @dfn{lookup}, @dfn{readlink} and @dfn{readdir}.
592 Some other calls are also implemented but most simply return an error
593 code; for example @dfn{mkdir} always returns ``read-only filesystem''.
595 @node Mounting a Volume, Automatic Unmounting, Operational Principles, Overview
596 @comment node-name, next, previous, up
597 @section Mounting a Volume
598 @cindex Mounting a volume
599 @cindex Location lists
600 @cindex Alternate locations
601 @cindex Mount retries
602 @cindex Background mounts
604 Each automount point has a corresponding mount map. The mount map
605 contains a list of key--value pairs. The key is the name of the volume
606 to be mounted. The value is a list of locations describing where the
607 filesystem is stored in the network. In the source for the map the
608 value would look like
611 location1 location2 @dots{} locationN
614 @i{Amd} examines each location in turn. Each location may contain
615 @dfn{selectors} which control whether @i{Amd} can use that location.
616 For example, the location may be restricted to use by certain hosts.
617 Those locations which cannot be used are ignored.
619 @i{Amd} attempts to mount the filesystem described by each remaining
620 location until a mount succeeds or @i{Amd} can no longer proceed. The
621 latter can occur in three ways:
625 If none of the locations could be used, or if all of the locations
626 caused an error, then the last error is returned.
629 If a location could be used but was being mounted in the background then
630 @i{Amd} marks that mount as being ``in progress'' and continues with
631 the next request; no reply is sent to the kernel.
634 Lastly, one or more of the mounts may have been @dfn{deferred}. A mount
635 is deferred if extra information is required before the mount can
636 proceed. When the information becomes available the mount will take
637 place, but in the mean time no reply is sent to the kernel. If the
638 mount is deferred, @i{Amd} continues to try any remaining locations.
641 Once a volume has been mounted, @i{Amd} establishes a @dfn{volume
642 mapping} which is used to satisfy subsequent requests.@refill
644 @node Automatic Unmounting, Keep-alives, Mounting a Volume, Overview
645 @comment node-name, next, previous, up
646 @section Automatic Unmounting
648 To avoid an ever increasing number of filesystem mounts, @i{Amd} removes
649 volume mappings which have not been used recently. A time-to-live
650 interval is associated with each mapping and when that expires the
651 mapping is removed. When the last reference to a filesystem is removed,
652 that filesystem is unmounted. If the unmount fails, for example the
653 filesystem is still busy, the mapping is re-instated and its
654 time-to-live interval is extended. The global default for this grace
655 period is controlled by the @code{-w} command-line option (@pxref{-w
656 Option, -w}) or the @i{amd.conf} parameter @samp{dismount_interval}
657 (@pxref{dismount_interval Parameter}). It is also possible to set this
658 value on a per-mount basis (@pxref{opts Option, opts, opts}).
660 Filesystems can be forcefully timed out using the @i{Amq} command.
661 @xref{Run-time Administration}. Note that on new enough systems that
662 support forced unmounts, such as Linux, @i{Amd} can try to use the
663 @b{umount2}(2) system call to force the unmount, if the regular
664 @b{umount}(2) system call failed in a way that indicates that the
665 mount point is hung or stale. @xref{forced_unmounts Parameter}.
667 @node Keep-alives, Non-blocking Operation, Automatic Unmounting, Overview
668 @comment node-name, next, previous, up
671 @cindex Server crashes
674 Use of some filesystem types requires the presence of a server on
675 another machine. If a machine crashes then it is of no concern to
676 processes on that machine that the filesystem is unavailable. However,
677 to processes on a remote host using that machine as a fileserver this
678 event is important. This situation is most widely recognized when an
679 NFS server crashes and the behavior observed on client machines is that
680 more and more processes hang. In order to provide the possibility of
681 recovery, @i{Amd} implements a @dfn{keep-alive} interval timer for some
682 filesystem types. Currently only NFS makes use of this service.
684 The basis of the NFS keep-alive implementation is the observation that
685 most sites maintain replicated copies of common system data such as
686 manual pages, most or all programs, system source code and so on. If
687 one of those servers goes down it would be reasonable to mount one of
688 the others as a replacement.
690 The first part of the process is to keep track of which fileservers are
691 up and which are down. @i{Amd} does this by sending RPC requests to the
692 servers' NFS @code{NullProc} and checking whether a reply is returned.
693 While the server state is uncertain the requests are re-transmitted at
694 three second intervals and if no reply is received after four attempts
695 the server is marked down. If a reply is received the fileserver is
696 marked up and stays in that state for 30 seconds at which time another
697 NFS ping is sent. This interval is configurable and can even be
698 turned off using the @i{ping} option. @xref{opts Option}.
700 Once a fileserver is marked down, requests continue to be sent every 30
701 seconds in order to determine when the fileserver comes back up. During
702 this time any reference through @i{Amd} to the filesystems on that
703 server fail with the error ``Operation would block''. If a replacement
704 volume is available then it will be mounted, otherwise the error is
705 returned to the user.
707 @c @i{Amd} keeps track of which servers are up and which are down.
708 @c It does this by sending RPC requests to the servers' NFS {\sc NullProc} and
709 @c checking whether a reply is returned. If no replies are received after a
710 @c short period, @i{Amd} marks the fileserver @dfn{down}.
711 @c RPC requests continue to be sent so that it will notice when a fileserver
713 @c ICMP echo packets \cite{rfc:icmp} are not used because it is the availability
714 @c of the NFS service that is important, not the existence of a base kernel.
715 @c Whenever a reference to a fileserver which is down is made via @i{Amd}, an alternate
716 @c filesystem is mounted if one is available.
718 Although this action does not protect user files, which are unique on
719 the network, or processes which do not access files via @i{Amd} or
720 already have open files on the hung filesystem, it can prevent most new
721 processes from hanging.
723 @c With a suitable combination of filesystem management and mount-maps,
724 @c machines can be protected against most server downtime. This can be
725 @c enhanced by allocating boot-servers dynamically which allows a diskless
726 @c workstation to be quickly restarted if necessary. Once the root filesystem
727 @c is mounted, @i{Amd} can be started and allowed to mount the remainder of
728 @c the filesystem from whichever fileservers are available.
730 @node Non-blocking Operation, , Keep-alives, Overview
731 @comment node-name, next, previous, up
732 @section Non-blocking Operation
733 @cindex Non-blocking operation
734 @cindex Multiple-threaded server
737 Since there is only one instance of @i{Amd} for each automount point,
738 and usually only one instance on each machine, it is important that it
739 is always available to service kernel calls. @i{Amd} goes to great
740 lengths to ensure that it does not block in a system call. As a last
741 resort @i{Amd} will fork before it attempts a system call that may block
742 indefinitely, such as mounting an NFS filesystem. Other tasks such as
743 obtaining filehandle information for an NFS filesystem, are done using a
744 purpose built non-blocking RPC library which is integrated with
745 @i{Amd}'s task scheduler. This library is also used to implement NFS
746 keep-alives (@pxref{Keep-alives}).
748 Whenever a mount is deferred or backgrounded, @i{Amd} must wait for it
749 to complete before replying to the kernel. However, this would cause
750 @i{Amd} to block waiting for a reply to be constructed. Rather than do
751 this, @i{Amd} simply @dfn{drops} the call under the assumption that the
752 kernel RPC mechanism will automatically retry the request.
754 @c ################################################################
755 @node Supported Platforms, Mount Maps, Overview, Top
756 @comment node-name, next, previous, up
757 @chapter Supported Platforms
758 @cindex Supported Platforms
759 @cindex shared libraries
760 @cindex NFS V.3 support
762 @i{Am-utils} has been ported to a wide variety of machines and operating
763 systems. @i{Am-utils}'s code works for little-endian and big-endian
764 machines, as well as 32 bit and 64 bit architectures. Furthermore, when
765 @i{Am-utils} ports to an Operating System on one architecture, it is generally
766 readily portable to the same Operating System on all platforms on which
769 See the @file{INSTALL} in the distribution for more specific details on
770 building and/or configuring for some systems.
772 @c ################################################################
773 @node Mount Maps, Amd Command Line Options, Supported Platforms, Top
774 @comment node-name, next, previous, up
777 @cindex Automounter configuration maps
778 @cindex Mount information
780 @i{Amd} has no built-in knowledge of machines or filesystems.
781 External @dfn{mount-maps} are used to provide the required information.
782 Specifically, @i{Amd} needs to know when and under what conditions it
783 should mount filesystems.
785 The map entry corresponding to the requested name contains a list of
786 possible locations from which to resolve the request. Each location
787 specifies filesystem type, information required by that filesystem (for
788 example the block special device in the case of UFS), and some
789 information describing where to mount the filesystem (@pxref{fs Option}). A
790 location may also contain @dfn{selectors} (@pxref{Selectors}).@refill
798 @node Map Types, Key Lookup, Mount Maps, Mount Maps
799 @comment node-name, next, previous, up
801 @cindex Mount map types
803 @cindex Configuration map types
804 @cindex Types of mount map
805 @cindex Types of configuration map
806 @cindex Determining the map type
808 A mount-map provides the run-time configuration information to @i{Amd}.
809 Maps can be implemented in many ways. Some of the forms supported by
810 @i{Amd} are regular files, ndbm databases, NIS maps, the @dfn{Hesiod}
811 name server, and even the password file.
813 A mount-map @dfn{name} is a sequence of characters. When an automount
814 point is created a handle on the mount-map is obtained. For each map
815 type configured, @i{Amd} attempts to reference the map of the
816 appropriate type. If a map is found, @i{Amd} notes the type for future
817 use and deletes the reference, for example closing any open file
818 descriptors. The available maps are configured when @i{Amd} is built
819 and can be displayed by running the command @samp{amd -v}.
821 When using an @i{Amd} configuration file (@pxref{Amd Configuration File})
822 and the keyword @samp{map_type} (@pxref{map_type Parameter}), you may
823 force the map used to any type.
825 By default, @i{Amd} caches data in a mode dependent on the type of map.
826 This is the same as specifying @samp{cache:=mapdefault} and selects a
827 suitable default cache mode depending on the map type. The individual
828 defaults are described below. The @var{cache} option can be specified
829 on automount points to alter the caching behavior (@pxref{Automount
832 The following map types have been implemented, though some are not
833 available on all machines. Run the command @samp{amd -v} to obtain a
834 list of map types configured on your machine.
848 @c ----------------------------------------------------------------
849 @node File maps, ndbm maps, Map Types, Map Types
850 @comment node-name, next, previous, up
851 @subsection File maps
853 @cindex Flat file maps
854 @cindex File map syntactic conventions
856 When @i{Amd} searches a file for a map entry it does a simple scan of
857 the file and supports both comments and continuation lines.
859 Continuation lines are indicated by a backslash character (@samp{\}) as
860 the last character of a line in the file. The backslash, newline character
861 @emph{and any leading white space on the following line} are discarded. A maximum
862 line length of 2047 characters is enforced after continuation lines are read
863 but before comments are stripped. Each line must end with
864 a newline character; that is newlines are terminators, not separators.
865 The following examples illustrate this:
872 specifies @emph{three} locations, and is identical to
885 specifies only @emph{two} locations, and is identical to
891 After a complete line has been read from the file, including
892 continuations, @i{Amd} determines whether there is a comment on the
893 line. A comment begins with a hash (``@samp{#}'') character and
894 continues to the end of the line. There is no way to escape or change
895 the comment lead-in character.
897 Note that continuation lines and comment support @dfn{only} apply to
898 file maps, or ndbm maps built with the @code{mk-amd-map} program.
900 When caching is enabled, file maps have a default cache mode of
901 @code{all} (@pxref{Automount Filesystem}).
903 @c ----------------------------------------------------------------
904 @node ndbm maps, NIS maps, File maps, Map Types
905 @comment node-name, next, previous, up
906 @subsection ndbm maps
909 An ndbm map may be used as a fast access form of a file map. The program,
910 @code{mk-amd-map}, converts a normal map file into an ndbm database.
911 This program supports the same continuation and comment conventions that
912 are provided for file maps. Note that ndbm format files may @emph{not}
913 be sharable across machine architectures. The notion of speed generally
914 only applies to large maps; a small map, less than a single disk block,
915 is almost certainly better implemented as a file map.
917 ndbm maps have a default cache mode of @samp{all}
918 (@pxref{Automount Filesystem}).
920 @c ----------------------------------------------------------------
921 @node NIS maps, NIS+ maps, ndbm maps, Map Types
922 @comment node-name, next, previous, up
924 @cindex NIS (YP) maps
926 When using NIS (formerly YP), an @i{Amd} map is implemented directly
927 by the underlying NIS map. Comments and continuation lines are
928 @emph{not} supported in the automounter and must be stripped when
929 constructing the NIS server's database.
931 NIS maps have a default cache mode of @code{all} (@pxref{Automount
934 The following rule illustrates what could be added to your NIS @file{Makefile},
935 in this case causing the @file{amd.home} map to be rebuilt:
937 $(YPTSDIR)/amd.home.time: $(ETCDIR)/amd.home
938 -@@sed -e "s/#.*$$//" -e "/^$$/d" $(ETCDIR)/amd.home | \
940 for (i = 1; i <= NF; i++) \
942 if (substr($$i, length($$i), 1) == "\\") \
943 printf("%s", substr($$i, 1, length($$i) - 1)); \
945 printf("%s\n", $$i); \
948 printf("%s ", $$i); \
950 $(MAKEDBM) - $(YPDBDIR)/amd.home; \
951 touch $(YPTSDIR)/amd.home.time; \
952 echo "updated amd.home"; \
953 if [ ! $(NOPUSH) ]; then \
954 $(YPPUSH) amd.home; \
955 echo "pushed amd.home"; \
961 Here @code{$(YPTSDIR)} contains the time stamp files, and
962 @code{$(YPDBDIR)} contains the dbm format NIS files.
964 @c ----------------------------------------------------------------
965 @node NIS+ maps, Hesiod maps, NIS maps, Map Types
966 @comment node-name, next, previous, up
967 @subsection NIS+ maps
970 NIS+ maps do not support cache mode @samp{all} and, when caching is
971 enabled, have a default cache mode of @samp{inc}.
973 XXX: FILL IN WITH AN EXAMPLE.
975 @c ----------------------------------------------------------------
976 @node Hesiod maps, Password maps, NIS+ maps, Map Types
977 @comment node-name, next, previous, up
978 @subsection Hesiod maps
981 When the map name begins with the string @samp{hesiod.} lookups are made
982 using the @dfn{Hesiod} name server. The string following the dot is
983 used as a name qualifier and is prepended with the key being located.
984 The entire string is then resolved in the @code{automount} context, or
985 the @i{amd.conf} parameter @samp{hesiod_base} (@pxref{hesiod_base
986 Parameter}). For example, if the key is @samp{jsp} and map name is
987 @samp{hesiod.homes} then @dfn{Hesiod} is asked to resolve
988 @samp{jsp.homes.automount}.
990 Hesiod maps do not support cache mode @samp{all} and, when caching is
991 enabled, have a default cache mode of @samp{inc} (@pxref{Automount
994 The following is an example of a @dfn{Hesiod} map entry:
997 jsp.homes.automount HS TXT "rfs:=/home/charm;rhost:=charm;sublink:=jsp"
998 njw.homes.automount HS TXT "rfs:=/home/dylan/dk2;rhost:=dylan;sublink:=njw"
1001 @c ----------------------------------------------------------------
1002 @node Password maps, Union maps, Hesiod maps, Map Types
1003 @comment node-name, next, previous, up
1004 @subsection Password maps
1005 @cindex Password file maps
1006 @cindex /etc/passwd maps
1007 @cindex User maps, automatic generation
1008 @cindex Automatic generation of user maps
1009 @cindex Using the password file as a map
1011 The password map support is unlike the four previous map types. When
1012 the map name is the string @file{/etc/passwd} @i{Amd} can lookup a user
1013 name in the password file and re-arrange the home directory field to
1014 produce a usable map entry.
1016 @i{Amd} assumes the home directory has the format
1017 `@t{/}@i{anydir}@t{/}@i{dom1}@t{/../}@i{domN}@t{/}@i{login}'.
1018 @c @footnote{This interpretation is not necessarily exactly what you want.}
1019 It breaks this string into a map entry where @code{$@{rfs@}} has the
1020 value `@t{/}@i{anydir}@t{/}@i{domN}', @code{$@{rhost@}} has the value
1021 `@i{domN}@t{.}@i{...}@t{.}@i{dom1}', and @code{$@{sublink@}} has the
1022 value @i{login}.@refill
1024 Thus if the password file entry was
1030 the map entry used by @i{Amd} would be
1033 rfs:=/home/achilles;rhost:=achilles;sublink:=jsp
1036 Similarly, if the password file entry was
1042 the map entry used by @i{Amd} would be
1045 rfs:=/home/sugar;rhost:=sugar.cc;sublink:=mhj
1048 @c ----------------------------------------------------------------
1049 @node Union maps, LDAP maps, Password maps, Map Types
1050 @comment node-name, next, previous, up
1051 @subsection Union maps
1052 @cindex Union file maps
1054 The union map support is provided specifically for use with the union
1055 filesystem, @pxref{Union Filesystem}.
1057 It is identified by the string @samp{union:} which is followed by a
1058 colon separated list of directories. The directories are read in order,
1059 and the names of all entries are recorded in the map cache. Later
1060 directories take precedence over earlier ones. The union filesystem
1061 type then uses the map cache to determine the union of the names in all
1064 @c ----------------------------------------------------------------
1065 @node LDAP maps, Executable maps, Union maps, Map Types
1066 @comment node-name, next, previous, up
1067 @subsection LDAP maps
1069 @cindex Lightweight Directory Access Protocol
1071 LDAP (Lightweight Directory Access Protocol) maps do not support cache
1072 mode @samp{all} and, when caching is enabled, have a default cache mode
1075 For example, an @i{Amd} map @samp{amd.home} that looks as follows:
1078 /defaults opts:=rw,intr;type:=link
1080 zing -rhost:=shekel \
1082 host!=shekel;type:=nfs
1085 when converted to LDAP (@pxref{amd2ldif}), will result in the following
1088 $ amd2ldif amd.home CUCS < amd.home
1089 dn: cn=amdmap timestamp, CUCS
1090 cn : amdmap timestamp
1091 objectClass : amdmapTimestamp
1092 amdmapTimestamp: 873071363
1094 dn: cn=amdmap amd.home[/defaults], CUCS
1095 cn : amdmap amd.home[/defaults]
1096 objectClass : amdmap
1097 amdmapName : amd.home
1098 amdmapKey : /defaults
1099 amdmapValue : opts:=rw,intr;type:=link
1101 dn: cn=amdmap amd.home[], CUCS
1102 cn : amdmap amd.home[]
1103 objectClass : amdmap
1104 amdmapName : amd.home
1108 dn: cn=amdmap amd.home[zing], CUCS
1109 cn : amdmap amd.home[zing]
1110 objectClass : amdmap
1111 amdmapName : amd.home
1113 amdmapValue : -rhost:=shekel host==shekel host!=shekel;type:=nfs
1116 @c ----------------------------------------------------------------
1117 @node Executable maps, , LDAP maps, Map Types
1118 @comment node-name, next, previous, up
1119 @subsection Executable maps
1120 @cindex Executable maps
1122 An executable map is a dynamic map in which the keys and values for
1123 the maps are generated on the fly by a program or script. The program
1124 is expected to take a single parameter argument which is the key to
1125 lookup. If the key is found, the program should print on stdout the
1126 key-value pair that were found; if the key was not found, nothing
1127 should be printed out. Below is an sample of such a map script:
1131 # executable map example
1134 echo "/defaults type:=nfs;rfs:=filer"
1137 echo "a type:=nfs;fs:=/tmp"
1140 echo "b type:=link;fs:=/usr/local"
1142 * ) # no match, echo nothing
1147 @xref{exec_map_timeout Parameter}.
1149 @c ----------------------------------------------------------------
1151 @c ----------------------------------------------------------------
1152 @node Key Lookup, Location Format, Map Types, Mount Maps
1153 @comment node-name, next, previous, up
1154 @section How keys are looked up
1157 @cindex Looking up keys
1158 @cindex How keys are looked up
1159 @cindex Wildcards in maps
1161 The key is located in the map whose type was determined when the
1162 automount point was first created. In general the key is a pathname
1163 component. In some circumstances this may be modified by variable
1164 expansion (@pxref{Variable Expansion}) and prefixing. If the automount
1165 point has a prefix, specified by the @var{pref} option, then that is
1166 prepended to the search key before the map is searched.
1168 If the map cache is a @samp{regexp} cache then the key is treated as an
1169 egrep-style regular expression, otherwise a normal string comparison is
1172 If the key cannot be found then a @dfn{wildcard} match is attempted.
1173 @i{Amd} repeatedly strips the basename from the key, appends @samp{/*} and
1174 attempts a lookup. Finally, @i{Amd} attempts to locate the special key @samp{*}.
1176 For example, the following sequence would be checked if @file{home/dylan/dk2} was
1186 At any point when a wildcard is found, @i{Amd} proceeds as if an exact
1187 match had been found and the value field is then used to resolve the
1188 mount request, otherwise an error code is propagated back to the kernel.
1189 (@pxref{Filesystem Types}).@refill
1191 @node Location Format, , Key Lookup, Mount Maps
1192 @comment node-name, next, previous, up
1193 @section Location Format
1194 @cindex Location format
1195 @cindex Map entry format
1196 @cindex How locations are parsed
1198 The value field from the lookup provides the information required to
1199 mount a filesystem. The information is parsed according to the syntax
1204 @i{location-selection}
1205 @i{location-list} @i{white-space} @t{||} @i{white-space} @i{location-selection}
1206 @i{location-selection}:
1208 @i{location-selection} @i{white-space} @i{location}
1211 @t{-}@i{location-info}
1215 @i{location-info}@t{;}@i{sel-or-opt}
1221 selector@t{==}@i{value}
1222 selector@t{!=}@i{value}
1224 option@t{:=}@i{value}
1230 Note that unquoted whitespace is not allowed in a location description.
1231 White space is only allowed, and is mandatory, where shown with non-terminal
1234 A @dfn{location-selection} is a list of possible volumes with which to
1235 satisfy the request. Each @dfn{location-selection} is tried
1236 sequentially, until either one succeeds or all fail. This, by the
1237 way, is different from the historically documented behavior, which
1238 claimed (falsely, at least for last 3 years) that @i{Amd} would
1239 attempt to mount all @dfn{location-selection}s in parallel and the
1240 first one to succeed would be used.
1242 @dfn{location-selection}s are optionally separated by the @samp{||}
1243 operator. The effect of this operator is to prevent use of
1244 location-selections to its right if any of the location-selections on
1245 its left were selected, whether or not any of them were successfully
1246 mounted (@pxref{Selectors}).@refill
1248 The location-selection, and singleton @dfn{location-list},
1249 @samp{type:=ufs;dev:=/dev/xd1g} would inform @i{Amd} to mount a UFS
1250 filesystem from the block special device @file{/dev/xd1g}.
1252 The @dfn{sel-or-opt} component is either the name of an option required
1253 by a specific filesystem, or it is the name of a built-in, predefined
1254 selector such as the architecture type. The value may be quoted with
1255 double quotes @samp{"}, for example
1256 @samp{type:="ufs";dev:="/dev/xd1g"}. These quotes are stripped when the
1257 value is parsed and there is no way to get a double quote into a value
1258 field. Double quotes are used to get white space into a value field,
1259 which is needed for the program filesystem (@pxref{Program Filesystem}).@refill
1263 * Variable Expansion::
1268 @node Map Defaults, Variable Expansion, Location Format, Location Format
1269 @comment node-name, next, previous, up
1270 @subsection Map Defaults
1271 @cindex Map defaults
1272 @cindex How to set default map parameters
1273 @cindex Setting default map parameters
1275 A location beginning with a dash @samp{-} is used to specify default
1276 values for subsequent locations. Any previously specified defaults in
1277 the location-list are discarded. The default string can be empty in
1278 which case no defaults apply.
1280 The location @samp{-fs:=/mnt;opts:=ro} would set the local mount point
1281 to @file{/mnt} and cause mounts to be read-only by default. Defaults
1282 specified this way are appended to, and so override, any global map
1283 defaults given with @samp{/defaults}).
1286 @c A @samp{/defaults} value @dfn{gdef} and a location list
1288 @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$
1292 @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$
1294 @c which is equivalent to
1296 @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$
1299 @node Variable Expansion, Selectors, Map Defaults, Location Format
1300 @comment node-name, next, previous, up
1301 @subsection Variable Expansion
1302 @cindex Variable expansion
1303 @cindex How variables are expanded
1304 @cindex Pathname operators
1305 @cindex Domain stripping
1306 @cindex Domainname operators
1307 @cindex Stripping the local domain name
1308 @cindex Environment variables
1309 @cindex How to access environment variables in maps
1311 To allow generic location specifications @i{Amd} does variable expansion
1312 on each location and also on some of the option strings. Any option or
1313 selector appearing in the form @code{$@dfn{var}} is replaced by the
1314 current value of that option or selector. For example, if the value of
1315 @code{$@{key@}} was @samp{bin}, @code{$@{autodir@}} was @samp{/a} and
1316 @code{$@{fs@}} was `@t{$@{autodir@}}@t{/local/}@t{$@{key@}}' then
1317 after expansion @code{$@{fs@}} would have the value @samp{/a/local/bin}.
1318 Any environment variable can be accessed in a similar way.@refill
1320 Two pathname operators are available when expanding a variable. If the
1321 variable name begins with @samp{/} then only the last component of the
1322 pathname is substituted. For example, if @code{$@{path@}} was
1323 @samp{/foo/bar} then @code{$@{/path@}} would be expanded to @samp{bar}.
1324 Similarly, if the variable name ends with @samp{/} then all but the last
1325 component of the pathname is substituted. In the previous example,
1326 @code{$@{path/@}} would be expanded to @samp{/foo}.@refill
1328 Two domain name operators are also provided. If the variable name
1329 begins with @samp{.} then only the domain part of the name is
1330 substituted. For example, if @code{$@{rhost@}} was
1331 @samp{swan.doc.ic.ac.uk} then @code{$@{.rhost@}} would be expanded to
1332 @samp{doc.ic.ac.uk}. Similarly, if the variable name ends with @samp{.}
1333 then only the host component is substituted. In the previous example,
1334 @code{$@{rhost.@}} would be expanded to @samp{swan}.@refill
1336 Variable expansion is a two phase process. Before a location is parsed,
1337 all references to selectors, @i{eg} @code{$@{path@}}, are expanded. The
1338 location is then parsed, selections are evaluated and option assignments
1339 recorded. If there were no selections or they all succeeded the
1340 location is used and the values of the following options are expanded in
1341 the order given: @var{sublink}, @var{rfs}, @var{fs}, @var{opts},
1342 @var{remopts}, @var{mount} and @var{unmount}.
1344 Note that expansion of option values is done after @dfn{all} assignments
1345 have been completed and not in a purely left to right order as is done
1346 by the shell. This generally has the desired effect but care must be
1347 taken if one of the options references another, in which case the
1348 ordering can become significant.
1350 There are two special cases concerning variable expansion:
1354 before a map is consulted, any selectors in the name received
1355 from the kernel are expanded. For example, if the request from the
1356 kernel was for `@t{$@{arch@}}@t{.bin}' and the machine architecture
1357 was @samp{vax}, the value given to @code{$@{key@}} would be
1358 @samp{vax.bin}.@refill
1361 the value of @code{$@{rhost@}} is expanded and normalized before the
1362 other options are expanded. The normalization process strips any local
1363 sub-domain components. For example, if @code{$@{domain@}} was
1364 @samp{Berkeley.EDU} and @code{$@{rhost@}} was initially
1365 @samp{snow.Berkeley.EDU}, after the normalization it would simply be
1366 @samp{snow}. Hostname normalization is currently done in a
1367 @emph{case-dependent} manner.@refill
1370 @c======================================================================
1371 @node Selectors, Map Options, Variable Expansion, Location Format
1372 @comment node-name, next, previous, up
1373 @subsection Selectors
1376 Selectors are used to control the use of a location. It is possible to
1377 share a mount map between many machines in such a way that filesystem
1378 location, architecture and operating system differences are hidden from
1379 the users. A selector of the form @samp{arch==sun3;os==sunos4} would only
1380 apply on Sun-3s running SunOS 4.x.
1382 Selectors can be negated by using @samp{!=} instead of @samp{==}. For
1383 example to select a location on all non-Vax machines the selector
1384 @samp{arch!=vax} would be used.
1386 Selectors are evaluated left to right. If a selector fails then that
1387 location is ignored. Thus the selectors form a conjunction and the
1388 locations form a disjunction. If all the locations are ignored or
1389 otherwise fail then @i{Amd} uses the @dfn{error} filesystem
1390 (@pxref{Error Filesystem}). This is equivalent to having a location
1391 @samp{type:=error} at the end of each mount-map entry.@refill
1393 The default value of many of the selectors listed here can be overridden
1394 by an @i{Amd} command line switch or in an @i{Amd} configuration file.
1395 @xref{Amd Configuration File}.
1397 The following selectors are currently implemented.
1400 * arch Selector Variable::
1401 * autodir Selector Variable::
1402 * byte Selector Variable::
1403 * cluster Selector Variable::
1404 * domain Selector Variable::
1405 * dollar Selector Variable::
1406 * host Selector Variable::
1407 * hostd Selector Variable::
1408 * karch Selector Variable::
1409 * os Selector Variable::
1410 * osver Selector Variable::
1411 * full_os Selector Variable::
1412 * vendor Selector Variable::
1414 * key Selector Variable::
1415 * map Selector Variable::
1416 * netnumber Selector Variable::
1417 * network Selector Variable::
1418 * path Selector Variable::
1419 * wire Selector Variable::
1420 * uid Selector Variable::
1421 * gid Selector Variable::
1423 * exists Selector Function::
1424 * false Selector Function::
1425 * netgrp Selector Function::
1426 * netgrpd Selector Function::
1427 * in_network Selector Function::
1428 * true Selector Function::
1429 * xhost Selector Function::
1432 @c ----------------------------------------------------------------
1433 @node arch Selector Variable, autodir Selector Variable, Selectors, Selectors
1434 @comment node-name, next, previous, up
1435 @subsubsection arch Selector Variable
1436 @cindex arch Selector Variable
1437 @cindex arch, mount selector
1438 @cindex Mount selector; arch
1439 @cindex Selector; arch
1441 The machine architecture which was automatically determined at compile
1442 time. The architecture type can be displayed by running the command
1443 @samp{amd -v}. You can override this value also using the @code{-A}
1444 command line option. @xref{Supported Platforms}.@refill
1446 @c ----------------------------------------------------------------
1447 @node autodir Selector Variable, byte Selector Variable, arch Selector Variable, Selectors
1448 @comment node-name, next, previous, up
1449 @subsubsection autodir Selector Variable
1450 @cindex autodir Selector Variable
1451 @cindex autodir, mount selector
1452 @cindex Mount selector; autodir
1453 @cindex Selector; autodir
1455 The default directory under which to mount filesystems. This may be
1456 changed by the @code{-a} command line option. @xref{fs Option}.
1458 @c ----------------------------------------------------------------
1459 @node byte Selector Variable, cluster Selector Variable, autodir Selector Variable, Selectors
1460 @comment node-name, next, previous, up
1461 @subsubsection byte Selector Variable
1462 @cindex byte Selector Variable
1463 @cindex byte, mount selector
1464 @cindex Mount selector; byte
1465 @cindex Selector; byte
1467 The machine's byte ordering. This is either @samp{little}, indicating
1468 little-endian, or @samp{big}, indicating big-endian. One possible use
1469 is to share @samp{rwho} databases (@pxref{rwho servers}). Another is to
1470 share ndbm databases, however this use can be considered a courageous
1473 @c ----------------------------------------------------------------
1474 @node cluster Selector Variable, domain Selector Variable, byte Selector Variable, Selectors
1475 @comment node-name, next, previous, up
1476 @subsubsection cluster Selector Variable
1477 @cindex cluster Selector Variable
1478 @cindex cluster, mount selector
1479 @cindex Mount selector; cluster
1480 @cindex Selector; cluster
1482 This is provided as a hook for the name of the local cluster. This can
1483 be used to decide which servers to use for copies of replicated
1484 filesystems. @code{$@{cluster@}} defaults to the value of
1485 @code{$@{domain@}} unless a different value is set with the @code{-C}
1486 command line option.
1488 @c ----------------------------------------------------------------
1489 @node domain Selector Variable, dollar Selector Variable, cluster Selector Variable, Selectors
1490 @comment node-name, next, previous, up
1491 @subsubsection domain Selector Variable
1492 @cindex domain Selector Variable
1493 @cindex domain, mount selector
1494 @cindex Mount selector; domain
1495 @cindex Selector; domain
1497 The local domain name as specified by the @code{-d} command line option.
1498 @xref{host Selector Variable}.
1500 @c ----------------------------------------------------------------
1501 @node dollar Selector Variable, host Selector Variable, domain Selector Variable, Selectors
1502 @comment node-name, next, previous, up
1503 @subsubsection dollar Selector Variable
1504 @cindex dollar Selector Variable
1506 This is a special variable, whose sole purpose is to produce a literal
1507 dollar sign in the value of another variable. For example, if you have
1508 a remote file system whose name is @samp{/disk$s}, you can mount it by
1509 setting the remote file system variable as follows:
1512 rfs:=/disk$@{dollar@}s
1515 @c ----------------------------------------------------------------
1516 @node host Selector Variable, hostd Selector Variable, dollar Selector Variable, Selectors
1517 @comment node-name, next, previous, up
1518 @subsubsection host Selector Variable
1519 @cindex host Selector Variable
1520 @cindex host, mount selector
1521 @cindex Mount selector; host
1522 @cindex Selector; host
1524 The local hostname as determined by @b{gethostname}(2). If no domain
1525 name was specified on the command line and the hostname contains a
1526 period @samp{.} then the string before the period is used as the host
1527 name, and the string after the period is assigned to @code{$@{domain@}}.
1528 For example, if the hostname is @samp{styx.doc.ic.ac.uk} then
1529 @code{host} would be @samp{styx} and @code{domain} would be
1530 @samp{doc.ic.ac.uk}. @code{hostd} would be
1531 @samp{styx.doc.ic.ac.uk}.@refill
1533 @c ----------------------------------------------------------------
1534 @node hostd Selector Variable, karch Selector Variable, host Selector Variable, Selectors
1535 @comment node-name, next, previous, up
1536 @subsubsection hostd Selector Variable
1537 @cindex hostd Selector Variable
1538 @cindex hostd, mount selector
1539 @cindex Mount selector; hostd
1540 @cindex Selector; hostd
1542 This resolves to the @code{$@{host@}} and @code{$@{domain@}}
1543 concatenated with a @samp{.} inserted between them if required. If
1544 @code{$@{domain@}} is an empty string then @code{$@{host@}} and
1545 @code{$@{hostd@}} will be identical.
1547 @c ----------------------------------------------------------------
1548 @node karch Selector Variable, os Selector Variable, hostd Selector Variable, Selectors
1549 @comment node-name, next, previous, up
1550 @subsubsection karch Selector Variable
1551 @cindex karch Selector Variable
1552 @cindex karch, mount selector
1553 @cindex Mount selector; karch
1554 @cindex Selector; karch
1556 This is provided as a hook for the kernel architecture. This is used on
1557 SunOS 4 and SunOS 5, for example, to distinguish between different
1558 @samp{/usr/kvm} volumes. @code{$@{karch@}} defaults to the ``machine''
1559 value gotten from @b{uname}(2). If the @b{uname}(2) system call is not
1560 available, the value of @code{$@{karch@}} defaults to that of
1561 @code{$@{arch@}}. Finally, a different value can be set with the @code{-k}
1562 command line option.
1564 @c ----------------------------------------------------------------
1565 @node os Selector Variable, osver Selector Variable, karch Selector Variable, Selectors
1566 @comment node-name, next, previous, up
1567 @subsubsection os Selector Variable
1568 @cindex os Selector Variable
1569 @cindex os, mount selector
1570 @cindex Mount selector; os
1571 @cindex Selector; os
1573 The operating system. Like the machine architecture, this is
1574 automatically determined at compile time. The operating system name can
1575 be displayed by running the command @samp{amd -v}. @xref{Supported
1578 @c ----------------------------------------------------------------
1579 @node osver Selector Variable, full_os Selector Variable, os Selector Variable, Selectors
1580 @comment node-name, next, previous, up
1581 @subsubsection osver Selector Variable
1582 @cindex osver Selector Variable
1583 @cindex osver, mount selector
1584 @cindex Mount selector; osver
1585 @cindex Selector; osver
1587 The operating system version. Like the machine architecture, this is
1588 automatically determined at compile time. The operating system name can
1589 be displayed by running the command @samp{amd -v}. @xref{Supported
1592 @c ----------------------------------------------------------------
1593 @node full_os Selector Variable, vendor Selector Variable, osver Selector Variable, Selectors
1594 @comment node-name, next, previous, up
1595 @subsubsection full_os Selector Variable
1596 @cindex full_os Selector Variable
1597 @cindex full_os, mount selector
1598 @cindex Mount selector; full_os
1599 @cindex Selector; full_os
1601 The full name of the operating system, including its version. This
1602 value is automatically determined at compile time. The full operating
1603 system name and version can be displayed by running the command
1604 @samp{amd -v}. @xref{Supported Platforms}.@refill
1606 @c ----------------------------------------------------------------
1607 @node vendor Selector Variable, key Selector Variable, full_os Selector Variable, Selectors
1608 @comment node-name, next, previous, up
1609 @subsubsection vendor Selector Variable
1610 @cindex vendor Selector Variable
1611 @cindex vendor, mount selector
1612 @cindex Mount selector; vendor
1613 @cindex Selector; vendor
1615 The name of the vendor of the operating system. This value is
1616 automatically determined at compile time. The name of the vendor can be
1617 displayed by running the command @samp{amd -v}. @xref{Supported
1621 @c ----------------------------------------------------------------
1626 The following selectors are also provided. Unlike the other selectors,
1627 they vary for each lookup. Note that when the name from the kernel is
1628 expanded prior to a map lookup, these selectors are all defined as empty
1631 @c ----------------------------------------------------------------
1632 @node key Selector Variable, map Selector Variable, vendor Selector Variable, Selectors
1633 @comment node-name, next, previous, up
1634 @subsubsection key Selector Variable
1635 @cindex key Selector Variable
1636 @cindex key, mount selector
1637 @cindex Mount selector; key
1638 @cindex Selector; key
1640 The name being resolved. For example, if @file{/home} is an automount
1641 point, then accessing @file{/home/foo} would set @code{$@{key@}} to the
1642 string @samp{foo}. The key is prefixed by the @var{pref} option set in
1643 the parent mount point. The default prefix is an empty string. If the
1644 prefix was @file{blah/} then @code{$@{key@}} would be set to
1645 @file{blah/foo}.@refill
1647 @c ----------------------------------------------------------------
1648 @node map Selector Variable, netnumber Selector Variable, key Selector Variable, Selectors
1649 @comment node-name, next, previous, up
1650 @subsubsection map Selector Variable
1651 @cindex map Selector Variable
1652 @cindex map, mount selector
1653 @cindex Mount selector; map
1654 @cindex Selector; map
1656 The name of the mount map being used.
1658 @c ----------------------------------------------------------------
1659 @node netnumber Selector Variable, network Selector Variable, map Selector Variable, Selectors
1660 @comment node-name, next, previous, up
1661 @subsubsection netnumber Selector Variable
1662 @cindex netnumber Selector Variable
1663 @cindex netnumber, mount selector
1664 @cindex Mount selector; netnumber
1665 @cindex Selector; netnumber
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}.
1673 @c ----------------------------------------------------------------
1674 @node network Selector Variable, path Selector Variable, netnumber Selector Variable, Selectors
1675 @comment node-name, next, previous, up
1676 @subsubsection network Selector Variable
1677 @cindex network Selector Variable
1678 @cindex network, mount selector
1679 @cindex Mount selector; network
1680 @cindex Selector; network
1682 This selector is identical to the @samp{in_network} selector function,
1683 see @ref{in_network Selector Function}. It will match either the name
1684 or number of @i{any} network interface on which this host is connected
1685 to. The names and numbers of all attached interfaces are available from
1686 the output of @samp{amd -v}.
1688 @c ----------------------------------------------------------------
1689 @node path Selector Variable, wire Selector Variable, network Selector Variable, Selectors
1690 @comment node-name, next, previous, up
1691 @subsubsection path Selector Variable
1692 @cindex path Selector Variable
1693 @cindex path, mount selector
1694 @cindex Mount selector; path
1695 @cindex Selector; path
1697 The full pathname of the name being resolved. For example
1698 @file{/home/foo} in the example above.
1700 @c ----------------------------------------------------------------
1701 @node wire Selector Variable, uid Selector Variable, path Selector Variable, Selectors
1702 @comment node-name, next, previous, up
1703 @subsubsection wire Selector Variable
1704 @cindex wire Selector Variable
1705 @cindex wire, mount selector
1706 @cindex Mount selector; wire
1707 @cindex Selector; wire
1709 This selector is identical to the @samp{in_network} selector function,
1710 see @ref{in_network Selector Function}. It will match either the name
1711 or number of @i{any} network interface on which this host is connected
1712 to. The names and numbers of all attached interfaces are available from
1713 the output of @samp{amd -v}.
1715 @c ----------------------------------------------------------------
1716 @node uid Selector Variable, gid Selector Variable, wire Selector Variable, Selectors
1717 @comment node-name, next, previous, up
1718 @subsubsection uid Selector Variable
1719 @cindex uid Selector Variable
1720 @cindex uid, mount selector
1721 @cindex Mount selector; uid
1722 @cindex Selector; uid
1724 This selector provides the numeric effective user ID (UID) of the user
1725 which last accessed an automounted path name. This simple example shows
1726 how floppy mounting can be assigned only to machine owners:
1729 floppy -type:=pcfs \
1730 uid==2301;host==shekel;dev:=/dev/floppy \
1731 uid==6712;host==titan;dev=/dev/fd0 \
1732 uid==0;dev:=/dev/fd0c \
1736 The example allows two machine owners to mount floppies on their
1737 designated workstations, allows the root user to mount on any host, and
1738 otherwise forces an error.
1740 @c ----------------------------------------------------------------
1741 @node gid Selector Variable, exists Selector Function, uid Selector Variable, Selectors
1742 @comment node-name, next, previous, up
1743 @subsubsection gid Selector Variable
1744 @cindex gid Selector Variable
1745 @cindex gid, mount selector
1746 @cindex Mount selector; gid
1747 @cindex Selector; gid
1749 This selector provides the numeric effective group ID (GID) of the user
1750 which last accessed an automounted path name.
1752 @c ----------------------------------------------------------------
1757 The following boolean functions are selectors which take an argument
1758 @i{ARG}. They return a value of true or false, and thus do not need to
1759 be compared with a value. Each of these may be negated by prepending
1760 @samp{!} to their name.
1762 @c ----------------------------------------------------------------
1763 @node exists Selector Function, false Selector Function, gid Selector Variable, Selectors
1764 @comment node-name, next, previous, up
1765 @subsubsection exists Selector Function
1766 @cindex exists Selector Function
1767 @cindex exists, boolean mount selector
1768 @cindex !exists, boolean mount selector
1769 @cindex Mount selector; exists
1770 @cindex Selector; exists
1772 If the file listed by @i{ARG} exists (via @b{lstat}(2)), this function
1773 evaluates to true. Otherwise it evaluates to false.
1775 @c ----------------------------------------------------------------
1776 @node false Selector Function, netgrp Selector Function, exists Selector Function, Selectors
1777 @comment node-name, next, previous, up
1778 @subsubsection false Selector Function
1779 @cindex false Selector Function
1780 @cindex false, boolean mount selector
1781 @cindex !false, boolean mount selector
1782 @cindex Mount selector; false
1783 @cindex Selector; false
1785 Always evaluates to false. @i{ARG} is ignored.
1787 @c ----------------------------------------------------------------
1788 @node netgrp Selector Function, netgrpd Selector Function, false Selector Function, Selectors
1789 @comment node-name, next, previous, up
1790 @subsubsection netgrp Selector Function
1791 @cindex netgrp Selector Function
1792 @cindex netgrp, boolean mount selector
1793 @cindex !netgrp, boolean mount selector
1794 @cindex Mount selector; netgrp
1795 @cindex Selector; netgrp
1797 The argument @i{ARG} of this selector is a netgroup name followed
1798 optionally by a comma and a host name. If the host name is not
1799 specified, it defaults to @code{$@{host@}}. If the host name (short
1800 name) is a member of the netgroup, this selector evaluates to true.
1801 Otherwise it evaluates to false.
1803 For example, suppose you have a netgroup @samp{ppp-hosts}, and for
1804 reasons of performance, these have a local @file{/home} partition,
1805 while all other clients on the faster network can access a shared home
1806 directory. A common map to use for both might look like the
1810 home/* netgrp(ppp-hosts);type:=link;fs:=/local/$@{key@} \
1811 !netgrp(ppp-hosts);type:=nfs;rhost:=serv1;rfs:=/remote/$@{key@}
1814 A more complex example that takes advantage of the two argument netgrp
1815 mount selector is given in the following scenario. Suppose one wants
1816 to mount the local scratch space from a each host under
1817 @file{scratch/<hostname>} and some hosts have their scratch space in a
1818 different path than others. Hosts in the netgroup @samp{apple-hosts}
1819 have their scratch space in the @file{/apple} path, where hosts in the
1820 netgroup @samp{cherry-hosts} have their scratch space in the
1821 @file{/cherry} path. For hosts that are neither in the
1822 @samp{apple-hosts} or @samp{cherry-hosts} netgroups we want to make a
1823 symlink pointing to nowhere but provide a descriptive error message in
1824 the link destination:
1827 scratch/* netgrp(apple-hosts,$@{/key@});type:=nfs;rhost:=$@{/key@};\
1829 netgrp(cherry-hosts,$@{/key@});type:=nfs;rhost:=$@{/key@};\
1831 type:=link;rfs:="no local partition for $@{/key@}"
1834 @c ----------------------------------------------------------------
1835 @node netgrpd Selector Function, in_network Selector Function, netgrp Selector Function, Selectors
1836 @comment node-name, next, previous, up
1837 @subsubsection netgrpd Selector Function
1838 @cindex netgrpd Selector Function
1839 @cindex netgrpd, boolean mount selector
1840 @cindex !netgrpd, boolean mount selector
1841 @cindex Mount selector; netgrpd
1842 @cindex Selector; netgrpd
1844 The argument @i{ARG} of this selector is a netgroup name followed
1845 optionally by a comma and a host name. If the host name is not
1846 specified, it defaults to @code{$@{hostd@}}. If the host name
1847 (fully-qualified name) is a member of the netgroup, this selector
1848 evaluates to true. Otherwise it evaluates to false.
1850 The @samp{netgrpd} function uses fully-qualified host names to match
1851 netgroup names, while the @samp{netgrp} function (@pxref{netgrp
1852 Selector Function}) uses short host names.
1854 @c ----------------------------------------------------------------
1855 @node in_network Selector Function, true Selector Function, netgrpd Selector Function, Selectors
1856 @comment node-name, next, previous, up
1857 @subsubsection in_network Selector Function
1858 @cindex in_network Selector Function
1859 @cindex in_network, boolean mount selector
1860 @cindex !in_network, boolean mount selector
1861 @cindex Mount selector; in_network
1862 @cindex Selector; in_network
1864 This selector matches against any network name or number with an
1865 optional netmask. First, if the current host has any network interface that is
1866 locally attached to the network specified in @i{ARG} (either via name or
1867 number), this selector evaluates to true.
1869 Second, @samp{in_network} supports a network/netmask syntax such as
1870 @samp{128.59.16.0/255.255.255.0}, @samp{128.59.16.0/24},
1871 @samp{128.59.16.0/0xffffff00}, or @samp{128.59.16.0/}. Using the last
1872 form, @i{Amd} will match the specified network number against the
1873 default netmasks of each of the locally attached interfaces.
1875 If the selector does not match, it evaluates to false.
1877 For example, suppose you have two servers that have an exportable
1878 @file{/opt} that smaller clients can NFS mount. The two servers are
1879 say, @samp{serv1} on network @samp{foo-net.site.com} and @samp{serv2} on
1880 network @samp{123.4.5.0}. You can write a map to be used by all clients
1881 that will attempt to mount the closest one as follows:
1884 opt in_network(foo-net.site.com);rhost:=serv1;rfs:=/opt \
1885 in_network(123.4.5.0);rhost:=serv2;rfs:=/opt \
1886 rhost:=fallback-server
1889 @c ----------------------------------------------------------------
1890 @node true Selector Function, xhost Selector Function, in_network Selector Function, Selectors
1891 @comment node-name, next, previous, up
1892 @subsubsection true Selector Function
1893 @cindex true Selector Function
1894 @cindex true, boolean mount selector
1895 @cindex !true, boolean mount selector
1896 @cindex Mount selector; true
1897 @cindex Selector; true
1899 Always evaluates to true. @i{ARG} is ignored.
1901 @c ----------------------------------------------------------------
1902 @node xhost Selector Function, , true Selector Function, Selectors
1903 @comment node-name, next, previous, up
1904 @subsubsection xhost Selector Function
1905 @cindex xhost Selector Function
1906 @cindex xhost, boolean mount selector
1907 @cindex !xhost, boolean mount selector
1908 @cindex Mount selector; xhost
1909 @cindex Selector; xhost
1912 This function compares @i{ARG} against the current hostname, similarly
1913 to the @ref{host Selector Variable}. However, this function will
1914 also match if @i{ARG} is a CNAME (DNS Canonical Name, or alias) for
1915 the current host's name.
1917 @c ================================================================
1918 @node Map Options, , Selectors, Location Format
1919 @comment node-name, next, previous, up
1920 @subsection Map Options
1922 @cindex Setting map options
1924 Options are parsed concurrently with selectors. The difference is that
1925 when an option is seen the string following the @samp{:=} is
1926 recorded for later use. As a minimum the @var{type} option must be
1927 specified. Each filesystem type has other options which must also be
1928 specified. @xref{Filesystem Types}, for details on the filesystem
1929 specific options.@refill
1931 Superfluous option specifications are ignored and are not reported
1934 The following options apply to more than one filesystem type.
1946 @node addopts Option, delay Option, Map Options, Map Options
1947 @comment node-name, next, previous, up
1948 @subsubsection addopts Option
1949 @cindex Setting additional options on a mount location
1950 @cindex Overriding or adding options to a mount
1951 @cindex addopts, mount option
1952 @cindex Mount option; addopts
1954 This option adds additional options to default options normally
1955 specified in the @samp{/defaults} entry or the defaults of the key entry
1956 being processed (@pxref{opts Option}). Normally when you specify
1957 @samp{opts} in both the @samp{/defaults} and the map entry, the latter
1958 overrides the former completely. But with @samp{addopts} it will append
1959 the options and override any conflicting ones.
1961 @samp{addopts} also overrides the value of the @samp{remopts} option
1962 (@pxref{remopts Option}), which unless specified defaults to the value
1965 Options which start with @samp{no} will override those with the same
1966 name that do not start with @samp{no} and vice verse. Special handling
1967 is given to inverted options such as @samp{soft} and @samp{hard},
1968 @samp{bg} and @samp{fg}, @samp{ro} and @samp{rw}, etc.
1970 For example, if the default options specified were
1972 opts:=rw,nosuid,intr,rsize=1024,wsize=1024,quota,posix
1975 and the ones specified in a map entry were
1978 addopts:=grpid,suid,ro,rsize=2048,quota,nointr
1981 then the actual options used would be
1984 wsize=1024,posix,grpid,suid,ro,rsize=2048,quota,nointr
1987 @node delay Option, fs Option, addopts Option, Map Options
1988 @comment node-name, next, previous, up
1989 @subsubsection delay Option
1990 @cindex Setting a delay on a mount location
1991 @cindex Delaying mounts from specific locations
1992 @cindex Primary server
1993 @cindex Secondary server
1994 @cindex delay, mount option
1995 @cindex Mount option; delay
1997 The delay, in seconds, before an attempt will be made to mount from the
1998 current location. Auxiliary data, such as network address, file handles
1999 and so on are computed regardless of this value.
2001 A delay can be used to implement the notion of primary and secondary
2002 file servers. The secondary servers would have a delay of a few
2003 seconds, thus giving the primary servers a chance to respond first.
2005 @node fs Option, opts Option, delay Option, Map Options
2006 @comment node-name, next, previous, up
2007 @subsubsection fs Option
2008 @cindex Setting the local mount point
2009 @cindex Overriding the default mount point
2010 @cindex fs, mount option
2011 @cindex Mount option; fs
2013 The local mount point. The semantics of this option vary between
2016 For NFS and UFS filesystems the value of @code{$@{fs@}} is used as the
2017 local mount point. For other filesystem types it has other meanings
2018 which are described in the section describing the respective filesystem
2019 type. It is important that this string uniquely identifies the
2020 filesystem being mounted. To satisfy this requirement, it should
2021 contain the name of the host on which the filesystem is resident and the
2022 pathname of the filesystem on the local or remote host.
2024 The reason for requiring the hostname is clear if replicated filesystems
2025 are considered. If a fileserver goes down and a replacement filesystem
2026 is mounted then the @dfn{local} mount point @dfn{must} be different from
2027 that of the filesystem which is hung. Some encoding of the filesystem
2028 name is required if more than one filesystem is to be mounted from any
2031 If the hostname is first in the path then all mounts from a particular
2032 host will be gathered below a single directory. If that server goes
2033 down then the hung mount points are less likely to be accidentally
2034 referenced, for example when @b{getcwd}(3) traverses the namespace to
2035 find the pathname of the current directory.
2037 The @samp{fs} option defaults to
2038 @code{$@{autodir@}/$@{rhost@}$@{rfs@}}. In addition,
2039 @samp{rhost} defaults to the local host name (@code{$@{host@}}) and
2040 @samp{rfs} defaults to the value of @code{$@{path@}}, which is the full
2041 path of the requested file; @samp{/home/foo} in the example above
2042 (@pxref{Selectors}). @code{$@{autodir@}} defaults to @samp{/a} but may
2043 be changed with the @code{-a} command line option. Sun's automounter
2044 defaults to @samp{/tmp_mnt}. Note that there is no @samp{/} between
2045 the @code{$@{rhost@}} and @code{$@{rfs@}} since @code{$@{rfs@}} begins
2046 with a @samp{/}.@refill
2048 @node opts Option, remopts Option, fs Option, Map Options
2049 @comment node-name, next, previous, up
2050 @subsubsection opts Option
2051 @cindex Setting system mount options
2052 @cindex Passing parameters to the mount system call
2053 @cindex mount system call
2054 @cindex mount system call flags
2055 @cindex The mount system call
2056 @cindex opts, mount option
2057 @cindex Mount option; opts
2059 The options to pass to the mount system call. A leading @samp{-} is
2060 silently ignored. The mount options supported generally correspond to
2061 those used by @b{mount}(8) and are listed below. Some additional
2062 pseudo-options are interpreted by @i{Amd} and are also listed.
2064 Unless specifically overridden, each of the system default mount options
2065 applies. Any options not recognized are ignored. If no options list is
2066 supplied the string @samp{rw,defaults} is used and all the system
2067 default mount options apply. Options which are not applicable for a
2068 particular operating system are silently ignored. For example, only 4.4BSD
2069 is known to implement the @code{compress} and @code{spongy} options.
2073 @item acdirmax=@var{n}
2074 @cindex Mount flags; acdirmax
2075 Set the maximum directory attribute cache timeout to @var{n}.
2077 @item acdirmin=@var{n}
2078 @cindex Mount flags; acdirmin
2079 Set the minimum directory attribute cache timeout to @var{n}.
2081 @item acregmax=@var{n}
2082 @cindex Mount flags; acregmax
2083 Set the maximum file attribute cache timeout to @var{n}.
2085 @item acregmin=@var{n}
2086 @cindex Mount flags; acregmin
2087 Set the minimum file attribute cache timeout to @var{n}.
2089 @item actimeo=@var{n}
2090 @cindex Mount flags; actimeo
2091 Set the overall attribute cache timeout to @var{n}.
2094 @cindex Mount flags; auto
2096 @cindex Mount flags; ignore
2097 Ignore this mount by @b{df}(1).
2100 @cindex Mount flags; cache
2101 Allow data to be cached from a remote server for this mount.
2104 @cindex Mount flags; closesession
2105 For UDF mounts, close the session when unmounting.
2108 @cindex Mount flags; compress
2109 Use NFS compression protocol.
2112 @cindex Mount flags; defperm
2113 Ignore the permission mode bits, and default file permissions to 0555,
2114 UID 0, and GID 0. Useful for CD-ROMs formatted as ISO-9660.
2117 @cindex Mount flags; dev
2118 Allow local special devices on this filesystem.
2120 @item dirmask=@var{n}
2121 @cindex Mount flags; dirmask
2122 For PCFS mounts, specify the maximum file permissions for directories
2123 in the file system. See the @samp{mask} option's description for more
2124 details. The mask value of @var{n} can be specified in decimal,
2125 octal, or hexadecimal.
2128 @cindex Mount flags; dumbtimr
2129 Turn off the dynamic retransmit timeout estimator. This may be useful
2130 for UDP mounts that exhibit high retry rates, since it is possible that
2131 the dynamically estimated timeout interval is too short.
2134 @cindex Mount flags; extatt
2135 Enable extended attributes in ISO-9660 file systems.
2138 @cindex Mount flags; fsid
2139 Set ID of filesystem.
2142 @cindex Mount flags; gens
2143 Enable generations in ISO-9660 file systems. Generations allow you to
2144 see all versions of a given file.
2146 @item gmtoff=@var{n}
2147 @cindex Mount flags; gmtoff
2148 For UDF mounts, set the time zone offset from UTC to @var{n} seconds,
2149 with positive values indicating east of the Prime Meridian. If not
2150 set, the user's current time zone will be used.
2153 @cindex Mount flags; group
2154 For PCFS and UDF mounts, set the group of the files in the file system
2155 to @var{n} (which can either be a group name or a GID number). The
2156 default group is the group of the directory on which the file system
2160 @cindex Mount flags; grpid
2161 Use BSD directory group-id semantics.
2164 @cindex Mount flags; int
2166 @cindex Mount flags; intr
2167 Allow keyboard interrupts on hard mounts.
2170 @cindex Mount flags; lock
2171 Use the NFS locking protocol (default)
2174 @cindex Mount Flags; longname
2175 For PCFS mounts, force Win95 long names.
2178 @cindex Mount flags; mask
2179 For PCFS mounts, specify the maximum file permissions for files in the
2180 file system. For example, a mask of 755 specifies that, by default,
2181 the owner should have read, write, and execute permissions for files,
2182 but others should only have read and execute permissions. Only the
2183 nine low-order bits of mask are used. The default mask is taken from
2184 the directory on which the file system is being mounted. The mask
2185 value of @var{n} can be specified in decimal, octal, or hexadecimal.
2188 @cindex Mount flags; multi
2189 Perform multi-component lookup on files.
2192 @cindex Mount flags; maxgroups
2193 Set the maximum number of groups to allow for this mount.
2196 @cindex Mount flags; nfsv3
2197 Use NFS Version 3 for this mount.
2200 @cindex Mount flags; noac
2201 Turn off the attribute cache.
2204 @cindex Mount flags; noauto
2205 This option is used by the mount command in @samp{/etc/fstab} or
2206 @samp{/etc/vfstab} and means not to mount this file system when mount -a
2210 @cindex Mount flags; nocache
2211 Do not allow data to be cached from a remote server for this
2215 @cindex Mount flags; nocasetrans
2216 Don't do case translation. Useful for CD-ROMS formatted as
2220 @cindex Mount flags; noconn
2221 Don't make a connection on datagram transports.
2224 @cindex Mount flags; nocto
2225 No close-to-open consistency.
2228 @cindex Mount flags; nodefperm
2229 Do not ignore the permission mode bits. Useful for CD-ROMS formatted as
2233 @cindex Mount flags; nodev
2235 @cindex Mount flags; nodevs
2236 Don't allow local special devices on this filesystem.
2239 @cindex Mount flags; noexec
2240 Don't allow program execution.
2243 @cindex Mount flags; noint
2244 Do not allow keyboard interrupts for this mount
2247 @cindex Mount flags; nojoliet
2248 Turn off the Joliet extensions. Useful for CD-ROMS formatted as ISO-9660.
2251 @cindex Mount flags; nolock
2252 Do not use the NFS locking protocol
2255 @cindex Mount flags; nomnttab
2256 This option is used internally to tell Amd that a Solaris 8 system using
2260 @cindex Mount flags; norrip
2261 Turn off using of the Rock Ridge Interchange Protocol (RRIP) extensions
2265 @cindex Mount flags; nosub
2266 Disallow mounts beneath this mount.
2269 @cindex Mount flags; nosuid
2270 Don't allow set-uid or set-gid executables on this filesystem.
2273 @cindex Mount flags; noversion
2274 Strip the extension @samp{;#} from the version string of files recorded
2275 on an ISO-9660 CD-ROM.
2278 @cindex Mount Flags; nowin95
2279 For PCFS mounts, completely ignore Win95 entries.
2282 @cindex Mount flags; optionstr
2283 Under Solaris 8, provide the kernel a string of options to parse and
2284 show as part of the special in-kernel mount file system.
2287 @cindex Mount flags; overlay
2288 Overlay this mount on top of an existing mount, if any.
2290 @item pgthresh=@var{n}
2291 @cindex Mount flags; pgthresh
2292 Set the paging threshold to @var{n} kilobytes.
2295 @cindex Mount flags; port
2296 Set the NFS port to @var{n}.
2299 @cindex Mount flags; posix
2300 Turn on POSIX static pathconf for mounts.
2303 @cindex Mount flags; private
2304 Use local locking instead of the NLM protocol, useful for IRIX 6 only.
2307 @cindex Mount flags; proplist
2308 Support property lists (ACLs) for this mount, useful primarily for Tru64
2312 @cindex Mount flags; proto
2313 Use transport protocol @var{s} for NFS (can be @code{"tcp"} or @code{"udp"}).
2316 @cindex Mount flags; quota
2317 Enable quota checking on this mount.
2320 @cindex Mount flags; rdonly
2322 @cindex Mount flags; ro
2323 Mount this filesystem readonly.
2326 @cindex Mount flags; resvport
2327 Use a reserved port (smaller than 1024) for remote NFS mounts. Most
2328 systems assume that, but some allow for mounts to occur on non-reserved
2329 ports. This causes problems when such a system tries to NFS mount one
2330 that requires reserved ports. It is recommended that this option always
2334 @cindex Mount flags; retrans
2335 The number of NFS retransmits made before a user error is generated by a
2336 @samp{soft} mounted filesystem, and before a @samp{hard} mounted
2337 filesystem reports @samp{NFS server @dfn{yoyo} not responding still
2341 @cindex Mount flags; retry
2342 Set the NFS retry counter.
2345 @cindex Mount flags; rrcaseins
2346 Enable the Rock Ridge Interchange Protocol (RRIP) case insensitive extensions.
2347 Useful for CD-ROMS formatted as ISO-9660.
2350 @cindex Mount flags; rrip
2351 Uses the Rock Ridge Interchange Protocol (RRIP) extensions to ISO-9660.
2354 @cindex Mount flags; rsize
2355 The NFS read packet size. You may need to set this if you are using
2356 NFS/UDP through a gateway or a slow link.
2359 @cindex Mount flags; rw
2360 Allow reads and writes on this filesystem.
2362 @item sessionnr=@var{n}
2363 @cindex Mount Flags; sessionnr
2364 For multisession UDF mounts, use session number @var{n} when mounting.
2367 @cindex Mount Flags; longname
2368 For PCFS mounts, force old DOS short names only.
2371 @cindex Mount flags; soft
2372 Give up after @dfn{retrans} retransmissions.
2375 @cindex Mount flags; spongy
2376 Like @samp{soft} for status requests, and @samp{hard} for data transfers.
2379 @cindex Mount flags; suid
2380 Allow set-uid programs on this mount.
2383 @cindex Mount flags; symttl
2384 Turn off the symbolic link cache time-to-live.
2387 @cindex Mount flags; sync
2388 Perform synchronous filesystem operations on this mount.
2391 @cindex Mount flags; tcp
2392 Use TCP/IP instead of UDP/IP, ignored if the NFS implementation does not
2393 support TCP/IP mounts.
2396 @cindex Mount flags; timeo
2397 The NFS timeout, in tenth-seconds, before a request is retransmitted.
2400 @cindex Mount flags; user
2401 For PCFS and UDF mounts, set the owner of the files in the file system
2402 to @var{n} (which can either be a user name or a UID number). The
2403 default owner is the owner of the directory on which the file system
2407 @cindex Mount flags; vers
2408 Use NFS protocol version number @var{n} (can be 2 or 3).
2411 @cindex Mount flags; wsize
2412 The NFS write packet size. You may need to set this if you are using
2413 NFS/UDP through a gateway or a slow link.
2417 The following options are implemented by @i{Amd}, rather than being
2418 passed to the kernel.
2423 @cindex Mount flags; nounmount
2424 Configures the mount so that its time-to-live will never expire. This
2425 is the default for non-network based filesystem types (such as
2426 mounting local disks, floppies, and CD-ROMs). See also the related
2429 @c Implementation broken:
2432 @cindex Mount flags; ping
2433 The interval, in seconds, between keep-alive pings. When four
2434 consecutive pings have failed the mount point is marked as hung. This
2435 interval defaults to 30 seconds; if the ping interval is set to zero,
2436 @i{Amd} will use the default 30-second interval. If the interval is
2437 set to -1 (or any other negative value), no pings are sent and the
2438 host is assumed to be always up, which can cause unmounts to hang See
2439 the @i{softlookup} option for a better alternative. Turning pings off
2440 can be useful in NFS-HA (High-Availability) sites where the NFS
2441 service rarely goes down. Setting the ping value to a large value can
2442 reduce the amount of NFS_NULL chatter on your network considerably,
2443 especially in large sites.
2445 Note that if you have multiple @i{Amd} entries using the same file
2446 server, and each entry sets a different value of N, then each time Amd
2447 mounts a new entry, the ping value will be re-evaluated (and updated,
2448 turned off, or turned back on as needed). Finally, note that NFS_NULL
2449 pings are sent for both UDP and TCP mounts, because even a hung TCP
2450 mount can cause user processes to hang.
2453 @cindex Mount flags; public
2454 Use WebNFS multi-component lookup on the public file handle instead of
2455 the mount protocol to obtain NFS file handles, as documented in the
2456 WebNFS Client Specification, RFC 2054. This means that @i{Amd} will not
2457 attempt to contact the remote portmapper or remote mountd daemon, and
2458 will only connect to the well-known NFS port 2049 or the port specified
2459 with the @i{port} mount option, thus making it easier to use NFS through
2463 @cindex Mount flags; retry=@var{n}
2464 The number of times to retry the mount system call.
2467 @cindex Mount flags; softlookup
2468 Configures @i{Amd}'s behavior with respect to already-mounted shares from
2469 NFS fileservers that are unreachable. If softlookup is specified,
2470 trying to access such a share will result in an error (EIO, which is
2471 changed from the ENOENT 6.0 used to return). If it is not specified, a
2472 regular symlink is provided and the access will probably hang
2473 in the NFS filesystem.
2475 The default behavior depends on whether the mount is 'soft' or 'hard';
2476 softlookup can be used to change this default. This is changed from 6.0
2477 which always behaved as if softlookup was specified.
2480 @cindex Mount flags; unmount
2481 Configures the mount so that its time-to-live will indeed expire (and
2482 thus may be automatically unmounted). This is also the default for
2483 network-based filesystem types (e.g., NFS). This option is useful for
2484 removable local media such as CD-ROMs, USB drives, etc. so they can
2485 expire when not in use, and get unmounted (such drives can get work
2486 out when they keep spinning). See also the related @i{nounmount}
2489 @item utimeout=@var{n}
2490 @cindex Mount flags; utimeout=@var{n}
2491 The interval, in seconds, that looked up and mounted map entries are
2492 cached. After that period of time, @i{Amd} will attempt to unmount
2493 the entries. If, however, the unmount fails (with EBUSY), then
2494 @i{Amd} will extend the mount's time-to-live by the @i{utimeout} value
2495 before the next unmount attempt is made. In fact the interval is
2496 extended before the unmount is attempted, to avoid thrashing. The
2497 default value is 120 seconds (two minutes) or as set by the @code{-w}
2498 command line option.
2501 @cindex Mount flags; xlatecookie
2502 Translate directory cookies between 32-long and 64-long lengths.
2506 @node remopts Option, sublink Option, opts Option, Map Options
2507 @comment node-name, next, previous, up
2508 @subsubsection remopts Option
2509 @cindex Setting system mount options for non-local networks
2510 @cindex remopts, mount option
2511 @cindex Mount option; remopts
2513 This option has the same use as @code{$@{opts@}} but applies only when
2514 the remote host is on a non-local network. For example, when using NFS
2515 across a gateway it is often necessary to use smaller values for the
2516 data read and write sizes. This can simply be done by specifying the
2517 small values in @var{remopts}. When a non-local host is accessed, the
2518 smaller sizes will automatically be used.
2520 @i{Amd} determines whether a host is local by examining the network
2521 interface configuration at startup. Any interface changes made after
2522 @i{Amd} has been started will not be noticed. The likely effect will
2523 be that a host may incorrectly be declared non-local.
2525 Unless otherwise set, the value of @code{$@{remopts@}} is the same as
2526 the value of @code{$@{opts@}}.
2528 @node sublink Option, type Option, remopts Option, Map Options
2529 @comment node-name, next, previous, up
2530 @subsubsection sublink Option
2531 @cindex Setting the sublink option
2532 @cindex sublink, mount option
2533 @cindex Mount option; sublink
2535 The subdirectory within the mounted filesystem to which the reference
2536 should point. This can be used to prevent duplicate mounts in cases
2537 where multiple directories in the same mounted filesystem are used.
2539 @node type Option, , sublink Option, Map Options
2540 @comment node-name, next, previous, up
2541 @subsubsection type Option
2542 @cindex Setting the filesystem type option
2543 @cindex type, mount option
2544 @cindex Mount option; type
2546 The filesystem type to be used. @xref{Filesystem Types}, for a full
2547 description of each type.@refill
2549 @c ################################################################
2550 @node Amd Command Line Options, Filesystem Types, Mount Maps, Top
2551 @comment node-name, next, previous, up
2552 @chapter @i{Amd} Command Line Options
2553 @cindex Command line options, Amd
2554 @cindex Amd command line options
2555 @cindex Overriding defaults on the command line
2557 Many of @i{Amd}'s parameters can be set from the command line. The
2558 command line is also used to specify automount points and maps.
2560 The general format of a command line is
2563 amd [@i{options}] [@{ @i{directory} @i{map-name} [-@i{map-options}] @} ...]
2566 For each directory and map-name given or specified in the
2567 @file{amd.conf} file, @i{Amd} establishes an automount point. The
2568 @dfn{map-options} may be any sequence of options or
2569 selectors---@pxref{Location Format}. The @dfn{map-options} apply only
2570 to @i{Amd}'s mount point.
2572 @samp{type:=toplvl;cache:=mapdefault;fs:=$@{map@}} is the default value for the
2573 map options. Default options for a map are read from a special entry in
2574 the map whose key is the string @samp{/defaults}. When default options
2575 are given they are prepended to any options specified in the mount-map
2576 locations as explained in @ref{Map Defaults}.
2578 The @dfn{options} are any combination of those listed below.
2580 Once the command line has been parsed, the automount points are mounted.
2581 The mount points are created if they do not already exist, in which case they
2582 will be removed when @i{Amd} exits.
2583 Finally, @i{Amd} disassociates itself from its controlling terminal and
2584 forks into the background.
2586 Note: Even if @i{Amd} has been built with @samp{-DDEBUG} (via
2587 @code{configure --enable-debug}), it will still background itself and
2588 disassociate itself from the controlling terminal. To use a debugger it
2589 is necessary to specify @samp{-D daemon} on the command line.
2590 However, even with all of this, mounts and unmounts are performed in the
2591 background, and @i{Amd} will always fork before doing them. Therefore,
2592 debugging what happens closely during un/mounts is more challenging.
2594 @emph{All} of @i{Amd}'s command options (save @code{-F} and @code{-T})
2595 can be specified in the @file{amd.conf} file. @xref{Amd Configuration
2596 File}. If @i{Amd} is invoked without any command line options, it will
2597 default to using the configuration file @file{/etc/amd.conf}, if one
2601 * -a Option:: Automount directory.
2602 * -c Option:: Cache timeout interval.
2603 * -d Option:: Domain name.
2604 * -k Option:: Kernel architecture.
2605 * -l Option:: Log file.
2606 * -n Option:: Hostname normalization.
2607 * -o Option:: Operating system version.
2608 * -p Option:: Output process id.
2609 * -r Option:: Restart existing mounts.
2610 * -t Option:: Kernel RPC timeout.
2611 * -v Option:: Version information.
2612 * -w Option:: Wait interval after failed unmount.
2613 * -x Option:: Log options.
2614 * -y Option:: NIS domain.
2615 * -A Option:: Operating system Architecture.
2616 * -C Option:: Cluster name.
2617 * -D Option:: Debug flags.
2618 * -F Option:: Amd configuration file.
2619 * -H Option:: Show brief help.
2620 * -O Option:: Operating system name.
2621 * -S Option:: Lock executable pages in memory.
2622 * -T Option:: Set tag for configuration file.
2625 @c ----------------------------------------------------------------
2626 @node -a Option, -c Option, Amd Command Line Options, Amd Command Line Options
2627 @comment node-name, next, previous, up
2628 @section @code{-a} @var{directory}
2629 @cindex Automount directory
2630 @cindex Setting the default mount directory
2632 Specifies the default mount directory. This option changes the variable
2633 @code{$@{autodir@}} which otherwise defaults to @file{/a}. For example,
2634 some sites prefer @file{/amd} or @file{/n}.
2640 @c ----------------------------------------------------------------
2641 @node -c Option, -d Option, -a Option, Amd Command Line Options
2642 @comment node-name, next, previous, up
2643 @section @code{-c} @var{cache-interval}
2644 @cindex Cache interval
2645 @cindex Interval before a filesystem times out
2646 @cindex Setting the interval before a filesystem times out
2647 @cindex Changing the interval before a filesystem times out
2649 Selects the period, in seconds, for which a name is cached by @i{Amd}.
2650 If no reference is made to the volume in this period, @i{Amd} discards
2651 the volume name to filesystem mapping.
2653 Once the last reference to a filesystem has been removed, @i{Amd}
2654 attempts to unmount the filesystem. If the unmount fails the interval
2655 is extended by a further period as specified by the @samp{-w} command
2656 line option or by the @samp{utimeout} mount option.
2658 The default @dfn{cache-interval} is 300 seconds (five minutes).
2660 @c ----------------------------------------------------------------
2661 @node -d Option, -k Option, -c Option, Amd Command Line Options
2662 @comment node-name, next, previous, up
2663 @section @code{-d} @var{domain}
2665 @cindex Setting the local domain name
2666 @cindex Overriding the local domain name
2668 Specifies the host's domain. This sets the internal variable
2669 @code{$@{domain@}} and affects the @code{$@{hostd@}} variable.
2671 If this option is not specified and the hostname already contains the
2672 local domain then that is used, otherwise the default value of
2673 @code{$@{domain@}} is @samp{unknown.domain}.
2675 For example, if the local domain was @samp{doc.ic.ac.uk}, @i{Amd} could
2676 be started as follows:
2679 amd -d doc.ic.ac.uk ...
2682 @c ----------------------------------------------------------------
2683 @node -k Option, -l Option, -d Option, Amd Command Line Options
2684 @comment node-name, next, previous, up
2685 @section @code{-k} @var{kernel-architecture}
2686 @cindex Setting the Kernel architecture
2688 Specifies the kernel architecture of the system. This is usually the
2689 output of @samp{uname -m} (the ``machine'' value gotten from
2690 @b{uname}(2)). If the @b{uname}(2) system call is not available, the
2691 value of @code{$@{karch@}} defaults to that of @code{$@{arch@}}.
2693 The only effect of this option is to set the variable @code{$@{karch@}}.
2695 This option would be used as follows:
2698 amd -k `arch -k` ...
2701 @c ----------------------------------------------------------------
2702 @node -l Option, -n Option, -k Option, Amd Command Line Options
2703 @comment node-name, next, previous, up
2704 @section @code{-l} @var{log-option}
2705 @cindex Log filename
2706 @cindex Setting the log file
2707 @cindex Using syslog to log errors
2710 Selects the form of logging to be made. Several special @dfn{log-options}
2715 If @dfn{log-option} is the string @samp{syslog}, @i{Amd} will use the
2716 @b{syslog}(3) mechanism. If your system supports syslog facilities, then
2717 the default facility used is @samp{LOG_DAEMON}.
2720 @cindex syslog facility; specifying an alternate
2721 When using syslog, if you wish to change the facility, append its name
2722 to the log option name, delimited by a single colon. For example, if
2723 @dfn{log-options} is the string @samp{syslog:local7} then @b{Amd} will
2724 log messages via @b{syslog}(3) using the @samp{LOG_LOCAL7} facility. If
2725 the facility name specified is not recognized, @i{Amd} will default to
2726 @samp{LOG_DAEMON}. Note: while you can use any syslog facility
2727 available on your system, it is generally a bad idea to use those
2728 reserved for other services such as @samp{kern}, @samp{lpr},
2732 If @dfn{log-option} is the string @samp{/dev/stderr}, @i{Amd} will use
2733 standard error, which is also the default target for log messages. To
2734 implement this, @i{Amd} simulates the effect of the @samp{/dev/fd}
2738 Any other string is taken as a filename to use for logging. Log
2739 messages are appended to the file if it already exists, otherwise a new
2740 file is created. The file is opened once and then held open, rather
2741 than being re-opened for each message.
2743 Normally, when long-running daemons hold an open file descriptor on a
2744 log file, it is impossible to ``rotate'' the log file and compress older
2745 logs on a daily basis. The daemon needs to be told to discard (via
2746 @b{close}(2)) its file handle, and re-open the log file. This is done
2747 using @code{amq -l} @i{log-option}. @xref{Amq -l option}.
2749 If the @samp{syslog} option is specified but the system does not support
2750 syslog or if the named file cannot be opened or created, @i{Amd} will
2751 use standard error. Error messages generated before @i{Amd} has
2752 finished parsing the command line are printed on standard error.
2754 Since @i{Amd} tends to generate a lot of logging information (especially
2755 if debugging was turned on), and due to it being an important program
2756 running on the system, it is usually best to log to a separate disk
2757 file. In that case @i{Amd} would be started as follows:
2760 amd -l /var/log/amd ...
2763 @c ----------------------------------------------------------------
2764 @node -n Option, -o Option, -l Option, Amd Command Line Options
2765 @comment node-name, next, previous, up
2767 @cindex Hostname normalization
2768 @cindex Aliased hostnames
2769 @cindex Resolving aliased hostnames
2770 @cindex Normalizing hostnames
2772 Normalizes the remote hostname before using it. Normalization is done
2773 by replacing the value of @code{$@{rhost@}} with the (generally fully
2774 qualified) primary name returned by a hostname lookup.
2776 This option should be used if several names are used to refer to a
2777 single host in a mount map.
2779 @c ----------------------------------------------------------------
2780 @node -o Option, -p Option, -n Option, Amd Command Line Options
2781 @comment node-name, next, previous, up
2782 @section @code{-o} @var{op-sys-ver}
2783 @cindex Operating System version
2784 @cindex Setting the Operating System version
2786 Overrides the compiled-in version number of the operating system, with
2787 @var{op-sys-ver}. Useful when the built-in version is not desired for
2788 backward compatibility reasons. For example, if the built-in version is
2789 @samp{2.5.1}, you can override it to @samp{5.5.1}, and use older maps
2790 that were written with the latter in mind.
2792 @c ----------------------------------------------------------------
2793 @node -p Option, -r Option, -o Option, Amd Command Line Options
2794 @comment node-name, next, previous, up
2797 @cindex Displaying the process id
2798 @cindex process id of Amd daemon
2799 @cindex pid file, creating with -p option
2800 @cindex Creating a pid file
2802 Causes @i{Amd}'s process id to be printed on standard output.
2803 This can be redirected to a suitable file for use with kill:
2806 amd -p > /var/run/amd.pid ...
2809 This option only has an affect if @i{Amd} is running in daemon mode.
2810 If @i{Amd} is started with the @code{-D daemon} debug flag, this
2813 @c ----------------------------------------------------------------
2814 @node -r Option, -t Option, -p Option, Amd Command Line Options
2815 @comment node-name, next, previous, up
2817 @cindex Restarting existing mounts
2818 @cindex Picking up existing mounts
2820 Tells @i{Amd} to restart existing mounts (@pxref{Inheritance Filesystem}).
2821 @c @dfn{This option will be made the default in the next release.}
2823 @c ----------------------------------------------------------------
2824 @node -t Option, -v Option, -r Option, Amd Command Line Options
2825 @comment node-name, next, previous, up
2826 @section @code{-t} @var{timeout.retransmit}
2827 @cindex Setting Amd's RPC parameters
2829 Specifies the RPC @dfn{timeout} interval and the @dfn{retransmit}
2830 counter used by the kernel to communicate to @i{Amd}. These are used to
2831 set the @samp{timeo} and @samp{retrans} mount options, respectively.
2832 The default timeout is 0.8 seconds, and the default number of
2833 retransmissions is 11.
2835 @i{Amd} relies on the kernel RPC retransmit mechanism to trigger mount
2836 retries. The values of these parameters change the overall retry
2837 interval. Too long an interval gives poor interactive response; too
2838 short an interval causes excessive retries.
2840 @c ----------------------------------------------------------------
2841 @node -v Option, -w Option, -t Option, Amd Command Line Options
2842 @comment node-name, next, previous, up
2844 @cindex Version information
2845 @cindex Discovering version information
2846 @cindex How to discover your version of Amd
2848 Print version information on standard error and then exit. The output
2852 Copyright (c) 1997-1999 Erez Zadok
2853 Copyright (c) 1990 Jan-Simon Pendry
2854 Copyright (c) 1990 Imperial College of Science, Technology & Medicine
2855 Copyright (c) 1990 The Regents of the University of California.
2856 am-utils version 6.0a15 (build 61).
2857 Built by ezk@@example.com on date Wed Oct 22 15:21:03 EDT 1997.
2858 cpu=sparc (big-endian), arch=sun4, karch=sun4u.
2859 full_os=solaris2.5.1, os=sos5, osver=5.5.1, vendor=sun.
2860 Map support for: root, passwd, union, nisplus, nis, ndbm, file, error.
2861 AMFS: nfs, link, nfsx, nfsl, host, linkx, program, union, inherit,
2862 ufs, lofs, hsfs, pcfs, auto, direct, toplvl, error.
2863 FS: autofs, cachefs, cdfs, lofs, nfs, nfs3, pcfs, tfs, tmpfs, udf, ufs.
2864 Network 1: wire="mcl-lab-net.cs.columbia.edu" (netnumber=128.59.13).
2865 Network 2: wire="14-net.cs.columbia.edu" (netnumber=128.59.14).
2866 Network 3: wire="old-net.cs.columbia.edu" (netnumber=128.59.16).
2869 The information includes the version number, number of times @i{Amd} was
2870 compiled on the local system, release date and name of the release.
2871 Following come the cpu type, byte ordering, and the architecture and
2872 kernel architecture as @code{$@{arch@}} and @code{$@{karch@}},
2873 respectively. The next line lists the operating system full name, short
2874 name, version, and vendor. These four values correspond to the
2875 variables @code{$@{full_os@}}, @code{$@{os@}}, @code{$@{osver@}}, and
2876 @code{$@{vendor@}}, respectively. @xref{Supported Platforms}.
2878 Then come a list of map types supported, filesystems internally
2879 supported by @i{Amd} (AMFS), and generic filesystems available (FS).
2880 Finally all known networks (if any) of this host are listed by name
2881 and number. They are available via the variables
2882 @code{$@{wire@}} or @code{$@{network@}}, and
2883 @code{$@{netnumber@}} (@pxref{Selectors}) or the @samp{in_network}
2884 selector function (@pxref{in_network Selector Function}).
2886 @c ----------------------------------------------------------------
2887 @node -w Option, -x Option, -v Option, Amd Command Line Options
2888 @comment node-name, next, previous, up
2889 @section @code{-w} @var{wait-timeout}
2890 @cindex Setting the interval between unmount attempts
2891 @cindex unmount attempt backoff interval
2893 Selects the interval in seconds between unmount attempts after the
2894 initial time-to-live has expired.
2896 This defaults to 120 seconds (two minutes).
2898 @c ----------------------------------------------------------------
2899 @node -x Option, -y Option, -w Option, Amd Command Line Options
2900 @comment node-name, next, previous, up
2901 @section @code{-x} @var{opts}
2902 @cindex Log message selection
2903 @cindex Selecting specific log messages
2904 @cindex How to select log messages
2905 @cindex syslog priorities
2907 Specifies the type and verbosity of log messages. @dfn{opts} is
2908 a comma separated list selected from the following options:
2912 Fatal errors (cannot be turned off)
2914 Non-fatal errors (cannot be turned off)
2916 Non-fatal user errors
2920 Alias for @code{warn}
2922 Information messages
2926 Additional statistics
2930 An alias for "fatal,error,user,warning,info".
2933 Initially a set of default logging flags is enabled. This is as if
2936 @samp{-x fatal,error,user,warning,info}
2937 had been selected. The command line is
2938 parsed and logging is controlled by the @code{-x} option. The very first
2939 set of logging flags is saved and can not be subsequently disabled using
2940 @i{Amq}. This default set of options is useful for general production
2943 The @samp{info} messages include details of what is mounted and
2944 unmounted and when filesystems have timed out. If you want to have the
2945 default set of messages without the @samp{info} messages then you simply
2946 need @samp{-x noinfo}. The messages given by @samp{user} relate to
2947 errors in the mount maps, so these are useful when new maps are
2948 installed. The following table lists the syslog priorities used for each
2949 of the message types.@refill
2970 The options can be prefixed by the string @samp{no} to indicate
2971 that this option should be turned off. For example, to obtain all
2972 but @samp{info} messages the option @samp{-x all,noinfo} would be used.
2974 If @i{Amd} was built with debugging enabled the @code{debug} option is
2975 automatically enabled regardless of the command line options.
2977 @c ----------------------------------------------------------------
2978 @node -y Option, -A Option, -x Option, Amd Command Line Options
2979 @comment node-name, next, previous, up
2980 @section @code{-y} @var{NIS-domain}
2981 @cindex NIS (YP) domain name
2982 @cindex Overriding the NIS (YP) domain name
2983 @cindex Setting the NIS (YP) domain name
2984 @cindex YP domain name
2986 Selects an alternate NIS domain. This is useful for debugging and
2987 cross-domain shared mounting. If this flag is specified, @i{Amd}
2988 immediately attempts to bind to a server for this domain.
2989 @c @i{Amd} refers to NIS maps when it starts, unless the @code{-m} option
2990 @c is specified, and whenever required in a mount map.
2992 @c ----------------------------------------------------------------
2993 @node -A Option, -C Option, -y Option, Amd Command Line Options
2994 @comment node-name, next, previous, up
2995 @section @code{-A} @var{architecture}
2996 @cindex Setting the operating system architecture
2998 Specifies the OS architecture of the system.
2999 The only effect of this option is to set the variable @code{$@{arch@}}.
3001 This option would be used as follows:
3007 @c ----------------------------------------------------------------
3008 @node -C Option, -D Option, -A Option, Amd Command Line Options
3009 @comment node-name, next, previous, up
3010 @section @code{-C} @var{cluster-name}
3011 @cindex Cluster names
3012 @cindex Setting the cluster name
3014 Specifies the name of the cluster of which the local machine is a member.
3015 The only effect is to set the variable @code{$@{cluster@}}.
3016 The @dfn{cluster-name} is will usually obtained by running another command which uses
3017 a database to map the local hostname into a cluster name.
3018 @code{$@{cluster@}} can then be used as a selector to restrict mounting of
3020 If this option is not given, @code{$@{cluster@}} has the same value as @code{$@{domain@}}.
3021 This would be used as follows:
3024 amd -C `clustername` ...
3027 @c ----------------------------------------------------------------
3028 @node -D Option, -F Option, -C Option, Amd Command Line Options
3029 @comment node-name, next, previous, up
3030 @section @code{-D} @var{opts}
3031 @cindex Debug options
3032 @cindex Setting debug flags
3034 Controls the verbosity and coverage of the debugging trace; @dfn{opts}
3035 is a comma separated list of debugging options. The @code{-D} option is
3036 only available if @i{Amd} was compiled with @samp{-DDEBUG}, or
3037 configured with @code{configure --enable-debug}. The memory debugging
3038 facilities (@samp{mem}) are only available if @i{Amd} was compiled with
3039 @samp{-DDEBUG_MEM} (in addition to @samp{-DDEBUG}), or configured with
3040 @code{configure --enable-debug=mem}.
3042 The most common options to use are @samp{-D trace} and @samp{-D test}
3043 (which turns on all the useful debug options). As usual, every option
3044 can be prefixed with @samp{no} to turn it off.
3048 all options (excluding hrtime and mtab)
3050 ``sensible'' default options (all--excluding hrtime, mtab, and xdrtrace)
3052 full debug options plus mtab,nodaemon,nofork,noamq
3054 register @i{Amd} with the RPC portmapper, for @i{Amq}
3058 fork child worker (hlfsd only)
3062 print high resolution time stamps (only if @b{syslog}(3) is not used)
3064 @cindex debugging hesiod resolver service
3065 @cindex Hesiod; turning on RES_DEBUG
3066 info service specific debugging (hesiod, nis, etc.) In the case of
3067 hesiod maps, turns on the hesiod RES_DEBUG internal debugging option.
3069 trace memory allocations. Needs to be explicitly enabled at compile
3070 time with --enable-debug=mem.
3072 use local mount-table file (defaults to @file{/tmp/mtab}, @pxref{debug_mtab_file Parameter})
3074 show readdir progress
3076 debug string munging
3078 trace RPC protocol and NFS mount arguments
3083 You may also refer to the program source for a more detailed explanation
3084 of the available options.
3086 @c ----------------------------------------------------------------
3087 @node -F Option, -H Option, -D Option, Amd Command Line Options
3088 @comment node-name, next, previous, up
3089 @section @code{-F} @var{conf-file}
3090 @cindex Amd configuration file; specifying name
3091 @cindex Amd configuration file
3092 @cindex amd.conf file
3094 Specify an @i{Amd} configuration file @var{conf-file} to use. For a
3095 description of the format and syntax, @pxref{Amd Configuration File}.
3096 This configuration file is used to specify any options in lieu of typing
3097 many of them on the command line. The @file{amd.conf} file includes
3098 directives for every command line option @i{Amd} has, and many more that
3099 are only available via the configuration file facility. The
3100 configuration file specified by this option is processed after all other
3101 options had been processed, regardless of the actual location of this
3102 option on the command line.
3104 @c ----------------------------------------------------------------
3105 @node -H Option, -O Option, -F Option, Amd Command Line Options
3106 @comment node-name, next, previous, up
3108 @cindex Displaying brief help
3109 @cindex Help; showing from Amd
3111 Print a brief help and usage string.
3113 @c ----------------------------------------------------------------
3114 @node -O Option, -S Option, -H Option, Amd Command Line Options
3115 @comment node-name, next, previous, up
3116 @section @code{-O} @var{op-sys-name}
3117 @cindex Operating System name
3118 @cindex Setting the Operating System name
3120 Overrides the compiled-in name of the operating system, with
3121 @var{op-sys-name}. Useful when the built-in name is not desired for
3122 backward compatibility reasons. For example, if the build in name is
3123 @samp{sunos5}, you can override it to the old name @samp{sos5}, and use
3124 older maps which were written with the latter in mind.
3126 @c ----------------------------------------------------------------
3127 @node -S Option, -T Option, -O Option, Amd Command Line Options
3128 @comment node-name, next, previous, up
3130 @cindex plock; using
3131 @cindex mlockall; using
3132 @cindex locking executable pages in memory
3134 Do @emph{not} lock the running executable pages of @i{Amd} into memory.
3135 To improve @i{Amd}'s performance, systems that support the @b{plock}(3)
3137 call lock the @i{Amd} process into memory. This way there is less
3138 chance the operating system will schedule, page out, and swap the
3139 @i{Amd} process as needed. This tends to improve @i{Amd}'s performance,
3140 at the cost of reserving the memory used by the @i{Amd} process (making
3141 it unavailable for other processes). If this behavior is not desired,
3142 use the @code{-S} option.
3144 @c ----------------------------------------------------------------
3145 @node -T Option, , -S Option, Amd Command Line Options
3146 @comment node-name, next, previous, up
3147 @section @code{-T} @var{tag}
3148 @cindex Tags for Amd configuration file
3149 @cindex Configuration file; tags
3151 Specify a tag to use with @file{amd.conf}. All map entries tagged with
3152 @var{tag} will be processed. Map entries that are not tagged are always
3153 processed. Map entries that are tagged with a tag other than @var{tag}
3154 will not be processed.
3156 @c ################################################################
3157 @node Filesystem Types, Amd Configuration File, Amd Command Line Options, Top
3158 @comment node-name, next, previous, up
3159 @chapter Filesystem Types
3160 @cindex Filesystem types
3162 @cindex Types of filesystem
3164 To mount a volume, @i{Amd} must be told the type of filesystem to be
3165 used. Each filesystem type typically requires additional information
3166 such as the fileserver name for NFS.
3168 From the point of view of @i{Amd}, a @dfn{filesystem} is anything that
3169 can resolve an incoming name lookup. An important feature is support
3170 for multiple filesystem types. Some of these filesystems are
3171 implemented in the local kernel and some on remote fileservers, whilst
3172 the others are implemented internally by @i{Amd}.@refill
3174 The two common filesystem types are UFS and NFS. Four other user
3175 accessible filesystems (@samp{link}, @samp{program}, @samp{auto} and
3176 @samp{direct}) are also implemented internally by @i{Amd} and these are
3177 described below. There are two additional filesystem types internal to
3178 @i{Amd} which are not directly accessible to the user (@samp{inherit}
3179 and @samp{error}). Their use is described since they may still have an
3180 effect visible to the user.@refill
3183 * Network Filesystem:: A single NFS filesystem.
3184 * Network Host Filesystem:: NFS mount a host's entire export tree.
3185 * Network Filesystem Group:: An atomic group of NFS filesystems.
3186 * Unix Filesystem:: Native disk filesystem.
3187 * Caching Filesystem:: Caching from remote server filesystem.
3188 * CD-ROM Filesystem:: ISO9660 CD ROM.
3189 * UDF Filesystem:: Universal Disk Format filesystem.
3190 * Loopback Filesystem:: Local loopback-mount filesystem.
3191 * Memory/RAM Filesystem:: A memory or RAM-based filesystem.
3192 * Null Filesystem:: 4.4BSD's loopback-mount filesystem.
3193 * Floppy Filesystem:: MS-DOS Floppy filesystem.
3194 * Translucent Filesystem:: The directory merging filesystem.
3195 * Shared Memory+Swap Filesystem:: Sun's tmpfs filesystem.
3196 * User ID Mapping Filesystem:: 4.4BSD's umapfs filesystem.
3197 * Program Filesystem:: Generic Program mounts.
3198 * Symbolic Link Filesystem:: Local link.
3199 * Symbolic Link Filesystem II:: Local link referencing existing filesystem.
3200 * NFS-Link Filesystem:: Link if path exists, NFS otherwise.
3201 * Automount Filesystem::
3202 * Direct Automount Filesystem::
3203 * Union Filesystem::
3204 * Error Filesystem::
3205 * Top-level Filesystem::
3207 * Inheritance Filesystem::
3210 @c ----------------------------------------------------------------
3211 @node Network Filesystem, Network Host Filesystem, Filesystem Types, Filesystem Types
3212 @comment node-name, next, previous, up
3213 @section Network Filesystem (@samp{nfs})
3215 @cindex Mounting an NFS filesystem
3216 @cindex How to mount and NFS filesystem
3217 @cindex nfs, filesystem type
3218 @cindex Filesystem type; nfs
3220 The @dfn{nfs} (@samp{type:=nfs}) filesystem type provides access to Sun's NFS.
3223 The following options must be specified:
3226 @cindex rhost, mount option
3227 @cindex Mount option; rhost
3229 the remote fileserver. This must be an entry in the hosts database. IP
3230 addresses are not accepted. The default value is taken
3231 from the local host name (@code{$@{host@}}) if no other value is
3234 @cindex rfs, mount option
3235 @cindex Mount option; rfs
3237 the remote filesystem.
3238 If no value is specified for this option, an internal default of
3239 @code{$@{path@}} is used.
3242 NFS mounts require a two stage process. First, the @dfn{file handle} of
3243 the remote file system must be obtained from the server. Then a mount
3244 system call must be done on the local system. @i{Amd} keeps a cache
3245 of file handles for remote file systems. The cache entries have a
3246 lifetime of a few minutes.
3248 If a required file handle is not in the cache, @i{Amd} sends a request
3249 to the remote server to obtain it.
3250 @c @i{Amd} @dfn{does not} wait for
3251 @c a response; it notes that one of the locations needs retrying, but
3252 @c continues with any remaining locations. When the file handle becomes
3253 @c available, and assuming none of the other locations was successfully
3254 @c mounted, @i{Amd} will retry the mount. This mechanism allows several
3255 @c NFS filesystems to be mounted in parallel.
3256 @c @footnote{The mechanism
3257 @c is general, however NFS is the only filesystem
3258 @c for which the required hooks have been written.}
3259 @c The first one which responds with a valid file handle will be used.
3261 Historically, this documentation has maintained that @i{Amd} will try
3262 all the locations in parallel and use the first one which responds
3263 with a valid file handle. This has not been the case for quite some
3264 time, however. Instead, @i{Amd} will go through each location, one by
3265 one, and will only skip to the next one if the previous one either
3269 An NFS entry might be:
3272 jsp host!=charm;type:=nfs;rhost:=charm;rfs:=/home/charm;sublink:=jsp
3275 The mount system call and any unmount attempts are always done
3276 in a new task to avoid the possibility of blocking @i{Amd}.
3278 @c ----------------------------------------------------------------
3279 @node Network Host Filesystem, Network Filesystem Group, Network Filesystem, Filesystem Types
3280 @comment node-name, next, previous, up
3281 @section Network Host Filesystem (@samp{host})
3282 @cindex Network host filesystem
3283 @cindex Mounting entire export trees
3284 @cindex How to mount all NFS exported filesystems
3285 @cindex host, filesystem type
3286 @cindex Filesystem type; host
3288 @c NOTE: the current implementation of the @dfn{host} filesystem type
3289 @c sometimes fails to maintain a consistent view of the remote mount tree.
3290 @c This happens when the mount times out and only some of the remote mounts
3291 @c are successfully unmounted. To prevent this from occurring, use the
3292 @c @samp{nounmount} mount option.
3294 The @dfn{host} (@samp{type:=host}) filesystem allows access to the entire export tree of an
3295 NFS server. The implementation is layered above the @samp{nfs}
3296 implementation so keep-alives work in the same way. The only option
3297 which needs to be specified is @samp{rhost} which is the name of the
3298 fileserver to mount.
3300 The @samp{host} filesystem type works by querying the mount daemon on
3301 the given fileserver to obtain its export list. @i{Amd} then obtains
3302 filehandles for each of the exported filesystems. Any errors at this
3303 stage cause that particular filesystem to be ignored. Finally each
3304 filesystem is mounted. Again, errors are logged but ignored. One
3305 common reason for mounts to fail is that the mount point does not exist.
3306 Although @i{Amd} attempts to automatically create the mount point, it
3307 may be on a remote filesystem to which @i{Amd} does not have write
3310 When an attempt to unmount a @samp{host} filesystem mount fails, @i{Amd}
3311 remounts any filesystems which had successfully been unmounted. To do
3312 this @i{Amd} queries the mount daemon again and obtains a fresh copy of
3313 the export list. @i{Amd} then tries to mount any exported filesystems
3314 which are not currently mounted.
3316 Sun's automounter provides a special @samp{-hosts} map. To achieve the
3317 same effect with @i{Amd} requires two steps. First a mount map must
3318 be created as follows:
3321 * type:=host;rhost:=$@{key@};fs:=$@{autodir@}/$@{rhost@}/root
3325 and then start @i{Amd} with the following command
3332 where @samp{net.map} is the name of map described above. Note that the
3333 value of @code{$@{fs@}} is overridden in the map. This is done to avoid
3334 a clash between the mount tree and any other filesystem already mounted
3335 from the same fileserver.
3337 If different mount options are needed for different hosts then
3338 additional entries can be added to the map, for example
3341 host2 opts:=ro,nosuid,soft
3345 would soft mount @samp{host2} read-only.
3347 @c ----------------------------------------------------------------
3348 @node Network Filesystem Group, Unix Filesystem, Network Host Filesystem, Filesystem Types
3349 @comment node-name, next, previous, up
3350 @section Network Filesystem Group (@samp{nfsx})
3351 @cindex Network filesystem group
3352 @cindex Atomic NFS mounts
3353 @cindex Mounting an atomic group of NFS filesystems
3354 @cindex How to mount an atomic group of NFS filesystems
3355 @cindex nfsx, filesystem type
3356 @cindex Filesystem type; nfsx
3358 The @dfn{nfsx} (@samp{type:=nfsx}) filesystem allows a group of filesystems to be mounted
3359 from a single NFS server. The implementation is layered above the
3360 @samp{nfs} implementation so keep-alives work in the same way.
3362 @emph{WARNING}: @samp{nfsx} is meant to be a ``last resort'' kind of
3363 solution. It is racy and poorly supported. The authors @emph{highly}
3364 recommend that other solutions be considered before relying on it.
3366 The options are the same as for the @samp{nfs} filesystem with one
3367 difference for @samp{rfs}, as explained below.
3370 The following options should be specified:
3374 the remote fileserver. The default value is taken from the local
3375 host name (@code{$@{host@}}) if no other value is specified.
3378 is a list of filesystems to mount, and must be specified.
3379 The list is in the form of a comma separated strings.
3386 pub type:=nfsx;rhost:=gould;\
3387 rfs:=/public,/,graphics,usenet;fs:=$@{autodir@}/$@{rhost@}/root
3390 The first string defines the root of the tree, and is applied as a
3391 prefix to the remaining members of the list which define the individual
3392 filesystems. The first string is @emph{not} used as a filesystem name.
3393 A serial operation is used to determine the local mount points to
3394 ensure a consistent layout of a tree of mounts.
3396 Here, the @emph{three} filesystems, @samp{/public},
3397 @samp{/public/graphics} and @samp{/public/usenet}, would be mounted.@refill
3399 A local mount point, @code{$@{fs@}}, @emph{must} be specified. The
3400 default local mount point will not work correctly in the general case.
3401 A suggestion is to use @samp{fs:=$@{autodir@}/$@{rhost@}/root}.@refill
3403 @c ----------------------------------------------------------------
3404 @node Unix Filesystem, Caching Filesystem, Network Filesystem Group, Filesystem Types
3405 @comment node-name, next, previous, up
3406 @section Unix Filesystem (@samp{ufs}, @samp{xfs}, or @samp{efs})
3407 @cindex Unix filesystem
3411 @cindex Mounting a UFS filesystem
3412 @cindex Mounting a local disk
3413 @cindex How to mount a UFS filesystems
3414 @cindex How to mount a local disk
3415 @cindex Disk filesystems
3416 @cindex ufs, filesystem type
3417 @cindex Filesystem type; ufs
3418 @cindex xfs, filesystem type
3419 @cindex Filesystem type; xfs
3420 @cindex efs, filesystem type
3421 @cindex Filesystem type; efs
3423 The @dfn{ufs} (@samp{type:=ufs}) filesystem type provides access to the system's standard
3424 disk filesystem---usually a derivative of the Berkeley Fast Filesystem.
3427 The following option must be specified:
3430 @cindex dev, mount option
3431 @cindex Mount option; dev
3433 the block special device to be mounted.
3436 A UFS entry might be:
3439 jsp host==charm;type:=ufs;dev:=/dev/sd0d;sublink:=jsp
3442 UFS is the default Unix disk-based file system, which Am-utils picks up
3443 during the autoconfiguration phase. Some systems have more than one
3444 type, such as IRIX, that comes with EFS (Extent File System) and XFS
3445 (Extended File System). In those cases, you may explicitly set the file
3446 system type, by using entries such:
3449 ez1 type:=efs;dev:=/dev/xd0a
3450 ez2 type:=xfs;dev:=/dev/sd3c
3453 The UFS/XFS/EFS filesystems are never timed out by default, i.e. they
3454 will never be unmounted by @i{Amd}. If automatic unmounting is
3455 desired, the ``unmount'' option should be added to the mount options
3458 @c ----------------------------------------------------------------
3459 @node Caching Filesystem, CD-ROM Filesystem, Unix Filesystem, Filesystem Types
3460 @comment node-name, next, previous, up
3461 @section Caching Filesystem (@samp{cachefs})
3462 @cindex Caching Filesystem
3463 @cindex cachefs, filesystem type
3464 @cindex Filesystem type; cachefs
3466 The @dfn{cachefs} (@samp{type:=cachefs}) filesystem caches files from
3467 one location onto another, presumably providing faster access. It is
3468 particularly useful to cache from a larger and remote (slower) NFS
3469 partition to a smaller and local (faster) UFS directory.
3472 The following options must be specified:
3475 @cindex cachedir, mount option
3476 @cindex Mount option; cachedir
3478 the directory where the cache is stored.
3480 the path name to the ``back file system'' to be cached from.
3482 the ``front file system'' mount point to the cached files, where @i{Amd}
3483 will set a symbolic link pointing to.
3486 A CacheFS entry for, say, the @file{/import} @i{Amd} mount point, might
3490 copt type:=cachefs;cachedir:=/cache;rfs:=/import/opt;fs:=/n/import/copt
3493 Access to the pathname @file{/import/copt} will follow a symbolic link
3494 to @file{/n/import/copt}. The latter is the mount point for a caching
3495 file system, that caches from @file{/import/opt} to @file{/cache}.
3497 The cachefs filesystem is never timed out by default, i.e. it will
3498 never be unmounted by @i{Amd}. If automatic unmounting is desired, the
3499 ``unmount'' option should be added to the mount options for the entry.
3503 @item This file system is currently only implemented for Solaris 2.x!
3504 @item Before being used for the first time, the cache directory @i{must} be
3505 initialized with @samp{cfsadmin -c @var{cachedir}}. See the manual page for
3506 @b{cfsadmin}(1M) for more information.
3507 @item The ``back file system'' mounted must be a complete file system, not
3508 a subdirectory thereof; otherwise you will get an error ``Invalid Argument''.
3509 @item If @i{Amd} aborts abnormally, the state of the cache may be
3510 inconsistent, requiring running the command @file{fsck -F cachefs
3511 @var{cachedir}}. Otherwise you will get the error ``No Space Left on Device''.
3514 @c ----------------------------------------------------------------
3515 @node CD-ROM Filesystem, UDF Filesystem, Caching Filesystem, Filesystem Types
3516 @comment node-name, next, previous, up
3517 @section CD-ROM Filesystem (@samp{cdfs})
3518 @cindex CD-ROM Filesystem
3519 @cindex cdfs, filesystem type
3520 @cindex Filesystem type; cdfs
3522 The @dfn{cdfs} (@samp{type:=cdfs}) filesystem mounts a CD-ROM with an
3523 ISO9660 format filesystem on it.
3526 The following option must be specified:
3529 @cindex dev, mount option
3530 @cindex Mount option; dev
3532 the block special device to be mounted.
3535 Some operating systems will fail to mount read-only CDs unless the
3536 @samp{ro} option is specified. A cdfs entry might be:
3539 cdfs os==sunos4;type:=cdfs;dev:=/dev/sr0 \
3540 os==sunos5;addopts:=ro;type:=cdfs;dev:=/dev/dsk/c0t6d0s2
3543 @c ----------------------------------------------------------------
3544 @node UDF Filesystem, Loopback Filesystem, CD-ROM Filesystem, Filesystem Types
3545 @comment node-name, next, previous, up
3546 @section CD-ROM Filesystem (@samp{udf})
3547 @cindex CD-ROM Filesystem
3548 @cindex udf, filesystem type
3549 @cindex Filesystem type; udf
3551 The @dfn{udf} (@samp{type:=udf}) filesystem mounts media with a
3552 Universal Disk Format (UDF) filesystem on it, e.g., a video DVD.
3555 The following option must be specified:
3558 @cindex dev, mount option
3559 @cindex Mount option; dev
3561 the block special device to be mounted.
3564 Some operating systems will fail to mount read-only media unless the
3565 @samp{ro} option is specified. A udf entry might be:
3568 udf os==sunos4;type:=udf;dev:=/dev/sr0 \
3569 os==sunos5;addopts:=ro;type:=udf;dev:=/dev/dsk/c0t6d0s2
3572 @c ----------------------------------------------------------------
3573 @node Loopback Filesystem, Memory/RAM Filesystem, UDF Filesystem, Filesystem Types
3574 @comment node-name, next, previous, up
3575 @section Loopback Filesystem (@samp{lofs})
3576 @cindex Loopback Filesystem
3577 @cindex lofs, filesystem type
3578 @cindex Filesystem type; lofs
3580 The @dfn{lofs} (@samp{type:=lofs}) filesystem is also called the
3581 loopback filesystem. It mounts a local directory on another, thus
3582 providing mount-time binding to another location (unlike symbolic
3585 The loopback filesystem is particularly useful within the context of a
3586 chroot-ed directory (via @b{chroot}(2)), to provide access to
3587 directories otherwise inaccessible.
3590 The following option must be specified:
3593 @cindex rfs, mount option
3594 @cindex Mount option; rfs
3596 the pathname to be mounted on top of @code{$@{fs@}}.
3599 Usually, the FTP server runs in a chroot-ed environment, for security
3600 reasons. In this example, lofs is used to provide a subdirectory within
3601 a user's home directory, also available for public ftp.
3604 lofs type:=lofs;rfs:=/home/ezk/myftpdir;fs:=/usr/ftp/pub/ezk
3607 @c ----------------------------------------------------------------
3608 @node Memory/RAM Filesystem, Null Filesystem, Loopback Filesystem, Filesystem Types
3609 @comment node-name, next, previous, up
3610 @section Memory/RAM Filesystem (@samp{mfs})
3611 @cindex Memory/RAM Filesystem
3612 @cindex mfs, filesystem type
3613 @cindex Filesystem type; mfs
3615 The @dfn{mfs} (@samp{type:=mfs}) filesystem is available in 4.4BSD,
3616 Linux, and other systems. It creates a filesystem in a portion of the
3617 system's memory, thus providing very fast file (volatile) access.
3619 XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3621 @c ----------------------------------------------------------------
3622 @node Null Filesystem, Floppy Filesystem, Memory/RAM Filesystem, Filesystem Types
3623 @comment node-name, next, previous, up
3624 @section Null Filesystem (@samp{nullfs})
3625 @cindex Null Filesystem
3626 @cindex nullfs, filesystem type
3627 @cindex Filesystem type; nullfs
3629 The @dfn{nullfs} (@samp{type:=nullfs}) filesystem is available from 4.4BSD,
3630 and is very similar to the loopback filesystem, @dfn{lofs}.
3632 XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3634 @c ----------------------------------------------------------------
3635 @node Floppy Filesystem, Translucent Filesystem, Null Filesystem, Filesystem Types
3636 @comment node-name, next, previous, up
3637 @section Floppy Filesystem (@samp{pcfs})
3638 @cindex Floppy Filesystem
3639 @cindex pcfs, filesystem type
3640 @cindex Filesystem type; pcfs
3642 The @dfn{pcfs} (@samp{type:=pcfs}) filesystem mounts a floppy previously
3643 formatted for the MS-DOS format.
3646 The following option must be specified:
3649 @cindex dev, mount option
3650 @cindex Mount option; dev
3652 the block special device to be mounted.
3655 A pcfs entry might be:
3658 pcfs os==sunos4;type:=pcfs;dev:=/dev/fd0 \
3659 os==sunos5;type:=pcfs;dev:=/dev/diskette
3662 @c ----------------------------------------------------------------
3663 @node Translucent Filesystem, Shared Memory+Swap Filesystem, Floppy Filesystem, Filesystem Types
3664 @comment node-name, next, previous, up
3665 @section Translucent Filesystem (@samp{tfs})
3666 @cindex Translucent Filesystem
3667 @cindex tfs, filesystem type
3668 @cindex Filesystem type; tfs
3670 The @dfn{tfs} (@samp{type:=tfs}) filesystem is an older version of the
3671 4.4BSD @dfn{unionfs}.
3673 XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3675 @c ----------------------------------------------------------------
3676 @node Shared Memory+Swap Filesystem, User ID Mapping Filesystem, Translucent Filesystem, Filesystem Types
3677 @comment node-name, next, previous, up
3678 @section Shared Memory+Swap Filesystem (@samp{tmpfs})
3679 @cindex Shared Memory and Swap Filesystem
3680 @cindex tmpfs, filesystem type
3681 @cindex Filesystem type; tmpfs
3683 The @dfn{tmpfs} (@samp{type:=tmpfs}) filesystem shares memory between a
3684 the swap device and the rest of the system. It is generally used to
3685 provide a fast access @file{/tmp} directory, one that uses memory that
3686 is otherwise unused. This filesystem is available in SunOS 4.x and 5.x.
3688 XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3690 @c ----------------------------------------------------------------
3691 @node User ID Mapping Filesystem, Program Filesystem, Shared Memory+Swap Filesystem, Filesystem Types
3692 @comment node-name, next, previous, up
3693 @section User ID Mapping Filesystem (@samp{umapfs})
3694 @cindex User ID Mapping Filesystem
3695 @cindex umapfs, filesystem type
3696 @cindex Filesystem type; umapfs
3698 The @dfn{umapfs} (@samp{type:=umapfs}) filesystem maps User IDs of file
3699 ownership, and is available from 4.4BSD.
3701 XXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3703 @c ----------------------------------------------------------------
3704 @node Program Filesystem, Symbolic Link Filesystem, User ID Mapping Filesystem, Filesystem Types
3705 @comment node-name, next, previous, up
3706 @section Program Filesystem (@samp{program})
3707 @cindex Program filesystem
3708 @cindex Mount a filesystem under program control
3709 @cindex program, filesystem type
3710 @cindex Filesystem type; program
3712 The @dfn{program} (@samp{type:=program}) filesystem type allows a
3713 program to be run whenever a mount or unmount is required. This allows
3714 easy addition of support for other filesystem types, such as MIT's
3715 Remote Virtual Disk (RVD) which has a programmatic interface via the
3716 commands @samp{rvdmount} and @samp{rvdunmount}.
3719 Both of the following options must be specified:
3722 @cindex mount, mount option
3723 @cindex Mount option; mount
3725 the program which will perform the mount.
3727 @cindex unmount, mount option
3728 @cindex umount, mount option
3729 @cindex Mount option; unmount
3730 @cindex Mount option; umount
3733 the program which will perform the unmount. For convenience, you may
3734 use either @samp{unmount} or @samp{umount} but not both. If neither
3735 is defined, @i{Amd} will default to @samp{umount $@{fs@}} (the actual
3736 unmount program pathname will be automatically determined at the time
3737 GNU @code{configure} runs.)
3740 The exit code from these two programs is interpreted as a Unix error
3741 code. As usual, exit code zero indicates success. To execute the
3742 program, @i{Amd} splits the string on whitespace to create an array of
3743 substrings. Single quotes @samp{'} can be used to quote whitespace
3744 if that is required in an argument. There is no way to escape or change
3745 the single quote character.
3747 To run e.g. the program @samp{rvdmount} with a host name and filesystem as
3748 arguments, it would be specified by
3749 @samp{fs:=$@{autodir@}$@{path@};type:=program;mount:="/etc/rvdmount
3750 rvdmount fserver $@{fs@}";unmount:="/etc/rdvumount rvdumount $@{fs@}"}.
3752 The first element in the array is taken as the pathname of the program
3753 to execute. The other members of the array form the argument vector
3754 to be passed to the program, @dfn{including argument zero}. The array
3755 is exactly the same as the array passed to the execv() system call
3756 (man execv for details). The split string must have at least two
3757 elements. The programs are directly executed by @i{Amd}, not via a
3758 shell. Therefore, if a script is to be used as a mount/umount
3759 program, it @dfn{must} begin with a @code{#!} interpreter specification.
3761 Often, this program mount type is used for Samba mounts, where you
3762 need a double slash in pathnames. However, @i{Amd} normalizes
3763 sequences of slashes into one slash. Therefore, you must use an
3764 escaped slash, preceded by an escaped backslash. So to get a double
3765 slash in the mount command, you need the eight character sequence
3766 @samp{\\\/\\\/} in your map. For example:
3768 @samp{mount="/sbin/mount mount -r -t smbfs -o-N,-Ihostname \\\/\\\/guest@@venus/mp3"}
3770 If a filesystem type is to be heavily used, it may be worthwhile adding
3771 a new filesystem type into @i{Amd}, but for most uses the program
3772 filesystem should suffice.
3774 When the program is run, standard input and standard error are inherited
3775 from the current values used by @i{Amd}. Standard output is a
3776 duplicate of standard error. The value specified with the @code{-l}
3777 command line option has no effect on standard error.
3779 @i{Amd} guarantees that the mountpoint will be created before calling
3780 the mount program, and that it will be removed after the umount
3781 program returns success.
3783 @c ----------------------------------------------------------------
3784 @node Symbolic Link Filesystem, Symbolic Link Filesystem II, Program Filesystem, Filesystem Types
3785 @comment node-name, next, previous, up
3786 @section Symbolic Link Filesystem (@samp{link})
3787 @cindex Symbolic link filesystem
3788 @cindex Referencing part of the local name space
3789 @cindex Mounting part of the local name space
3790 @cindex How to reference part of the local name space
3791 @cindex link, filesystem type
3792 @cindex symlink, link filesystem type
3793 @cindex Filesystem type; link
3795 Each filesystem type creates a symbolic link to point from the volume
3796 name to the physical mount point. The @samp{link} filesystem does the
3797 same without any other side effects. This allows any part of the
3798 machines name space to be accessed via @i{Amd}.
3800 One common use for the symlink filesystem is @file{/homes} which can be
3801 made to contain an entry for each user which points to their
3802 (auto-mounted) home directory. Although this may seem rather expensive,
3803 it provides a great deal of administrative flexibility.
3806 The following option must be defined:
3810 The value of @var{fs} option specifies the destination of the link, as
3811 modified by the @var{sublink} option. If @var{sublink} is non-null, it
3812 is appended to @code{$@{fs@}}@code{/} and the resulting string is used
3816 The @samp{link} filesystem can be thought of as identical to the
3817 @samp{ufs} filesystem but without actually mounting anything.
3819 An example entry might be:
3822 jsp host==charm;type:=link;fs:=/home/charm;sublink:=jsp
3824 which would return a symbolic link pointing to @file{/home/charm/jsp}.
3826 @c ----------------------------------------------------------------
3827 @node Symbolic Link Filesystem II, NFS-Link Filesystem, Symbolic Link Filesystem, Filesystem Types
3828 @comment node-name, next, previous, up
3829 @section Symbolic Link Filesystem II (@samp{linkx})
3830 @cindex Symbolic link filesystem II
3831 @cindex Referencing an existing part of the local name space
3832 @cindex Mounting an existing part of the local name space
3833 @cindex How to reference an existing part of the local name space
3834 @cindex linkx, filesystem type
3835 @cindex symlink, linkx filesystem type
3836 @cindex Filesystem type; linkx
3838 The @dfn{linkx} (@samp{type:=linkx}) filesystem type is identical to @samp{link} with the
3839 exception that the target of the link must exist. Existence is checked
3840 with the @b{lstat}(2) system call.
3842 The @samp{linkx} filesystem type is particularly useful for wildcard map
3843 entries. In this case, a list of possible targets can be given and
3844 @i{Amd} will choose the first one which exists on the local machine.
3846 @c ----------------------------------------------------------------
3847 @node NFS-Link Filesystem, Automount Filesystem, Symbolic Link Filesystem II, Filesystem Types
3848 @comment node-name, next, previous, up
3849 @section NFS-Link Filesystem (@samp{nfsl})
3850 @cindex NFS-Link filesystem II
3851 @cindex Referencing an existing part of the name space if target exists
3852 @cindex Mounting a remote part of the name space if target is missing
3853 @cindex Symlink if target exists, NFS otherwise
3854 @cindex nfsl, filesystem type
3855 @cindex symlink, nfsl filesystem type
3856 @cindex Filesystem type; nfsl
3858 The @dfn{nfsl} (@samp{type:=nfsl}) filesystem type is a combination of two others:
3859 @samp{link} and @samp{nfs}. If the local host name is equal to the
3860 value of @code{$@{rhost@}} @emph{and} the target pathname listed in
3861 @code{$@{fs@}} exists, @samp{nfsl} will behave exactly as
3862 @samp{type:=link}, and refer to the target as a symbolic link. If the
3863 local host name is not equal to the value of @code{$@{rhost@}}, or if
3864 the target of the link does not exist, @i{Amd} will treat it as
3865 @samp{type:=nfs}, and will mount a remote pathname for it.
3867 The @samp{nfsl} filesystem type is particularly useful as a shorthand
3868 for the more cumbersome and yet one of the most popular @i{Amd}
3869 entries. For example, you can simplify all map entries that look like:
3872 zing -fs:=/n/shekel/u/zing \
3873 host!=shekel;type:=nfs;rhost:=shekel;rfs:=$@{fs@} \
3874 host==shekel;type:=link
3880 zing -fs:=/n/shekel/u/zing \
3881 exists($@{fs@});type:=link \
3882 !exists($@{fs@});type:=nfs;rhost:=shekel;rfs:=$@{fs@}
3888 zing type:=nfsl;fs:=/n/shekel/u/zing;rhost:=shekel;rfs:=$@{fs@}
3891 Not just does it make the maps smaller and simpler, but it avoids
3892 possible mistakes that often happen when forgetting to set up the two
3893 entries (one for @samp{type:=nfs} and the other for @samp{type:=link})
3894 necessary to perform transparent mounts of existing or remote mounts.
3896 @c ----------------------------------------------------------------
3897 @node Automount Filesystem, Direct Automount Filesystem, NFS-Link Filesystem, Filesystem Types
3898 @comment node-name, next, previous, up
3899 @section Automount Filesystem (@samp{auto})
3900 @cindex Automount filesystem
3901 @cindex Map cache types
3902 @cindex Setting map cache parameters
3903 @cindex How to set map cache parameters
3904 @cindex How to start an indirect automount point
3905 @cindex auto, filesystem type
3906 @cindex Filesystem type; auto
3907 @cindex SIGHUP signal
3908 @cindex Map cache synchronizing
3909 @cindex Synchronizing the map cache
3910 @cindex Map cache options
3911 @cindex Regular expressions in maps
3913 The @dfn{auto} (@samp{type:=auto}) filesystem type creates a new automount point below an
3914 existing automount point. Top-level automount points appear as system
3915 mount points. An automount mount point can also appear as a
3916 sub-directory of an existing automount point. This allows some
3917 additional structure to be added, for example to mimic the mount tree of
3920 The following options may be specified:
3923 @cindex cache, mount map option
3924 @cindex Mount map option; cache
3926 specifies whether the data in this mount-map should be
3927 cached. The default value is @samp{none}, in which case
3928 no caching is done in order to conserve memory.
3930 However, better performance and reliability can be obtained by caching
3931 some or all of a mount-map.
3933 If the cache option specifies @samp{all},
3934 the entire map is enumerated when the mount point is created.
3936 If the cache option specifies @samp{inc}, caching is done incrementally
3937 as and when data is required.
3938 Some map types do not support cache mode @samp{all}, in which case @samp{inc}
3939 is used whenever @samp{all} is requested.
3941 Caching can be entirely disabled by using cache mode @samp{none}.
3943 If the cache option specifies @samp{regexp} then the entire map will be
3944 enumerated and each key will be treated as an egrep-style regular
3945 expression. The order in which a cached map is searched does not
3946 correspond to the ordering in the source map so the regular expressions
3947 should be mutually exclusive to avoid confusion.
3949 Each mount map type has a default cache type, usually @samp{inc}, which
3950 can be selected by specifying @samp{mapdefault}.
3952 The cache mode for a mount map can only be selected on the command line.
3953 Starting @i{Amd} with the command:
3956 amd /homes hesiod.homes -cache:=inc
3959 will cause @samp{/homes} to be automounted using the @dfn{Hesiod} name
3960 server with local incremental caching of all successfully resolved names.
3962 All cached data is forgotten whenever @i{Amd} receives a @samp{SIGHUP}
3963 signal and, if cache @samp{all} mode was selected, the cache will be
3964 reloaded. This can be used to inform @i{Amd} that a map has been
3965 updated. In addition, whenever a cache lookup fails and @i{Amd} needs
3966 to examine a map, the map's modify time is examined. If the cache is
3967 out of date with respect to the map then it is flushed as if a
3968 @samp{SIGHUP} had been received.
3970 An additional option (@samp{sync}) may be specified to force @i{Amd} to
3971 check the map's modify time whenever a cached entry is being used. For
3972 example, an incremental, synchronized cache would be created by the
3976 amd /homes hesiod.homes -cache:=inc,sync
3980 specifies the name of the mount map to use for the new mount point.
3982 Arguably this should have been specified with the @code{$@{rfs@}} option but
3983 we are now stuck with it due to historical accident.
3985 @c %If the string @samp{.} is used then the same map is used;
3986 @c %in addition the lookup prefix is set to the name of the mount point followed
3987 @c %by a slash @samp{/}.
3988 @c %This is the same as specifying @samp{fs:=\$@{map@};pref:=\$@{key@}/}.
3992 alters the name that is looked up in the mount map. If
3993 @code{$@{pref@}}, the @dfn{prefix}, is non-null then it is prepended
3994 to the name requested by the kernel @dfn{before} the map is
3995 searched. The default prefix is the prefix of the parent map (if any)
3996 with name of the auto node appended to it. That means if you want no
3997 prefix you must say so in the map: @samp{pref:=null}.
4000 Normally, @samp{auto} style maps are not browsable even if you turn on
4001 directory browsability (@pxref{browsable_dirs Parameter}). To enable
4002 browsing entries in @samp{auto} maps, specify @samp{opts:=browsable}
4003 or @samp{opts:=fullybrowsable} in
4004 the description of this map.
4008 The server @samp{dylan.doc.ic.ac.uk} has two user disks:
4009 @samp{/dev/dsk/2s0} and @samp{/dev/dsk/5s0}. These are accessed as
4010 @samp{/home/dylan/dk2} and @samp{/home/dylan/dk5} respectively. Since
4011 @samp{/home} is already an automount point, this naming is achieved with
4012 the following map entries:@refill
4015 dylan type:=auto;fs:=$@{map@};pref:=$@{key@}/
4016 dylan/dk2 type:=ufs;dev:=/dev/dsk/2s0
4017 dylan/dk5 type:=ufs;dev:=/dev/dsk/5s0
4020 @c ----------------------------------------------------------------
4021 @node Direct Automount Filesystem, Union Filesystem, Automount Filesystem, Filesystem Types
4022 @comment node-name, next, previous, up
4023 @section Direct Automount Filesystem (@samp{direct})
4024 @cindex Direct automount filesystem
4025 @cindex How to start a direct automount point
4026 @cindex direct, filesystem type
4027 @cindex Filesystem type; direct
4029 The @dfn{direct} (@samp{type:=direct}) filesystem is almost identical to
4030 the automount filesystem. Instead of appearing to be a directory of
4031 mount points, it appears as a symbolic link to a mounted filesystem.
4032 The mount is done at the time the link is accessed. @xref{Automount
4033 Filesystem}, for a list of required options.
4035 Direct automount points are created by specifying the @samp{direct}
4036 filesystem type on the command line:
4039 amd ... /usr/man auto.direct -type:=direct
4042 where @samp{auto.direct} would contain an entry such as:
4045 usr/man -type:=nfs;rfs:=/usr/man \
4046 rhost:=man-server1 rhost:=man-server2
4049 In this example, @samp{man-server1} and @samp{man-server2} are file
4050 servers which export copies of the manual pages. Note that the key
4051 which is looked up is the name of the automount point without the
4054 Note that the implementation of the traditional @dfn{direct} filesystem is
4055 essentially a hack (pretending that the root of an NFS filesystem is a
4056 symlink) and many modern operating systems get very unhappy about
4057 it. For example, Linux kernel 2.4+ completely disallows it, and Solaris
4058 2.8 fails to unmount it when @i{Amd} shuts down. Therefore, the use of
4059 the traditional @dfn{direct} filesystem is strongly discouraged; it is
4060 only semi-supported, at best.
4062 The autofs implementations that permit direct mounts are fully
4063 supported, however. That currently includes all versions of
4064 Solaris. Linux autofs does NOT support direct mounts at all.
4066 @c ----------------------------------------------------------------
4067 @node Union Filesystem, Error Filesystem, Direct Automount Filesystem, Filesystem Types
4068 @comment node-name, next, previous, up
4069 @section Union Filesystem (@samp{union})
4070 @cindex Union filesystem
4071 @cindex union, filesystem type
4072 @cindex Filesystem type; union
4074 The @dfn{union} (@samp{type:=union}) filesystem type allows the contents of several
4075 directories to be merged and made visible in a single directory. This
4076 can be used to overcome one of the major limitations of the Unix mount
4077 mechanism which only allows complete directories to be mounted.
4079 For example, supposing @file{/tmp} and @file{/var/tmp} were to be merged
4080 into a new directory called @file{/mtmp}, with files in @file{/var/tmp}
4081 taking precedence. The following command could be used to achieve this
4085 amd ... /mtmp union:/tmp:/var/tmp -type:=union
4088 Currently, the unioned directories must @emph{not} be automounted. That
4089 would cause a deadlock. This seriously limits the current usefulness of
4090 this filesystem type and the problem will be addressed in a future
4093 Files created in the union directory are actually created in the last
4094 named directory. This is done by creating a wildcard entry which points
4095 to the correct directory. The wildcard entry is visible if the union
4096 directory is listed, so allowing you to see which directory has
4099 The files visible in the union directory are computed at the time
4100 @i{Amd} is started, and are not kept up-to-date with respect to the
4101 underlying directories. Similarly, if a link is removed, for example
4102 with the @samp{rm} command, it will be lost forever.
4104 @c ----------------------------------------------------------------
4105 @node Error Filesystem, Top-level Filesystem, Union Filesystem, Filesystem Types
4106 @comment node-name, next, previous, up
4107 @section Error Filesystem (@samp{error})
4108 @cindex Error filesystem
4109 @cindex error, filesystem type
4110 @cindex Filesystem type; error
4112 The @dfn{error} (@samp{type:=error}) filesystem type is used internally as a catch-all in the
4113 case where none of the other filesystems was selected, or some other
4114 error occurred. Lookups and mounts always fail with ``No such file or
4115 directory''. All other operations trivially succeed.
4117 The error filesystem is not directly accessible.
4119 @c ----------------------------------------------------------------
4120 @node Top-level Filesystem, Root Filesystem, Error Filesystem, Filesystem Types
4121 @comment node-name, next, previous, up
4122 @section Top-level Filesystem (@samp{toplvl})
4123 @cindex Top level filesystem
4124 @cindex toplvl, filesystem type
4125 @cindex Filesystem type; toplvl
4127 The @dfn{toplvl} (@samp{type:=toplvl}) filesystems is derived from the @samp{auto} filesystem
4128 and is used to mount the top-level automount nodes. Requests of this
4129 type are automatically generated from the command line arguments.
4131 @c ----------------------------------------------------------------
4132 @node Root Filesystem, Inheritance Filesystem, Top-level Filesystem, Filesystem Types
4133 @comment node-name, next, previous, up
4134 @section Root Filesystem (@samp{root})
4135 @cindex Root filesystem
4136 @cindex root, filesystem type
4137 @cindex Filesystem type; root
4139 The @dfn{root} (@samp{type:=root}) filesystem type acts as an internal
4140 placeholder onto which @i{Amd} can pin @samp{toplvl} mounts. Only one
4141 node of this type need ever exist and one is created automatically
4142 during startup. The effect of having more than one root node is
4145 The root filesystem is not directly accessible.
4147 @c ----------------------------------------------------------------
4148 @node Inheritance Filesystem, , Root Filesystem, Filesystem Types
4149 @comment node-name, next, previous, up
4150 @section Inheritance Filesystem (@samp{inherit})
4151 @cindex Inheritance filesystem
4152 @cindex Nodes generated on a restart
4153 @cindex inherit, filesystem type
4154 @cindex Filesystem type; inherit
4156 The @dfn{inheritance} (@samp{type:=inherit}) filesystem is not directly
4157 accessible. Instead, internal mount nodes of this type are
4158 automatically generated when @i{Amd} is started with the @code{-r} option.
4159 At this time the system mount table is scanned to locate any filesystems
4160 which are already mounted. If any reference to these filesystems is
4161 made through @i{Amd} then instead of attempting to mount it, @i{Amd}
4162 simulates the mount and @dfn{inherits} the filesystem. This allows a
4163 new version of @i{Amd} to be installed on a live system simply by
4164 killing the old daemon with @samp{SIGTERM} and starting the new one.@refill
4166 This filesystem type is not generally visible externally, but it is
4167 possible that the output from @samp{amq -m} may list @samp{inherit} as
4168 the filesystem type. This happens when an inherit operation cannot
4169 be completed for some reason, usually because a fileserver is down.
4171 @c ################################################################
4172 @node Amd Configuration File, Run-time Administration, Filesystem Types, Top
4173 @comment node-name, next, previous, up
4174 @chapter Amd Configuration File
4175 @cindex Amd Configuration File
4178 The @samp{amd.conf} file is the configuration file for @i{Amd}, as part
4179 of the am-utils suite. This file contains runtime configuration
4180 information for the @i{Amd} automounter program.
4184 * The Global Section::
4185 * Regular Map Sections::
4186 * Common Parameters::
4187 * Global Parameters::
4188 * Regular Map Parameters::
4189 * amd.conf Examples::
4192 @c ================================================================
4193 @node File Format, The Global Section, Amd Configuration File, Amd Configuration File
4194 @comment node-name, next, previous, up
4195 @section File Format
4196 @cindex amd.conf file format
4198 The @samp{amd.conf} file consists of sections and parameters. A section
4199 begins with the name of the section in square brackets @samp{[]} and
4200 continues until the next section begins or the end of the file is reached.
4201 Sections contain parameters of the form @samp{name = value}.
4203 The file is line-based --- that is, each newline-terminated line
4204 represents either a comment, a section name or a parameter. No
4205 line-continuation syntax is available.
4207 Section names, parameter names and their values are case sensitive.
4209 Only the first equals sign in a parameter is significant. Whitespace
4210 before or after the first equals sign is discarded. Leading, trailing
4211 and internal whitespace in section and parameter names is irrelevant.
4212 Leading and trailing whitespace in a parameter value is discarded.
4213 Internal whitespace within a parameter value is not allowed, unless the
4214 whole parameter value is quoted with double quotes as in @samp{name =
4217 Any line beginning with a pound sign @samp{#} is ignored, as are lines
4218 containing only whitespace.
4220 The values following the equals sign in parameters are all either a
4221 string (no quotes needed if string does not include spaces) or a
4222 boolean, which may be given as @samp{yes}/@samp{no}. Case is significant in all
4223 values. Some items such as cache timeouts are numeric.
4225 @c ================================================================
4226 @node The Global Section, Regular Map Sections, File Format, Amd Configuration File
4227 @comment node-name, next, previous, up
4228 @section The Global Section
4229 @cindex amd.conf global section
4231 The global section must be specified as @samp{[global]}. Parameters in
4232 this section either apply to @i{Amd} as a whole, or to all other regular map
4233 sections which follow. There should be only one global section defined
4234 in one configuration file.
4236 It is highly recommended that this section be specified first in the
4237 configuration file. If it is not, then regular map sections which
4238 precede it will not use global values defined later.
4240 @c ================================================================
4241 @node Regular Map Sections, Common Parameters, The Global Section, Amd Configuration File
4242 @comment node-name, next, previous, up
4243 @section Regular Map Sections
4244 @cindex amd.conf regular map sections
4246 Parameters in regular (non-global) sections apply to a single map entry.
4247 For example, if the map section @samp{[/homes]} is defined, then all
4248 parameters following it will be applied to the @file{/homes}
4249 @i{Amd}-managed mount point.
4251 @c ================================================================
4252 @node Common Parameters, Global Parameters, Regular Map Sections, Amd Configuration File
4253 @comment node-name, next, previous, up
4254 @section Common Parameters
4255 @cindex amd.conf common parameters
4257 These parameters can be specified either in the global or a map-specific
4258 section. Entries specified in a map-specific section override the default
4259 value or one defined in the global section. If such a common parameter is
4260 specified only in the global section, it is applicable to all regular map
4261 sections that follow.
4264 * autofs_use_lofs Parameter::
4265 * browsable_dirs Parameter::
4266 * map_defaults Parameter::
4267 * map_options Parameter::
4268 * map_type Parameter::
4269 * mount_type Parameter::
4270 * search_path Parameter::
4271 * selectors_in_defaults Parameter::
4272 * sun_map_syntax Parameter::
4275 @c ----------------------------------------------------------------
4276 @node autofs_use_lofs Parameter, browsable_dirs Parameter, Common Parameters, Common Parameters
4277 @comment node-name, next, previous, up
4278 @subsection @t{autofs_use_lofs} Parameter
4279 @cindex autofs_use_lofs Parameter
4281 (type=string, default=@samp{yes}).
4282 When set to @samp{yes}, @i{Amd}'s autofs code will use lofs-type
4283 (loopback) mounts for @code{type:=link} mounts, as well as several
4284 other cases that require local references. This has the advantage
4285 that @i{Amd} does not use a secondary mount point and users do not see
4286 external pathnames (the infamous @code{/bin/pwd} problem, where it
4287 reports a different path than the user chdir'ed into). One of the
4288 disadvantages of using this option is that the autofs code is
4289 relatively new and the in-place mounts have not been throughly tested.
4291 If this option is set to @samp{no}, then @i{Amd}'s autofs code will
4292 use symlinks instead of lofs-type mounts for local references. This
4293 has the advantage of using simpler (more stable) code, but at the
4294 expense of negating one of autofs's big advantages: the hiding of
4295 @i{Amd}'s internal paths. Note that symlinks are not supported in all
4296 autofs implementations, especially those derived from Solaris Autofs
4297 v1. Also, on Solaris 2.6 and newer, autofs symlinks are not cached,
4298 resulting in repeated up-call requests to @i{Amd}.
4300 @c ----------------------------------------------------------------
4301 @node browsable_dirs Parameter, map_defaults Parameter, autofs_use_lofs Parameter, Common Parameters
4302 @comment node-name, next, previous, up
4303 @subsection @t{browsable_dirs} Parameter
4304 @cindex browsable_dirs Parameter
4306 (type=string, default=@samp{no}). If @samp{yes}, then @i{Amd}'s top-level
4307 mount points will be browsable to @b{readdir}(3) calls. This means you
4308 could run for example @b{ls}(1) and see what keys are available to mount
4309 in that directory. Not all entries are made visible to @b{readdir}(3):
4310 the @samp{/defaults} entry, wildcard entries, and those with a @file{/}
4311 in them are not included. If you specify @samp{full} to this option,
4312 all but the @samp{/defaults} entry will be visible. Note that if you run
4313 a command which will attempt to @b{stat}(2) the entries, such as often
4314 done by @samp{ls -l} or @samp{ls -F}, @i{Amd} will attempt to mount
4315 @i{every} entry in that map. This is often called a ``mount storm''.
4317 Note that mount storms are mostly avoided by using autofs mounts
4318 (@samp{mount_type = autofs}).
4320 @c ----------------------------------------------------------------
4321 @node map_defaults Parameter, map_options Parameter, browsable_dirs Parameter, Common Parameters
4322 @comment node-name, next, previous, up
4323 @subsection @t{map_defaults} Parameter
4324 @cindex map_defaults Parameter
4326 (type=string, default to empty). This option sets a string to be used
4327 as the map's @code{/defaults} entry, overriding any @code{/defaults}
4328 specified in the map. This allows local users to override a given
4329 map's defaults without modifying maps globally (which is impossible in
4330 sites where the maps are managed by a different administrative group).
4332 @c ----------------------------------------------------------------
4333 @node map_options Parameter, map_type Parameter, map_defaults Parameter, Common Parameters
4334 @comment node-name, next, previous, up
4335 @subsection @t{map_options} Parameter
4336 @cindex map_options Parameter
4338 (type=string, default no options). This option is the same as
4339 specifying map options on the command line to @i{Amd}, such as
4342 @c ----------------------------------------------------------------
4343 @node map_type Parameter, mount_type Parameter, map_options Parameter, Common Parameters
4344 @comment node-name, next, previous, up
4345 @subsection @t{map_type} Parameter
4346 @cindex map_type Parameter
4348 (type=string, default search all map types). If specified, @i{Amd} will
4349 initialize the map only for the type given. This is useful to avoid the
4350 default map search type used by @i{Amd} which takes longer and can have
4351 undesired side-effects such as initializing NIS even if not used.
4358 Hesiod name service from MIT
4360 Lightweight Directory Access Protocol
4362 (New) dbm style hash files
4364 Network Information Services (version 2)
4366 Network Information Services Plus (version 3)
4368 local password files
4373 @c ----------------------------------------------------------------
4374 @node mount_type Parameter, search_path Parameter, map_type Parameter, Common Parameters
4375 @comment node-name, next, previous, up
4376 @subsection @t{mount_type} Parameter
4377 @cindex mount_type Parameter
4379 (type=string, default=@samp{nfs}). All @i{Amd} mount types default to NFS.
4380 That is, @i{Amd} is an NFS server on the map mount points, for the local
4381 host it is running on. If @samp{autofs} is specified, @i{Amd} will be
4382 an autofs server for those mount points.
4384 @c ----------------------------------------------------------------
4385 @node search_path Parameter, selectors_in_defaults Parameter, mount_type Parameter, Common Parameters
4386 @comment node-name, next, previous, up
4387 @subsection @t{search_path} Parameter
4388 @cindex search_path Parameter
4390 (type=string, default no search path). This provides a
4391 (colon-delimited) search path for file maps. Using a search path,
4392 sites can allow for local map customizations and overrides, and can
4393 distributed maps in several locations as needed.
4395 @c ----------------------------------------------------------------
4396 @node selectors_in_defaults Parameter, sun_map_syntax Parameter, search_path Parameter, Common Parameters
4397 @comment node-name, next, previous, up
4398 @subsection @t{selectors_in_defaults} Parameter
4399 @cindex selectors_in_defaults Parameter
4401 (type=boolean, default=@samp{no}). If @samp{yes}, then the
4402 @samp{/defaults} entry of maps will search for and process any
4403 selectors before setting defaults for all other keys in that map.
4404 Useful when you want to set different options for a complete map based
4405 on some parameters. For example, you may want to better the NFS
4406 performance over slow slip-based networks as follows:
4410 wire==slip-net;opts:=intr,rsize=1024,wsize=1024 \
4411 wire!=slip-net;opts:=intr,rsize=8192,wsize=8192
4414 Deprecated form: selectors_on_default.
4416 @c ----------------------------------------------------------------
4417 @node sun_map_syntax Parameter, , selectors_in_defaults Parameter, Common Parameters
4418 @comment node-name, next, previous, up
4419 @subsection @t{sun_map_syntax} Parameter
4420 @cindex sun_map_syntax Parameter
4422 (type=boolean, default=@samp{no}). If @samp{yes}, then @i{Amd} will
4423 parse the map according to the Sun Automount syntax.
4426 @c ================================================================
4427 @node Global Parameters, Regular Map Parameters, Common Parameters, Amd Configuration File
4428 @comment node-name, next, previous, up
4429 @section Global Parameters
4430 @cindex amd.conf global parameters
4432 The following parameters are applicable to the @samp{[global]} section only.
4436 * auto_attrcache Parameter::
4437 * auto_dir Parameter::
4438 * cache_duration Parameter::
4439 * cluster Parameter::
4440 * debug_mtab_file Parameter::
4441 * debug_options Parameter::
4442 * dismount_interval Parameter::
4443 * domain_strip Parameter::
4444 * exec_map_timeout Parameter::
4445 * forced_unmounts Parameter::
4446 * full_os Parameter::
4447 * fully_qualified_hosts Parameter::
4448 * hesiod_base Parameter::
4450 * ldap_base Parameter::
4451 * ldap_cache_maxmem Parameter::
4452 * ldap_cache_seconds Parameter::
4453 * ldap_hostports Parameter::
4454 * ldap_proto_version Parameter::
4455 * local_domain Parameter::
4456 * localhost_address Parameter::
4457 * log_file Parameter::
4458 * log_options Parameter::
4459 * map_reload_interval Parameter::
4460 * nfs_allow_any_interface Parameter::
4461 * nfs_allow_insecure_port Parameter::
4462 * nfs_proto Parameter::
4463 * nfs_retransmit_counter Parameter::
4464 * nfs_retransmit_counter_udp Parameter::
4465 * nfs_retransmit_counter_tcp Parameter::
4466 * nfs_retransmit_counter_toplvl Parameter::
4467 * nfs_retry_interval Parameter::
4468 * nfs_retry_interval_udp Parameter::
4469 * nfs_retry_interval_tcp Parameter::
4470 * nfs_retry_interval_toplvl Parameter::
4471 * nfs_vers Parameter::
4472 * nis_domain Parameter::
4473 * normalize_hostnames Parameter::
4474 * normalize_slashes Parameter::
4477 * pid_file Parameter::
4479 * portmap_program Parameter::
4480 * preferred_amq_port Parameter::
4481 * print_pid Parameter::
4482 * print_version Parameter::
4483 * restart_mounts Parameter::
4484 * show_statfs_entries Parameter::
4485 * truncate_log Parameter::
4486 * unmount_on_exit Parameter::
4487 * use_tcpwrappers Parameter::
4488 * vendor Parameter::
4491 @c ----------------------------------------------------------------
4492 @node arch Parameter, auto_attrcache Parameter, Global Parameters, Global Parameters
4493 @comment node-name, next, previous, up
4494 @subsection @t{arch} Parameter
4495 @cindex arch Parameter
4497 (type=string, default to compiled in value). Same as the @code{-A}
4498 option to @i{Amd}. Allows you to override the value of the @i{arch}
4501 @c ----------------------------------------------------------------
4502 @node auto_attrcache Parameter, auto_dir Parameter, arch Parameter, Global Parameters
4503 @comment node-name, next, previous, up
4504 @subsection @t{auto_attrcache} Parameter
4505 @cindex auto_attrcache Parameter
4507 (type=numeric, default=0). Specify in seconds (or units of 0.1
4508 seconds, depending on the OS), what is the (kernel-side) NFS attribute
4509 cache timeout for @i{Amd}'s own automount points. A value of 0 is
4510 supposed to turn off attribute caching, meaning that @i{Amd} will be
4511 consulted via a kernel-RPC each time someone stat()'s the mount point
4512 (which could be abused as a denial-of-service attack).
4514 @emph{WARNING}: @i{Amd} depends on being able to turn off the NFS
4515 attribute cache of the client OS. If it cannot be turned off, then
4516 users may get ESTALE errors or symlinks that point to the wrong
4517 places. This is more likely under heavy use of @i{Amd}, for example
4518 if your system is experiencing frequent map changes or frequent
4519 mounts/unmounts. Therefore, under normal circumstances, this
4520 parameter should remain set to 0, to ensure that the attribute cache
4523 Unfortunately, some kernels (e.g., certain BSDs) don't have a way to
4524 turn off the NFS attribute cache. Setting this parameter to 0 is
4525 supposed to turn off attribute caching entirely, but unfortunately it
4526 does not; instead, the attribute cache is set to some internal
4527 hard-coded default (usually anywhere from 5-30 seconds). If you
4528 suspect that your OS doesn't have a reliable way of turning off the
4529 attribute cache, then it is better to set this parameter to the
4530 smallest possible non-zero value (set @samp{auto_attrcache=1} in your
4531 @code{amd.conf}). This will not eliminate the problem, but reduce the
4532 risk window somewhat. The best solutions are (1) to use @i{Amd} in
4533 Autofs mode, if it's supported in your OS, and (2) talk to your OS
4534 vendor to support a true @samp{noac} flag. See the
4535 @uref{http://www.am-utils.org/docs/am-utils/attrcache.txt,README.attrcache}
4536 document for more details.
4538 If you are able to turn off the attribute cache on your OS, alas,
4539 @i{Amd}'s performance may degrade (when not using Autofs) because
4540 every traversal of an automounter-controlled pathname will result in a
4541 lookup request from the kernel to @i{Amd}. Under heavy loads, for
4542 example when using recursive tools like @samp{find}, @samp{rdist}, or
4543 @samp{rsync}, this performance degradation can be noticeable. There
4544 are two possible solutions that some administrators have chosen to
4545 improve performance:
4550 First, you can turn off unmounting using the @samp{nounmount} mount
4551 option. This will ensure that no @i{Amd} symlink could ever change,
4552 thereby the kernel's attribute cache and @i{Amd} will always be in
4553 sync. However, this method will cause the number of mounts to keep
4554 growing, even if some are no longer in use; this has the disadvantage
4555 that your system could be more susceptible to hangs if even one of
4556 those accumulating mounts hangs due to a downed server.
4559 Second, you can turn on attribute caching carefully by setting a small
4560 automounter attribute cache value (say, one second), and a relatively
4561 large dismount interval (say, one hour). (@xref{dismount_interval
4562 Parameter}.) For example, you can set this in your @code{amd.conf}:
4567 dismount_interval = 3600
4570 This has the benefit of using the kernel's attribute cache and thus
4571 improving performance. The disadvantage with this option is that the
4572 window of vulnerability is not eliminated entirely: it is only made
4577 @c ----------------------------------------------------------------
4578 @node auto_dir Parameter, cache_duration Parameter, auto_attrcache Parameter, Global Parameters
4579 @comment node-name, next, previous, up
4580 @subsection @t{auto_dir} Parameter
4581 @cindex auto_dir Parameter
4583 (type=string, default=@samp{/a}). Same as the @code{-a} option to @i{Amd}.
4584 This sets the private directory where @i{Amd} will create
4585 sub-directories for its real mount points.
4587 @c ----------------------------------------------------------------
4588 @node cache_duration Parameter, cluster Parameter, auto_dir Parameter, Global Parameters
4589 @comment node-name, next, previous, up
4590 @subsection @t{cache_duration} Parameter
4591 @cindex cache_duration Parameter
4593 (type=numeric, default=300). Same as the @code{-c} option to @i{Amd}.
4594 Sets the duration in seconds that looked-up or mounted map entries
4595 remain in the cache.
4597 @c ----------------------------------------------------------------
4598 @node cluster Parameter, debug_mtab_file Parameter, cache_duration Parameter, Global Parameters
4599 @comment node-name, next, previous, up
4600 @subsection @t{cluster} Parameter
4601 @cindex cluster Parameter
4603 (type=string, default no cluster). Same as the @code{-C} option to
4604 @i{Amd}. Specifies the alternate HP-UX cluster to use.
4606 @c ----------------------------------------------------------------
4607 @node debug_mtab_file Parameter, debug_options Parameter, cluster Parameter, Global Parameters
4608 @comment node-name, next, previous, up
4609 @subsection @t{debug_mtab_file} Parameter
4610 @cindex debug_mtab_file Parameter
4612 (type=string, default="/tmp/mtab"). Path to mtab file that is used
4613 by @i{Amd} to store a list of mounted file systems during debug-mtab mode.
4614 This option only applies to systems that store mtab information on disk.
4616 @c ----------------------------------------------------------------
4617 @node debug_options Parameter, dismount_interval Parameter, debug_mtab_file Parameter, Global Parameters
4618 @comment node-name, next, previous, up
4619 @subsection @t{debug_options} Parameter
4620 @cindex debug_options Parameter
4622 (type=string, default no debug options). Same as the @code{-D} option
4623 to @i{Amd}. Specify any debugging options for @i{Amd}. Works only if
4624 am-utils was configured for debugging using the @code{--enable-debug}
4625 option. The additional @samp{mem} option can be turned on via
4626 @code{--enable-debug=mem}. Otherwise debugging options are ignored.
4627 Options are comma delimited, and can be preceded by the string
4628 @samp{no} to negate their meaning. You can get the list of supported
4629 debugging and logging options by running @code{amd -H}. Possible
4630 values those listed for the -D option. @xref{-D Option}.
4632 @c ----------------------------------------------------------------
4633 @node dismount_interval Parameter, domain_strip Parameter, debug_options Parameter, Global Parameters
4634 @comment node-name, next, previous, up
4635 @subsection @t{dismount_interval} Parameter
4636 @cindex dismount_interval Parameter
4638 (type=numeric, default=120). Same as the @code{-w} option to
4639 @i{Amd}. Specify in seconds, the time between attempts to dismount file
4640 systems that have exceeded their cached times.
4642 @c ----------------------------------------------------------------
4643 @node domain_strip Parameter, exec_map_timeout Parameter, dismount_interval Parameter, Global Parameters
4644 @comment node-name, next, previous, up
4645 @subsection @t{domain_strip} Parameter
4646 @cindex domain_strip Parameter
4648 (type=boolean, default=@samp{yes}). If @samp{yes}, then the domain
4649 name part referred to by @code{$@{rhost@}} is stripped off. This is
4650 useful to keep logs and smaller. If @samp{no}, then the domain name
4651 part is left changed. This is useful when using multiple domains with
4652 the same maps (as you may have hosts whose domain-stripped name is
4655 @c ----------------------------------------------------------------
4656 @node exec_map_timeout Parameter, forced_unmounts Parameter, domain_strip Parameter, Global Parameters
4657 @comment node-name, next, previous, up
4658 @subsection @t{exec_map_timeout} Parameter
4659 @cindex exec_map_timeout Parameter
4661 (type=numeric, default=10). The timeout in seconds that @i{Amd} will
4662 wait for an executable map program before an answer is returned from
4663 that program (or script). This value should be set to as small as
4664 possible while still allowing normal replies to be returned before the
4665 timer expires, because during the time that the executable map program
4666 is queried, @i{Amd} is essentially waiting and is thus not responding
4667 to any other queries. @xref{Executable maps}.
4669 @c ----------------------------------------------------------------
4670 @node forced_unmounts Parameter, full_os Parameter, exec_map_timeout Parameter, Global Parameters
4671 @comment node-name, next, previous, up
4672 @subsection @t{forced_unmounts} Parameter
4673 @cindex forced_unmounts Parameter
4675 (type=boolean, default=@samp{no}).
4676 Sometimes, mount points are hung due to unrecoverable conditions, such
4677 as when NFS servers migrate, change their IP address, are down
4678 permanently, or due to hardware failures, and more. In this case,
4679 attempting to unmount an existing mount point, or even just to
4680 @b{stat}(2) it, results in one of three fatal errors: EIO, ESTALE, or
4681 EBUSY. At that point, @i{Amd} can do little to recover that hung
4682 point (in fact, the OS cannot automatically recover either). For that
4683 reason, some OSs support special kinds of forced unmounts, which must
4684 be used very carefully: they will force an unmount immediately (or
4685 lazily on Linux), which could result in application data loss.
4686 However, that may be the only way to recover the entire host (without
4687 rebooting). Once a hung mount point is forced out, @i{Amd} can then
4688 re-mount a replacement one (if available), bringing a mostly-hung
4689 system back to operation and avoiding a potentially costly reboot.
4691 If the @samp{forced_unmounts} option is set to @samp{yes}, and the
4692 client OS supports forced or lazy unmounts, then @i{Amd} will attempt
4693 to use them if it gets any of the three serious error conditions
4694 listed above. Note that @i{Amd} will force the unmount of mount
4695 points that returned EBUSY only for @samp{type:=toplvl} mounts
4696 (@pxref{Top-level Filesystem}): that is, @i{Amd}'s own mount points.
4697 This is useful to recover from a previously hung @i{Amd}, and to
4698 ensure that an existing @i{Amd} can shutdown cleanly even if some
4699 processes are keeping its mount points busy (i.e., when a user's shell
4700 process uses @code{cd} to set its CWD to @i{Amd}'s own mount point).
4702 If this option is set to @samp{no} (the default), then @i{Amd} will
4703 not attempt this special recovery procedure.
4705 @c ----------------------------------------------------------------
4706 @node full_os Parameter, fully_qualified_hosts Parameter, forced_unmounts Parameter, Global Parameters
4707 @comment node-name, next, previous, up
4708 @subsection @t{full_os} Parameter
4709 @cindex full_os Parameter
4711 (type=string, default to compiled in value). The full name of the
4712 operating system, along with its version. Allows you to override the
4713 compiled-in full name and version of the operating system. Useful when
4714 the compiled-in name is not desired. For example, the full operating
4715 system name on linux comes up as @samp{linux}, but you can override it
4716 to @samp{linux-2.2.5}.
4718 @c ----------------------------------------------------------------
4719 @node fully_qualified_hosts Parameter, hesiod_base Parameter, full_os Parameter, Global Parameters
4720 @comment node-name, next, previous, up
4721 @subsection @t{fully_qualified_hosts} Parameter
4722 @cindex fully_qualified_hosts Parameter
4724 (type=string, default=@samp{no}). If @samp{yes}, @i{Amd} will perform RPC
4725 authentication using fully-qualified host names. This is necessary for
4726 some systems, and especially when performing cross-domain mounting. For
4727 this function to work, the @i{Amd} variable @samp{$@{hostd@}} is used,
4728 requiring that @samp{$@{domain@}} not be null.
4730 @c ----------------------------------------------------------------
4731 @node hesiod_base Parameter, karch Parameter, fully_qualified_hosts Parameter, Global Parameters
4732 @comment node-name, next, previous, up
4733 @subsection @t{hesiod_base} Parameter
4734 @cindex hesiod_base Parameter
4736 (type=string, default=@samp{automount}). Specify the base name for
4739 @c ----------------------------------------------------------------
4740 @node karch Parameter, ldap_base Parameter, hesiod_base Parameter, Global Parameters
4741 @comment node-name, next, previous, up
4742 @subsection @t{karch} Parameter
4743 @cindex karch Parameter
4745 (type=string, default to karch of the system). Same as the @code{-k}
4746 option to @i{Amd}. Allows you to override the kernel-architecture of
4747 your system. Useful for example on Sun (Sparc) machines, where you can
4748 build one @i{Amd} binary, and run it on multiple machines, yet you want
4749 each one to get the correct @i{karch} variable set (for example, sun4c,
4750 sun4m, sun4u, etc.) Note that if not specified, @i{Amd} will use
4751 @b{uname}(2) to figure out the kernel architecture of the machine.
4753 @c ----------------------------------------------------------------
4754 @node ldap_base Parameter, ldap_cache_maxmem Parameter, karch Parameter, Global Parameters
4755 @comment node-name, next, previous, up
4756 @subsection @t{ldap_base} Parameter
4757 @cindex ldap_base Parameter
4759 (type=string, default not set).
4760 Specify the base name for LDAP. This often includes LDAP-specific
4761 values such as country and organization.
4763 @c ----------------------------------------------------------------
4764 @node ldap_cache_maxmem Parameter, ldap_cache_seconds Parameter, ldap_base Parameter, Global Parameters
4765 @comment node-name, next, previous, up
4766 @subsection @t{ldap_cache_maxmem} Parameter
4767 @cindex ldap_cache_maxmem Parameter
4769 (type=numeric, default=131072). Specify the maximum memory @i{Amd}
4770 should use to cache LDAP entries.
4772 @c ----------------------------------------------------------------
4773 @node ldap_cache_seconds Parameter, ldap_hostports Parameter, ldap_cache_maxmem Parameter, Global Parameters
4774 @comment node-name, next, previous, up
4775 @subsection @t{ldap_cache_seconds} Parameter
4776 @cindex ldap_cache_seconds Parameter
4778 (type=numeric, default=0). Specify the number of seconds to keep
4779 entries in the cache.
4781 @c ----------------------------------------------------------------
4782 @node ldap_hostports Parameter, ldap_proto_version Parameter, ldap_cache_seconds Parameter, Global Parameters
4783 @comment node-name, next, previous, up
4784 @subsection @t{ldap_hostports} Parameter
4785 @cindex ldap_hostports Parameter
4787 (type=string, default not set).
4788 Specify the LDAP host and port values.
4790 @c ----------------------------------------------------------------
4791 @node ldap_proto_version Parameter, local_domain Parameter, ldap_hostports Parameter, Global Parameters
4792 @comment node-name, next, previous, up
4793 @subsection @t{ldap_proto_version} Parameter
4794 @cindex ldap_proto_version Parameter
4796 (type=numeric, default=2). Specify the LDAP protocol version to use.
4797 With a value of 3 will use LDAPv3 protocol.
4799 @c ----------------------------------------------------------------
4800 @node local_domain Parameter, localhost_address Parameter, ldap_proto_version Parameter, Global Parameters
4801 @comment node-name, next, previous, up
4802 @subsection @t{local_domain} Parameter
4803 @cindex local_domain Parameter
4805 (type=string, default no sub-domain). Same as the @code{-d} option
4806 to @i{Amd}. Specify the local domain name. If this option is not given
4807 the domain name is determined from the hostname, by removing the first
4808 component of the fully-qualified host name.
4810 @c ----------------------------------------------------------------
4811 @node localhost_address Parameter, log_file Parameter, local_domain Parameter, Global Parameters
4812 @comment node-name, next, previous, up
4813 @subsection @t{localhost_address} Parameter
4814 @cindex localhost_address Parameter
4816 (type=string, default to localhost or 127.0.0.1). Specify the name or
4817 IP address for @i{Amd} to use when connecting the sockets for the
4818 local NFS server and the RPC server. This defaults to 127.0.0.1 or
4819 whatever the host reports as its local address. This parameter is
4820 useful on hosts with multiple addresses where you want to force
4821 @i{Amd} to connect to a specific address.
4823 @c ----------------------------------------------------------------
4824 @node log_file Parameter, log_options Parameter, localhost_address Parameter, Global Parameters
4825 @comment node-name, next, previous, up
4826 @subsection @t{log_file} Parameter
4827 @cindex log_file Parameter
4829 (type=string, default=@samp{stderr}). Same as the @code{-l} option to
4830 @i{Amd}. Specify a file name to log @i{Amd} events to.
4831 If the string @samp{/dev/stderr} is specified,
4832 @i{Amd} will send its events to the standard error file descriptor.
4834 If the string @samp{syslog} is given, @i{Amd} will record its events
4835 with the system logger @b{syslogd}(8). If your system supports syslog
4836 facilities, then the default facility used is @samp{LOG_DAEMON}.
4838 When using syslog, if you wish to change the facility, append its name
4839 to the option name, delimited by a single colon. For example, if it is
4840 the string @samp{syslog:local7} then @i{Amd} will log messages via
4841 @b{syslog}(3) using the @samp{LOG_LOCAL7} facility. If the facility
4842 name specified is not recognized, @i{Amd} will default to @samp{LOG_DAEMON}.
4843 Note: while you can use any syslog facility available on your system, it
4844 is generally a bad idea to use those reserved for other services such as
4845 @samp{kern}, @samp{lpr}, @samp{cron}, etc.
4847 @c ----------------------------------------------------------------
4848 @node log_options Parameter, map_reload_interval Parameter, log_file Parameter, Global Parameters
4849 @comment node-name, next, previous, up
4850 @subsection @t{log_options} Parameter
4851 @cindex log_options Parameter
4853 (type=string, default=``defaults''). Same as the @code{-x}
4854 option to @i{Amd}. Specify any logging options for @i{Amd}. Options
4855 are comma delimited, and can be preceded by the string @samp{no} to
4856 negate their meaning. The @samp{debug} logging option is only available
4857 if am-utils was configured with @code{--enable-debug}. You can get the
4858 list of supported debugging options by running @code{amd -H}. Possible
4865 an alias for "fatal,error,user,warning,info"
4869 non-fatal system errors (cannot be turned off)
4871 fatal errors (cannot be turned off)
4877 additional statistical information
4879 non-fatal user errors
4886 @c ----------------------------------------------------------------
4887 @node map_reload_interval Parameter, nfs_allow_any_interface Parameter, log_options Parameter, Global Parameters
4888 @comment node-name, next, previous, up
4889 @subsection @t{map_reload_interval} Parameter
4890 @cindex map_reload_interval Parameter
4892 (type=numeric, default=3600). The number of seconds that @i{Amd} will
4893 wait before it checks to see if any maps have changed at their source
4894 (NIS servers, LDAP servers, files, etc.). @i{Amd} will reload only
4895 those maps that have changed.
4897 @c ----------------------------------------------------------------
4898 @node nfs_allow_any_interface Parameter, nfs_allow_insecure_port Parameter, map_reload_interval Parameter, Global Parameters
4899 @comment node-name, next, previous, up
4900 @subsection @t{nfs_allow_any_interface} Parameter
4901 @cindex nfs_allow_any_interface Parameter
4903 (type=string, default=@samp{no}). Normally @i{Amd} accepts local NFS
4904 packets only from 127.0.0.1. If this parameter is set to @samp{yes},
4905 then @i{amd} will accept local NFS packets from any local interface;
4906 this is useful on hosts that may have multiple interfaces where the
4907 system is forced to send all outgoing packets (even those bound to the
4908 same host) via an address other than 127.0.0.1.
4910 @c ----------------------------------------------------------------
4911 @node nfs_allow_insecure_port Parameter, nfs_proto Parameter, nfs_allow_any_interface Parameter, Global Parameters
4912 @comment node-name, next, previous, up
4913 @subsection @t{nfs_allow_insecure_port} Parameter
4914 @cindex nfs_allow_insecure_port Parameter
4916 (type=string, default=@samp{no}). Normally @i{Amd} will refuse requests
4917 coming from unprivileged ports (i.e., ports >= 1024 on Unix systems),
4918 so that only privileged users and the kernel can send NFS requests to
4919 it. However, some kernels (certain versions of Darwin, MacOS X, and
4920 Linux) have bugs that cause them to use unprivileged ports in certain
4921 situations, which causes @i{Amd} to stop dead in its tracks. This
4922 parameter allows @i{Amd} to operate normally even on such systems, at the
4923 expense of a slight decrease in the security of its operations. If
4924 you see messages like ``ignoring request from foo:1234, port not
4925 reserved'' in your @i{Amd} log, try enabling this parameter and give it
4928 @c ----------------------------------------------------------------
4929 @node nfs_proto Parameter, nfs_retransmit_counter Parameter, nfs_allow_insecure_port Parameter, Global Parameters
4930 @comment node-name, next, previous, up
4931 @subsection @t{nfs_proto} Parameter
4932 @cindex nfs_proto Parameter
4934 (type=string, default to trying version tcp then udp). By default,
4935 @i{Amd} tries @code{tcp} and then @code{udp}. This option forces the
4936 overall NFS protocol used to TCP or UDP. It overrides what is in the
4937 @i{Amd} maps, and is useful when @i{Amd} is compiled with TCP support
4938 in NFSv2/NFSv3 that may not be stable. With this option you can turn
4939 off the complete usage of TCP for NFS dynamically (without having to
4940 recompile @i{Amd}), and use UDP only, until such time as TCP support
4943 @c ----------------------------------------------------------------
4944 @node nfs_retransmit_counter Parameter, nfs_retransmit_counter_udp Parameter, nfs_proto Parameter, Global Parameters
4945 @comment node-name, next, previous, up
4946 @subsection @t{nfs_retransmit_counter} Parameter
4947 @cindex nfs_retransmit_counter Parameter
4949 (type=numeric, default=11). Same as the @i{retransmit} part of the
4950 @code{-t} @i{timeout.retransmit} option to @i{Amd}. Specifies the
4951 number of NFS retransmissions that the kernel will use to communicate
4952 with @i{Amd} using either UDP or TCP mounts. @xref{-t Option}.
4954 @c ----------------------------------------------------------------
4955 @node nfs_retransmit_counter_udp Parameter, nfs_retransmit_counter_tcp Parameter, nfs_retransmit_counter Parameter, Global Parameters
4956 @comment node-name, next, previous, up
4957 @subsection @t{nfs_retransmit_counter_udp} Parameter
4958 @cindex nfs_retransmit_counter_udp Parameter
4959 @cindex nfs_retransmit_counter Parameter
4962 (type=numeric, default=11). Same as the @i{nfs_retransmit_counter}
4963 parameter, but applied globally only to UDP mounts.
4964 @xref{nfs_retransmit_counter Parameter}.
4966 @c ----------------------------------------------------------------
4967 @node nfs_retransmit_counter_tcp Parameter, nfs_retransmit_counter_toplvl Parameter, nfs_retransmit_counter_udp Parameter, Global Parameters
4968 @comment node-name, next, previous, up
4969 @subsection @t{nfs_retransmit_counter_tcp} Parameter
4970 @cindex nfs_retransmit_counter_tcp Parameter
4971 @cindex nfs_retransmit_counter Parameter
4974 (type=numeric, default=11). Same as the @i{nfs_retransmit_counter}
4975 parameter, but applied globally only to TCP mounts.
4976 @xref{nfs_retransmit_counter Parameter}.
4978 @c ----------------------------------------------------------------
4979 @node nfs_retransmit_counter_toplvl Parameter, nfs_retry_interval Parameter, nfs_retransmit_counter_tcp Parameter, Global Parameters
4980 @comment node-name, next, previous, up
4981 @subsection @t{nfs_retransmit_counter_toplvl} Parameter
4982 @cindex nfs_retransmit_counter_toplvl Parameter
4983 @cindex nfs_retransmit_counter Parameter
4986 (type=numeric, default=11). Same as the @i{nfs_retransmit_counter}
4987 parameter, applied only for @i{Amd}'s top-level UDP mounts. On some
4988 systems it is useful to set this differently than the OS default, so
4989 as to better tune @i{Amd}'s responsiveness under heavy scheduler
4990 loads. @xref{nfs_retransmit_counter Parameter}.
4992 @c ----------------------------------------------------------------
4993 @node nfs_retry_interval Parameter, nfs_retry_interval_udp Parameter, nfs_retransmit_counter_toplvl Parameter, Global Parameters
4994 @comment node-name, next, previous, up
4995 @subsection @t{nfs_retry_interval} Parameter
4996 @cindex nfs_retry_interval Parameter
4998 (type=numeric, default=8). Same as the @i{timeout} part of the
4999 @code{-t} @i{timeout.retransmit} option to @i{Amd}. Specifies the NFS
5000 timeout interval, in @emph{tenths} of seconds, between NFS/RPC retries
5001 (for UDP or TCP). This is the value that the kernel will use to
5002 communicate with @i{Amd}. @xref{-t Option}.
5004 @i{Amd} relies on the kernel RPC retransmit mechanism to trigger mount
5005 retries. The values of the @i{nfs_retransmit_counter} and the
5006 @i{nfs_retry_interval} parameters change the overall retry interval.
5007 Too long an interval gives poor interactive response; too short an
5008 interval causes excessive retries.
5010 @c ----------------------------------------------------------------
5011 @node nfs_retry_interval_udp Parameter, nfs_retry_interval_tcp Parameter, nfs_retry_interval Parameter, Global Parameters
5012 @comment node-name, next, previous, up
5013 @subsection @t{nfs_retry_interval_udp} Parameter
5014 @cindex nfs_retry_interval_udp Parameter
5015 @cindex nfs_retry_interval Parameter
5018 (type=numeric, default=8). Same as the @i{nfs_retry_interval}
5019 parameter, but applied globally only to UDP mounts.
5020 @xref{nfs_retry_interval Parameter}.
5022 @c ----------------------------------------------------------------
5023 @node nfs_retry_interval_tcp Parameter, nfs_retry_interval_toplvl Parameter, nfs_retry_interval_udp Parameter, Global Parameters
5024 @comment node-name, next, previous, up
5025 @subsection @t{nfs_retry_interval_tcp} Parameter
5026 @cindex nfs_retry_interval_tcp Parameter
5027 @cindex nfs_retry_interval Parameter
5030 (type=numeric, default=8). Same as the @i{nfs_retry_interval}
5031 parameter, but applied globally only to TCP mounts.
5032 @xref{nfs_retry_interval Parameter}.
5034 @c ----------------------------------------------------------------
5035 @node nfs_retry_interval_toplvl Parameter, nfs_vers Parameter, nfs_retry_interval_tcp Parameter, Global Parameters
5036 @comment node-name, next, previous, up
5037 @subsection @t{nfs_retry_interval_toplvl} Parameter
5038 @cindex nfs_retry_interval_toplvl Parameter
5039 @cindex nfs_retry_interval Parameter
5042 (type=numeric, default=8). Same as the @i{nfs_retry_interval}
5043 parameter, applied only for @i{Amd}'s top-level UDP mounts. On some
5044 systems it is useful to set this differently than the OS default, so
5045 as to better tune @i{Amd}'s responsiveness under heavy scheduler
5046 loads. @xref{nfs_retry_interval Parameter}.
5048 @c ----------------------------------------------------------------
5049 @node nfs_vers Parameter, nis_domain Parameter, nfs_retry_interval_toplvl Parameter, Global Parameters
5050 @comment node-name, next, previous, up
5051 @subsection @t{nfs_vers} Parameter
5052 @cindex nfs_vers Parameter
5054 (type=numeric, default to trying version 3 then 2). By default,
5055 @i{Amd} tries version 3 and then version 2. This option forces the
5056 overall NFS protocol used to version 3 or 2. It overrides what is in
5057 the @i{Amd} maps, and is useful when @i{Amd} is compiled with NFSv3
5058 support that may not be stable. With this option you can turn off the
5059 complete usage of NFSv3 dynamically (without having to recompile
5060 @i{Amd}), and use NFSv2 only, until such time as NFSv3 support is
5063 @c ----------------------------------------------------------------
5064 @node nis_domain Parameter, normalize_hostnames Parameter, nfs_vers Parameter, Global Parameters
5065 @comment node-name, next, previous, up
5066 @subsection @t{nis_domain} Parameter
5067 @cindex nis_domain Parameter
5069 (type=string, default to local NIS domain name). Same as the
5070 @code{-y} option to @i{Amd}. Specify an alternative NIS domain from
5071 which to fetch the NIS maps. The default is the system domain name.
5072 This option is ignored if NIS support is not available.
5074 @c ----------------------------------------------------------------
5075 @node normalize_hostnames Parameter, normalize_slashes Parameter, nis_domain Parameter, Global Parameters
5076 @comment node-name, next, previous, up
5077 @subsection @t{normalize_hostnames} Parameter
5078 @cindex normalize_hostnames Parameter
5080 (type=boolean, default=@samp{no}). Same as the @code{-n} option to @i{Amd}.
5081 If @samp{yes}, then the name referred to by @code{$@{rhost@}} is normalized
5082 relative to the host database before being used. The effect is to
5083 translate aliases into ``official'' names.
5085 @c ----------------------------------------------------------------
5086 @node normalize_slashes Parameter, os Parameter, normalize_hostnames Parameter, Global Parameters
5087 @comment node-name, next, previous, up
5088 @subsection @t{normalize_slashes} Parameter
5089 @cindex normalize_slashes Parameter
5091 (type=boolean, default=@samp{yes}). If @samp{yes} then amd will
5092 condense all multiple @code{/} (slash) characters into one and remove
5093 all trailing slashes. If @samp{no}, then amd will not touch strings
5094 that may contain repeated or trailing slashes. The latter is
5095 sometimes useful with SMB mounts, which often require multiple slash
5096 characters in pathnames.
5098 @c ----------------------------------------------------------------
5099 @node os Parameter, osver Parameter, normalize_slashes Parameter, Global Parameters
5100 @comment node-name, next, previous, up
5101 @subsection @t{os} Parameter
5102 @cindex os Parameter
5104 (type=string, default to compiled in value). Same as the @code{-O}
5105 option to @i{Amd}. Allows you to override the compiled-in name of the
5106 operating system. Useful when the built-in name is not desired for
5107 backward compatibility reasons. For example, if the built-in name is
5108 @samp{sunos5}, you can override it to @samp{sos5}, and use older maps
5109 which were written with the latter in mind.
5112 @c ----------------------------------------------------------------
5113 @node osver Parameter, pid_file Parameter, os Parameter, Global Parameters
5114 @comment node-name, next, previous, up
5115 @subsection @t{osver} Parameter
5116 @cindex osver Parameter
5118 (type=string, default to compiled in value). Same as the @code{-o}
5119 option to @i{Amd}. Allows you to override the compiled-in version
5120 number of the operating system. Useful when the built-in version is not
5121 desired for backward compatibility reasons. For example, if the build
5122 in version is @samp{2.5.1}, you can override it to @samp{5.5.1}, and use
5123 older maps that were written with the latter in mind.
5125 @c ----------------------------------------------------------------
5126 @node pid_file Parameter, plock Parameter, osver Parameter, Global Parameters
5127 @comment node-name, next, previous, up
5128 @subsection @t{pid_file} Parameter
5129 @cindex pid_file Parameter
5131 (type=string, default=@samp{/dev/stdout}). Specify a file to store the process
5132 ID of the running daemon into. If not specified, @i{Amd} will print its
5133 process id onto the standard output. Useful for killing @i{Amd} after
5134 it had run. Note that the PID of a running @i{Amd} can also be
5135 retrieved via @i{Amq} (@pxref{Amq -p option}).
5137 This file is used only if the @samp{print_pid} option is on
5138 (@pxref{print_pid Parameter}).
5140 @c ----------------------------------------------------------------
5141 @node plock Parameter, portmap_program Parameter, pid_file Parameter, Global Parameters
5142 @comment node-name, next, previous, up
5143 @subsection @t{plock} Parameter
5144 @cindex plock Parameter
5146 (type=boolean, default=@samp{yes}). Same as the @code{-S} option to @i{Amd}.
5147 If @samp{yes}, lock the running executable pages of @i{Amd} into memory.
5148 To improve @i{Amd}'s performance, systems that support the @b{plock}(3)
5150 call can lock the @i{Amd} process into memory. This way there is less
5151 chance the operating system will schedule, page out, and swap the
5152 @i{Amd} process as needed. This improves @i{Amd}'s performance, at the
5153 cost of reserving the memory used by the @i{Amd} process (making it
5154 unavailable for other processes).
5156 @c ----------------------------------------------------------------
5157 @node portmap_program Parameter, preferred_amq_port Parameter, plock Parameter, Global Parameters
5158 @comment node-name, next, previous, up
5159 @subsection @t{portmap_program} Parameter
5160 @cindex portmap_program Parameter
5162 (type=numeric, default=300019). Specify an alternate Port-mapper RPC
5163 program number, other than the official number. This is useful when
5164 running multiple @i{Amd} processes. For example, you can run another
5165 @i{Amd} in ``test'' mode, without affecting the primary @i{Amd} process
5166 in any way. For safety reasons, the alternate program numbers that can
5167 be specified must be in the range 300019-300029, inclusive. @i{Amq} has
5168 an option @code{-P} which can be used to specify an alternate program
5169 number of an @i{Amd} to contact. In this way, amq can fully control any
5170 number of @i{Amd} processes running on the same host.
5172 @c ----------------------------------------------------------------
5173 @node preferred_amq_port Parameter, print_pid Parameter, portmap_program Parameter, Global Parameters
5174 @comment node-name, next, previous, up
5175 @subsection @t{preferred_amq_port} Parameter
5176 @cindex preferred_amq_port Parameter
5178 (type=numeric, default=0). Specify an alternate Port-mapper RPC port
5179 number for @i{Amd}'s @i{Amq} service. This is used for both UDP and
5180 TCP. Setting this value to 0 (or not defining it) will cause @i{Amd}
5181 to select an arbitrary port number. Setting the @i{Amq} RPC service
5182 port to a specific number is useful in firewalled or NAT'ed
5183 environments, where you need to know which port @i{Amd} will listen
5186 @c ----------------------------------------------------------------
5187 @node print_pid Parameter, print_version Parameter, preferred_amq_port Parameter, Global Parameters
5188 @comment node-name, next, previous, up
5189 @subsection @t{print_pid} Parameter
5190 @cindex print_pid Parameter
5192 (type=boolean, default=@samp{no}). Same as the @code{-p} option to @i{Amd}.
5193 If @samp{yes}, @i{Amd} will print its process ID upon starting.
5195 @c ----------------------------------------------------------------
5196 @node print_version Parameter, restart_mounts Parameter, print_pid Parameter, Global Parameters
5197 @comment node-name, next, previous, up
5198 @subsection @t{print_version} Parameter
5199 @cindex print_version Parameter
5201 (type=boolean, default=@samp{no}). Same as the @code{-v} option to @i{Amd},
5202 but the version prints and @i{Amd} continues to run. If @samp{yes}, @i{Amd}
5203 will print its version information string, which includes some
5204 configuration and compilation values.
5206 @c ----------------------------------------------------------------
5207 @node restart_mounts Parameter, show_statfs_entries Parameter, print_version Parameter, Global Parameters
5208 @comment node-name, next, previous, up
5209 @subsection @t{restart_mounts} Parameter
5210 @cindex restart_mounts Parameter
5212 (type=boolean, default=@samp{no}). Same as the @code{-r} option to @i{Amd}.
5213 If @samp{yes} @i{Amd} will scan the mount table to determine which file
5214 systems are currently mounted. Whenever one of these would have been
5215 auto-mounted, @i{Amd} inherits it.
5217 @c ----------------------------------------------------------------
5218 @node show_statfs_entries Parameter, truncate_log Parameter, restart_mounts Parameter, Global Parameters
5219 @comment node-name, next, previous, up
5220 @subsection @t{show_statfs_entries} Parameter
5221 @cindex show_statfs_entries Parameter
5223 (type=boolean), default=@samp{no}). If @samp{yes}, then all maps which are
5224 browsable will also show the number of entries (keys) they have when
5225 @b{df}(1) runs. (This is accomplished by returning non-zero values to
5226 the @b{statfs}(2) system call).
5228 @c ----------------------------------------------------------------
5229 @node truncate_log Parameter, unmount_on_exit Parameter, show_statfs_entries Parameter, Global Parameters
5230 @comment node-name, next, previous, up
5231 @subsection @t{truncate_log} Parameter
5232 @cindex truncate_log Parameter
5234 (type=boolean), default=@samp{no}). If @samp{yes}, then @i{Amd} will
5235 truncate the log file (if it's a regular file) on startup. This could
5236 be useful when conducting extensive testing on @i{Amd} maps (or
5237 @i{Amd} itself) and you don't want to see log data from a previous run
5240 @c ----------------------------------------------------------------
5241 @node unmount_on_exit Parameter, use_tcpwrappers Parameter, truncate_log Parameter, Global Parameters
5242 @comment node-name, next, previous, up
5243 @subsection @t{unmount_on_exit} Parameter
5244 @cindex unmount_on_exit Parameter
5246 (type=boolean, default=@samp{no}). If @samp{yes}, then @i{Amd} will attempt
5247 to unmount all file systems which it knows about. Normally it leaves
5248 all (esp. NFS) mounted file systems intact. Note that @i{Amd} does not
5249 know about file systems mounted before it starts up, unless the
5250 @samp{restart_mounts} option is used (@pxref{restart_mounts Parameter}).
5252 @c ----------------------------------------------------------------
5253 @node use_tcpwrappers Parameter, vendor Parameter, unmount_on_exit Parameter, Global Parameters
5254 @comment node-name, next, previous, up
5255 @subsection @t{use_tcpwrappers} Parameter
5256 @cindex use_tcpwrappers Parameter
5258 (type=boolean), default=@samp{yes}). If @samp{yes}, then amd will use
5259 the tcpwrappers (tcpd/librwap) library (if available) to control
5260 access to @i{Amd} via the @code{/etc/hosts.allow} and
5261 @code{/etc/hosts.deny} files. @i{Amd} will verify that the host
5262 running @i{Amq} is authorized to connect. The @code{amd} service name
5263 must used in the @code{/etc/hosts.allow} and @code{/etc/hosts.deny}
5264 files. For example, to allow only localhost to connect to @i{Amd},
5265 add this line to @code{/etc/hosts.allow}:
5271 and this line to @code{/etc/hosts.deny}:
5277 Consult the man pages for @b{hosts_access}(5) for more information on using
5278 the tcpwrappers access-control library.
5280 Note that in particular, you should not configure your @code{hosts.allow}
5281 file to spawn a command for @i{Amd}: that will cause @i{Amd} to not be able
5282 to @code{waitpid} on the child process ID of any background un/mount that
5283 @i{Amd} issued, resulting in a confused @i{Amd} that does not know what
5284 happened to those background un/mount requests.
5286 @c ----------------------------------------------------------------
5287 @node vendor Parameter, , use_tcpwrappers Parameter, Global Parameters
5288 @comment node-name, next, previous, up
5289 @subsection @t{vendor} Parameter
5290 @cindex vendor Parameter
5292 (type=string, default to compiled in value). The name of the vendor of
5293 the operating system. Overrides the compiled-in vendor name. Useful
5294 when the compiled-in name is not desired. For example, most Intel based
5295 systems set the vendor name to @samp{unknown}, but you can set it to
5298 @c ================================================================
5299 @node Regular Map Parameters, amd.conf Examples, Global Parameters, Amd Configuration File
5300 @comment node-name, next, previous, up
5301 @section Regular Map Parameters
5302 @cindex amd.conf regular map parameters
5304 The following parameters are applicable only to regular map sections.
5307 * map_name Parameter::
5311 @c ----------------------------------------------------------------
5312 @node map_name Parameter, tag Parameter, Regular Map Parameters, Regular Map Parameters
5313 @comment node-name, next, previous, up
5314 @subsection map_name Parameter
5315 @cindex map_name Parameter
5317 (type=string, must be specified). Name of the map where the keys are
5320 @c ----------------------------------------------------------------
5321 @node tag Parameter, , map_name Parameter, Regular Map Parameters
5322 @comment node-name, next, previous, up
5323 @subsection tag Parameter
5324 @cindex tag Parameter
5326 (type=string, default no tag). Each map entry in the configuration file
5327 can be tagged. If no tag is specified, that map section will always be
5328 processed by @i{Amd}. If it is specified, then @i{Amd} will process the map
5329 if the @code{-T} option was given to @i{Amd}, and the value given to that
5330 command-line option matches that in the map section.
5332 @c ================================================================
5333 @node amd.conf Examples, , Regular Map Parameters, Amd Configuration File
5334 @comment node-name, next, previous, up
5335 @section amd.conf Examples
5336 @cindex amd.conf examples
5338 The following is the actual @code{amd.conf} file I used at the
5339 Computer Science Department of Columbia University.
5342 # GLOBAL OPTIONS SECTION
5344 normalize_hostnames = no
5346 #pid_file = /var/run/amd.pid
5347 restart_mounts = yes
5348 #unmount_on_exit = yes
5350 log_file = /var/log/amd
5352 #debug_options = defaults
5354 selectors_in_defaults = yes
5355 # config.guess picks up "sunos5" and I don't want to edit my maps yet
5357 # if you print_version after setting up "os", it will show it.
5360 search_path = /etc/amdmaps:/usr/lib/amd:/usr/local/AMD/lib
5361 browsable_dirs = yes
5362 fully_qualified_hosts = no
5364 # DEFINE AN AMD MOUNT POINT
5378 map_name = amd.import
5382 map_name = amd.tftpboot
5385 @c ################################################################
5386 @node Run-time Administration, FSinfo, Amd Configuration File, Top
5387 @comment node-name, next, previous, up
5388 @chapter Run-time Administration
5389 @cindex Run-time administration
5399 @node Starting Amd, Stopping Amd, Run-time Administration, Run-time Administration
5400 @comment node-name, next, previous, up
5401 @section Starting @i{Amd}
5402 @cindex Starting Amd
5403 @cindex Additions to /etc/rc.local
5404 @cindex /etc/rc.local additions
5407 @i{Amd} is best started from @samp{/etc/rc.local} on BSD systems, or
5408 from the appropriate start-level script in @samp{/etc/init.d} on System V
5412 if [ -f /usr/local/sbin/ctl-amd ]; then
5413 /usr/local/sbin/ctl-amd start; (echo -n ' amd') > /dev/console
5418 The shell script, @samp{ctl-amd} is used to start, stop, or restart
5419 @i{Amd}. It is a relatively generic script. All options you want to
5420 set should not be made in this script, but rather updated in the
5421 @file{amd.conf} file. @xref{Amd Configuration File}.
5423 If you do not wish to use an @i{Amd} configuration file, you may start
5424 @i{Amd} manually. For example, getting the map entries via NIS:
5427 amd -r -l /var/log/amd `ypcat -k auto.master`
5430 @node Stopping Amd, Restarting Amd, Starting Amd, Run-time Administration
5431 @comment node-name, next, previous, up
5432 @section Stopping @i{Amd}
5433 @cindex Stopping Amd
5434 @cindex SIGTERM signal
5435 @cindex SIGINT signal
5437 @i{Amd} stops in response to two signals.
5441 causes the top-level automount points to be unmounted and then @i{Amd}
5442 to exit. Any automounted filesystems are left mounted. They can be
5443 recovered by restarting @i{Amd} with the @code{-r} command line option.@refill
5446 causes @i{Amd} to attempt to unmount any filesystems which it has
5447 automounted, in addition to the actions of @samp{SIGTERM}. This signal
5448 is primarily used for debugging.@refill
5451 Actions taken for other signals are undefined.
5453 The easiest and safest way to stop @i{Amd}, without having to find its
5454 process ID by hand, is to use the @file{ctl-amd} script, as with:
5460 @node Restarting Amd, Controlling Amd, Stopping Amd, Run-time Administration
5461 @comment node-name, next, previous, up
5462 @section Restarting @i{Amd}
5463 @cindex Restarting Amd
5464 @cindex Killing and starting Amd
5466 Before @i{Amd} can be started, it is vital to ensure that no other
5467 @i{Amd} processes are managing any of the mount points, and that the
5468 previous process(es) have terminated cleanly. When a terminating signal
5469 is set to @i{Amd}, the automounter does @emph{not} terminate right then.
5470 Rather, it starts by unmounting all of its managed mount mounts in the
5471 background, and then terminates. It usually takes a few seconds for
5472 this process to happen, but it can take an arbitrarily longer time. If
5473 two or more @i{Amd} processes attempt to manage the same mount point, it
5474 usually will result in a system lockup.
5476 The easiest and safest way to restart @i{Amd}, without having to find
5477 its process ID by hand, sending it the @samp{SIGTERM} signal, waiting for @i{Amd}
5478 to die cleanly, and verifying so, is to use the @file{ctl-amd} script,
5485 The script will locate the process ID of @i{Amd}, kill it, and wait for
5486 it to die cleanly before starting a new instance of the automounter.
5487 @file{ctl-amd} will wait for a total of 30 seconds for @i{Amd} to die,
5488 and will check once every 5 seconds if it had.
5490 @node Controlling Amd, , Restarting Amd, Run-time Administration
5491 @comment node-name, next, previous, up
5492 @section Controlling @i{Amd}
5493 @cindex Controlling Amd
5494 @cindex Discovering what is going on at run-time
5495 @cindex Listing currently mounted filesystems
5497 It is sometimes desirable or necessary to exercise external control
5498 over some of @i{Amd}'s internal state. To support this requirement,
5499 @i{Amd} implements an RPC interface which is used by the @dfn{Amq} program.
5500 A variety of information is available.
5502 @i{Amq} generally applies an operation, specified by a single letter option,
5503 to a list of mount points. The default operation is to obtain statistics
5504 about each mount point. This is similar to the output shown above
5505 but includes information about the number and type of accesses to each
5509 * Amq default:: Default command behavior.
5510 * Amq -f option:: Flushing the map cache.
5511 * Amq -h option:: Controlling a non-local host.
5512 * Amq -H option:: Print help message.
5513 * Amq -l option:: Controlling the log file.
5514 * Amq -m option:: Obtaining mount statistics.
5515 * Amq -p option:: Getting Amd's process ID.
5516 * Amq -P option:: Contacting alternate Amd processes.
5517 * Amq -q option:: Suppress synchronous unmounting errors.
5518 * Amq -s option:: Obtaining global statistics.
5519 * Amq -T option:: Use TCP transport.
5520 * Amq -U option:: Use UDP transport.
5521 * Amq -u option:: Forcing volumes to time out.
5522 * Amq -v option:: Version information.
5523 * Amq -w option:: Print Amd current working directory.
5524 * Other Amq options:: Three other special options.
5527 @c ----------------------------------------------------------------
5528 @node Amq default, Amq -f option, Controlling Amd, Controlling Amd
5529 @comment node-name, next, previous, up
5530 @subsection @i{Amq} default information
5532 With no arguments, @dfn{Amq} obtains a brief list of all existing
5533 mounts created by @i{Amd}. This is different from the list displayed by
5534 @b{df}(1) since the latter only includes system mount points.
5537 The output from this option includes the following information:
5541 the automount point,
5543 the filesystem type,
5545 the mount map or mount information,
5547 the internal, or system mount point.
5554 / root "root" sky:(pid75)
5555 /homes toplvl /usr/local/etc/amd.homes /homes
5556 /home toplvl /usr/local/etc/amd.home /home
5557 /homes/jsp nfs charm:/home/charm /a/charm/home/charm/jsp
5558 /homes/phjk nfs toytown:/home/toytown /a/toytown/home/toytown/ai/phjk
5562 If an argument is given then statistics for that volume name will
5563 be output. For example:
5566 What Uid Getattr Lookup RdDir RdLnk Statfs Mounted@@
5567 /homes 0 1196 512 22 0 30 90/09/14 12:32:55
5568 /homes/jsp 0 0 0 0 1180 0 90/10/13 12:56:58
5579 the count of NFS @dfn{getattr} requests on this node. This should only be
5580 non-zero for directory nodes.
5583 the count of NFS @dfn{lookup} requests on this node. This should only be
5584 non-zero for directory nodes.
5587 the count of NFS @dfn{readdir} requests on this node. This should only
5588 be non-zero for directory nodes.
5591 the count of NFS @dfn{readlink} requests on this node. This should be
5592 zero for directory nodes.
5595 the count of NFS @dfn{statfs} requests on this node. This should only
5596 be non-zero for top-level automount points.
5599 the date and time the volume name was first referenced.
5602 @c ----------------------------------------------------------------
5603 @node Amq -f option, Amq -h option, Amq default, Controlling Amd
5604 @comment node-name, next, previous, up
5605 @subsection @i{Amq} @code{-f} option
5606 @cindex Flushing the map cache
5607 @cindex Map cache, flushing
5609 The @code{-f} option causes @i{Amd} to flush the internal mount map cache.
5610 This is useful for example in Hesiod maps since @i{Amd} will not
5611 automatically notice when they have been updated. The map cache can
5612 also be synchronized with the map source by using the @samp{sync} option
5613 (@pxref{Automount Filesystem}).@refill
5615 @c ----------------------------------------------------------------
5616 @node Amq -h option, Amq -H option, Amq -f option, Controlling Amd
5617 @comment node-name, next, previous, up
5618 @subsection @i{Amq} @code{-h} option
5619 @cindex Querying an alternate host
5621 By default the local host is used. In an HP-UX cluster the root server
5622 is used since that is the only place in the cluster where @i{Amd} will
5623 be running. To query @i{Amd} on another host the @code{-h} option should
5626 @c ----------------------------------------------------------------
5627 @node Amq -H option, Amq -l option, Amq -h option, Controlling Amd
5628 @comment node-name, next, previous, up
5629 @subsection @i{Amq} @code{-H} option
5630 @cindex Displaying brief help
5631 @cindex Help; showing from Amq
5633 Print a brief help and usage string.
5635 @c ----------------------------------------------------------------
5636 @node Amq -l option, Amq -m option, Amq -H option, Controlling Amd
5637 @comment node-name, next, previous, up
5638 @subsection @i{Amq} @code{-l} option
5639 @cindex Resetting the Amd log file
5640 @cindex Setting the Amd log file via Amq
5641 @cindex Log file, resetting
5643 Tell @i{Amd} to use @i{log_file} as the log file name. For security
5644 reasons, this @emph{must} be the same log file which @i{Amd} used when
5645 started. This option is therefore only useful to refresh @i{Amd}'s open
5646 file handle on the log file, so that it can be rotated and compressed
5647 via daily cron jobs.
5649 @c ----------------------------------------------------------------
5650 @node Amq -m option, Amq -p option, Amq -l option, Controlling Amd
5651 @comment node-name, next, previous, up
5652 @subsection @i{Amq} @code{-m} option
5654 The @code{-m} option displays similar information about mounted
5655 filesystems, rather than automount points. The output includes the
5656 following information:
5660 the mount information,
5664 the filesystem type,
5666 the number of references to this filesystem,
5668 the server hostname,
5670 the state of the file server,
5672 any error which has occurred.
5678 "root" truth:(pid602) root 1 localhost is up
5679 hesiod.home /home toplvl 1 localhost is up
5680 hesiod.vol /vol toplvl 1 localhost is up
5681 hesiod.homes /homes toplvl 1 localhost is up
5682 amy:/home/amy /a/amy/home/amy nfs 5 amy is up
5683 swan:/home/swan /a/swan/home/swan nfs 0 swan is up (Permission denied)
5684 ex:/home/ex /a/ex/home/ex nfs 0 ex is down
5687 When the reference count is zero the filesystem is not mounted but
5688 the mount point and server information is still being maintained
5691 @c ----------------------------------------------------------------
5693 @comment Retained for future consideration: from the description of the
5694 @comment amq -M option removed in amd 6.0.5.
5696 A future release of @i{Amd} will include code to allow the @b{mount}(8)
5697 command to mount automount points:
5700 mount -t amd /vol hesiod.vol
5703 This will then allow @i{Amd} to be controlled from the standard system
5704 filesystem mount list.
5708 @c ----------------------------------------------------------------
5709 @node Amq -p option, Amq -P option, Amq -m option, Controlling Amd
5710 @comment node-name, next, previous, up
5711 @subsection @i{Amq} @code{-p} option
5712 @cindex Process ID; Amd
5713 @cindex Amd's process ID
5717 Return the process ID of the remote or locally running @i{Amd}. Useful
5718 when you need to send a signal to the local @i{Amd} process, and would
5719 rather not have to search through the process table. This option is
5720 used in the @file{ctl-amd} script.
5722 @c ----------------------------------------------------------------
5723 @node Amq -P option, Amq -q option, Amq -p option, Controlling Amd
5724 @comment node-name, next, previous, up
5725 @subsection @i{Amq} @code{-P} option
5726 @cindex Multiple Amd processes
5727 @cindex Running multiple Amd
5728 @cindex Debugging a new Amd configuration
5729 @cindex RPC Program numbers; Amd
5731 Contact an alternate running @i{Amd} that had registered itself on a
5732 different RPC @var{program_number} and apply all other operations to
5733 that instance of the automounter. This is useful when you run multiple
5734 copies of @i{Amd}, and need to manage each one separately. If not
5735 specified, @i{Amq} will use the default program number for @i{Amd}, 300019.
5736 For security reasons, the only alternate program numbers @i{Amd} can use
5737 range from 300019 to 300029, inclusive.
5739 For example, to kill an alternate running @i{Amd}:
5742 kill `amq -p -P 300020`
5745 @c ----------------------------------------------------------------
5746 @node Amq -q option, Amq -s option, Amq -P option, Controlling Amd
5747 @comment node-name, next, previous, up
5748 @subsection @i{Amq} @code{-q} option
5749 @cindex Unmounting a filesystem
5751 Suppress any error messages produced when a synchronous unmount fails.
5752 See @ref{Amq -u option}.
5754 @c ----------------------------------------------------------------
5755 @node Amq -s option, Amq -T option, Amq -q option, Controlling Amd
5756 @comment node-name, next, previous, up
5757 @subsection @i{Amq} @code{-s} option
5758 @cindex Global statistics
5761 The @code{-s} option displays global statistics. If any other options are specified
5762 or any filesystems named then this option is ignored. For example:
5765 requests stale mount mount unmount
5766 deferred fhandles ok failed failed
5771 @item Deferred requests
5772 are those for which an immediate reply could not be constructed. For
5773 example, this would happen if a background mount was required.
5775 @item Stale filehandles
5776 counts the number of times the kernel passes a stale filehandle to @i{Amd}.
5777 Large numbers indicate problems.
5780 counts the number of automounts which were successful.
5783 counts the number of automounts which failed.
5785 @item Unmount failed
5786 counts the number of times a filesystem could not be unmounted. Very
5787 large numbers here indicate that the time between unmount attempts
5788 should be increased.
5791 @c ----------------------------------------------------------------
5792 @node Amq -T option, Amq -U option, Amq -s option, Controlling Amd
5793 @comment node-name, next, previous, up
5794 @subsection @i{Amq} @code{-T} option
5795 @cindex Forcing Amq to use a TCP transport
5796 @cindex TCP; using with Amq
5798 The @code{-T} option causes the @i{Amq} to contact @i{Amd} using the TCP
5799 transport only (connection oriented). Normally, @i{Amq} will use TCP
5800 first, and if that failed, will try UDP.
5802 @c ----------------------------------------------------------------
5803 @node Amq -U option, Amq -u option, Amq -T option, Controlling Amd
5804 @comment node-name, next, previous, up
5805 @subsection @i{Amq} @code{-U} option
5806 @cindex Forcing Amq to use a UDP transport
5807 @cindex UDP; using with Amq
5809 The @code{-U} option causes the @i{Amq} to contact @i{Amd} using the UDP
5810 transport only (connectionless). Normally, @i{Amq} will use TCP first,
5811 and if that failed, will try UDP.
5813 @c ----------------------------------------------------------------
5814 @node Amq -u option, Amq -v option, Amq -U option, Controlling Amd
5815 @comment node-name, next, previous, up
5816 @subsection @i{Amq} @code{-u} option
5817 @cindex Forcing filesystem to time out
5818 @cindex Unmounting a filesystem
5820 The @code{-u} option causes the time-to-live interval of the named
5821 mount points to be expired, thus causing an unmount attempt. This is
5822 the only safe way to unmount an automounted filesystem. If @code{-u}
5823 is repeated, then @i{Amd} will attempt to unmount the filesystem
5824 synchronously. This makes things like
5827 amq -uu /t/cd0d && eject cd0
5831 work as expected. Any error messages this might produce can be
5832 suppressed with the @code{-q} option. See @ref{Amq -q option}.
5834 @c The @code{-H} option informs @i{Amd} that the specified mount point
5835 @c has hung - as if its keepalive timer had expired.
5837 @c ----------------------------------------------------------------
5838 @node Amq -v option, Amq -w option, Amq -u option, Controlling Amd
5839 @comment node-name, next, previous, up
5840 @subsection @i{Amq} @code{-v} option
5841 @cindex Version information at run-time
5843 The @code{-v} option displays the version of @i{Amd} in a similar way to
5844 @i{Amd}'s @code{-v} option.
5846 @c ----------------------------------------------------------------
5847 @node Amq -w option, Other Amq options, Amq -v option, Controlling Amd
5848 @comment node-name, next, previous, up
5849 @subsection @i{Amq} @code{-w} option
5850 @cindex Getting real working directory
5852 The @code{-w} option translates a full pathname as returned by
5853 @b{getpwd}(3) into a short @i{Amd} pathname that goes through its mount
5854 points. This option requires that @i{Amd} is running.
5856 @c ----------------------------------------------------------------
5857 @node Other Amq options, , Amq -w option, Controlling Amd
5858 @comment node-name, next, previous, up
5859 @subsection Other @i{Amq} options
5860 @cindex Logging options via Amq
5861 @cindex Debugging options via Amq
5863 Two other operations are implemented. These modify the state of @i{Amd}
5864 as a whole, rather than any particular filesystem. The @code{-x} and
5865 @code{-D} options have exactly the same effect as @i{Amd}'s corresponding
5866 command line options.
5868 When @i{Amd} receives the @code{-x} flag, it disallows turning off the
5869 @samp{fatal} or @samp{error} flags. Both are on by default. They are
5870 mandatory so that @i{Amd} could report important errors, including
5871 errors relating to turning flags on/off.
5873 @c ################################################################
5874 @node FSinfo, Hlfsd, Run-time Administration, Top
5875 @comment node-name, next, previous, up
5878 @cindex Filesystem info package
5880 XXX: this chapter should be reviewed by someone knowledgeable with
5884 * FSinfo Overview:: Introduction to FSinfo.
5885 * Using FSinfo:: Basic concepts.
5886 * FSinfo Grammar:: Language syntax, semantics and examples.
5887 * FSinfo host definitions:: Defining a new host.
5888 * FSinfo host attributes:: Definable host attributes.
5889 * FSinfo filesystems:: Defining locally attached filesystems.
5890 * FSinfo static mounts:: Defining additional static mounts.
5891 * FSinfo automount definitions::
5892 * FSinfo Command Line Options::
5896 @node FSinfo Overview, Using FSinfo, FSinfo, FSinfo
5897 @comment node-name, next, previous, up
5898 @section @i{FSinfo} overview
5899 @cindex FSinfo overview
5901 @i{FSinfo} is a filesystem management tool. It has been designed to
5902 work with @i{Amd} to help system administrators keep track of the ever
5903 increasing filesystem namespace under their control.
5905 The purpose of @i{FSinfo} is to generate all the important standard
5906 filesystem data files from a single set of input data. Starting with a
5907 single data source guarantees that all the generated files are
5908 self-consistent. One of the possible output data formats is a set of
5909 @i{Amd} maps which can be used among the set of hosts described in the
5912 @i{FSinfo} implements a declarative language. This language is
5913 specifically designed for describing filesystem namespace and physical
5914 layouts. The basic declaration defines a mounted filesystem including
5915 its device name, mount point, and all the volumes and access
5916 permissions. @i{FSinfo} reads this information and builds an internal
5917 map of the entire network of hosts. Using this map, many different data
5918 formats can be produced including @file{/etc/fstab},
5919 @file{/etc/exports}, @i{Amd} mount maps and
5920 @file{/etc/bootparams}.@refill
5922 @node Using FSinfo, FSinfo Grammar, FSinfo Overview, FSinfo
5923 @comment node-name, next, previous, up
5924 @section Using @i{FSinfo}
5925 @cindex Using FSinfo
5927 The basic strategy when using @i{FSinfo} is to gather all the
5928 information about all disks on all machines into one set of
5929 declarations. For each machine being managed, the following data is
5936 List of all filesystems and, optionally, their mount points.
5938 Names of volumes stored on each filesystem.
5940 NFS export information for each volume.
5942 The list of static filesystem mounts.
5945 The following information can also be entered into the same
5946 configuration files so that all data can be kept in one place.
5950 List of network interfaces
5952 IP address of each interface
5954 Hardware address of each interface
5956 Dumpset to which each filesystem belongs
5961 To generate @i{Amd} mount maps, the automount tree must also be defined
5962 (@pxref{FSinfo automount definitions}). This will have been designed at
5963 the time the volume names were allocated. Some volume names will not be
5964 automounted, so @i{FSinfo} needs an explicit list of which volumes
5965 should be automounted.@refill
5967 Hostnames are required at several places in the @i{FSinfo} language. It
5968 is important to stick to either fully qualified names or unqualified
5969 names. Using a mixture of the two will inevitably result in confusion.
5971 Sometimes volumes need to be referenced which are not defined in the set
5972 of hosts being managed with @i{FSinfo}. The required action is to add a
5973 dummy set of definitions for the host and volume names required. Since
5974 the files generated for those particular hosts will not be used on them,
5975 the exact values used is not critical.
5977 @node FSinfo Grammar, FSinfo host definitions, Using FSinfo, FSinfo
5978 @comment node-name, next, previous, up
5979 @section @i{FSinfo} grammar
5980 @cindex FSinfo grammar
5981 @cindex Grammar, FSinfo
5983 @i{FSinfo} has a relatively simple grammar. Distinct syntactic
5984 constructs exist for each of the different types of data, though they
5985 share a common flavor. Several conventions are used in the grammar
5988 The notation, @i{list(}@t{xxx}@i{)}, indicates a list of zero or more
5989 @t{xxx}'s. The notation, @i{opt(}@t{xxx}@i{)}, indicates zero or one
5990 @t{xxx}. Items in double quotes, @i{eg} @t{"host"}, represent input
5991 tokens. Items in angle brackets, @i{eg} @var{<hostname>}, represent
5992 strings in the input. Strings need not be in double quotes, except to
5993 differentiate them from reserved words. Quoted strings may include the
5994 usual set of C ``@t{\}'' escape sequences with one exception: a
5995 backslash-newline-whitespace sequence is squashed into a single space
5996 character. To defeat this feature, put a further backslash at the start
5999 At the outermost level of the grammar, the input consists of a
6000 sequence of host and automount declarations. These declarations are
6001 all parsed before they are analyzed. This means they can appear in
6002 any order and cyclic host references are possible.
6005 fsinfo : @i{list(}fsinfo_attr@i{)} ;
6007 fsinfo_attr : host | automount ;
6011 * FSinfo host definitions::
6012 * FSinfo automount definitions::
6015 @node FSinfo host definitions, FSinfo host attributes, FSinfo Grammar, FSinfo
6016 @comment node-name, next, previous, up
6017 @section @i{FSinfo} host definitions
6018 @cindex FSinfo host definitions
6019 @cindex Defining a host, FSinfo
6021 A host declaration consists of three parts: a set of machine attribute
6022 data, a list of filesystems physically attached to the machine, and a
6023 list of additional statically mounted filesystems.
6026 host : "host" host_data @i{list(}filesystem@i{@i{)}} @i{list(}mount@i{@i{)}} ;
6029 Each host must be declared in this way exactly once. Such things as the
6030 hardware address, the architecture and operating system types and the
6031 cluster name are all specified within the @dfn{host data}.
6033 All the disks the machine has should then be described in the @dfn{list
6034 of filesystems}. When describing disks, you can specify what
6035 @dfn{volname} the disk/partition should have and all such entries are
6036 built up into a dictionary which can then be used for building the
6039 The @dfn{list of mounts} specifies all the filesystems that should be
6040 statically mounted on the machine.
6043 * FSinfo host attributes::
6044 * FSinfo filesystems::
6045 * FSinfo static mounts::
6048 @node FSinfo host attributes, FSinfo filesystems, FSinfo host definitions , FSinfo host definitions
6049 @comment node-name, next, previous, up
6050 @section @i{FSinfo} host attributes
6051 @cindex FSinfo host attributes
6052 @cindex Defining host attributes, FSinfo
6054 The host data, @dfn{host_data}, always includes the @dfn{hostname}. In
6055 addition, several other host attributes can be given.
6058 host_data : @var{<hostname>}
6059 | "@{" @i{list(}host_attrs@i{)} "@}" @var{<hostname>}
6062 host_attrs : host_attr "=" @var{<string>}
6066 host_attr : "config"
6073 The @dfn{hostname} is, typically, the fully qualified hostname of the
6079 host dylan.doc.ic.ac.uk
6084 @} dougal.doc.ic.ac.uk
6087 The options that can be given as host attributes are shown below.
6090 * FSinfo netif Option:: FSinfo host netif.
6091 * FSinfo config Option:: FSinfo host config.
6092 * FSinfo arch Option:: FSinfo host arch.
6093 * FSinfo os Option:: FSinfo host os.
6094 * FSinfo cluster Option:: FSinfo host cluster.
6097 @node FSinfo netif Option, FSinfo config Option, , FSinfo host attributes
6098 @comment node-name, next, previous, up
6099 @subsection netif Option
6101 This defines the set of network interfaces configured on the machine.
6102 The interface attributes collected by @i{FSinfo} are the IP address,
6103 subnet mask and hardware address. Multiple interfaces may be defined
6104 for hosts with several interfaces by an entry for each interface. The
6105 values given are sanity checked, but are currently unused for anything
6109 netif : "netif" @var{<string>} "@{" @i{list(}netif_attrs@i{)} "@}" ;
6111 netif_attrs : netif_attr "=" @var{<string>} ;
6113 netif_attr : "inaddr" | "netmask" | "hwaddr" ;
6120 inaddr = 129.31.81.37
6121 netmask = 0xfffffe00
6122 hwaddr = "08:00:20:01:a6:a5"
6128 @node FSinfo config Option, FSinfo arch Option, FSinfo netif Option, FSinfo host attributes
6129 @comment node-name, next, previous, up
6130 @subsection config Option
6131 @cindex FSinfo config host attribute
6132 @cindex config, FSinfo host attribute
6134 This option allows you to specify configuration variables for the
6135 startup scripts (@file{rc} scripts). A simple string should immediately
6141 config "NFS_SERVER=true"
6142 config "ZEPHYR=true"
6145 This option is currently unsupported.
6147 @node FSinfo arch Option, FSinfo os Option, FSinfo config Option, FSinfo host attributes
6148 @comment node-name, next, previous, up
6149 @subsection arch Option
6150 @cindex FSinfo arch host attribute
6151 @cindex arch, FSinfo host attribute
6153 This defines the architecture of the machine. For example:
6159 This is intended to be of use when building architecture specific
6160 mountmaps, however, the option is currently unsupported.
6162 @node FSinfo os Option, FSinfo cluster Option, FSinfo arch Option, FSinfo host attributes
6163 @comment node-name, next, previous, up
6164 @subsection os Option
6165 @cindex FSinfo os host attribute
6166 @cindex os, FSinfo host attribute
6168 This defines the operating system type of the host. For example:
6174 This information is used when creating the @file{fstab} files, for
6175 example in choosing which format to use for the @file{fstab} entries
6178 @node FSinfo cluster Option, , FSinfo os Option, FSinfo host attributes
6179 @comment node-name, next, previous, up
6180 @subsection cluster Option
6181 @cindex FSinfo cluster host attribute
6182 @cindex cluster, FSinfo host attribute
6184 This is used for specifying in which cluster the machine belongs. For
6191 The cluster is intended to be used when generating the automount maps,
6192 although it is currently unsupported.
6194 @node FSinfo filesystems, FSinfo static mounts, FSinfo host attributes, FSinfo host definitions
6195 @comment node-name, next, previous, up
6196 @section @i{FSinfo} filesystems
6197 @cindex FSinfo filesystems
6199 The list of physically attached filesystems follows the machine
6200 attributes. These should define all the filesystems available from this
6201 machine, whether exported or not. In addition to the device name,
6202 filesystems have several attributes, such as filesystem type, mount
6203 options, and @samp{fsck} pass number which are needed to generate
6204 @file{fstab} entries.
6207 filesystem : "fs" @var{<device>} "@{" @i{list(}fs_data@i{)} "@}" ;
6209 fs_data : fs_data_attr "=" @var{<string>}
6214 : "fstype" | "opts" | "passno"
6215 | "freq" | "dumpset" | "log"
6219 Here, @var{<device>} is the device name of the disk (for example,
6220 @file{/dev/dsk/2s0}). The device name is used for building the mount
6221 maps and for the @file{fstab} file. The attributes that can be
6222 specified are shown in the following section.
6224 The @i{FSinfo} configuration file for @code{dylan.doc.ic.ac.uk} is listed below.
6227 host dylan.doc.ic.ac.uk
6235 opts = rw,noquota,grpid
6248 exportfs "dougal eden dylan zebedee brian"
6249 volname /nfs/hp300/local
6260 exportfs "toytown_clients hangers_on"
6261 volname /home/dylan/dk2
6271 exportfs "toytown_clients hangers_on"
6272 volname /home/dylan/dk3
6282 exportfs "toytown_clients hangers_on"
6283 volname /home/dylan/dk5
6289 * FSinfo fstype Option:: FSinfo filesystems fstype.
6290 * FSinfo opts Option:: FSinfo filesystems opts.
6291 * FSinfo passno Option:: FSinfo filesystems passno.
6292 * FSinfo freq Option:: FSinfo filesystems freq.
6293 * FSinfo mount Option:: FSinfo filesystems mount.
6294 * FSinfo dumpset Option:: FSinfo filesystems dumpset.
6295 * FSinfo log Option:: FSinfo filesystems log.
6298 @node FSinfo fstype Option, FSinfo opts Option, , FSinfo filesystems
6299 @comment node-name, next, previous, up
6300 @subsection fstype Option
6301 @cindex FSinfo fstype filesystems option
6302 @cindex fstype, FSinfo filesystems option
6303 @cindex export, FSinfo special fstype
6305 This specifies the type of filesystem being declared and will be placed
6306 into the @file{fstab} file as is. The value of this option will be
6307 handed to @code{mount} as the filesystem type---it should have such
6308 values as @code{4.2}, @code{nfs} or @code{swap}. The value is not
6309 examined for correctness.
6311 There is one special case. If the filesystem type is specified as
6312 @samp{export} then the filesystem information will not be added to the
6313 host's @file{fstab} information, but it will still be visible on the
6314 network. This is useful for defining hosts which contain referenced
6315 volumes but which are not under full control of @i{FSinfo}.
6323 @node FSinfo opts Option, FSinfo passno Option, FSinfo fstype Option, FSinfo filesystems
6324 @comment node-name, next, previous, up
6325 @subsection opts Option
6326 @cindex FSinfo opts filesystems option
6327 @cindex opts, FSinfo filesystems option
6329 This defines any options that should be given to @b{mount}(8) in the
6330 @file{fstab} file. For example:
6333 opts = rw,nosuid,grpid
6336 @node FSinfo passno Option, FSinfo freq Option, FSinfo opts Option, FSinfo filesystems
6337 @comment node-name, next, previous, up
6338 @subsection passno Option
6339 @cindex FSinfo passno filesystems option
6340 @cindex passno, FSinfo filesystems option
6342 This defines the @b{fsck}(8) pass number in which to check the
6343 filesystem. This value will be placed into the @file{fstab} file.
6351 @node FSinfo freq Option, FSinfo mount Option, FSinfo passno Option, FSinfo filesystems
6352 @comment node-name, next, previous, up
6353 @subsection freq Option
6354 @cindex FSinfo freq filesystems option
6355 @cindex freq, FSinfo filesystems option
6357 This defines the interval (in days) between dumps. The value is placed
6358 as is into the @file{fstab} file.
6366 @node FSinfo mount Option, FSinfo dumpset Option, FSinfo freq Option, FSinfo filesystems
6367 @comment node-name, next, previous, up
6368 @subsection mount Option
6369 @cindex FSinfo mount filesystems option
6370 @cindex mount, FSinfo filesystems option
6371 @cindex exportfs, FSinfo mount option
6372 @cindex volname, FSinfo mount option
6373 @cindex sel, FSinfo mount option
6375 This defines the mountpoint at which to place the filesystem. If the
6376 mountpoint of the filesystem is specified as @code{default}, then the
6377 filesystem will be mounted in the automounter's tree under its volume
6378 name and the mount will automatically be inherited by the automounter.
6380 Following the mountpoint, namespace information for the filesystem may
6381 be described. The options that can be given here are @code{exportfs},
6382 @code{volname} and @code{sel}.
6387 mount : "mount" vol_tree ;
6389 vol_tree : @i{list(}vol_tree_attr@i{)} ;
6392 : @var{<string>} "@{" @i{list(}vol_tree_info@i{)} vol_tree "@}" ;
6395 : "exportfs" @var{<export-data>}
6396 | "volname" @var{<volname>}
6397 | "sel" @var{<selector-list>}
6405 exportfs "dylan dougal florence zebedee"
6410 In the above example, the filesystem currently being declared will have
6411 an entry placed into the @file{exports} file allowing the filesystem to
6412 be exported to the machines @code{dylan}, @code{dougal}, @code{florence}
6413 and @code{zebedee}. The volume name by which the filesystem will be
6414 referred to remotely, is @file{/vol/andrew}. By declaring the
6415 mountpoint to be @code{default}, the filesystem will be mounted on the
6416 local machine in the automounter tree, where @i{Amd} will automatically
6417 inherit the mount as @file{/vol/andrew}.@refill
6421 a string defining which machines the filesystem may be exported to.
6422 This is copied, as is, into the @file{exports} file---no sanity checking
6423 is performed on this string.@refill
6426 a string which declares the remote name by which to reference the
6427 filesystem. The string is entered into a dictionary and allows you to
6428 refer to this filesystem in other places by this volume name.@refill
6431 a string which is placed into the automounter maps as a selector for the
6436 @node FSinfo dumpset Option, FSinfo log Option, FSinfo mount Option, FSinfo filesystems
6437 @comment node-name, next, previous, up
6438 @subsection dumpset Option
6439 @cindex FSinfo dumpset filesystems option
6440 @cindex dumpset, FSinfo filesystems option
6442 This provides support for Imperial College's local file backup tools and
6443 is not documented further here.
6445 @node FSinfo log Option, , FSinfo dumpset Option, FSinfo filesystems
6446 @comment node-name, next, previous, up
6447 @subsection log Option
6448 @cindex FSinfo log filesystems option
6449 @cindex log, FSinfo filesystems option
6451 Specifies the log device for the current filesystem. This is ignored if
6452 not required by the particular filesystem type.
6454 @node FSinfo static mounts, FSinfo automount definitions , FSinfo filesystems, FSinfo host definitions
6455 @comment node-name, next, previous, up
6456 @section @i{FSinfo} static mounts
6457 @cindex FSinfo static mounts
6458 @cindex Statically mounts filesystems, FSinfo
6460 Each host may also have a number of statically mounted filesystems. For
6461 example, the host may be a diskless workstation in which case it will
6462 have no @code{fs} declarations. In this case the @code{mount}
6463 declaration is used to determine from where its filesystems will be
6464 mounted. In addition to being added to the @file{fstab} file, this
6465 information can also be used to generate a suitable @file{bootparams}
6469 mount : "mount" @var{<volname>} @i{list(}localinfo@i{)} ;
6471 localinfo : localinfo_attr @var{<string>} ;
6481 The filesystem specified to be mounted will be searched for in the
6482 dictionary of volume names built when scanning the list of hosts'
6485 The attributes have the following semantics:
6487 @item from @var{machine}
6488 mount the filesystem from the machine with the hostname of
6489 @dfn{machine}.@refill
6491 @item as @var{mountpoint}
6492 mount the filesystem locally as the name given, in case this is
6493 different from the advertised volume name of the filesystem.
6495 @item opts @var{options}
6496 native @b{mount}(8) options.
6498 @item fstype @var{type}
6499 type of filesystem to be mounted.
6505 mount /export/exec/hp300/local as /usr/local
6508 If the mountpoint specified is either @file{/} or @file{swap}, the
6509 machine will be considered to be booting off the net and this will be
6510 noted for use in generating a @file{bootparams} file for the host which
6511 owns the filesystems.
6513 @node FSinfo automount definitions, FSinfo Command Line Options, FSinfo static mounts, FSinfo
6514 @comment node-name, next, previous, up
6515 @section Defining an @i{Amd} Mount Map in @i{FSinfo}
6516 @cindex FSinfo automount definitions
6517 @cindex Defining an Amd mount map, FSinfo
6519 The maps used by @i{Amd} can be constructed from @i{FSinfo} by defining
6520 all the automount trees. @i{FSinfo} takes all the definitions found and
6521 builds one map for each top level tree.
6523 The automount tree is usually defined last. A single automount
6524 configuration will usually apply to an entire management domain. One
6525 @code{automount} declaration is needed for each @i{Amd} automount point.
6526 @i{FSinfo} determines whether the automount point is @dfn{direct}
6527 (@pxref{Direct Automount Filesystem}) or @dfn{indirect}
6528 (@pxref{Top-level Filesystem}). Direct automount points are
6529 distinguished by the fact that there is no underlying
6530 @dfn{automount_tree}.@refill
6533 automount : "automount" @i{opt(}auto_opts@i{)} automount_tree ;
6535 auto_opts : "opts" @var{<mount-options>} ;
6538 : @i{list(}automount_attr@i{)}
6542 : @var{<string>} "=" @var{<volname>}
6543 | @var{<string>} "->" @var{<symlink>}
6544 | @var{<string>} "@{" automount_tree "@}"
6548 If @var{<mount-options>} is given, then it is the string to be placed in
6549 the maps for @i{Amd} for the @code{opts} option.
6551 A @dfn{map} is typically a tree of filesystems, for example @file{home}
6552 normally contains a tree of filesystems representing other machines in
6555 A map can either be given as a name representing an already defined
6556 volume name, or it can be a tree. A tree is represented by placing
6557 braces after the name. For example, to define a tree @file{/vol}, the
6558 following map would be defined:
6561 automount /vol @{ @}
6564 Within a tree, the only items that can appear are more maps.
6574 In this case, @i{FSinfo} will look for volumes named @file{/vol/andrew}
6575 and @file{/vol/X11} and a map entry will be generated for each. If the
6576 volumes are defined more than once, then @i{FSinfo} will generate
6577 a series of alternate entries for them in the maps.@refill
6579 Instead of a tree, either a link (@var{name} @code{->}
6580 @var{destination}) or a reference can be specified (@var{name} @code{=}
6581 @var{destination}). A link creates a symbolic link to the string
6582 specified, without further processing the entry. A reference will
6583 examine the destination filesystem and optimize the reference. For
6584 example, to create an entry for @code{njw} in the @file{/homes} map,
6585 either of the two forms can be used:@refill
6589 njw -> /home/dylan/njw
6597 njw = /home/dylan/njw
6601 In the first example, when @file{/homes/njw} is referenced from @i{Amd},
6602 a link will be created leading to @file{/home/dylan/njw} and the
6603 automounter will be referenced a second time to resolve this filename.
6604 The map entry would be:
6607 njw type:=link;fs:=/home/dylan/njw
6610 In the second example, the destination directory is analyzed and found
6611 to be in the filesystem @file{/home/dylan} which has previously been
6612 defined in the maps. Hence the map entry will look like:
6615 njw rhost:=dylan;rfs:=/home/dylan;sublink:=njw
6618 Creating only one symbolic link, and one access to @i{Amd}.
6620 @node FSinfo Command Line Options, FSinfo errors, FSinfo automount definitions, FSinfo
6621 @comment node-name, next, previous, up
6622 @section @i{FSinfo} Command Line Options
6623 @cindex FSinfo command line options
6624 @cindex Command line options, FSinfo
6626 @i{FSinfo} is started from the command line by using the command:
6629 fsinfo [@i{options}] @i{files} ...
6632 The input to @i{FSinfo} is a single set of definitions of machines and
6633 automount maps. If multiple files are given on the command-line, then
6634 the files are concatenated together to form the input source. The files
6635 are passed individually through the C pre-processor before being parsed.
6637 Several options define a prefix for the name of an output file. If the
6638 prefix is not specified no output of that type is produced. The suffix
6639 used will correspond either to the hostname to which a file belongs, or
6640 to the type of output if only one file is produced. Dumpsets and the
6641 @file{bootparams} file are in the latter class. To put the output into
6642 a subdirectory simply put a @file{/} at the end of the prefix, making
6643 sure that the directory has already been made before running
6647 * -a FSinfo Option:: Amd automount directory:
6648 * -b FSinfo Option:: Prefix for bootparams files.
6649 * -d FSinfo Option:: Prefix for dumpset data files.
6650 * -e FSinfo Option:: Prefix for exports files.
6651 * -f FSinfo Option:: Prefix for fstab files.
6652 * -h FSinfo Option:: Local hostname.
6653 * -m FSinfo Option:: Prefix for automount maps.
6654 * -q FSinfo Option:: Ultra quiet mode.
6655 * -v FSinfo Option:: Verbose mode.
6656 * -I FSinfo Option:: Define new #include directory.
6657 * -D-FSinfo Option:: Define macro.
6658 * -U FSinfo Option:: Undefine macro.
6661 @node -a FSinfo Option, -b FSinfo Option, FSinfo Command Line Options, FSinfo Command Line Options
6662 @comment node-name, next, previous, up
6663 @subsection @code{-a} @var{autodir}
6665 Specifies the directory name in which to place the automounter's
6666 mountpoints. This defaults to @file{/a}. Some sites have the autodir set
6667 to be @file{/amd}, and this would be achieved by:
6673 @node -b FSinfo Option, -d FSinfo Option, -a FSinfo Option, FSinfo Command Line Options
6674 @comment node-name, next, previous, up
6675 @subsection @code{-b} @var{bootparams}
6676 @cindex bootparams, FSinfo prefix
6678 This specifies the prefix for the @file{bootparams} filename. If it is
6679 not given, then the file will not be generated. The @file{bootparams}
6680 file will be constructed for the destination machine and will be placed
6681 into a file named @file{bootparams} and prefixed by this string. The
6682 file generated contains a list of entries describing each diskless
6683 client that can boot from the destination machine.
6685 As an example, to create a @file{bootparams} file in the directory
6686 @file{generic}, the following would be used:
6689 fsinfo -b generic/ ...
6692 @node -d FSinfo Option, -e FSinfo Option, -b FSinfo Option, FSinfo Command Line Options
6693 @comment node-name, next, previous, up
6694 @subsection @code{-d} @var{dumpsets}
6695 @cindex dumpset, FSinfo prefix
6697 This specifies the prefix for the @file{dumpsets} file. If it is not
6698 specified, then the file will not be generated. The file will be for
6699 the destination machine and will be placed into a filename
6700 @file{dumpsets}, prefixed by this string. The @file{dumpsets} file is
6701 for use by Imperial College's local backup system.
6703 For example, to create a @file{dumpsets} file in the directory @file{generic},
6704 then you would use the following:
6707 fsinfo -d generic/ ...
6710 @node -e FSinfo Option, -f FSinfo Option, -d FSinfo Option, FSinfo Command Line Options
6711 @comment node-name, next, previous, up
6712 @subsection @code{-e} @var{exportfs}
6713 @cindex exports, FSinfo prefix
6715 Defines the prefix for the @file{exports} files. If it is not given,
6716 then the file will not be generated. For each machine defined in the
6717 configuration files as having disks, an @file{exports} file is
6718 constructed and given a filename determined by the name of the machine,
6719 prefixed with this string. If a machine is defined as diskless, then no
6720 @file{exports} file will be created for it. The files contain entries
6721 for directories on the machine that may be exported to clients.
6723 Example: To create the @file{exports} files for each diskfull machine
6724 and place them into the directory @file{exports}:
6727 fsinfo -e exports/ ...
6730 @node -f FSinfo Option, -h FSinfo Option, -e FSinfo Option, FSinfo Command Line Options
6731 @comment node-name, next, previous, up
6732 @subsection @code{-f} @var{fstab}
6733 @cindex fstab, FSinfo prefix
6735 This defines the prefix for the @file{fstab} files. The files will only
6736 be created if this prefix is defined. For each machine defined in the
6737 configuration files, a @file{fstab} file is created with the filename
6738 determined by prefixing this string with the name of the machine. These
6739 files contain entries for filesystems and partitions to mount at boot
6742 Example, to create the files in the directory @file{fstabs}:
6745 fsinfo -f fstabs/ ...
6748 @node -h FSinfo Option, -m FSinfo Option, -f FSinfo Option, FSinfo Command Line Options
6749 @comment node-name, next, previous, up
6750 @subsection @code{-h} @var{hostname}
6751 @cindex hostname, FSinfo command line option
6753 Defines the hostname of the destination machine to process for. If this
6754 is not specified, it defaults to the local machine name, as returned by
6760 fsinfo -h dylan.doc.ic.ac.uk ...
6763 @node -m FSinfo Option, -q FSinfo Option, -h FSinfo Option, FSinfo Command Line Options
6764 @comment node-name, next, previous, up
6765 @subsection @code{-m} @var{mount-maps}
6766 @cindex maps, FSinfo command line option
6768 Defines the prefix for the automounter files. The maps will only be
6769 produced if this prefix is defined. The mount maps suitable for the
6770 network defined by the configuration files will be placed into files
6771 with names calculated by prefixing this string to the name of each map.
6773 For example, to create the automounter maps and place them in the
6774 directory @file{automaps}:
6777 fsinfo -m automaps/ ...
6780 @node -q FSinfo Option, -v FSinfo Option, -m FSinfo Option, FSinfo Command Line Options
6781 @comment node-name, next, previous, up
6782 @subsection @code{-q}
6783 @cindex quiet, FSinfo command line option
6785 Selects quiet mode. @i{FSinfo} suppress the ``running commentary'' and
6786 only outputs any error messages which are generated.
6788 @node -v FSinfo Option, -D-FSinfo Option, -q FSinfo Option, FSinfo Command Line Options
6789 @comment node-name, next, previous, up
6790 @subsection @code{-v}
6791 @cindex verbose, FSinfo command line option
6793 Selects verbose mode. When this is activated, the program will display
6794 more messages, and display all the information discovered when
6795 performing the semantic analysis phase. Each verbose message is output
6796 to @file{stdout} on a line starting with a @samp{#} character.
6798 @node -D-FSinfo Option, -I FSinfo Option, -v FSinfo Option, FSinfo Command Line Options
6799 @comment node-name, next, previous, up
6800 @subsection @code{-D} @var{name}@i{[=defn]}
6802 Defines a symbol @dfn{name} for the preprocessor when reading the
6803 configuration files. Equivalent to @code{#define} directive.
6805 @node -I FSinfo Option, -U FSinfo Option, -D-FSinfo Option, FSinfo Command Line Options
6806 @comment node-name, next, previous, up
6807 @subsection @code{-I} @var{directory}
6809 This option is passed into the preprocessor for the configuration files.
6810 It specifies directories in which to find include files
6812 @node -U FSinfo Option, , -I FSinfo Option, FSinfo Command Line Options
6813 @comment node-name, next, previous, up
6814 @subsection @code{-U} @var{name}
6816 Removes any initial definition of the symbol @dfn{name}. Inverse of the
6819 @node FSinfo errors, , FSinfo Command Line Options, FSinfo
6820 @comment node-name, next, previous, up
6821 @section Errors produced by @i{FSinfo}
6822 @cindex FSinfo error messages
6824 The following table documents the errors and warnings which @i{FSinfo} may produce.
6829 Occurs if an unescaped newline is found in a quoted string.
6831 @item ambiguous mount: @var{volume} is a replicated filesystem
6832 If several filesystems are declared as having the same volume name, they
6833 will be considered replicated filesystems. To mount a replicated
6834 filesystem statically, a specific host will need to be named, to say
6835 which particular copy to try and mount, else this error will
6838 @item can't open @var{filename} for writing
6839 Occurs if any errors are encountered when opening an output file.
6841 @item cannot determine localname since volname @var{volume} is not uniquely defined
6842 If a volume is replicated and an attempt is made to mount the filesystem
6843 statically without specifying a local mountpoint, @i{FSinfo} cannot
6844 calculate a mountpoint, as the desired pathname would be
6847 @item @var{device} has duplicate exportfs data
6848 Produced if the @samp{exportfs} option is used multiple times within the
6849 same branch of a filesystem definition. For example, if you attempt to
6850 set the @samp{exportfs} data at different levels of the mountpoint
6853 @item dump frequency for @var{host}:@var{device} is non-zero
6854 Occurs if @var{device} has its @samp{fstype} declared to be @samp{swap}
6855 or @samp{export} and the @samp{dump} option is set to a value greater
6856 than zero. Swap devices should not be dumped.
6858 @item duplicate host @var{hostname}!
6859 If a host has more than one definition.
6861 @item end of file within comment
6862 A comment was unterminated before the end of one of the configuration
6865 @item @var{filename}: cannot open for reading
6866 If a file specified on the command line as containing configuration data
6867 could not be opened.
6869 @item @var{filesystem} has a volname but no exportfs data
6870 Occurs when a volume name is declared for a file system, but the string
6871 specifying what machines the filesystem can be exported to is
6874 @item fs field "@var{field-name}" already set
6875 Occurs when multiple definitions are given for one of the attributes of a
6878 @item host field "@var{field-name}" already set
6879 If duplicate definitions are given for any of the fields with a host
6882 @item @var{host}:@var{device} has more than one mount point
6883 Occurs if the mount option for a host's filesystem specifies multiple
6884 trees at which to place the mountpoint.
6886 @item @var{host}:@var{device} has no mount point
6887 Occurs if the @samp{mount} option is not specified for a host's
6890 @item @var{host}:@var{device} needs field "@var{field-name}"
6891 Occurs when a filesystem is missing a required field. @var{field-name} could
6892 be one of @samp{fstype}, @samp{opts}, @samp{passno} or
6895 @item @var{host}:mount field specified for swap partition
6896 Occurs if a mountpoint is given for a filesystem whose type is declared
6899 @item malformed IP dotted quad: @var{address}
6900 If the Internet address of an interface is incorrectly specified. An
6901 Internet address definition is handled to @b{inet_addr}(3N) to see if it
6902 can cope. If not, then this message will be displayed.
6904 @item malformed netmask: @var{netmask}
6905 If the netmask cannot be decoded as though it were a hexadecimal number,
6906 then this message will be displayed. It will typically be caused by
6907 incorrect characters in the @var{netmask} value.
6909 @item mount field "@var{field-name}" already set
6910 Occurs when a static mount has multiple definitions of the same field.
6912 @item mount tree field "@var{field-name}" already set
6913 Occurs when the @var{field-name} is defined more than once during the
6914 definition of a filesystems mountpoint.
6916 @item netif field @var{field-name} already set
6917 Occurs if you attempt to define an attribute of an interface more than
6920 @item network booting requires both root and swap areas
6921 Occurs if a machine has mount declarations for either the root partition
6922 or the swap area, but not both. You cannot define a machine to only
6923 partially boot via the network.
6925 @item no disk mounts on @var{hostname}
6926 If there are no static mounts, nor local disk mounts specified for a
6927 machine, this message will be displayed.
6929 @item no volname given for @var{host}:@var{device}
6930 Occurs when a filesystem is defined to be mounted on @file{default}, but
6931 no volume name is given for the file system, then the mountpoint cannot
6934 @item not allowed '/' in a directory name
6935 Occurs when a pathname with multiple directory elements is specified as
6936 the name for an automounter tree. A tree should only have one name at
6939 @item pass number for @var{host}:@var{device} is non-zero
6940 Occurs if @var{device} has its @samp{fstype} declared to be @samp{swap}
6941 or @samp{export} and the @b{fsck}(8) pass number is set. Swap devices
6942 should not be fsck'd. @xref{FSinfo fstype Option}.
6944 @item sub-directory @var{directory} of @var{directory-tree} starts with '/'
6945 Within the filesystem specification for a host, if an element
6946 @var{directory} of the mountpoint begins with a @samp{/} and it is not
6947 the start of the tree.
6949 @item sub-directory of @var{directory-tree} is named "default"
6950 @samp{default} is a keyword used to specify if a mountpoint should be
6951 automatically calculated by @i{FSinfo}. If you attempt to specify a
6952 directory name as this, it will use the filename of @file{default} but
6953 will produce this warning.
6955 @item unknown \ sequence
6956 Occurs if an unknown escape sequence is found inside a string. Within a
6957 string, you can give the standard C escape sequences for strings, such
6958 as newlines and tab characters.
6960 @item unknown directory attribute
6961 If an unknown keyword is found while reading the definition of a host's
6962 filesystem mount option.
6964 @item unknown filesystem attribute
6965 Occurs if an unrecognized keyword is used when defining a host's
6968 @item unknown host attribute
6969 Occurs if an unrecognized keyword is used when defining a host.
6971 @item unknown mount attribute
6972 Occurs if an unrecognized keyword is found while parsing the list of
6975 @item unknown volname @var{volume} automounted @i{[} on @i{name} @i{]}
6976 Occurs if @var{volume} is used in a definition of an automount map but the volume
6977 name has not been declared during the host filesystem definitions.
6979 @item volname @var{volume} is unknown
6980 Occurs if an attempt is made to mount or reference a volume name which
6981 has not been declared during the host filesystem definitions.
6983 @item volname @var{volume} not exported from @var{machine}
6984 Occurs if you attempt to mount the volume @var{volume} from a machine
6985 which has not declared itself to have such a filesystem
6990 @c ################################################################
6991 @node Hlfsd, Assorted Tools, FSinfo, Top
6992 @comment node-name, next, previous, up
6995 @cindex Home-Link Filesystem
6997 @i{Hlfsd} is a daemon which implements a filesystem containing a
6998 symbolic link to subdirectory within a user's home directory, depending
6999 on the user which accessed that link. It was primarily designed to
7000 redirect incoming mail to users' home directories, so that it can be read
7001 from anywhere. It was designed and implemented by
7002 @uref{http://www.cs.sunysb.edu/~ezk,Erez Zadok} and
7003 @email{dupuy AT cs.columbia.edu,Alexander Dupuy}, at the
7004 @uref{http://www.cs.columbia.edu/,Computer Science Department} of
7005 @uref{http://www.columbia.edu/,Columbia University}. A
7006 @uref{http://www.fsl.cs.sunysb.edu/docs/hlfsd/hlfsd.html,paper}
7007 on @i{Hlfsd} was presented at the Usenix LISA VII conference in 1993.
7009 @i{Hlfsd} operates by mounting itself as an NFS server for the directory
7010 containing @i{linkname}, which defaults to @file{/hlfs/home}. Lookups
7011 within that directory are handled by @i{Hlfsd}, which uses the
7012 password map to determine how to resolve the lookup. The directory will
7013 be created if it doesn't already exist. The symbolic link will be to
7014 the accessing user's home directory, with @i{subdir} appended to it. If
7015 not specified, @i{subdir} defaults to @file{.hlfsdir}. This directory
7016 will also be created if it does not already exist.
7018 A @samp{SIGTERM} sent to @i{Hlfsd} will cause it to shutdown. A
7019 @samp{SIGHUP} will flush the internal caches, and reload the password
7020 map. It will also close and reopen the log file, to enable the original
7021 log file to be removed or rotated. A @samp{SIGUSR1} will cause it to
7022 dump its internal table of user IDs and home directories to the file
7023 @file{/tmp/hlfsddump}.
7026 * Introduction to Hlfsd::
7027 * Background to Mail Delivery::
7031 @c ================================================================
7032 @node Introduction to Hlfsd, Background to Mail Delivery, Hlfsd, Hlfsd
7033 @comment node-name, next, previous, up
7034 @section Introduction to Hlfsd
7035 @cindex Introduction to Hlfsd
7036 @cindex Hlfsd; introduction
7038 Electronic mail has become one of the major applications for many
7039 computer networks, and use of this service is expected to increase over
7040 time, as networks proliferate and become faster. Providing a convenient
7041 environment for users to read, compose, and send electronic mail has
7042 become a requirement for systems administrators (SAs).
7044 Widely used methods for handling mail usually require users to be logged
7045 into a designated ``home'' machine, where their mailbox files reside.
7046 Only on that one machine can they read newly arrived mail. Since users
7047 have to be logged into that system to read their mail, they often find
7048 it convenient to run all of their other processes on that system as
7049 well, including memory and CPU-intensive jobs. For example, in our
7050 department, we have allocated and configured several multi-processor
7051 servers to handle such demanding CPU/memory applications, but these were
7052 underutilized, in large part due to the inconvenience of not being able
7053 to read mail on those machines. (No home directories were located on
7054 these designated CPU-servers, since we did not want NFS service for
7055 users' home directories to have to compete with CPU-intensive jobs. At the
7056 same time, we discouraged users from running demanding applications on
7057 their home machines.)
7059 Many different solutions have been proposed to allow users to read their
7060 mail on any host. However, all of these solutions fail in one or more
7066 they introduce new single points of failure
7069 they require using different mail transfer agents (MTAs) or user agents
7073 they do not solve the problem for all cases, i.e. the solution is only
7074 partially successful for a particular environment.
7078 We have designed a simple filesystem, called the @dfn{Home-Link File
7079 System}, to provide the ability to deliver mail to users' home
7080 directories, without modification to mail-related applications. We have
7081 endeavored to make it as stable as possible. Of great importance to us
7082 was to make sure the HLFS daemon, @file{hlfsd} , would not hang under
7083 any circumstances, and would take the next-best action when faced with
7084 problems. Compared to alternative methods, @i{Hlfsd} is a stable, more
7085 general solution, and easier to install/use. In fact, in some ways, we
7086 have even managed to improve the reliability and security of mail
7089 Our server implements a small filesystem containing a symbolic link
7090 to a subdirectory of the invoking user's home directory, and named symbolic
7091 links to users' mailbox files.
7093 The @i{Hlfsd} server finds out the @var{uid} of the process that is
7094 accessing its mount point, and resolves the pathname component @samp{home} as a
7095 symbolic link to a subdirectory within the home directory given by the
7096 @var{uid}'s entry in the password file. If the @var{gid} of the process
7097 that attempts to access a mailbox file is a special one (called
7098 HLFS_GID), then the server maps the name of the @emph{next} pathname
7099 component directly to the user's mailbox. This is necessary so that
7100 access to a mailbox file by users other than the owner can succeed. The
7101 server has safety features in case of failures such as hung filesystems
7102 or home directory filesystems that are inaccessible or full.
7104 On most of our machines, mail gets delivered to the directory
7105 @file{/var/spool/mail}. Many programs, including UAs, depend on that
7106 path. @i{Hlfsd} creates a directory @file{/mail}, and mounts itself on
7107 top of that directory. @i{Hlfsd} implements the path name component
7108 called @samp{home}, pointing to a subdirectory of the user's home directory.
7109 We have made @file{/var/spool/mail} a symbolic link to
7110 @file{/mail/home}, so that accessing @file{/var/spool/mail} actually
7111 causes access to a subdirectory within a user's home directory.
7113 The following table shows an example of how resolving the pathname
7114 @file{/var/mail/@i{NAME}} to @file{/users/ezk/.mailspool/@i{NAME}} proceeds.
7116 @multitable {Resolving Component} {Pathname left to resolve} {Value if symbolic link}
7118 @item @b{Resolving Component}
7119 @tab @b{Pathname left to resolve}
7120 @tab @b{Value if symbolic link}
7123 @tab @t{var/mail/}@i{NAME}
7126 @tab @t{mail/}@i{NAME}
7129 @tab @t{/mail/home/}@i{NAME}
7130 @tab @t{mail}@@ -> @t{/mail/home}
7133 @tab @t{mail/home/}@i{NAME}
7136 @tab @t{home/}@i{NAME}
7140 @tab @t{home}@@ -> @t{/users/ezk/.mailspool}
7143 @tab @t{users/ezk/.mailspool/}@i{NAME}
7146 @tab @t{ezk/.mailspool/}@i{NAME}
7149 @tab @t{.mailspool/}@i{NAME}
7151 @item @t{.mailspool/}
7158 @c ================================================================
7159 @node Background to Mail Delivery, Using Hlfsd, Introduction to Hlfsd, Hlfsd
7160 @comment node-name, next, previous, up
7161 @section Background to Mail Delivery
7162 @cindex Background to Mail Delivery
7163 @cindex Hlfsd; background
7165 This section provides an in-depth discussion of why available methods
7166 for delivering mail to home directories are not as good as the one used
7170 * Single-Host Mail Spool Directory::
7171 * Centralized Mail Spool Directory::
7172 * Distributed Mail Spool Service::
7173 * Why Deliver Into the Home Directory?::
7176 @c ----------------------------------------------------------------
7177 @node Single-Host Mail Spool Directory, Centralized Mail Spool Directory, Background to Mail Delivery, Background to Mail Delivery
7178 @comment node-name, next, previous, up
7179 @subsection Single-Host Mail Spool Directory
7180 @cindex Single-Host Mail Spool Directory
7182 The most common method for mail delivery is for mail to be appended to a
7183 mailbox file in a standard spool directory on the designated ``mail
7184 home'' machine of the user. The greatest advantage of this method is
7185 that it is the default method most vendors provide with their systems,
7186 thus very little (if any) configuration is required on the SA's part.
7187 All they need to set up are mail aliases directing mail to the host on
7188 which the user's mailbox file is assigned. (Otherwise, mail is
7189 delivered locally, and users find mailboxes on many machines.)
7191 As users become more sophisticated, and aided by windowing systems, they
7192 find themselves logging in on multiple hosts at once, performing several
7193 tasks concurrently. They ask to be able to read their mail on any host
7194 on the network, not just the one designated as their ``mail home''.
7196 @c ----------------------------------------------------------------
7197 @node Centralized Mail Spool Directory, Distributed Mail Spool Service, Single-Host Mail Spool Directory, Background to Mail Delivery
7198 @comment node-name, next, previous, up
7199 @subsection Centralized Mail Spool Directory
7200 @cindex Centralized Mail Spool Directory
7202 A popular method for providing mail readability from any host is to have
7203 all mail delivered to a mail spool directory on a designated
7204 ``mail-server'' which is exported via NFS to all of the hosts on the
7205 network. Configuring such a system is relatively easy. On most
7206 systems, the bulk of the work is a one-time addition to one or two
7207 configuration files in @file{/etc}. The file-server's spool directory
7208 is then hard-mounted across every machine on the local network. In
7209 small environments with only a handful of hosts this can be an
7210 acceptable solution. In our department, with a couple of hundred active
7211 hosts and thousands of mail messages processed daily, this was deemed
7212 completely unacceptable, as it introduced several types of problems:
7216 @item Scalability and Performance
7218 As more and more machines get added to the network, more mail traffic
7219 has to go over NFS to and from the mail-server. Users like to run
7220 mail-watchers, and read their mail often. The stress on the shared
7221 infrastructure increases with every user and host added; loads on the
7222 mail server would most certainly be high since all mail delivery goes
7223 through that one machine.@footnote{ Delivery via NFS-mounted filesystems
7224 may require usage of @samp{rpc.lockd} and @samp{rpc.statd} to provide
7225 distributed file-locking, both of which are widely regarded as unstable
7226 and unreliable. Furthermore, this will degrade performance, as local
7227 processes as well as remote @samp{nfsd} processes are kept busy.} This
7228 leads to lower reliability and performance. To reduce the number of
7229 concurrent connections between clients and the server host, some SAs
7230 have resorted to automounting the mail-spool directory. But this
7231 solution only makes things worse: since users often run mail watchers,
7232 and many popular applications such as @samp{trn}, @samp{emacs},
7233 @samp{csh} or @samp{ksh} check periodically for new mail, the
7234 automounted directory would be effectively permanently mounted. If it
7235 gets unmounted automatically by the automounter program, it is most
7236 likely to get mounted shortly afterwards, consuming more I/O resources
7237 by the constant cycle of mount and umount calls.
7241 The mail-server host and its network connectivity must be very reliable.
7242 Worse, since the spool directory has to be hard-mounted,@footnote{No SA
7243 in their right minds would soft-mount read/write partitions --- the
7244 chances for data loss are too great.} many processes which access the
7245 spool directory (various shells, @samp{login}, @samp{emacs}, etc.)
7246 would be hung as long as connectivity to the mail-server is severed. To
7247 improve reliability, SAs may choose to backup the mail-server's spool
7248 partition several times a day. This may make things worse since reading
7249 or delivering mail while backups are in progress may cause backups to be
7250 inconsistent; more backups consume more backup-media resources, and
7251 increase the load on the mail-server host.
7255 @c ----------------------------------------------------------------
7256 @node Distributed Mail Spool Service, Why Deliver Into the Home Directory?, Centralized Mail Spool Directory, Background to Mail Delivery
7257 @comment node-name, next, previous, up
7258 @subsection Distributed Mail Spool Service
7259 @cindex Distributed Mail Spool Service
7261 Despite the existence of a few systems that support delivery to users'
7262 home directories, mail delivery to home directories hasn't caught on.
7263 We believe the main reason is that there are too many programs that
7264 ``know'' where mailbox files reside. Besides the obvious (the delivery
7265 program @file{/bin/mail} and mail readers like @file{/usr/ucb/Mail},
7266 @samp{mush}, @samp{mm}, etc.), other programs that know mailbox location
7267 are login, from, almost every shell, @samp{xbiff}, @samp{xmailbox}, and
7268 even some programs not directly related to mail, such as @samp{emacs}
7269 and @samp{trn}. Although some of these programs can be configured to
7270 look in different directories with the use of environment variables and
7271 other resources, many of them cannot. The overall porting work is
7274 Other methods that have yet to catch on require the use of a special
7275 mail-reading server, such as IMAP or POP. The main disadvantage of
7276 these systems is that UAs need to be modified to use these services ---
7277 a long and involved task. That is why they are not popular at this
7280 Several other ideas have been proposed and even used in various
7281 environments. None of them is robust. They are mostly very
7282 specialized, inflexible, and do not extend to the general case. Some of
7283 the ideas are plain bad, potentially leading to lost or corrupt mail:
7289 Using an automounter such as @i{Amd} to provide a set of symbolic links
7290 from the normal spool directory to user home directories is not
7291 sufficient. UAs rename, unlink, and recreate the mailbox as a regular
7292 file, therefore it must be a real file, not a symbolic link.
7293 Furthermore, it must reside in a real directory which is writable by the
7294 UAs and MTAs. This method may also require populating
7295 @file{/var/spool/mail} with symbolic links and making sure they are
7296 updated. Making @i{Amd} manage that directory directly fails, since
7297 many various lock files need to be managed as well. Also, @i{Amd} does
7298 not provide all of the NFS operations which are required to write mail
7299 such as write, create, remove, and unlink.
7303 Setting this variable to an automounted directory pointing to the user's
7304 mail spool host only solves the problem for those programs which know
7305 and use @code{$MAIL}. Many programs don't, therefore this solution is partial
7306 and of limited flexibility. Also, it requires the SAs or the users to
7307 set it themselves --- an added level of inconvenience and possible
7312 Using a different mail delivery agent could be the solution. One such
7313 example is @samp{hdmail}. However, @samp{hdmail} still requires
7314 modifying all UAs, the MTA's configuration, installing new daemons, and
7315 changing login scripts. This makes the system less upgradable or
7316 compatible with others, and adds one more complicated system for SAs to
7317 deal with. It is not a complete solution because it still requires each
7318 user have their @code{$MAIL} variable setup correctly, and that every program
7323 @c ----------------------------------------------------------------
7324 @node Why Deliver Into the Home Directory?, , Distributed Mail Spool Service, Background to Mail Delivery
7325 @comment node-name, next, previous, up
7326 @subsection Why Deliver Into the Home Directory?
7327 @cindex Why Deliver Into the Home Directory?
7328 @cindex Hlfsd; Why Deliver Into the Home Directory?
7330 There are several major reasons why SAs might want to deliver mail
7331 directly into the users' home directories:
7337 Many mail readers need to move mail from the spool directory to the
7338 user's home directory. It speeds up this operation if the two are on
7339 the same filesystem. If for some reason the user's home directory is
7340 inaccessible, it isn't that useful to be able to read mail, since there
7341 is no place to move it to. In some cases, trying to move mail to a
7342 non-existent or hung filesystem may result in mail loss.
7346 Having all mail spool directories spread among the many more filesystems
7347 minimizes the chances that complete environments will grind to a halt
7348 when a single server is down. It does increase the chance that there
7349 will be someone who is not able to read their mail when a machine is
7350 down, but that is usually preferred to having no one be able to read
7351 their mail because a centralized mail server is down. The problem of
7352 losing some mail due to the (presumably) higher chances that a user's
7353 machine is down is minimized in HLFS.
7357 Delivering mail to users' home directories has another advantage ---
7358 enhanced security and privacy. Since a shared system mail spool
7359 directory has to be world-readable and searchable, any user can see
7360 whether other users have mail, when they last received new mail, or when
7361 they last read their mail. Programs such as @samp{finger} display this
7362 information, which some consider an infringement of privacy. While it
7363 is possible to disable this feature of @samp{finger} so that remote
7364 users cannot see a mailbox file's status, this doesn't prevent local
7365 users from getting the information. Furthermore, there are more
7366 programs which make use of this information. In shared environments,
7367 disabling such programs has to be done on a system-wide basis, but with
7368 mail delivered to users' home directories, users less concerned with
7369 privacy who do want to let others know when they last received or read
7370 mail can easily do so using file protection bits.
7372 @c Lastly, on systems that do not export their NFS filesystem with
7373 @c @t{anon=0}, superusers are less likely to snoop around others' mail, as
7374 @c they become ``nobodies'' across NFS.
7378 In summary, delivering mail to home directories provides users the
7379 functionality sought, and also avoids most of the problems just
7382 @c ================================================================
7383 @node Using Hlfsd, , Background to Mail Delivery, Hlfsd
7384 @comment node-name, next, previous, up
7385 @section Using Hlfsd
7387 @cindex Hlfsd; using
7390 * Controlling Hlfsd::
7395 @c ----------------------------------------------------------------
7396 @node Controlling Hlfsd, Hlfsd Options, Using Hlfsd, Using Hlfsd
7397 @comment node-name, next, previous, up
7398 @subsection Controlling Hlfsd
7399 @cindex Controlling Hlfsd
7400 @cindex Hlfsd; controlling
7403 Much the same way @i{Amd} is controlled by @file{ctl-amd}, so does
7404 @i{Hlfsd} get controlled by the @file{ctl-hlfsd} script:
7408 @item ctl-hlfsd start
7409 Start a new @i{Hlfsd}.
7411 @item ctl-hlfsd stop
7412 Stop a running @i{Hlfsd}.
7414 @item ctl-hlfsd restart
7415 Stop a running @i{Hlfsd}, wait for 10 seconds, and then start a new
7416 one. It is hoped that within 10 seconds, the previously running
7417 @i{Hlfsd} terminate properly; otherwise, starting a second one could
7418 cause system lockup.
7422 For example, on our systems, we start @i{Hlfsd} within @file{ctl-hlfsd}
7423 as follows on Solaris 2 systems:
7426 hlfsd -a /var/alt_mail -x all -l /var/log/hlfsd /mail/home .mailspool
7429 The directory @file{/var/alt_mail} is a directory in the root partition
7430 where alternate mail will be delivered into, when it cannot be delivered
7431 into the user's home directory.
7433 Normal mail gets delivered into @file{/var/mail}, but on our systems,
7434 that is a symbolic link to @file{/mail/home}. @file{/mail} is managed
7435 by @i{Hlfsd}, which creates a dynamic symlink named @samp{home},
7436 pointing to the subdirectory @file{.mailspool} @emph{within} the
7437 accessing user's home directory. This results in mail which normally
7438 should go to @file{/var/mail/@code{$USER}}, to go to
7439 @file{@code{$HOME}/.mailspool/@code{$USER}}.
7441 @i{Hlfsd} does not create the @file{/var/mail} symlink. This needs to
7442 be created (manually) once on each host, by the system administrators,
7446 mv /var/mail /var/alt_mail
7447 ln -s /mail/home /var/mail
7450 @i{Hlfsd} also responds to the following signals:
7452 A @samp{SIGHUP} signal sent to @i{Hlfsd} will force it to reload the
7453 password map immediately.
7455 A @samp{SIGUSR1} signal sent to @i{Hlfsd} will cause it to dump its
7456 internal password map to the file @file{/usr/tmp/hlfsd.dump.XXXXXX},
7457 where @samp{XXXXXX} will be replaced by a random string generated by
7458 @b{mktemp}(3) or (the more secure) @b{mkstemp}(3).
7460 @c ----------------------------------------------------------------
7461 @node Hlfsd Options, Hlfsd Files, Controlling Hlfsd, Using Hlfsd
7462 @comment node-name, next, previous, up
7463 @subsection Hlfsd Options
7464 @cindex Hlfsd Options
7465 @cindex Hlfsd; Options
7469 @item -a @var{alt_dir}
7470 Alternate directory. The name of the directory to which the symbolic
7471 link returned by @i{Hlfsd} will point, if it cannot access the home
7472 directory of the user. This defaults to @file{/var/hlfs}. This
7473 directory will be created if it doesn't exist. It is expected that
7474 either users will read these files, or the system administrators will
7475 run a script to resend this ``lost mail'' to its owner.
7477 @item -c @var{cache-interval}
7478 Caching interval. @i{Hlfsd} will cache the validity of home directories
7479 for this interval, in seconds. Entries which have been verified within
7480 the last @var{cache-interval} seconds will not be verified again, since
7481 the operation could be expensive, and the entries are most likely still
7482 valid. After the interval has expired, @i{Hlfsd} will re-verify the
7483 validity of the user's home directory, and reset the cache time-counter.
7484 The default value for @var{cache-interval} is 300 seconds (5 minutes).
7487 Force fast startup. This option tells @i{Hlfsd} to skip startup-time
7488 consistency checks such as existence of mount directory, alternate spool
7489 directory, symlink to be hidden under the mount directory, their
7490 permissions and validity.
7492 @item -g @var{group}
7493 Set the special group HLFS_GID to @var{group}. Programs such as
7494 @file{/usr/ucb/from} or @file{/usr/sbin/in.comsat}, which access the
7495 mailboxes of other users, must be setgid @samp{HLFS_GID} to work properly. The
7496 default group is @samp{hlfs}. If no group is provided, and there is no
7497 group @samp{hlfs}, this feature is disabled.
7500 Help. Print a brief help message, and exit.
7502 @item -i @var{reload-interval}
7503 Map-reloading interval. Each @var{reload-interval} seconds, @i{Hlfsd}
7504 will reload the password map. @i{Hlfsd} needs the password map for the
7505 UIDs and home directory pathnames. @i{Hlfsd} schedules a @samp{SIGALRM} to
7506 reload the password maps. A @samp{SIGHUP} sent to @i{Hlfsd} will force it to
7507 reload the maps immediately. The default value for
7508 @var{reload-interval} is 900 seconds (15 minutes.)
7510 @item -l @var{logfile}
7511 Specify a log file to which @i{Hlfsd} will record events. If
7512 @var{logfile} is the string @samp{syslog} then the log messages will be
7513 sent to the system log daemon by @b{syslog}(3), using the @samp{LOG_DAEMON}
7514 facility. This is also the default.
7517 No verify. @i{Hlfsd} will not verify the validity of the symbolic link
7518 it will be returning, or that the user's home directory contains
7519 sufficient disk-space for spooling. This can speed up @i{Hlfsd} at the
7520 cost of possibly returning symbolic links to home directories which are
7521 not currently accessible or are full. By default, @i{Hlfsd} validates
7522 the symbolic-link in the background. The @code{-n} option overrides the
7523 meaning of the @code{-c} option, since no caching is necessary.
7525 @item -o @var{mount-options}
7526 Mount options which @i{Hlfsd} will use to mount itself on top of
7527 @var{dirname}. By default, @var{mount-options} is set to @samp{ro}. If
7528 the system supports symbolic-link caching, default options are set
7529 to @samp{ro,nocache}.
7532 Print PID. Outputs the process-id of @i{Hlfsd} to standard output where
7533 it can be saved into a file.
7536 Version. Displays version information to standard error.
7538 @item -x @var{log-options}
7539 Specify run-time logging options. The options are a comma separated
7540 list chosen from: @samp{fatal}, @samp{error}, @samp{user}, @samp{warn}, @samp{info}, @samp{map}, @samp{stats}, @samp{all}.
7543 Force @i{Hlfsd} to run on systems that cannot turn off the NFS
7544 attribute-cache. Use of this option on those systems is discouraged, as
7545 it may result in loss or misdelivery of mail. The option is ignored on
7546 systems that can turn off the attribute-cache.
7548 @item -D @var{log-options}
7549 Select from a variety of debugging options. Prefixing an option with
7550 the string @samp{no} reverses the effect of that option. Options are
7551 cumulative. The most useful option is @samp{all}. Since this option is
7552 only used for debugging other options are not documented here. A fuller
7553 description is available in the program source.
7555 @item -P @var{password-file}
7556 Read the user-name, user-id, and home directory information from the
7557 file @var{password-file}. Normally, @i{Hlfsd} will use @b{getpwent}(3)
7558 to read the password database. This option allows you to override the
7559 default database, and is useful if you want to map users' mail files to
7560 a directory other than their home directory. Only the username, uid,
7561 and home-directory fields of the file @var{password-file} are read and
7562 checked. All other fields are ignored. The file @var{password-file}
7563 must otherwise be compliant with Unix Version 7 colon-delimited format
7568 @c ----------------------------------------------------------------
7569 @node Hlfsd Files, , Hlfsd Options, Using Hlfsd
7570 @comment node-name, next, previous, up
7571 @subsection Hlfsd Files
7573 @cindex Hlfsd; Files
7575 The following files are used by @i{Hlfsd}:
7580 directory under which @i{Hlfsd} mounts itself and manages the symbolic
7584 default sub-directory in the user's home directory, to which the
7585 @file{home} symbolic link returned by @i{Hlfsd} points.
7588 directory to which @file{home} symbolic link returned by @i{Hlfsd}
7589 points if it is unable to verify the that user's home directory is
7592 @item /usr/tmp/hlfsd.dump.XXXXXX
7593 file to which @i{Hlfsd} will dump its internal password map when it
7594 receives the @samp{SIGUSR1} signal. @samp{XXXXXX} will be replaced by
7595 a random string generated by @b{mktemp}(3) or (the more secure)
7600 For discussion on other files used by @i{Hlfsd}, see @xref{lostaltmail}, and
7601 @ref{lostaltmail.conf-sample}.
7603 @c ################################################################
7604 @node Assorted Tools, Examples, Hlfsd, Top
7605 @comment node-name, next, previous, up
7606 @chapter Assorted Tools
7607 @cindex Assorted Tools
7609 The following are additional utilities and scripts included with
7610 am-utils, and get installed.
7625 * lostaltmail.conf-sample::
7634 @c ----------------------------------------------------------------
7635 @node am-eject, amd.conf-sample, Assorted Tools, Assorted Tools
7636 @comment node-name, next, previous, up
7640 A shell script unmounts a floppy or CD-ROM that is automounted, and
7641 then attempts to eject the removable device.
7643 @c ----------------------------------------------------------------
7644 @node amd.conf-sample, amd2ldif, am-eject, Assorted Tools
7645 @comment node-name, next, previous, up
7646 @section amd.conf-sample
7647 @pindex amd.conf-sample
7649 A sample @i{Amd} configuration file. @xref{Amd Configuration File}.
7651 @c ----------------------------------------------------------------
7652 @node amd2ldif, amd2sun, amd.conf-sample, Assorted Tools
7653 @comment node-name, next, previous, up
7657 A script to convert @i{Amd} maps to LDAP input files. Use it as follows:
7660 amd2ldif @i{mapname} @i{base} < @i{amd.mapfile} > @i{mapfile.ldif}
7663 @c ----------------------------------------------------------------
7664 @node amd2sun, automount2amd, amd2ldif, Assorted Tools
7665 @comment node-name, next, previous, up
7669 A script to convert @i{Amd} maps to Sun Automounter maps. Use it as
7673 amd2sun < @i{amd.mapfile} > @i{auto_mapfile}
7676 @c ----------------------------------------------------------------
7677 @node automount2amd, ctl-amd, amd2sun, Assorted Tools
7678 @comment node-name, next, previous, up
7679 @section automount2amd
7680 @pindex automount2amd
7682 A script to convert old Sun Automounter maps to @i{Amd} maps.
7684 Say you have the Sun automount file @i{auto.foo}, with these two lines:
7687 moon -ro,intr server:/proj/images
7691 automount2amd auto.foo > amd.foo
7694 will produce the @i{Amd} map @i{amd.foo} with this content:
7697 # generated by automount2amd on Sat Aug 14 17:59:32 US/Eastern 1999
7700 type:=nfs;opts:=rw,grpid,nosuid,utimeout=600
7703 host==earth;type:=link;fs:=/home \\
7704 rhost:=earth;rfs:=/home
7707 -addopts:=ro,intr \\
7708 host==server;type:=link;fs:=/proj/images \\
7709 rhost:=server;rfs:=/proj/images
7712 This perl script will use the following @i{/default} entry
7714 type:=nfs;opts:=rw,grpid,nosuid,utimeout=600
7716 If you wish to override that, define the @b{$DEFAULTS} environment
7717 variable, or modify the script.
7719 If you wish to generate Amd maps using the @i{hostd} (@pxref{hostd
7720 Selector Variable}) @i{Amd} map syntax, then define the environment
7721 variable @b{$DOMAIN} or modify the script.
7723 Note that automount2amd does not understand the syntax in newer Sun
7724 Automount maps, those used with autofs.
7726 @c ----------------------------------------------------------------
7727 @node ctl-amd, ctl-hlfsd, automount2amd, Assorted Tools
7728 @comment node-name, next, previous, up
7732 A script to start, stop, or restart @i{Amd}. Use it as follows:
7736 Start a new @i{Amd} process.
7738 Stop the running @i{Amd}.
7739 @item ctl-amd restart
7740 Stop the running @i{Amd} (if any), safely wait for it to terminate, and
7741 then start a new process --- only if the previous one died cleanly.
7744 @xref{Run-time Administration}, for more details.
7746 @c ----------------------------------------------------------------
7747 @node ctl-hlfsd, expn, ctl-amd, Assorted Tools
7748 @comment node-name, next, previous, up
7752 A script for controlling @i{Hlfsd}, much the same way @file{ctl-amd}
7753 controls @i{Amd}. Use it as follows:
7756 @item ctl-hlfsd start
7757 Start a new @i{Hlfsd} process.
7758 @item ctl-hlfsd stop
7759 Stop the running @i{Hlfsd}.
7760 @item ctl-hlfsd restart
7761 Stop the running @i{Hlfsd} (if any), wait for 10 seconds for it to
7762 terminate, and then start a new process --- only if the previous one
7766 @xref{Hlfsd}, for more details.
7768 @c ----------------------------------------------------------------
7769 @node expn, fix-amd-map, ctl-hlfsd, Assorted Tools
7770 @comment node-name, next, previous, up
7774 A script to expand email addresses into their full name. It is
7775 generally useful when using with the @file{lostaltmail} script, but is a
7776 useful tools otherwise.
7779 $ expn -v ezk@@example.com
7781 ezk@@shekel.example.com
7782 ezk@@shekel.example.com ->
7783 Erez Zadok <"| /usr/local/mh/lib/slocal -user ezk || exit 75>
7785 Erez Zadok </u/zing/ezk/.mailspool/backup>
7788 @c ----------------------------------------------------------------
7789 @node fix-amd-map, fixmount, expn, Assorted Tools
7790 @comment node-name, next, previous, up
7791 @section fix-amd-map
7794 Am-utils changed some of the syntax and default values of some
7795 variables. For example, the default value for @samp{$@{os@}} for
7796 Solaris 2.x (aka SunOS 5.x) systems used to be @samp{sos5}, it is now
7797 more automatically generated from @file{config.guess} and its value is
7800 This script converts older @i{Amd} maps to new ones. Use it as follows:
7803 fix-amd-map < @i{old.map} > @i{new.map}
7806 @c ----------------------------------------------------------------
7807 @node fixmount, fixrmtab, fix-amd-map, Assorted Tools
7808 @comment node-name, next, previous, up
7812 @samp{fixmount} is a variant of @b{showmount}(8) that can delete bogus
7813 mount entries in remote @b{mountd}(8) daemons. This is useful to
7814 cleanup otherwise ever-accumulating ``junk''. Use it for example:
7817 fixmount -r @i{host}
7820 See the online manual page for @samp{fixmount} for more details of its
7823 @c ----------------------------------------------------------------
7824 @node fixrmtab, lostaltmail, fixmount, Assorted Tools
7825 @comment node-name, next, previous, up
7829 A script to invalidate @file{/etc/rmtab} entries for hosts named. Also
7830 restart mountd for changes to take effect. Use it for example:
7833 fixrmtab @i{host1} @i{host2} @i{...}
7836 @c ----------------------------------------------------------------
7837 @node lostaltmail, lostaltmail.conf-sample, fixrmtab, Assorted Tools
7838 @comment node-name, next, previous, up
7839 @section lostaltmail
7842 A script used with @i{Hlfsd} to resend any ``lost'' mail. @i{Hlfsd}
7843 redirects mail which cannot be written into the user's home directory to
7844 an alternate directory. This is useful to continue delivering mail,
7845 even if the user's file system was unavailable, full, or over quota.
7846 But, the mail which gets delivered to the alternate directory needs to
7847 be resent to its respective users. This is what the @samp{lostaltmail}
7856 This script needs a configuration file @samp{lostaltmail.conf} set up
7857 with the right parameters to properly work. @xref{Hlfsd}, for more
7860 @c ----------------------------------------------------------------
7861 @node lostaltmail.conf-sample, mk-amd-map, lostaltmail, Assorted Tools
7862 @comment node-name, next, previous, up
7863 @section lostaltmail.conf-sample
7864 @pindex lostaltmail.conf-sample
7865 @cindex lostaltmail; configuration file
7867 This is a text file with configuration parameters needed for the
7868 @samp{lostaltmail} script. The script includes comments explaining each
7869 of the configuration variables. See it for more information. Also
7870 @pxref{Hlfsd} for general information.
7872 @c ----------------------------------------------------------------
7873 @node mk-amd-map, pawd, lostaltmail.conf-sample, Assorted Tools
7874 @comment node-name, next, previous, up
7878 This program converts a normal @i{Amd} map file into an ndbm database
7879 with the same prefix as the named file. Use it as follows:
7882 mk-amd-map @i{mapname}
7885 @c ----------------------------------------------------------------
7886 @node pawd, redhat-ctl-amd, mk-amd-map, Assorted Tools
7887 @comment node-name, next, previous, up
7891 @i{Pawd} is used to print the current working directory, adjusted to
7892 reflect proper paths that can be reused to go through the automounter
7893 for the shortest possible path. In particular, the path printed back
7894 does not include any of @i{Amd}'s local mount points. Using them is
7895 unsafe, because @i{Amd} may unmount managed file systems from the mount
7896 points, and thus including them in paths may not always find the files
7899 Without any arguments, @i{Pawd} will print the automounter adjusted
7900 current working directory. With any number of arguments, it will print
7901 the adjusted path of each one of the arguments.
7903 @c ----------------------------------------------------------------
7904 @node redhat-ctl-amd, wait4amd, pawd, Assorted Tools
7905 @comment node-name, next, previous, up
7906 @section redhat-ctl-amd
7907 @pindex redhat-ctl-amd
7909 This script is similar to @i{ctl-amd} (@pxref{ctl-amd}) but is intended
7910 for Red Hat Linux systems. You can safely copy @i{redhat-ctl-amd} onto
7911 @file{/etc/rc.d/init.d/amd}. The script supplied by @i{Am-utils} is
7912 usually better than the one provided by Red Hat, because the Red Hat
7913 script does not correctly kill @i{Amd} processes: it is too quick to
7914 kill the wrong processes, leaving stale or hung mount points behind.
7916 @c ----------------------------------------------------------------
7917 @node wait4amd, wait4amd2die, redhat-ctl-amd, Assorted Tools
7918 @comment node-name, next, previous, up
7922 A script to wait for @i{Amd} to start on a particular host before
7923 performing an arbitrary command. The command is executed repeatedly,
7924 with 1 second intervals in between. You may interrupt the script using
7925 @samp{^C} (or whatever keyboard sequence your terminal's @samp{intr} function
7931 @item wait4amd saturn amq -p -h saturn
7932 When @i{Amd} is up on host @samp{saturn}, get the process ID of that
7934 @item wait4amd pluto rlogin pluto
7935 Remote login to host @samp{pluto} when @i{Amd} is up on that host. It
7936 is generally necessary to wait for @i{Amd} to properly start and
7937 initialize on a remote host before logging in to it, because otherwise
7938 user home directories may not be accessible across the network.
7939 @item wait4amd pluto
7940 A short-hand version of the previous command, since the most useful
7941 reason for this script is to login to a remote host. I use it very
7942 often when testing out new versions of @i{Amd}, and need to reboot hung
7946 @c ----------------------------------------------------------------
7947 @node wait4amd2die, wire-test, wait4amd, Assorted Tools
7948 @comment node-name, next, previous, up
7949 @section wait4amd2die
7950 @pindex wait4amd2die
7952 This script is used internally by @samp{ctl-amd} when used to restart
7953 @i{Amd}. It waits for @i{Amd} to terminate. If it detected that
7954 @i{Amd} terminated cleanly, this script will return an exist status of
7955 zero. Otherwise, it will return a non-zero exit status.
7957 The script tests for @i{Amd}'s existence once every 5 seconds, six
7958 times, for a total of 30 seconds. It will return a zero exist status as
7959 soon as it detects that @i{Amd} dies.
7961 @c ----------------------------------------------------------------
7962 @node wire-test, , wait4amd2die, Assorted Tools
7963 @comment node-name, next, previous, up
7967 A simple program to test if some of the most basic networking functions
7968 in am-util's library @file{libamu} work. It also tests the combination
7969 of NFS protocol and version number that are supported from the current
7970 host, to a remote one.
7972 For example, in this test a machine which only supports NFS Version 2 is
7973 contacting a remote host that can support the same version, but using
7974 both UDP and TCP. If no host name is specified, @samp{wire-test} will
7975 try @file{localhost}.
7979 Network name is "mcl-lab-net.cs.columbia.edu"
7980 Network number is "128.59.13"
7981 Network name is "old-net.cs.columbia.edu"
7982 Network number is "128.59.16"
7983 My IP address is 0x7f000001.
7984 NFS Version and protocol tests to host "moisil"...
7985 testing vers=2, proto="udp" -> found version 2.
7986 testing vers=3, proto="udp" -> failed!
7987 testing vers=2, proto="tcp" -> found version 2.
7988 testing vers=3, proto="tcp" -> failed!
7991 @c ################################################################
7992 @node Examples, Internals, Assorted Tools, Top
7993 @comment node-name, next, previous, up
7997 * User Filesystems::
7998 * Home Directories::
7999 * Architecture Sharing::
8003 * /defaults with selectors::
8004 * /tftpboot in a chroot-ed environment::
8008 @node User Filesystems, Home Directories, Examples, Examples
8009 @comment node-name, next, previous, up
8010 @section User Filesystems
8011 @cindex User filesystems
8012 @cindex Mounting user filesystems
8014 With more than one fileserver, the directories most frequently
8015 cross-mounted are those containing user home directories. A common
8016 convention used at Imperial College is to mount the user disks under
8017 @t{/home/}@i{machine}.
8019 Typically, the @samp{/etc/fstab} file contained a long list of entries
8023 @i{machine}:/home/@i{machine} /home/@i{machine} nfs ...
8026 for each fileserver on the network.
8028 There are numerous problems with this system. The mount list can become
8029 quite large and some of the machines may be down when a system is
8030 booted. When a new fileserver is installed, @samp{/etc/fstab} must be
8031 updated on every machine, the mount directory created and the filesystem
8034 In many environments most people use the same few workstations, but
8035 it is convenient to go to a colleague's machine and access your own
8036 files. When a server goes down, it can cause a process on a client
8037 machine to hang. By minimizing the mounted filesystems to only include
8038 those actively being used, there is less chance that a filesystem will
8039 be mounted when a server goes down.
8041 The following is a short extract from a map taken from a research fileserver
8042 at Imperial College.
8044 Note the entry for @samp{localhost} which is used for users such as
8045 the operator (@samp{opr}) who have a home directory on most machine as
8046 @samp{/home/localhost/opr}.
8049 /defaults opts:=rw,intr,grpid,nosuid
8050 charm host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \
8051 host==$@{key@};type:=ufs;dev:=/dev/xd0g
8056 localhost type:=link;fs:=$@{host@}
8059 # dylan has two user disks so have a
8060 # top directory in which to mount them.
8062 dylan type:=auto;fs:=$@{map@};pref:=$@{key@}/
8064 dylan/dk2 host!=dylan;type:=nfs;rhost:=dylan;rfs:=/home/$@{key@} \
8065 host==dylan;type:=ufs;dev:=/dev/dsk/2s0
8067 dylan/dk5 host!=dylan;type:=nfs;rhost:=dylan;rfs:=/home/$@{key@} \
8068 host==dylan;type:=ufs;dev:=/dev/dsk/5s0
8071 toytown host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \
8072 host==$@{key@};type:=ufs;dev:=/dev/xy1g
8075 zebedee host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \
8076 host==$@{key@};type:=ufs;dev:=/dev/dsk/1s0
8078 # Just for access...
8080 gould type:=auto;fs:=$@{map@};pref:=$@{key@}/
8081 gould/staff host!=gould;type:=nfs;rhost:=gould;rfs:=/home/$@{key@}
8083 gummo host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@}
8087 This map is shared by most of the machines listed so on those
8088 systems any of the user disks is accessible via a consistent name.
8089 @i{Amd} is started with the following command
8095 Note that when mounting a remote filesystem, the @dfn{automounted}
8096 mount point is referenced, so that the filesystem will be mounted if
8097 it is not yet (at the time the remote @samp{mountd} obtains the file handle).
8099 @node Home Directories, Architecture Sharing, User Filesystems, Examples
8100 @comment node-name, next, previous, up
8101 @section Home Directories
8102 @cindex Home directories
8103 @cindex Example of mounting home directories
8104 @cindex Mount home directories
8106 One convention for home directories is to locate them in @samp{/homes}
8107 so user @samp{jsp}'s home directory is @samp{/homes/jsp}. With more
8108 than a single fileserver it is convenient to spread user files across
8109 several machines. All that is required is a mount-map which converts
8110 login names to an automounted directory.
8112 Such a map might be started by the command:
8115 amd /homes amd.homes
8118 where the map @samp{amd.homes} contained the entries:
8121 /defaults type:=link # All the entries are of type:=link
8122 jsp fs:=/home/charm/jsp
8123 njw fs:=/home/dylan/dk5/njw
8125 phjk fs:=/home/toytown/ai/phjk
8126 sjv fs:=/home/ganymede/sjv
8129 Whenever a login name is accessed in @samp{/homes} a symbolic link
8130 appears pointing to the real location of that user's home directory. In
8131 this example, @samp{/homes/jsp} would appear to be a symbolic link
8132 pointing to @samp{/home/charm/jsp}. Of course, @samp{/home} would also
8133 be an automount point.
8135 This system causes an extra level of symbolic links to be used.
8136 Although that turns out to be relatively inexpensive, an alternative is
8137 to directly mount the required filesystems in the @samp{/homes}
8138 map. The required map is simple, but long, and its creation is best automated.
8139 The entry for @samp{jsp} could be:
8142 jsp -sublink:=$@{key@};rfs:=/home/charm \
8143 host==charm;type:=ufs;dev:=/dev/xd0g \
8144 host!=charm;type:=nfs;rhost:=charm
8147 This map can become quite big if it contains a large number of entries.
8148 By combining two other features of @i{Amd} it can be greatly simplified.
8150 First the UFS partitions should be mounted under the control of
8151 @samp{/etc/fstab}, taking care that they are mounted in the same place
8152 that @i{Amd} would have automounted them. In most cases this would be
8153 something like @samp{/a/@dfn{host}/home/@dfn{host}} and
8154 @samp{/etc/fstab} on host @samp{charm} would have a line:@refill
8157 /dev/xy0g /a/charm/home/charm 4.2 rw,nosuid,grpid 1 5
8160 The map can then be changed to:
8163 /defaults type:=nfs;sublink:=$@{key@};opts:=rw,intr,nosuid,grpid
8164 jsp rhost:=charm;rfs:=/home/charm
8165 njw rhost:=dylan;rfs:=/home/dylan/dk5
8167 phjk rhost:=toytown;rfs:=/home/toytown;sublink:=ai/$@{key@}
8168 sjv rhost:=ganymede;rfs:=/home/ganymede
8171 This map operates as usual on a remote machine (@i{ie} @code{$@{host@}}
8172 not equal to @code{$@{rhost@}}). On the machine where the filesystem is
8173 stored (@i{ie} @code{$@{host@}} equal to @code{$@{rhost@}}), @i{Amd}
8174 will construct a local filesystem mount point which corresponds to the
8175 name of the locally mounted UFS partition. If @i{Amd} is started with
8176 the @code{-r} option then instead of attempting an NFS mount, @i{Amd} will
8177 simply inherit the UFS mount (@pxref{Inheritance Filesystem}). If
8178 @code{-r} is not used then a loopback NFS mount will be made. This type of
8179 mount is known to cause a deadlock on many systems.
8181 @node Architecture Sharing, Wildcard Names, Home Directories, Examples
8182 @comment node-name, next, previous, up
8183 @section Architecture Sharing
8184 @cindex Architecture sharing
8185 @cindex Sharing a fileserver between architectures
8186 @cindex Architecture dependent volumes
8188 @c %At the moment some of the research machines have sets of software
8189 @c %mounted in @samp{/vol}. This contains subdirectories for \TeX,
8190 @c %system sources, local sources, prolog libraries and so on.
8191 Often a filesystem will be shared by machines of different architectures.
8192 Separate trees can be maintained for the executable images for each
8193 architecture, but it may be more convenient to have a shared tree,
8194 with distinct subdirectories.
8196 A shared tree might have the following structure on the fileserver (called
8197 @samp{fserver} in the example):
8206 local/tex/bin/hp9000
8210 In this example, the subdirectories of @samp{local/tex/bin} should be
8211 hidden when accessed via the automount point (conventionally @samp{/vol}).
8212 A mount-map for @samp{/vol} to achieve this would look like:
8215 /defaults sublink:=$@{/key@};rhost:=fserver;type:=link
8216 tex type:=auto;fs:=$@{map@};pref:=$@{key@}/
8217 tex/fonts host!=fserver;type:=nfs;rfs:=/vol/tex \
8218 host==fserver;fs:=/usr/local/tex
8219 tex/lib host!=fserver;type:=nfs;rfs:=/vol/tex \
8220 host==fserver;fs:=/usr/local/tex
8221 tex/bin -sublink:=$@{/key@}/$@{arch@} \
8222 host!=fserver;type:=nfs;rfs:=/vol/tex \
8223 host:=fserver;fs:=/usr/local/tex
8226 When @samp{/vol/tex/bin} is referenced, the current machine architecture
8227 is automatically appended to the path by the @code{$@{sublink@}}
8228 variable. This means that users can have @samp{/vol/tex/bin} in their
8229 @samp{PATH} without concern for architecture dependencies.
8231 @node Wildcard Names, rwho servers, Architecture Sharing, Examples
8232 @comment node-name, next, previous, up
8233 @section Wildcard Names & Replicated Servers
8235 By using the wildcard facility, @i{Amd} can @dfn{overlay} an existing
8236 directory with additional entries.
8237 The system files are usually mounted under @samp{/usr}. If instead,
8238 @i{Amd} is mounted on @samp{/usr}, additional
8239 names can be overlayed to augment or replace names in the ``master'' @samp{/usr}.
8240 A map to do this would have the form:
8243 local type:=auto;fs:=local-map
8244 share type:=auto;fs:=share-map
8245 * -type:=nfs;rfs:=/export/exec/$@{arch@};sublink:="$@{key@}" \
8246 rhost:=fserv1 rhost:=fserv2 rhost:=fserv3
8249 Note that the assignment to @code{$@{sublink@}} is surrounded by double
8250 quotes to prevent the incoming key from causing the map to be
8251 misinterpreted. This map has the effect of directing any access to
8252 @samp{/usr/local} or @samp{/usr/share} to another automount point.
8254 In this example, it is assumed that the @samp{/usr} files are replicated
8255 on three fileservers: @samp{fserv1}, @samp{fserv2} and @samp{fserv3}.
8256 For any references other than to @samp{local} and @samp{share} one of
8257 the servers is used and a symbolic link to
8258 @t{$@{autodir@}/$@{rhost@}/export/exec/$@{arch@}/@i{whatever}} is
8259 returned once an appropriate filesystem has been mounted.@refill
8261 @node rwho servers, /vol, Wildcard Names, Examples
8262 @comment node-name, next, previous, up
8263 @section @samp{rwho} servers
8264 @cindex rwho servers
8265 @cindex Architecture specific mounts
8266 @cindex Example of architecture specific mounts
8268 The @samp{/usr/spool/rwho} directory is a good candidate for automounting.
8269 For efficiency reasons it is best to capture the rwho data on a small
8270 number of machines and then mount that information onto a large number
8271 of clients. The data written into the rwho files is byte order dependent
8272 so only servers with the correct byte ordering can be used by a client:
8276 usr/spool/rwho -byte==little;rfs:=/usr/spool/rwho \
8277 rhost:=vaxA rhost:=vaxB \
8278 || -rfs:=/usr/spool/rwho \
8279 rhost:=sun4 rhost:=hp300
8282 @node /vol, /defaults with selectors, rwho servers, Examples
8283 @comment node-name, next, previous, up
8284 @section @samp{/vol}
8286 @cindex Catch-all mount point
8287 @cindex Generic volume name
8289 @samp{/vol} is used as a catch-all for volumes which do not have other
8292 Below is part of the @samp{/vol} map for the domain @samp{doc.ic.ac.uk}.
8293 The @samp{r+d} tree is used for new or experimental software that needs
8294 to be available everywhere without installing it on all the fileservers.
8295 Users wishing to try out the new software then simply include
8296 @samp{/vol/r+d/@{bin,ucb@}} in their path.@refill
8298 The main tree resides on one host @samp{gould.doc.ic.ac.uk}, which has
8299 different @samp{bin}, @samp{etc}, @samp{lib} and @samp{ucb}
8300 sub-directories for each machine architecture. For example,
8301 @samp{/vol/r+d/bin} for a Sun-4 would be stored in the sub-directory
8302 @samp{bin/sun4} of the filesystem @samp{/usr/r+d}. When it was accessed
8303 a symbolic link pointing to @samp{/a/gould/usr/r+d/bin/sun4} would be
8307 /defaults type:=nfs;opts:=rw,grpid,nosuid,intr,soft
8308 wp -opts:=rw,grpid,nosuid;rhost:=charm \
8309 host==charm;type:=link;fs:=/usr/local/wp \
8310 host!=charm;type:=nfs;rfs:=/vol/wp
8313 src -opts:=rw,grpid,nosuid;rhost:=charm \
8314 host==charm;type:=link;fs:=/usr/src \
8315 host!=charm;type:=nfs;rfs:=/vol/src
8317 r+d type:=auto;fs:=$@{map@};pref:=r+d/
8318 # per architecture bin,etc,lib&ucb...
8319 r+d/bin rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
8320 r+d/etc rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
8321 r+d/include rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}
8322 r+d/lib rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
8323 r+d/man rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}
8324 r+d/src rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}
8325 r+d/ucb rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
8327 pictures -opts:=rw,grpid,nosuid;rhost:=thpfs \
8328 host==thpfs;type:=link;fs:=/nbsd/pictures \
8329 host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=pictures
8331 hades -opts:=rw,grpid,nosuid;rhost:=thpfs \
8332 host==thpfs;type:=link;fs:=/nbsd/hades \
8333 host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=hades
8335 bsd -opts:=rw,grpid,nosuid;arch==hp9000;rhost:=thpfs \
8336 host==thpfs;type:=link;fs:=/nbsd/bsd \
8337 host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=bsd
8340 @node /defaults with selectors, /tftpboot in a chroot-ed environment, /vol, Examples
8341 @comment node-name, next, previous, up
8342 @section @samp{/defaults} with selectors
8343 @cindex /defaults with selectors
8344 @cindex selectors on default
8346 It is sometimes useful to have different defaults for a given map. To
8347 achieve this, the @samp{/defaults} entry must be able to process normal
8348 selectors. This feature is turned on by setting
8349 @samp{selectors_in_defaults = yes} in the @file{amd.conf} file.
8350 @xref{selectors_in_defaults Parameter}.
8352 In this example, I set different default NFS mount options for hosts
8353 which are running over a slower network link. By setting a smaller size
8354 for the NFS read and write buffer sizes, you can greatly improve remote
8355 file service performance.
8359 wire==slip-net;opts:=rw,intr,rsize=1024,wsize=1024,timeo=20,retrans=10 \
8360 wire!=slip-net;opts:=rw,intr
8363 @node /tftpboot in a chroot-ed environment, , /defaults with selectors, Examples
8364 @comment node-name, next, previous, up
8365 @section @samp{/tftpboot} in a chroot-ed environment
8366 @cindex /tftpboot in a chroot-ed environment
8367 @cindex chroot; /tftpboot example
8369 In this complex example, we attempt to run an @i{Amd} process
8370 @emph{inside} a chroot-ed environment. @samp{tftpd} (Trivial FTP) is
8371 used to trivially retrieve files used to boot X-Terminals, Network
8372 Printers, Network routers, diskless workstations, and other such
8373 devices. For security reasons, @samp{tftpd} (and also @samp{ftpd})
8374 processes are run using the @b{chroot}(2) system call. This provides an
8375 environment for these processes, where access to any files outside the
8376 directory where the chroot-ed process runs is denied.
8378 For example, if you start @samp{tftpd} on your system with
8381 chroot /tftpboot /usr/sbin/tftpd
8385 then the @samp{tftpd} process will not be able to access any files
8386 outside @file{/tftpboot}. This ensures that no one can retrieve files
8387 such as @file{/etc/passwd} and run password crackers on it.
8389 Since the TFTP service works by broadcast, it is necessary to have at
8390 least one TFTP server running on each subnet. If you have lots of files
8391 that you need to make available for @samp{tftp}, and many subnets, it
8392 could take significant amounts of disk space on each host serving them.
8394 A solution we implemented at Columbia University was to have every host
8395 run @samp{tftpd}, but have those servers retrieve the boot files from
8396 two replicated servers. Those replicated servers have special
8397 partitions dedicated to the many network boot files.
8399 We start @i{Amd} as follows:
8402 amd /tftpboot/.amd amd.tftpboot
8405 That is, @i{Amd} is serving the directory @file{/tftpboot/.amd}. The
8406 @samp{tftp} server runs inside @file{/tftpboot} and is chroot-ed in that
8407 directory too. The @file{amd.tftpboot} map looks like:
8411 # Amd /tftpboot directory -> host map
8414 /defaults opts:=nosuid,ro,intr,soft;fs:=/tftpboot/import;type:=nfs
8416 tp host==lol;rfs:=/n/lol/import/tftpboot;type:=lofs \
8417 host==ober;rfs:=/n/ober/misc/win/tftpboot;type:=lofs \
8418 rhost:=ober;rfs:=/n/ober/misc/win/tftpboot \
8419 rhost:=lol;rfs:=/n/lol/import/tftpboot
8422 To help understand this example, I list a few of the file entries that
8423 are created inside @file{/tftpboot}:
8427 dr-xr-xr-x 2 root 512 Aug 30 23:11 .amd
8428 drwxrwsr-x 12 root 512 Aug 30 08:00 import
8429 lrwxrwxrwx 1 root 33 Feb 27 1997 adminpr.cfg -> ./.amd/tp/hplj/adminpr.cfg
8430 lrwxrwxrwx 1 root 22 Dec 5 1996 tekxp -> ./.amd/tp/xterms/tekxp
8431 lrwxrwxrwx 1 root 1 Dec 5 1996 tftpboot -> .
8434 Here is an explanation of each of the entries listed above:
8439 This is the @i{Amd} mount point. Note that you do not need to run a
8440 separate @i{Amd} process for the TFTP service. The @b{chroot}(2) system
8441 call only protects against file access, but the same process can still
8442 serve files and directories inside and outside the chroot-ed
8443 environment, because @i{Amd} itself was not run in chroot-ed mode.
8446 This is the mount point where @i{Amd} will mount the directories
8447 containing the boot files. The map is designed so that remote
8448 directories will be NFS mounted (even if they are already mounted
8449 elsewhere), and local directories are loopback mounted (since they are
8450 not accessible outside the chroot-ed @file{/tftpboot} directory).
8454 Two manually created symbolic links to directories @emph{inside} the
8455 @i{Amd}-managed directory. The crossing of the component @file{tp} will
8456 cause @i{Amd} to automount one of the remote replicas. Once crossed,
8457 access to files inside proceeds as usual. The @samp{adminpr.cfg} is a
8458 configuration file for an HP Laser-Jet 4si printer, and the @samp{tekxp}
8459 is a directory for Tektronix X-Terminal boot files.
8462 This innocent looking symlink is important. Usually, when devices boot
8463 via the TFTP service, they perform the @samp{get file} command to
8464 retrieve @var{file}. However, some devices assume that @samp{tftpd}
8465 does not run in a chroot-ed environment, but rather ``unprotected'', and
8466 thus use a full pathname for files to retrieve, as in @samp{get
8467 /tftpboot/file}. This symlink effectively strips out the leading
8472 @c ################################################################
8473 @node Internals, Acknowledgments & Trademarks, Examples, Top
8474 @comment node-name, next, previous, up
8477 Note that there are more error and logging messages possible than are
8478 listed here. Most of them are self-explanatory. Refer to the program
8479 sources for more details on the rest.
8485 @node Log Messages, , Internals, Internals
8486 @comment node-name, next, previous, up
8487 @section Log Messages
8489 In the following sections a brief explanation is given of some of the
8490 log messages made by @i{Amd}. Where the message is in @samp{typewriter}
8491 font, it corresponds exactly to the message produced by @i{Amd}. Words
8492 in @dfn{italic} are replaced by an appropriate string. Variables,
8493 @code{$@{@i{var}@}}, indicate that the value of the appropriate variable is
8496 Log messages are either sent directly to a file,
8497 or logged via the @b{syslog}(3) mechanism. @xref{log_file Parameter}.
8498 In either case, entries in the file are of the form:
8500 @i{date-string} @i{hostname} @t{amd[}@i{pid}@t{]} @i{message}
8508 @node Fatal errors, Info messages, Log Messages, Log Messages
8509 @comment node-name, next, previous, up
8510 @subsection Fatal errors
8512 @i{Amd} attempts to deal with unusual events. Whenever it is not
8513 possible to deal with such an error, @i{Amd} will log an appropriate
8514 message and, if it cannot possibly continue, will either exit or abort.
8515 These messages are selected by @samp{-x fatal} on the command line.
8516 When @b{syslog}(3) is being used, they are logged with level
8517 @samp{LOG_FATAL}. Even if @i{Amd} continues to operate it is likely to
8518 remain in a precarious state and should be restarted at the earliest
8523 @item Attempting to inherit not-a-filesystem
8524 The prototype mount point created during a filesystem restart did not
8525 contain a reference to the restarted filesystem. This error ``should
8528 @item Can't bind to domain "@i{NIS-domain}"
8529 A specific NIS domain was requested on the command line, but no server
8530 for that domain is available on the local net.
8532 @item Can't determine IP address of this host (@i{hostname})
8533 When @i{Amd} starts it determines its own IP address. If this lookup
8534 fails then @i{Amd} cannot continue. The hostname it looks up is that
8535 obtained returned by @b{gethostname}(2) system call.
8537 @item Can't find root file handle for @i{automount point}
8538 @i{Amd} creates its own file handles for the automount points. When it
8539 mounts itself as a server, it must pass these file handles to the local
8540 kernel. If the filehandle is not obtainable the mount point is ignored.
8541 This error ``should never happen''.
8543 @item Must be root to mount filesystems (euid = @i{euid})
8544 To prevent embarrassment, @i{Amd} makes sure it has appropriate system
8545 privileges. This amounts to having an euid of 0. The check is made
8546 after argument processing complete to give non-root users a chance to
8547 access the @code{-v} option.
8549 @item No work to do - quitting
8550 No automount points were given on the command line and so there is no
8554 While attempting to malloc some memory, the memory space available to
8555 @i{Amd} was exhausted. This is an unrecoverable error.
8557 @item Out of memory in realloc
8558 While attempting to realloc some memory, the memory space available to
8559 @i{Amd} was exhausted. This is an unrecoverable error.
8561 @item cannot create rpc/udp service
8562 Either the NFS or AMQ endpoint could not be created.
8564 @item gethostname: @i{description}
8565 The @b{gethostname}(2) system call failed during startup.
8567 @item host name is not set
8568 The @b{gethostname}(2) system call returned a zero length host name.
8569 This can happen if @i{Amd} is started in single user mode just after
8572 @item ifs_match called!
8573 An internal error occurred while restarting a pre-mounted filesystem.
8574 This error ``should never happen''.
8576 @item mount_afs: @i{description}
8577 An error occurred while @i{Amd} was mounting itself.
8579 @item run_rpc failed
8580 Somehow the main NFS server loop failed. This error ``should never
8583 @item unable to free rpc arguments in amqprog_1
8584 The incoming arguments to the AMQ server could not be free'ed.
8586 @item unable to free rpc arguments in nfs_program_1
8587 The incoming arguments to the NFS server could not be free'ed.
8589 @item unable to register (AMQ_PROGRAM, AMQ_VERSION, udp)
8590 The AMQ server could not be registered with the local portmapper or the
8591 internal RPC dispatcher.
8593 @item unable to register (NFS_PROGRAM, NFS_VERSION, 0)
8594 The NFS server could not be registered with the internal RPC dispatcher.
8598 XXX: This section needs to be updated
8600 @node Info messages, , Fatal errors, Log Messages
8601 @comment node-name, next, previous, up
8602 @subsection Info messages
8604 @i{Amd} generates information messages to record state changes. These
8605 messages are selected by @samp{-x info} on the command line. When
8606 @b{syslog}(3) is being used, they are logged with level @samp{LOG_INFO}.
8608 The messages listed below can be generated and are in a format suitable
8609 for simple statistical analysis. @dfn{mount-info} is the string
8610 that is displayed by @dfn{Amq} in its mount information column and
8611 placed in the system mount table.
8615 @item "@t{$@{@i{path}@}}" forcibly timed out
8616 An automount point has been timed out by the @i{Amq} command.
8618 @item "@t{$@{@i{path}@}}" has timed out
8619 No access to the automount point has been made within the timeout
8622 @item Filehandle denied for "$@{@i{rhost}@}:$@{@i{rfs}@}"
8623 The mount daemon refused to return a file handle for the requested filesystem.
8625 @item Filehandle error for "$@{@i{rhost}@}:$@{@i{rfs}@}": @i{description}
8626 The mount daemon gave some other error for the requested filesystem.
8628 @item Finishing with status @i{exit-status}
8629 @i{Amd} is about to exit with the given exit status.
8631 @item Re-synchronizing cache for map @t{$@{@i{map}@}}
8632 The named map has been modified and the internal cache is being re-synchronized.
8634 @item file server @t{$@{@i{rhost}@}} is down - timeout of "@t{$@{@i{path}@}}" ignored
8635 An automount point has timed out, but the corresponding file server is
8636 known to be down. This message is only produced once for each mount
8637 point for which the server is down.
8639 @item file server @t{$@{@i{rhost}@}} type nfs is down
8640 An NFS file server that was previously up is now down.
8642 @item file server @t{$@{@i{rhost}@}} type nfs is up
8643 An NFS file server that was previously down is now up.
8645 @item file server @t{$@{@i{rhost}@}} type nfs starts down
8646 A new NFS file server has been referenced and is known to be down.
8648 @item file server @t{$@{@i{rhost}@}} type nfs starts up
8649 A new NFS file server has been referenced and is known to be up.
8651 @item mount of "@t{$@{@i{path}@}}" on @t{$@{@i{fs}@}} timed out
8652 Attempts to mount a filesystem for the given automount point have failed
8653 to complete within 30 seconds.
8655 @item @i{mount-info} mounted fstype @t{$@{@i{type}@}} on @t{$@{@i{fs}@}}
8656 A new file system has been mounted.
8658 @item @i{mount-info} restarted fstype @t{$@{@i{type}@}} on @t{$@{@i{fs}@}}
8659 @i{Amd} is using a pre-mounted filesystem to satisfy a mount request.
8661 @item @i{mount-info} unmounted fstype @t{$@{@i{type}@}} from @t{$@{@i{fs}@}}
8662 A file system has been unmounted.
8664 @item @i{mount-info} unmounted fstype @t{$@{@i{type}@}} from @t{$@{@i{fs}@}} link @t{$@{@i{fs}@}}/@t{$@{@i{sublink}@}}
8665 A file system of which only a sub-directory was in use has been unmounted.
8667 @item restarting @i{mount-info} on @t{$@{@i{fs}@}}
8668 A pre-mounted file system has been noted.
8672 XXX: This section needs to be updated
8674 @c ################################################################
8675 @node Acknowledgments & Trademarks, Index, Internals, Top
8676 @comment node-name, next, previous, up
8677 @unnumbered Acknowledgments & Trademarks
8679 Many thanks to the Am-Utils Users
8680 mailing list through the months developing am-utils. These members
8681 have contributed to the discussions, ideas, code and documentation,
8682 and subjected their systems to alpha quality code. Special thanks go
8683 to those @uref{http://www.am-utils.org/docs/am-utils/AUTHORS.txt,authors} who have
8684 submitted patches, and especially to the maintainers:
8687 @item @uref{http://www.cs.sunysb.edu/~ezk,Erez Zadok}
8688 @item @email{ionut AT badula.org,Ion Badulescu}
8689 @item @email{ro AT techfak.uni-bielefeld.de,Rainer Orth}
8690 @item @email{nick.williams AT morganstanley.com,Nick Williams}
8693 Thanks to the Formal Methods Group at Imperial College for suffering
8694 patiently while @i{Amd} was being developed on their machines.
8696 Thanks to the many people who have helped with the development of
8697 @i{Amd}, especially Piete Brooks at the Cambridge University Computing
8698 Lab for many hours of testing, experimentation and discussion.
8700 Thanks to the older @email{amd-workers AT majordomo.glue.umd.edu,Amd
8701 Workers} mailing list (now defunct) members for many suggestions and
8702 bug reports to @i{Amd}.
8706 @b{DEC}, @b{VAX} and @b{Ultrix} are registered trademarks of Digital
8707 Equipment Corporation.
8709 @b{AIX} and @b{IBM} are registered trademarks of International Business
8710 Machines Corporation.
8712 @b{Sun}, @b{NFS} and @b{SunOS} are registered trademarks of Sun
8715 @b{UNIX} is a registered trademark in the USA and other countries,
8716 exclusively licensed through X/Open Company, Ltd.
8718 All other registered trademarks are owned by their respective owners.
8721 @c ################################################################
8722 @node Index, , Acknowledgments & Trademarks, Top
8723 @comment node-name, next, previous, up
8731 @c ====================================================================
8732 @c ISPELL LOCAL WORDS:
8733 @c LocalWords: setfilename amdref overfullrule settitle titlepage titlefont nz
8734 @c LocalWords: authorfont vskip ifinfo iftex cindex unnumberedsec dfn xref vol
8735 @c LocalWords: locationN pxref jpo nott concentrix Sjoerd sjoerd cwi Eitan vuw
8736 @c LocalWords: Mizrotsky eitan shumuji dgux fpx scp hcx metcalf masala hlh OTS
8737 @c LocalWords: Presnell srp cgl Trost trost ogi pyrOSx OSx tubsibr riscix iX
8738 @c LocalWords: Piete pb Lindblad cjl ai umax utek xinu Mitchum D'Souza dsouza
8739 @c LocalWords: mrc apu alliant aviion AViiON fps macII multimax tahoe vax emph
8740 @c LocalWords: mapdefault valA valB valC YPTSDIR ETCDIR substr MAKEDBM YPDBDIR
8741 @c LocalWords: NOPUSH njw dylan dk dylan njw anydir domN achilles mjh pref sel
8742 @c LocalWords: gdef loc loc loc ldots autodir remopts rwho rwho styx styx yoyo
8743 @c LocalWords: noindent gould rvdmount rvdunmount fserver mtmp unioned logfile
8744 @c LocalWords: dmn esac phjk toytown toytown toytown toytown phjk RdDir RdLnk
8745 @c LocalWords: volname attrs netif dougal inaddr hwaddr ec mountmaps passno xy
8746 @c LocalWords: freq dumpset hfs brian florence localinfo fstabs automaps defn
8747 @c LocalWords: localname fsck'd opr gummo sjv ganymede sjv fserv fserv fserv
8748 @c LocalWords: vaxA vaxB wp thpfs nbsd asis ifs amqprog free'ed printindex gov
8749 @c LocalWords: LocalWords syncodeindex Distrib bsdnet lanl AutoMounter acis ic
8750 @c LocalWords: ac uk aix bsd Mullender nl il DG lcs hpux irix ucsf NeXT cse cl
8751 @c LocalWords: mt FX hp ibm mips utils def def Domainname eg hostd getwd tmp
8752 @c LocalWords: subsubsection rw grpid intr noconn nocto nodevs nosuid retrans
8753 @c LocalWords: rsize tcp timeo nounmount utimeout DDEBUG nodaemon fd hostnames
8754 @c LocalWords: pid Amd's pendry vangogh nfsx backoff stats nomap nostats CRIT
8755 @c LocalWords: noinfo clustername RVD dsk dsk amq hostports osver statfs str
8756 @c LocalWords: ou counter's amdmaps proj src tftpboot sh mv cd sbin ypcat inet
8757 @c LocalWords: Getattr getattr localhost fhandles netmask fstype noquota addr
8758 @c LocalWords: exportfs Dumpsets dumpsets pindex ldif fixmount fixrmtab euid
8759 @c LocalWords: lostaltmail realloc netnumber itemx primnetnum primnetname ARG
8760 @c LocalWords: subsnetname subsnetnum netgrp netgroup multitable Shlib dec osf
8761 @c LocalWords: hppa pc bsdi freebsd netbsd openbsd ncr sysv rs acdirmax fsid
8762 @c LocalWords: acdirmin acregmax acregmin actimeo dumbtimr nfsv noac noauto sd
8763 @c LocalWords: nocache nodev noint nosub pgthresh posix rdonly suid symttl mfs
8764 @c LocalWords: AMFS umapfs myftpdir unionfs es mapname mapfile mapfile slocal
8765 @c LocalWords: mailspool saturn saturn notknown lol ober dr xr xr drwxrwsr cfg
8766 @c LocalWords: lrwxrwxrwx adminpr hplj adminpr cfg tekxp xterms tekxp Dupuy tp
8767 @c LocalWords: linkname hlfsddump dirname rmtab pluto rlogin direntry pg vr dn
8768 @c LocalWords: maxmem hlfsdir xmailbox showmount cn amdmap amdmapName resvport
8769 @c LocalWords: objectClass amdmapKey amdmapValue ln powerpc amdmapTimestamp ez
8770 @c LocalWords: moisil FSinfo Libtool Unmounting sublink fileservers NullProc
8771 @c LocalWords: gethostname mount's unmounts linkx remounts unmounting UAs SA's
8772 @c LocalWords: mountpoint mountpoints unescaped UIDs util's overlayed uref EFS
8773 @c LocalWords: serv maxgroups nfsl cachedir copt cfsadmin efs addopts fg ROMs
8774 @c LocalWords: nointr extatt setchapternewpage columnfractions alphaev gnulibc
8775 @c LocalWords: freebsdelf gnuoldld ifhtml defperm nodefperm norrip RRIP rrip
8776 @c LocalWords: noversion attr XXXXXX netgrpd rh mkstemp uid gid noexec mntfs
8777 @c LocalWords: nomnttab optionstr hrtime xdrtrace getpwd proplist redhat ctl
8778 @c LocalWords: texinfo texi ib sp cartouche ified xlatecookie dircategory sc
8779 @c LocalWords: AddInfo suse Novell softlookup ENOENT USB fullybrowsable LDAPv
8780 @c LocalWords: amy ie xfffffe zebedee andrew diskfull hdmail searchable si
8781 @c LocalWords: Orth ESTALE