xref: /netbsd-src/external/bsd/am-utils/dist/doc/am-utils.texi (revision 4da6d876cd9670a0f55b4857d574006fa142db45)
1a53f50b9Schristos\input texinfo          @c -*-texinfo-*-
2*4da6d876Schristos@c $NetBSD: am-utils.texi,v 1.4 2015/01/17 17:46:31 christos Exp $
3a53f50b9Schristos@c
4*4da6d876Schristos@c Copyright (c) 1997-2014 Erez Zadok
5a53f50b9Schristos@c Copyright (c) 1989 Jan-Simon Pendry
6a53f50b9Schristos@c Copyright (c) 1989 Imperial College of Science, Technology & Medicine
7a53f50b9Schristos@c Copyright (c) 1989 The Regents of the University of California.
8a53f50b9Schristos@c All rights reserved.
9a53f50b9Schristos@c
10a53f50b9Schristos@c This code is derived from software contributed to Berkeley by
11a53f50b9Schristos@c Jan-Simon Pendry at Imperial College, London.
12a53f50b9Schristos@c
13a53f50b9Schristos@c Redistribution and use in source and binary forms, with or without
14a53f50b9Schristos@c modification, are permitted provided that the following conditions
15a53f50b9Schristos@c are met:
16a53f50b9Schristos@c 1. Redistributions of source code must retain the above copyright
17a53f50b9Schristos@c    notice, this list of conditions and the following disclaimer.
18a53f50b9Schristos@c 2. Redistributions in binary form must reproduce the above copyright
19a53f50b9Schristos@c    notice, this list of conditions and the following disclaimer in the
20a53f50b9Schristos@c    documentation and/or other materials provided with the distribution.
21*4da6d876Schristos@c 3. Neither the name of the University nor the names of its contributors
22a53f50b9Schristos@c    may be used to endorse or promote products derived from this software
23a53f50b9Schristos@c    without specific prior written permission.
24a53f50b9Schristos@c
25a53f50b9Schristos@c THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26a53f50b9Schristos@c ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27a53f50b9Schristos@c IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28a53f50b9Schristos@c ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29a53f50b9Schristos@c FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30a53f50b9Schristos@c DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31a53f50b9Schristos@c OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32a53f50b9Schristos@c HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33a53f50b9Schristos@c LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34a53f50b9Schristos@c OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35a53f50b9Schristos@c
36a53f50b9Schristos@c
37a53f50b9Schristos@c File: am-utils/doc/am-utils.texi
38a53f50b9Schristos@c
39a53f50b9Schristos@setfilename am-utils.info
40a53f50b9Schristos
41a53f50b9Schristos@include version.texi
42a53f50b9Schristos
43a53f50b9Schristos@c info directory entry
44a53f50b9Schristos@dircategory Administration
45a53f50b9Schristos@direntry
46a53f50b9Schristos* Am-utils: (am-utils).          The Amd automounter suite of utilities
47a53f50b9Schristos@end direntry
48a53f50b9Schristos
49a53f50b9Schristos@settitle Am-utils (4.4BSD Automounter Utilities)
50a53f50b9Schristos@setchapternewpage odd
51a53f50b9Schristos
52a53f50b9Schristos@titlepage
53a53f50b9Schristos@title Am-utils (4.4BSD Automounter Utilities)
54a53f50b9Schristos@subtitle For version @value{VERSION}, @value{UPDATED}
55a53f50b9Schristos
56a53f50b9Schristos@author Erez Zadok
57a53f50b9Schristos(Originally by Jan-Simon Pendry and Nick Williams)
58a53f50b9Schristos
59a53f50b9Schristos@page
60*4da6d876SchristosCopyright @copyright{} 1997-2014 Erez Zadok
61a53f50b9Schristos@*
62a53f50b9SchristosCopyright @copyright{} 1989 Jan-Simon Pendry
63a53f50b9Schristos@*
64a53f50b9SchristosCopyright @copyright{} 1989 Imperial College of Science, Technology & Medicine
65a53f50b9Schristos@*
66a53f50b9SchristosCopyright @copyright{} 1989 The Regents of the University of California.
67*4da6d876Schristos@sp 1
68a53f50b9SchristosAll Rights Reserved.
69a53f50b9Schristos@vskip 1ex
70a53f50b9SchristosPermission to copy this document, or any portion of it, as
71a53f50b9Schristosnecessary for use of this software is granted provided this
72a53f50b9Schristoscopyright notice and statement of permission are included.
73a53f50b9Schristos@end titlepage
74a53f50b9Schristos@page
75a53f50b9Schristos
76a53f50b9Schristos@c Define a new index for options.
77a53f50b9Schristos@syncodeindex pg cp
78a53f50b9Schristos@syncodeindex vr cp
79a53f50b9Schristos
80a53f50b9Schristos@ifinfo
81a53f50b9Schristos
82a53f50b9Schristos@c ################################################################
83a53f50b9Schristos@node Top, License, , (DIR)
84a53f50b9Schristos
85a53f50b9Schristos@b{Am-utils (4.4BSD Automounter Utilities) User Manual}
86a53f50b9Schristos@*
87a53f50b9SchristosFor version @value{VERSION}, @value{UPDATED}
88a53f50b9Schristos
89a53f50b9Schristos@b{Erez Zadok}
90a53f50b9Schristos@*
91a53f50b9Schristos(Originally by Jan-Simon Pendry and Nick Williams)
92a53f50b9Schristos
93*4da6d876SchristosCopyright @copyright{} 1997-2014 Erez Zadok
94a53f50b9Schristos@*
95a53f50b9SchristosCopyright @copyright{} 1989 Jan-Simon Pendry
96a53f50b9Schristos@*
97a53f50b9SchristosCopyright @copyright{} 1989 Imperial College of Science, Technology & Medicine
98a53f50b9Schristos@*
99a53f50b9SchristosCopyright @copyright{} 1989 The Regents of the University of California.
100a53f50b9Schristos@*
101a53f50b9SchristosAll Rights Reserved.
102a53f50b9Schristos
103a53f50b9SchristosPermission to copy this document, or any portion of it, as
104a53f50b9Schristosnecessary for use of this software is granted provided this
105a53f50b9Schristoscopyright notice and statement of permission are included.
106a53f50b9Schristos
107a53f50b9SchristosAm-utils is the 4.4BSD Automounter Tool Suite, which includes the Amd
108a53f50b9Schristosautomounter, the Amq query and control program, the Hlfsd daemon, and
109a53f50b9Schristosother tools.  This Info file describes how to use and understand the
110a53f50b9Schristostools within Am-utils.
111a53f50b9Schristos@end ifinfo
112a53f50b9Schristos
113a53f50b9Schristos@menu
114a53f50b9Schristos* License::                  Explains the terms and conditions for using
115a53f50b9Schristos                             and distributing Am-utils.
116a53f50b9Schristos* Distrib::                  How to get the latest Am-utils distribution.
117a53f50b9Schristos* AddInfo::                  How to get additional information.
118a53f50b9Schristos* Intro::                    An introduction to Automounting concepts.
119a53f50b9Schristos* History::                  History of am-utils' development.
120a53f50b9Schristos* Overview::                 An overview of Amd.
121a53f50b9Schristos* Supported Platforms::      Machines and Systems supported by Amd.
122a53f50b9Schristos* Mount Maps::               Details of mount maps.
123a53f50b9Schristos* Amd Command Line Options:: All the Amd command line options explained.
124a53f50b9Schristos* Filesystem Types::         The different mount types supported by Amd.
125a53f50b9Schristos* Amd Configuration File::   The amd.conf file syntax and meaning.
126a53f50b9Schristos* Run-time Administration::  How to start, stop and control Amd.
127a53f50b9Schristos* FSinfo::                   The FSinfo filesystem management tool.
128a53f50b9Schristos* Hlfsd::                    The Home-Link Filesystem server.
129a53f50b9Schristos* Assorted Tools::           Other tools which come with am-utils.
130a53f50b9Schristos* Examples::                 Some examples showing how Amd might be used.
131a53f50b9Schristos* Internals::                Implementation details.
132a53f50b9Schristos* Acknowledgments & Trademarks:: Legal Notes.
133a53f50b9Schristos
134a53f50b9SchristosIndexes
135a53f50b9Schristos* Index::                    An item for each concept.
136a53f50b9Schristos@end menu
137a53f50b9Schristos
138a53f50b9Schristos@iftex
139a53f50b9Schristos@unnumbered Preface
140a53f50b9Schristos
141a53f50b9SchristosThis manual documents the use of the 4.4BSD automounter tool suite,
142a53f50b9Schristoswhich includes @i{Amd}, @i{Amq}, @i{Hlfsd}, and other programs.  This is
143a53f50b9Schristosprimarily a reference manual.  While no tutorial exists, there are
144a53f50b9Schristosexamples available.  @xref{Examples}.
145a53f50b9Schristos
146a53f50b9SchristosThis manual comes in two forms: the published form and the Info form.
147a53f50b9SchristosThe Info form is for on-line perusal with the INFO program which is
148a53f50b9Schristosdistributed along with GNU texinfo package (a version of which is
149a53f50b9Schristosavailable for GNU Emacs).@footnote{GNU packages can be found in
150a53f50b9Schristos@url{ftp://ftp.gnu.org/pub/gnu/}.}  Both forms contain substantially
151a53f50b9Schristosthe same text and are generated from a common source file, which is
152a53f50b9Schristosdistributed with the @i{Am-utils} source.
153a53f50b9Schristos@end iftex
154a53f50b9Schristos
155a53f50b9Schristos@c ################################################################
156a53f50b9Schristos@node License, Distrib, Top, Top
157a53f50b9Schristos@unnumbered License
158a53f50b9Schristos@cindex License Information
159a53f50b9Schristos
160a53f50b9Schristos@i{Am-utils} is not in the public domain; it is copyrighted and there are
161a53f50b9Schristosrestrictions on its distribution.
162a53f50b9Schristos
163a53f50b9SchristosRedistribution and use in source and binary forms, with or without
164a53f50b9Schristosmodification, are permitted provided that the following conditions are
165a53f50b9Schristosmet:
166a53f50b9Schristos
167a53f50b9Schristos@enumerate
168a53f50b9Schristos
169a53f50b9Schristos@item
170a53f50b9SchristosRedistributions of source code must retain the above copyright notice,
171a53f50b9Schristosthis list of conditions and the following disclaimer.
172a53f50b9Schristos
173a53f50b9Schristos@item
174a53f50b9SchristosRedistributions in binary form must reproduce the above copyright
175a53f50b9Schristosnotice, this list of conditions and the following disclaimer in the
176a53f50b9Schristosdocumentation and/or other materials provided with the distribution.
177a53f50b9Schristos
178a53f50b9Schristos@item
179a53f50b9SchristosNeither the name of the University nor the names of its contributors may
180a53f50b9Schristosbe used to endorse or promote products derived from this software
181a53f50b9Schristoswithout specific prior written permission.
182a53f50b9Schristos
183a53f50b9Schristos@end enumerate
184a53f50b9Schristos
185a53f50b9SchristosTHIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
186a53f50b9SchristosANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
187a53f50b9SchristosIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
188a53f50b9SchristosPURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
189a53f50b9SchristosBE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
190a53f50b9SchristosCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
191a53f50b9SchristosSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
192a53f50b9SchristosINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
193a53f50b9SchristosCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
194a53f50b9SchristosARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
195a53f50b9SchristosTHE POSSIBILITY OF SUCH DAMAGE.
196a53f50b9Schristos
197a53f50b9Schristos@c ################################################################
198a53f50b9Schristos@node Distrib, AddInfo, License, Top
199a53f50b9Schristos@unnumbered Source Distribution
200a53f50b9Schristos@cindex Source code distribution
201a53f50b9Schristos@cindex Obtaining the source code
202a53f50b9Schristos
203a53f50b9SchristosThe @i{Am-utils} home page is located in
204a53f50b9Schristos@example
205a53f50b9Schristos@url{http://www.am-utils.org/}
206a53f50b9Schristos@end example
207a53f50b9Schristos
208a53f50b9SchristosYou can get the latest distribution version of @i{Am-utils} from
209a53f50b9Schristos@example
210a53f50b9Schristos@url{ftp://ftp.am-utils.org/pub/am-utils/am-utils.tar.gz}
211a53f50b9Schristos@end example
212a53f50b9Schristos
213a53f50b9SchristosAdditional alpha, beta, and release distributions are available in
214a53f50b9Schristos@example
215a53f50b9Schristos@url{ftp://ftp.am-utils.org/pub/am-utils/}.
216a53f50b9Schristos@end example
217a53f50b9Schristos
218a53f50b9SchristosRevision 5.2 was part of the 4.3BSD Reno distribution.
219a53f50b9Schristos
220a53f50b9SchristosRevision 5.3bsdnet, a late alpha version of 5.3, was part
221a53f50b9Schristosof the BSD network version 2 distribution
222a53f50b9Schristos
223a53f50b9SchristosRevision 6.0 was made independently by
224a53f50b9SchristosErez Zadok at the Computer Science
225a53f50b9SchristosDepartment of @uref{http://www.cs.columbia.edu/,Columbia University},
226a53f50b9Schristosas part of his
227a53f50b9Schristos@uref{http://www.fsl.cs.sunysb.edu/docs/zadok-thesis-proposal/,PhD
228a53f50b9Schristosthesis work}.  Am-utils (especially version 6.1) continues to be
229a53f50b9Schristosdeveloped and maintained at the
230a53f50b9Schristos@uref{http://www.cs.sunysb.edu/,Computer Science Department} of
231a53f50b9Schristos@uref{http://www.stonybrook.edu/,Stony Brook University}, as a service
232a53f50b9Schristosto the user community.
233a53f50b9Schristos
234a53f50b9Schristos
235a53f50b9Schristos@xref{History}, for more details.
236a53f50b9Schristos
237a53f50b9Schristos@c ################################################################
238a53f50b9Schristos@node AddInfo, Intro, Distrib, Top
239a53f50b9Schristos@unnumbered Getting Additional Information
240a53f50b9Schristos@cindex Getting Additional Information
241a53f50b9Schristos
242a53f50b9Schristos@unnumberedsec Bug Reports
243a53f50b9Schristos@cindex Bug reports
244a53f50b9Schristos
245a53f50b9SchristosBefore reporting a bug, see if it is a known one in the
246a53f50b9Schristos@uref{http://www.am-utils.org/docs/am-utils/BUGS.txt,bugs} file.
247a53f50b9Schristos
248a53f50b9SchristosIf you find a problem and hopefully you can reproduce it, please
249a53f50b9Schristosdescribe it in detail and
250a53f50b9Schristos@uref{https://bugzilla.filesystems.org/,submit a bug report} via
251a53f50b9Schristos@uref{http://www.bugzilla.org/,Bugzilla}.  Alternatively, you can send
252a53f50b9Schristosyour bug report to the ``am-utils'' list (see
253a53f50b9Schristos@url{http://www.am-utils.org/} under ``Mailing Lists'') quoting the details
254a53f50b9Schristosof the release and your configuration.  These details can be obtained
255a53f50b9Schristosby running the command @samp{amd -v}.  It would greatly help if you
256a53f50b9Schristoscould provide a reproducible procedure for detecting the bug you are
257a53f50b9Schristosreporting.
258a53f50b9Schristos
259a53f50b9SchristosProviding working patches is highly encouraged.  Every patch
260a53f50b9Schristosincorporated, however small, will get its author an honorable mention in
261a53f50b9Schristosthe @uref{http://www.am-utils.org/docs/am-utils/AUTHORS.txt,authors
262a53f50b9Schristosfile}.
263a53f50b9Schristos
264a53f50b9Schristos@unnumberedsec Mailing Lists
265a53f50b9Schristos@cindex Mailing lists
266a53f50b9Schristos
267a53f50b9SchristosThere are several mailing lists for people interested in keeping up-to-date
268a53f50b9Schristoswith developments.
269a53f50b9Schristos
270a53f50b9Schristos@c ###############
271a53f50b9Schristos
272a53f50b9Schristos@enumerate
273a53f50b9Schristos
274a53f50b9Schristos@item
275a53f50b9SchristosThe users mailing list, @samp{am-utils} is for
276a53f50b9Schristos
277a53f50b9Schristos@itemize @minus
278a53f50b9Schristos@item
279a53f50b9Schristosannouncements of alpha and beta releases of am-utils
280a53f50b9Schristos@item
281a53f50b9Schristosreporting of bugs and patches
282a53f50b9Schristos@item
283a53f50b9Schristosdiscussions of new features for am-utils
284a53f50b9Schristos@item
285a53f50b9Schristosimplementation and porting issues
286a53f50b9Schristos@end itemize
287a53f50b9Schristos
288a53f50b9SchristosTo subscribe, visit @url{http://www.am-utils.org/} under ``Mailing
289a53f50b9SchristosLists.''  After subscribing, you can post a message to this list.  To
290a53f50b9Schristosavoid as much spam as possible, only subscribers to this list may post
291a53f50b9Schristosto it.
292a53f50b9Schristos
293a53f50b9SchristosSubscribers of @samp{am-utils} are most helpful if they have the time
294a53f50b9Schristosand resources to test new and development versions of amd, on as many
295a53f50b9Schristosdifferent platforms as possible.  They should also be prepared to
296a53f50b9Schristoslearn and use the GNU Autoconf, Automake, and Libtool packages, as
297a53f50b9Schristosneeded; and of course, become familiar with the complex code in the
298a53f50b9Schristosam-utils package.  In other words, subscribers on this list should
299a53f50b9Schristoshopefully be able to contribute meaningfully to the development of
300a53f50b9Schristosamd.
301a53f50b9Schristos
302a53f50b9SchristosNote that this @samp{am-utils} list used to be called @samp{amd-dev}
303a53f50b9Schristosbefore January 1st, 2004.  Please use the new name, @samp{am-utils}.
304a53f50b9Schristos
305a53f50b9Schristos@item
306a53f50b9SchristosThe announcements mailing list, @samp{am-utils-announce} is for
307a53f50b9Schristosannouncements only (mostly new releases).  To subscribe, visit
308a53f50b9Schristos@url{http://www.am-utils.org/} under ``Mailing Lists.''
309a53f50b9SchristosThis list is read-only: only am-utils developers may post to it.
310a53f50b9Schristos
311a53f50b9Schristos@item
312a53f50b9SchristosWe distribute nightly CVS snapshots in
313a53f50b9Schristos@url{ftp://ftp.am-utils.org/pub/am-utils/snapshots/daily/}.  If you
314a53f50b9Schristoslike to get email notices of commits to the am-utils CVS repository,
315a53f50b9Schristossubscribe to the CVS logs mailing list, @samp{am-utils-cvs} at
316a53f50b9Schristos@url{http://www.am-utils.org/} under ``Mailing Lists.''
317a53f50b9Schristos
318a53f50b9Schristos@item
319a53f50b9SchristosThe older list which was used to user discussions, @samp{amd-workers},
320a53f50b9Schristosis defunct as of January 2004.  (Its last address was
321a53f50b9Schristos@email{amd-workers AT majordomo.glue.umd.edu}.)  Don't use
322a53f50b9Schristos@samp{amd-workers}: use the newer, more active @samp{am-utils} list.
323a53f50b9Schristos
324a53f50b9Schristos@item
325a53f50b9SchristosFor completeness, there's a developers-only closed list called
326a53f50b9Schristos@samp{am-utils-developers} (see @url{http://www.am-utils.org/} under
327a53f50b9Schristos``Mailing Lists'').
328a53f50b9Schristos
329a53f50b9Schristos@end enumerate
330a53f50b9Schristos
331a53f50b9Schristos@unnumberedsec Am-utils Book
332a53f50b9Schristos@cindex Am-utils book
333a53f50b9Schristos@cindex Amd book
334a53f50b9Schristos@cindex Automounter book
335a53f50b9Schristos@cindex book
336a53f50b9Schristos
337a53f50b9Schristos@uref{http://www.cs.sunysb.edu/~ezk,Erez Zadok} wrote a
338a53f50b9Schristos@uref{http://www.fsl.cs.sunysb.edu/docs/amd-book/,book}, titled @i{Linux NFS and
339a53f50b9SchristosAutomounter Administration}, ISBN 0-7821-2739-8, (Sybex, 2001).  The
340a53f50b9Schristosbook is full of details and examples that go beyond what this manual
341a53f50b9Schristoshas.  The book also covers NFS in great detail.  Although the book is
342a53f50b9Schristosgeared toward Linux users, it is general enough for any Unix
343a53f50b9Schristosadministrator and contains specific sections for non-Linux systems.
344a53f50b9Schristos
345a53f50b9Schristos@c ################################################################
346a53f50b9Schristos@node Intro, History, AddInfo, Top
347a53f50b9Schristos@unnumbered Introduction
348a53f50b9Schristos@cindex Introduction
349a53f50b9Schristos
350a53f50b9SchristosAn @dfn{automounter} maintains a cache of mounted filesystems.
351a53f50b9SchristosFilesystems are mounted on demand when they are first referenced,
352a53f50b9Schristosand unmounted after a period of inactivity.
353a53f50b9Schristos
354a53f50b9Schristos@i{Amd} may be used as a replacement for Sun's automounter.  The choice
355a53f50b9Schristosof which filesystem to mount can be controlled dynamically with
356a53f50b9Schristos@dfn{selectors}.  Selectors allow decisions of the form ``hostname is
357a53f50b9Schristos@var{this},'' or ``architecture is not @var{that}.''  Selectors may be
358a53f50b9Schristoscombined arbitrarily.  @i{Amd} also supports a variety of filesystem
359a53f50b9Schristostypes, including NFS, UFS and the novel @dfn{program} filesystem.  The
360a53f50b9Schristoscombination of selectors and multiple filesystem types allows identical
361a53f50b9Schristosconfiguration files to be used on all machines thus reducing the
362a53f50b9Schristosadministrative overhead.
363a53f50b9Schristos
364a53f50b9Schristos@i{Amd} ensures that it will not hang if a remote server goes down.
365a53f50b9SchristosMoreover, @i{Amd} can determine when a remote server has become
366a53f50b9Schristosinaccessible and then mount replacement filesystems as and when they
367a53f50b9Schristosbecome available.
368a53f50b9Schristos
369a53f50b9Schristos@i{Amd} contains no proprietary source code and has been ported to
370a53f50b9Schristosnumerous flavors of Unix.
371a53f50b9Schristos
372a53f50b9Schristos@c ################################################################
373a53f50b9Schristos@node History, Overview, Intro, Top
374a53f50b9Schristos@unnumbered History
375a53f50b9Schristos@cindex History
376a53f50b9Schristos
377a53f50b9SchristosThe @i{Amd} package has been without an official maintainer since 1992.
378a53f50b9SchristosSeveral people have stepped in to maintain it unofficially.  Most
379a53f50b9Schristosnotable were the `upl' (Unofficial Patch Level) releases of @i{Amd},
380a53f50b9Schristoscreated by me (@uref{http://www.cs.sunysb.edu/~ezk,Erez Zadok}), and available from
381a53f50b9Schristos@url{ftp://ftp.am-utils.org/pub/amd/}.  The last such unofficial
382a53f50b9Schristosrelease was `upl102'.
383a53f50b9Schristos
384a53f50b9SchristosThrough the process of patching and aging, it was becoming more and more
385a53f50b9Schristosapparent that @i{Amd} was in much need of revitalizing.  Maintaining
386a53f50b9Schristos@i{Amd} had become a difficult task.  I took it upon myself to cleanup
387a53f50b9Schristosthe code, so that it would be easier to port to new platforms, add new
388a53f50b9Schristosfeatures, keep up with the many new feature requests, and deal with the
389a53f50b9Schristosnever ending stream of bug reports.
390a53f50b9Schristos
391a53f50b9SchristosI have been working on such a release of @i{Amd} on and off since
392a53f50b9SchristosJanuary of 1996.  The new suite of tools is currently named "am-utils"
393a53f50b9Schristos(AutoMounter Utilities), in line with GNU naming conventions, befitting
394a53f50b9Schristosthe contents of the package.  In October of 1996 I had received enough
395a53f50b9Schristosoffers to help me with this task that I decided to make a mailing list
396a53f50b9Schristosfor this group of people.  Around the same time, @i{Amd} had become a
397a53f50b9Schristosnecessary part of my PhD thesis work, resulting in more work performed
398a53f50b9Schristoson am-utils.
399a53f50b9Schristos
400a53f50b9SchristosAm-utils version 6.0 was numbered with a major new release number to
401a53f50b9Schristosdistinguish it from the last official release of @i{Amd} (5.x).  Many
402a53f50b9Schristosnew features have been added such as a GNU @code{configure} system, NFS
403a53f50b9SchristosVersion 3, a run-time configuration file (`amd.conf'), many new ports,
404a53f50b9Schristosmore scripts and programs, as well as numerous bug fixes.  Another
405a53f50b9Schristosreason for the new major release number was to alert users of am-utils
406a53f50b9Schristosthat user-visible interfaces may have changed.  In order to make @i{Amd}
407a53f50b9Schristoswork well for the next 10 years, and be easier to maintain, it was
408a53f50b9Schristosnecessary to remove old or unused features, change various syntax files,
409a53f50b9Schristosetc.  However, great care was taken to ensure the maximum possible
410a53f50b9Schristosbackwards compatibility.
411a53f50b9Schristos
412a53f50b9SchristosAm-utils version 6.1 has autofs support for Linux and Solaris 2.5+ as
413a53f50b9Schristos@i{the} major new feature, in addition to several other minor new
414a53f50b9Schristosfeatures.  The autofs support is completely transparent to the
415a53f50b9Schristosend-user, aside from the fact that @code{/bin/pwd} now always returns
416a53f50b9Schristosthe correct amd-ified path.  The administrator can easily switch
417a53f50b9Schristosbetween NFS and autofs mounts by changing one parameter in
418a53f50b9Schristos@code{amd.conf}.  Autofs support and maintenance was developed in
419a53f50b9Schristosconjunction with @email{ionut AT badula.org,Ion Badulescu}.
420a53f50b9Schristos
421a53f50b9Schristos@c ################################################################
422a53f50b9Schristos@node Overview, Supported Platforms, History, Top
423a53f50b9Schristos@chapter Overview
424a53f50b9Schristos
425a53f50b9Schristos@i{Amd} maintains a cache of mounted filesystems.  Filesystems are
426a53f50b9Schristos@dfn{demand-mounted} when they are first referenced, and unmounted after
427a53f50b9Schristosa period of inactivity.  @i{Amd} may be used as a replacement for Sun's
428a53f50b9Schristos@b{automount}(8) program.  It contains no proprietary source code and
429a53f50b9Schristoshas been ported to numerous flavors of Unix.  @xref{Supported
430a53f50b9SchristosPlatforms}.@refill
431a53f50b9Schristos
432a53f50b9Schristos@i{Amd} was designed as the basis for experimenting with filesystem
433a53f50b9Schristoslayout and management.  Although @i{Amd} has many direct applications it
434a53f50b9Schristosis loaded with additional features which have little practical use.  At
435a53f50b9Schristossome point the infrequently used components may be removed to streamline
436a53f50b9Schristosthe production system.
437a53f50b9Schristos
438a53f50b9Schristos@i{Amd} supports the notion of @dfn{replicated} filesystems by evaluating
439a53f50b9Schristoseach member of a list of possible filesystem locations one by one.
440a53f50b9Schristos@i{Amd} checks that each cached mapping remains valid.  Should a mapping be
441a53f50b9Schristoslost -- such as happens when a fileserver goes down -- @i{Amd} automatically
442a53f50b9Schristosselects a replacement should one be available.
443a53f50b9Schristos
444a53f50b9Schristos@menu
445a53f50b9Schristos* Fundamentals::
446a53f50b9Schristos* Filesystems and Volumes::
447a53f50b9Schristos* Volume Naming::
448a53f50b9Schristos* Volume Binding::
449a53f50b9Schristos* Operational Principles::
450a53f50b9Schristos* Mounting a Volume::
451a53f50b9Schristos* Automatic Unmounting::
452a53f50b9Schristos* Keep-alives::
453a53f50b9Schristos* Non-blocking Operation::
454a53f50b9Schristos@end menu
455a53f50b9Schristos
456a53f50b9Schristos@node Fundamentals, Filesystems and Volumes, Overview, Overview
457a53f50b9Schristos@comment  node-name,  next,  previous,  up
458a53f50b9Schristos@section Fundamentals
459a53f50b9Schristos@cindex Automounter fundamentals
460a53f50b9Schristos
461a53f50b9SchristosThe fundamental concept behind @i{Amd} is the ability to separate the
462a53f50b9Schristosname used to refer to a file from the name used to refer to its physical
463a53f50b9Schristosstorage location.  This allows the same files to be accessed with the
464a53f50b9Schristossame name regardless of where in the network the name is used.  This is
465a53f50b9Schristosvery different from placing @file{/n/hostname} in front of the pathname
466a53f50b9Schristossince that includes location dependent information which may change if
467a53f50b9Schristosfiles are moved to another machine.
468a53f50b9Schristos
469a53f50b9SchristosBy placing the required mappings in a centrally administered database,
470a53f50b9Schristosfilesystems can be re-organized without requiring changes to
471a53f50b9Schristosconfiguration files, shell scripts and so on.
472a53f50b9Schristos
473a53f50b9Schristos@node Filesystems and Volumes, Volume Naming, Fundamentals, Overview
474a53f50b9Schristos@comment  node-name,  next,  previous,  up
475a53f50b9Schristos@section Filesystems and Volumes
476a53f50b9Schristos@cindex Filesystem
477a53f50b9Schristos@cindex Volume
478a53f50b9Schristos@cindex Fileserver
479a53f50b9Schristos@cindex sublink
480a53f50b9Schristos
481a53f50b9Schristos@i{Amd} views the world as a set of fileservers, each containing one or
482a53f50b9Schristosmore filesystems where each filesystem contains one or more
483a53f50b9Schristos@dfn{volumes}.  Here the term @dfn{volume} is used to refer to a
484a53f50b9Schristoscoherent set of files such as a user's home directory or a @TeX{}
485a53f50b9Schristosdistribution.@refill
486a53f50b9Schristos
487a53f50b9SchristosIn order to access the contents of a volume, @i{Amd} must be told in
488a53f50b9Schristoswhich filesystem the volume resides and which host owns the filesystem.
489a53f50b9SchristosBy default the host is assumed to be local and the volume is assumed to
490a53f50b9Schristosbe the entire filesystem.  If a filesystem contains more than one
491a53f50b9Schristosvolume, then a @dfn{sublink} is used to refer to the sub-directory
492a53f50b9Schristoswithin the filesystem where the volume can be found.
493a53f50b9Schristos
494a53f50b9Schristos@node Volume Naming, Volume Binding, Filesystems and Volumes, Overview
495a53f50b9Schristos@comment  node-name,  next,  previous,  up
496a53f50b9Schristos@section Volume Naming
497a53f50b9Schristos@cindex Volume names
498a53f50b9Schristos@cindex Network-wide naming
499a53f50b9Schristos@cindex Replicated volumes
500a53f50b9Schristos@cindex Duplicated volumes
501a53f50b9Schristos@cindex Replacement volumes
502a53f50b9Schristos
503a53f50b9SchristosVolume names are defined to be unique across the entire network.  A
504a53f50b9Schristosvolume name is the pathname to the volume's root as known by the users
505a53f50b9Schristosof that volume.  Since this name uniquely identifies the volume
506a53f50b9Schristoscontents, all volumes can be named and accessed from each host, subject
507a53f50b9Schristosto administrative controls.
508a53f50b9Schristos
509a53f50b9SchristosVolumes may be replicated or duplicated.  Replicated volumes contain
510a53f50b9Schristosidentical copies of the same data and reside at two or more locations in
511a53f50b9Schristosthe network.  Each of the replicated volumes can be used
512a53f50b9Schristosinterchangeably.  Duplicated volumes each have the same name but contain
513a53f50b9Schristosdifferent, though functionally identical, data.  For example,
514a53f50b9Schristos@samp{/vol/tex} might be the name of a @TeX{} distribution which varied
515a53f50b9Schristosfor each machine architecture.@refill
516a53f50b9Schristos
517a53f50b9Schristos@i{Amd} provides facilities to take advantage of both replicated and
518a53f50b9Schristosduplicated volumes.  Configuration options allow a single set of
519a53f50b9Schristosconfiguration data to be shared across an entire network by taking
520a53f50b9Schristosadvantage of replicated and duplicated volumes.
521a53f50b9Schristos
522a53f50b9Schristos@i{Amd} can take advantage of replacement volumes by mounting them as
523a53f50b9Schristosrequired should an active fileserver become unavailable.
524a53f50b9Schristos
525a53f50b9Schristos@node Volume Binding, Operational Principles, Volume Naming, Overview
526a53f50b9Schristos@comment  node-name,  next,  previous,  up
527a53f50b9Schristos@section Volume Binding
528a53f50b9Schristos@cindex Volume binding
529a53f50b9Schristos@cindex Unix namespace
530a53f50b9Schristos@cindex Namespace
531a53f50b9Schristos@cindex Binding names to filesystems
532a53f50b9Schristos
533a53f50b9SchristosUnix implements a namespace of hierarchically mounted filesystems.  Two
534a53f50b9Schristosforms of binding between names and files are provided.  A @dfn{hard
535a53f50b9Schristoslink} completes the binding when the name is added to the filesystem.  A
536a53f50b9Schristos@dfn{soft link} delays the binding until the name is accessed.  An
537a53f50b9Schristos@dfn{automounter} adds a further form in which the binding of name to
538a53f50b9Schristosfilesystem is delayed until the name is accessed.@refill
539a53f50b9Schristos
540a53f50b9SchristosThe target volume, in its general form, is a tuple (host, filesystem,
541a53f50b9Schristossublink) which can be used to name the physical location of any volume
542a53f50b9Schristosin the network.
543a53f50b9Schristos
544a53f50b9SchristosWhen a target is referenced, @i{Amd} ignores the sublink element and
545a53f50b9Schristosdetermines whether the required filesystem is already mounted.  This is
546a53f50b9Schristosdone by computing the local mount point for the filesystem and checking
547a53f50b9Schristosfor an existing filesystem mounted at the same place.  If such a
548a53f50b9Schristosfilesystem already exists then it is assumed to be functionally
549a53f50b9Schristosidentical to the target filesystem.  By default there is a one-to-one
550a53f50b9Schristosmapping between the pair (host, filesystem) and the local mount point so
551a53f50b9Schristosthis assumption is valid.
552a53f50b9Schristos
553a53f50b9Schristos@node Operational Principles, Mounting a Volume, Volume Binding, Overview
554a53f50b9Schristos@comment  node-name,  next,  previous,  up
555a53f50b9Schristos@section Operational Principles
556a53f50b9Schristos@cindex Operational principles
557a53f50b9Schristos
558a53f50b9Schristos@i{Amd} operates by introducing new mount points into the namespace.
559a53f50b9SchristosThese are called @dfn{automount} points.  The kernel sees these
560a53f50b9Schristosautomount points as NFS filesystems being served by @i{Amd}.  Having
561a53f50b9Schristosattached itself to the namespace, @i{Amd} is now able to control the
562a53f50b9Schristosview the rest of the system has of those mount points.  RPC calls are
563a53f50b9Schristosreceived from the kernel one at a time.
564a53f50b9Schristos
565a53f50b9SchristosWhen a @dfn{lookup} call is received @i{Amd} checks whether the name is
566a53f50b9Schristosalready known.  If it is not, the required volume is mounted.  A
567a53f50b9Schristossymbolic link pointing to the volume root is then returned.  Once the
568a53f50b9Schristossymbolic link is returned, the kernel will send all other requests
569a53f50b9Schristosdirect to the mounted filesystem.
570a53f50b9Schristos
571a53f50b9SchristosIf a volume is not yet mounted, @i{Amd} consults a configuration
572a53f50b9Schristos@dfn{mount-map} corresponding to the automount point.  @i{Amd} then
573a53f50b9Schristosmakes a runtime decision on what and where to mount a filesystem based
574a53f50b9Schristoson the information obtained from the map.
575a53f50b9Schristos
576a53f50b9Schristos@i{Amd} does not implement all the NFS requests; only those relevant
577a53f50b9Schristosto name binding such as @dfn{lookup}, @dfn{readlink} and @dfn{readdir}.
578a53f50b9SchristosSome other calls are also implemented but most simply return an error
579a53f50b9Schristoscode; for example @dfn{mkdir} always returns ``read-only filesystem''.
580a53f50b9Schristos
581a53f50b9Schristos@node Mounting a Volume, Automatic Unmounting, Operational Principles, Overview
582a53f50b9Schristos@comment  node-name,  next,  previous,  up
583a53f50b9Schristos@section Mounting a Volume
584a53f50b9Schristos@cindex Mounting a volume
585a53f50b9Schristos@cindex Location lists
586a53f50b9Schristos@cindex Alternate locations
587a53f50b9Schristos@cindex Mount retries
588a53f50b9Schristos@cindex Background mounts
589a53f50b9Schristos
590a53f50b9SchristosEach automount point has a corresponding mount map.  The mount map
591a53f50b9Schristoscontains a list of key--value pairs.  The key is the name of the volume
592a53f50b9Schristosto be mounted.  The value is a list of locations describing where the
593a53f50b9Schristosfilesystem is stored in the network.  In the source for the map the
594a53f50b9Schristosvalue would look like
595a53f50b9Schristos
596a53f50b9Schristos@display
597a53f50b9Schristoslocation1  location2  @dots{}  locationN
598a53f50b9Schristos@end display
599a53f50b9Schristos
600a53f50b9Schristos@i{Amd} examines each location in turn.  Each location may contain
601a53f50b9Schristos@dfn{selectors} which control whether @i{Amd} can use that location.
602a53f50b9SchristosFor example, the location may be restricted to use by certain hosts.
603a53f50b9SchristosThose locations which cannot be used are ignored.
604a53f50b9Schristos
605a53f50b9Schristos@i{Amd} attempts to mount the filesystem described by each remaining
606a53f50b9Schristoslocation until a mount succeeds or @i{Amd} can no longer proceed.  The
607a53f50b9Schristoslatter can occur in three ways:
608a53f50b9Schristos
609a53f50b9Schristos@itemize @bullet
610a53f50b9Schristos@item
611a53f50b9SchristosIf none of the locations could be used, or if all of the locations
612a53f50b9Schristoscaused an error, then the last error is returned.
613a53f50b9Schristos
614a53f50b9Schristos@item
615a53f50b9SchristosIf a location could be used but was being mounted in the background then
616a53f50b9Schristos@i{Amd} marks that mount as being ``in progress'' and continues with
617a53f50b9Schristosthe next request; no reply is sent to the kernel.
618a53f50b9Schristos
619a53f50b9Schristos@item
620a53f50b9SchristosLastly, one or more of the mounts may have been @dfn{deferred}.  A mount
621a53f50b9Schristosis deferred if extra information is required before the mount can
622a53f50b9Schristosproceed.  When the information becomes available the mount will take
623a53f50b9Schristosplace, but in the mean time no reply is sent to the kernel.  If the
624a53f50b9Schristosmount is deferred, @i{Amd} continues to try any remaining locations.
625a53f50b9Schristos@end itemize
626a53f50b9Schristos
627a53f50b9SchristosOnce a volume has been mounted, @i{Amd} establishes a @dfn{volume
628a53f50b9Schristosmapping} which is used to satisfy subsequent requests.@refill
629a53f50b9Schristos
630a53f50b9Schristos@node Automatic Unmounting, Keep-alives, Mounting a Volume, Overview
631a53f50b9Schristos@comment  node-name,  next,  previous,  up
632a53f50b9Schristos@section Automatic Unmounting
633a53f50b9Schristos
634a53f50b9SchristosTo avoid an ever increasing number of filesystem mounts, @i{Amd} removes
635a53f50b9Schristosvolume mappings which have not been used recently.  A time-to-live
636a53f50b9Schristosinterval is associated with each mapping and when that expires the
637a53f50b9Schristosmapping is removed.  When the last reference to a filesystem is removed,
638a53f50b9Schristosthat filesystem is unmounted.  If the unmount fails, for example the
639a53f50b9Schristosfilesystem is still busy, the mapping is re-instated and its
640a53f50b9Schristostime-to-live interval is extended.  The global default for this grace
641a53f50b9Schristosperiod is controlled by the @code{-w} command-line option (@pxref{-w
642a53f50b9SchristosOption, -w}) or the @i{amd.conf} parameter @samp{dismount_interval}
643a53f50b9Schristos(@pxref{dismount_interval Parameter}).  It is also possible to set this
644a53f50b9Schristosvalue on a per-mount basis (@pxref{opts Option, opts, opts}).
645a53f50b9Schristos
646a53f50b9SchristosFilesystems can be forcefully timed out using the @i{Amq} command.
647a53f50b9Schristos@xref{Run-time Administration}.  Note that on new enough systems that
648a53f50b9Schristossupport forced unmounts, such as Linux, @i{Amd} can try to use the
649a53f50b9Schristos@b{umount2}(2) system call to force the unmount, if the regular
650a53f50b9Schristos@b{umount}(2) system call failed in a way that indicates that the
651a53f50b9Schristosmount point is hung or stale.  @xref{forced_unmounts Parameter}.
652a53f50b9Schristos
653a53f50b9Schristos@node Keep-alives, Non-blocking Operation, Automatic Unmounting, Overview
654a53f50b9Schristos@comment  node-name,  next,  previous,  up
655a53f50b9Schristos@section Keep-alives
656a53f50b9Schristos@cindex Keep-alives
657a53f50b9Schristos@cindex Server crashes
658a53f50b9Schristos@cindex NFS ping
659a53f50b9Schristos
660a53f50b9SchristosUse of some filesystem types requires the presence of a server on
661a53f50b9Schristosanother machine.  If a machine crashes then it is of no concern to
662a53f50b9Schristosprocesses on that machine that the filesystem is unavailable.  However,
663a53f50b9Schristosto processes on a remote host using that machine as a fileserver this
664a53f50b9Schristosevent is important.  This situation is most widely recognized when an
665a53f50b9SchristosNFS server crashes and the behavior observed on client machines is that
666a53f50b9Schristosmore and more processes hang.  In order to provide the possibility of
667a53f50b9Schristosrecovery, @i{Amd} implements a @dfn{keep-alive} interval timer for some
668a53f50b9Schristosfilesystem types.  Currently only NFS makes use of this service.
669a53f50b9Schristos
670a53f50b9SchristosThe basis of the NFS keep-alive implementation is the observation that
671a53f50b9Schristosmost sites maintain replicated copies of common system data such as
672a53f50b9Schristosmanual pages, most or all programs, system source code and so on.  If
673a53f50b9Schristosone of those servers goes down it would be reasonable to mount one of
674a53f50b9Schristosthe others as a replacement.
675a53f50b9Schristos
676a53f50b9SchristosThe first part of the process is to keep track of which fileservers are
677a53f50b9Schristosup and which are down.  @i{Amd} does this by sending RPC requests to the
678a53f50b9Schristosservers' NFS @code{NullProc} and checking whether a reply is returned.
679a53f50b9SchristosWhile the server state is uncertain the requests are re-transmitted at
680a53f50b9Schristosthree second intervals and if no reply is received after four attempts
681a53f50b9Schristosthe server is marked down.  If a reply is received the fileserver is
682a53f50b9Schristosmarked up and stays in that state for 30 seconds at which time another
683a53f50b9SchristosNFS ping is sent.  This interval is configurable and can even be
684a53f50b9Schristosturned off using the @i{ping} option.  @xref{opts Option}.
685a53f50b9Schristos
686a53f50b9SchristosOnce a fileserver is marked down, requests continue to be sent every 30
687a53f50b9Schristosseconds in order to determine when the fileserver comes back up.  During
688a53f50b9Schristosthis time any reference through @i{Amd} to the filesystems on that
689a53f50b9Schristosserver fail with the error ``Operation would block''.  If a replacement
690a53f50b9Schristosvolume is available then it will be mounted, otherwise the error is
691a53f50b9Schristosreturned to the user.
692a53f50b9Schristos
693a53f50b9Schristos@c @i{Amd} keeps track of which servers are up and which are down.
694a53f50b9Schristos@c It does this by sending RPC requests to the servers' NFS {\sc NullProc} and
695a53f50b9Schristos@c checking whether a reply is returned.  If no replies are received after a
696a53f50b9Schristos@c short period, @i{Amd} marks the fileserver @dfn{down}.
697a53f50b9Schristos@c RPC requests continue to be sent so that it will notice when a fileserver
698a53f50b9Schristos@c comes back up.
699a53f50b9Schristos@c ICMP echo packets \cite{rfc:icmp} are not used because it is the availability
700a53f50b9Schristos@c of the NFS service that is important, not the existence of a base kernel.
701a53f50b9Schristos@c Whenever a reference to a fileserver which is down is made via @i{Amd}, an alternate
702a53f50b9Schristos@c filesystem is mounted if one is available.
703a53f50b9Schristos@c
704a53f50b9SchristosAlthough this action does not protect user files, which are unique on
705a53f50b9Schristosthe network, or processes which do not access files via @i{Amd} or
706a53f50b9Schristosalready have open files on the hung filesystem, it can prevent most new
707a53f50b9Schristosprocesses from hanging.
708a53f50b9Schristos@c
709a53f50b9Schristos@c With a suitable combination of filesystem management and mount-maps,
710a53f50b9Schristos@c machines can be protected against most server downtime.  This can be
711a53f50b9Schristos@c enhanced by allocating boot-servers dynamically which allows a diskless
712a53f50b9Schristos@c workstation to be quickly restarted if necessary.  Once the root filesystem
713a53f50b9Schristos@c is mounted, @i{Amd} can be started and allowed to mount the remainder of
714a53f50b9Schristos@c the filesystem from whichever fileservers are available.
715a53f50b9Schristos
716a53f50b9Schristos@node Non-blocking Operation, , Keep-alives, Overview
717a53f50b9Schristos@comment  node-name,  next,  previous,  up
718a53f50b9Schristos@section Non-blocking Operation
719a53f50b9Schristos@cindex Non-blocking operation
720a53f50b9Schristos@cindex Multiple-threaded server
721a53f50b9Schristos@cindex RPC retries
722a53f50b9Schristos
723a53f50b9SchristosSince there is only one instance of @i{Amd} for each automount point,
724a53f50b9Schristosand usually only one instance on each machine, it is important that it
725a53f50b9Schristosis always available to service kernel calls.  @i{Amd} goes to great
726a53f50b9Schristoslengths to ensure that it does not block in a system call.  As a last
727a53f50b9Schristosresort @i{Amd} will fork before it attempts a system call that may block
728a53f50b9Schristosindefinitely, such as mounting an NFS filesystem.  Other tasks such as
729a53f50b9Schristosobtaining filehandle information for an NFS filesystem, are done using a
730a53f50b9Schristospurpose built non-blocking RPC library which is integrated with
731a53f50b9Schristos@i{Amd}'s task scheduler.  This library is also used to implement NFS
732a53f50b9Schristoskeep-alives (@pxref{Keep-alives}).
733a53f50b9Schristos
734a53f50b9SchristosWhenever a mount is deferred or backgrounded, @i{Amd} must wait for it
735a53f50b9Schristosto complete before replying to the kernel.  However, this would cause
736a53f50b9Schristos@i{Amd} to block waiting for a reply to be constructed.  Rather than do
737a53f50b9Schristosthis, @i{Amd} simply @dfn{drops} the call under the assumption that the
738a53f50b9Schristoskernel RPC mechanism will automatically retry the request.
739a53f50b9Schristos
740a53f50b9Schristos@c ################################################################
741a53f50b9Schristos@node Supported Platforms, Mount Maps, Overview, Top
742a53f50b9Schristos@comment  node-name,  next,  previous,  up
743a53f50b9Schristos@chapter Supported Platforms
744a53f50b9Schristos@cindex Supported Platforms
745a53f50b9Schristos@cindex shared libraries
746a53f50b9Schristos@cindex NFS V.3 support
747a53f50b9Schristos
748a53f50b9Schristos@i{Am-utils} has been ported to a wide variety of machines and operating
749a53f50b9Schristossystems.  @i{Am-utils}'s code works for little-endian and big-endian
750a53f50b9Schristosmachines, as well as 32 bit and 64 bit architectures.  Furthermore, when
751a53f50b9Schristos@i{Am-utils} ports to an Operating System on one architecture, it is generally
752a53f50b9Schristosreadily portable to the same Operating System on all platforms on which
753a53f50b9Schristosit is available.
754a53f50b9Schristos
755a53f50b9SchristosSee the @file{INSTALL} in the distribution for more specific details on
756a53f50b9Schristosbuilding and/or configuring for some systems.
757a53f50b9Schristos
758a53f50b9Schristos@c ################################################################
759a53f50b9Schristos@node Mount Maps, Amd Command Line Options, Supported Platforms, Top
760a53f50b9Schristos@comment  node-name,  next,  previous,  up
761a53f50b9Schristos@chapter Mount Maps
762a53f50b9Schristos@cindex Mount maps
763a53f50b9Schristos@cindex Automounter configuration maps
764a53f50b9Schristos@cindex Mount information
765a53f50b9Schristos
766a53f50b9Schristos@i{Amd} has no built-in knowledge of machines or filesystems.
767a53f50b9SchristosExternal @dfn{mount-maps} are used to provide the required information.
768a53f50b9SchristosSpecifically, @i{Amd} needs to know when and under what conditions it
769a53f50b9Schristosshould mount filesystems.
770a53f50b9Schristos
771a53f50b9SchristosThe map entry corresponding to the requested name contains a list of
772a53f50b9Schristospossible locations from which to resolve the request.  Each location
773a53f50b9Schristosspecifies filesystem type, information required by that filesystem (for
774a53f50b9Schristosexample the block special device in the case of UFS), and some
775a53f50b9Schristosinformation describing where to mount the filesystem (@pxref{fs Option}).  A
776a53f50b9Schristoslocation may also contain @dfn{selectors} (@pxref{Selectors}).@refill
777a53f50b9Schristos
778a53f50b9Schristos@menu
779a53f50b9Schristos* Map Types::
780a53f50b9Schristos* Key Lookup::
781a53f50b9Schristos* Location Format::
782a53f50b9Schristos@end menu
783a53f50b9Schristos
784a53f50b9Schristos@node Map Types, Key Lookup, Mount Maps, Mount Maps
785a53f50b9Schristos@comment  node-name,  next,  previous,  up
786a53f50b9Schristos@section Map Types
787a53f50b9Schristos@cindex Mount map types
788a53f50b9Schristos@cindex Map types
789a53f50b9Schristos@cindex Configuration map types
790a53f50b9Schristos@cindex Types of mount map
791a53f50b9Schristos@cindex Types of configuration map
792a53f50b9Schristos@cindex Determining the map type
793a53f50b9Schristos
794a53f50b9SchristosA mount-map provides the run-time configuration information to @i{Amd}.
795a53f50b9SchristosMaps can be implemented in many ways.  Some of the forms supported by
796a53f50b9Schristos@i{Amd} are regular files, ndbm databases, NIS maps, the @dfn{Hesiod}
797a53f50b9Schristosname server, and even the password file.
798a53f50b9Schristos
799a53f50b9SchristosA mount-map @dfn{name} is a sequence of characters.  When an automount
800a53f50b9Schristospoint is created a handle on the mount-map is obtained.  For each map
801a53f50b9Schristostype configured, @i{Amd} attempts to reference the map of the
802a53f50b9Schristosappropriate type.  If a map is found, @i{Amd} notes the type for future
803a53f50b9Schristosuse and deletes the reference, for example closing any open file
804a53f50b9Schristosdescriptors.  The available maps are configured when @i{Amd} is built
805a53f50b9Schristosand can be displayed by running the command @samp{amd -v}.
806a53f50b9Schristos
807a53f50b9SchristosWhen using an @i{Amd} configuration file (@pxref{Amd Configuration File})
808a53f50b9Schristosand the keyword @samp{map_type} (@pxref{map_type Parameter}), you may
809a53f50b9Schristosforce the map used to any type.
810a53f50b9Schristos
811a53f50b9SchristosBy default, @i{Amd} caches data in a mode dependent on the type of map.
812a53f50b9SchristosThis is the same as specifying @samp{cache:=mapdefault} and selects a
813a53f50b9Schristossuitable default cache mode depending on the map type.  The individual
814a53f50b9Schristosdefaults are described below.  The @var{cache} option can be specified
815a53f50b9Schristoson automount points to alter the caching behavior (@pxref{Automount
816a53f50b9SchristosFilesystem}).@refill
817a53f50b9Schristos
818a53f50b9SchristosThe following map types have been implemented, though some are not
819a53f50b9Schristosavailable on all machines.  Run the command @samp{amd -v} to obtain a
820a53f50b9Schristoslist of map types configured on your machine.
821a53f50b9Schristos
822a53f50b9Schristos@menu
823a53f50b9Schristos* File maps::
824a53f50b9Schristos* ndbm maps::
825a53f50b9Schristos* NIS maps::
826a53f50b9Schristos* NIS+ maps::
827a53f50b9Schristos* Hesiod maps::
828a53f50b9Schristos* Password maps::
829a53f50b9Schristos* Union maps::
830a53f50b9Schristos* LDAP maps::
831a53f50b9Schristos* Executable maps::
832a53f50b9Schristos@end menu
833a53f50b9Schristos
834a53f50b9Schristos@c ----------------------------------------------------------------
835a53f50b9Schristos@node File maps, ndbm maps, Map Types, Map Types
836a53f50b9Schristos@comment  node-name,  next,  previous,  up
837a53f50b9Schristos@subsection File maps
838a53f50b9Schristos@cindex File maps
839a53f50b9Schristos@cindex Flat file maps
840a53f50b9Schristos@cindex File map syntactic conventions
841a53f50b9Schristos
842a53f50b9SchristosWhen @i{Amd} searches a file for a map entry it does a simple scan of
843a53f50b9Schristosthe file and supports both comments and continuation lines.
844a53f50b9Schristos
845a53f50b9SchristosContinuation lines are indicated by a backslash character (@samp{\}) as
846a53f50b9Schristosthe last character of a line in the file.  The backslash, newline character
847a53f50b9Schristos@emph{and any leading white space on the following line} are discarded.  A maximum
848a53f50b9Schristosline length of 2047 characters is enforced after continuation lines are read
849a53f50b9Schristosbut before comments are stripped.  Each line must end with
850a53f50b9Schristosa newline character; that is newlines are terminators, not separators.
851a53f50b9SchristosThe following examples illustrate this:
852a53f50b9Schristos
853a53f50b9Schristos@example
854a53f50b9Schristoskey     valA   valB;   \
855a53f50b9Schristos          valC
856a53f50b9Schristos@end example
857a53f50b9Schristos
858a53f50b9Schristosspecifies @emph{three} locations, and is identical to
859a53f50b9Schristos
860a53f50b9Schristos@example
861a53f50b9Schristoskey     valA   valB;   valC
862a53f50b9Schristos@end example
863a53f50b9Schristos
864a53f50b9SchristosHowever,
865a53f50b9Schristos
866a53f50b9Schristos@example
867a53f50b9Schristoskey     valA   valB;\
868a53f50b9Schristos          valC
869a53f50b9Schristos@end example
870a53f50b9Schristos
871a53f50b9Schristosspecifies only @emph{two} locations, and is identical to
872a53f50b9Schristos
873a53f50b9Schristos@example
874a53f50b9Schristoskey     valA   valB;valC
875a53f50b9Schristos@end example
876a53f50b9Schristos
877a53f50b9SchristosAfter a complete line has been read from the file, including
878a53f50b9Schristoscontinuations, @i{Amd} determines whether there is a comment on the
879a53f50b9Schristosline.  A comment begins with a hash (``@samp{#}'') character and
880a53f50b9Schristoscontinues to the end of the line.  There is no way to escape or change
881a53f50b9Schristosthe comment lead-in character.
882a53f50b9Schristos
883a53f50b9SchristosNote that continuation lines and comment support @dfn{only} apply to
884a53f50b9Schristosfile maps, or ndbm maps built with the @code{mk-amd-map} program.
885a53f50b9Schristos
886a53f50b9SchristosWhen caching is enabled, file maps have a default cache mode of
887a53f50b9Schristos@code{all} (@pxref{Automount Filesystem}).
888a53f50b9Schristos
889a53f50b9Schristos@c ----------------------------------------------------------------
890a53f50b9Schristos@node ndbm maps, NIS maps, File maps, Map Types
891a53f50b9Schristos@comment  node-name,  next,  previous,  up
892a53f50b9Schristos@subsection ndbm maps
893a53f50b9Schristos@cindex ndbm maps
894a53f50b9Schristos
895a53f50b9SchristosAn ndbm map may be used as a fast access form of a file map.  The program,
896a53f50b9Schristos@code{mk-amd-map}, converts a normal map file into an ndbm database.
897a53f50b9SchristosThis program supports the same continuation and comment conventions that
898a53f50b9Schristosare provided for file maps.  Note that ndbm format files may @emph{not}
899a53f50b9Schristosbe sharable across machine architectures.  The notion of speed generally
900a53f50b9Schristosonly applies to large maps; a small map, less than a single disk block,
901a53f50b9Schristosis almost certainly better implemented as a file map.
902a53f50b9Schristos
903a53f50b9Schristosndbm maps have a default cache mode of @samp{all}
904a53f50b9Schristos(@pxref{Automount Filesystem}).
905a53f50b9Schristos
906a53f50b9Schristos@c ----------------------------------------------------------------
907a53f50b9Schristos@node NIS maps, NIS+ maps, ndbm maps, Map Types
908a53f50b9Schristos@comment  node-name,  next,  previous,  up
909a53f50b9Schristos@subsection NIS maps
910a53f50b9Schristos@cindex NIS (YP) maps
911a53f50b9Schristos
912a53f50b9SchristosWhen using NIS (formerly YP), an @i{Amd} map is implemented directly
913a53f50b9Schristosby the underlying NIS map.  Comments and continuation lines are
914a53f50b9Schristos@emph{not} supported in the automounter and must be stripped when
915a53f50b9Schristosconstructing the NIS server's database.
916a53f50b9Schristos
917a53f50b9SchristosNIS maps have a default cache mode of @code{all} (@pxref{Automount
918a53f50b9SchristosFilesystem}).
919a53f50b9Schristos
920a53f50b9SchristosThe following rule illustrates what could be added to your NIS @file{Makefile},
921a53f50b9Schristosin this case causing the @file{amd.home} map to be rebuilt:
922a53f50b9Schristos@example
923a53f50b9Schristos$(YPTSDIR)/amd.home.time: $(ETCDIR)/amd.home
924a53f50b9Schristos    -@@sed -e "s/#.*$$//" -e "/^$$/d" $(ETCDIR)/amd.home | \
925a53f50b9Schristos      awk '@{  \
926a53f50b9Schristos         for (i = 1; i <= NF; i++) \
927a53f50b9Schristos             if (i == NF) @{ \
928a53f50b9Schristos             if (substr($$i, length($$i), 1) == "\\") \
929a53f50b9Schristos                 printf("%s", substr($$i, 1, length($$i) - 1)); \
930a53f50b9Schristos             else \
931a53f50b9Schristos                 printf("%s\n", $$i); \
932a53f50b9Schristos             @} \
933a53f50b9Schristos             else \
934a53f50b9Schristos             printf("%s ", $$i); \
935a53f50b9Schristos         @}' | \
936a53f50b9Schristos    $(MAKEDBM) - $(YPDBDIR)/amd.home; \
937a53f50b9Schristos    touch $(YPTSDIR)/amd.home.time; \
938a53f50b9Schristos    echo "updated amd.home"; \
939a53f50b9Schristos    if [ ! $(NOPUSH) ]; then \
940a53f50b9Schristos        $(YPPUSH) amd.home; \
941a53f50b9Schristos        echo "pushed amd.home"; \
942a53f50b9Schristos    else \
943a53f50b9Schristos        : ; \
944a53f50b9Schristos    fi
945a53f50b9Schristos@end example
946a53f50b9Schristos
947a53f50b9SchristosHere @code{$(YPTSDIR)} contains the time stamp files, and
948a53f50b9Schristos@code{$(YPDBDIR)} contains the dbm format NIS files.
949a53f50b9Schristos
950a53f50b9Schristos@c ----------------------------------------------------------------
951a53f50b9Schristos@node NIS+ maps, Hesiod maps, NIS maps, Map Types
952a53f50b9Schristos@comment  node-name,  next,  previous,  up
953a53f50b9Schristos@subsection NIS+ maps
954a53f50b9Schristos@cindex NIS+ maps
955a53f50b9Schristos
956a53f50b9SchristosNIS+ maps do not support cache mode @samp{all} and, when caching is
957a53f50b9Schristosenabled, have a default cache mode of @samp{inc}.
958a53f50b9Schristos
959a53f50b9SchristosXXX: FILL IN WITH AN EXAMPLE.
960a53f50b9Schristos
961a53f50b9Schristos@c ----------------------------------------------------------------
962a53f50b9Schristos@node Hesiod maps, Password maps, NIS+ maps, Map Types
963a53f50b9Schristos@comment  node-name,  next,  previous,  up
964a53f50b9Schristos@subsection Hesiod maps
965a53f50b9Schristos@cindex Hesiod maps
966a53f50b9Schristos
967a53f50b9SchristosWhen the map name begins with the string @samp{hesiod.} lookups are made
968a53f50b9Schristosusing the @dfn{Hesiod} name server.  The string following the dot is
969a53f50b9Schristosused as a name qualifier and is prepended with the key being located.
970a53f50b9SchristosThe entire string is then resolved in the @code{automount} context, or
971a53f50b9Schristosthe @i{amd.conf} parameter @samp{hesiod_base} (@pxref{hesiod_base
972a53f50b9SchristosParameter}).  For example, if the key is @samp{jsp} and map name is
973a53f50b9Schristos@samp{hesiod.homes} then @dfn{Hesiod} is asked to resolve
974a53f50b9Schristos@samp{jsp.homes.automount}.
975a53f50b9Schristos
976a53f50b9SchristosHesiod maps do not support cache mode @samp{all} and, when caching is
977a53f50b9Schristosenabled, have a default cache mode of @samp{inc} (@pxref{Automount
978a53f50b9SchristosFilesystem}).
979a53f50b9Schristos
980a53f50b9SchristosThe following is an example of a @dfn{Hesiod} map entry:
981a53f50b9Schristos
982a53f50b9Schristos@example
983a53f50b9Schristosjsp.homes.automount HS TXT "rfs:=/home/charm;rhost:=charm;sublink:=jsp"
984a53f50b9Schristosnjw.homes.automount HS TXT "rfs:=/home/dylan/dk2;rhost:=dylan;sublink:=njw"
985a53f50b9Schristos@end example
986a53f50b9Schristos
987a53f50b9Schristos@c ----------------------------------------------------------------
988a53f50b9Schristos@node Password maps, Union maps, Hesiod maps, Map Types
989a53f50b9Schristos@comment  node-name,  next,  previous,  up
990a53f50b9Schristos@subsection Password maps
991a53f50b9Schristos@cindex Password file maps
992a53f50b9Schristos@cindex /etc/passwd maps
993a53f50b9Schristos@cindex User maps, automatic generation
994a53f50b9Schristos@cindex Automatic generation of user maps
995a53f50b9Schristos@cindex Using the password file as a map
996a53f50b9Schristos
997a53f50b9SchristosThe password map support is unlike the four previous map types.  When
998a53f50b9Schristosthe map name is the string @file{/etc/passwd} @i{Amd} can lookup a user
999a53f50b9Schristosname in the password file and re-arrange the home directory field to
1000a53f50b9Schristosproduce a usable map entry.
1001a53f50b9Schristos
1002a53f50b9Schristos@i{Amd} assumes the home directory has the format
1003a53f50b9Schristos`@t{/}@i{anydir}@t{/}@i{dom1}@t{/../}@i{domN}@t{/}@i{login}'.
1004a53f50b9Schristos@c @footnote{This interpretation is not necessarily exactly what you want.}
1005a53f50b9SchristosIt breaks this string into a map entry where @code{$@{rfs@}} has the
1006a53f50b9Schristosvalue `@t{/}@i{anydir}@t{/}@i{domN}', @code{$@{rhost@}} has the value
1007a53f50b9Schristos`@i{domN}@t{.}@i{...}@t{.}@i{dom1}', and @code{$@{sublink@}} has the
1008a53f50b9Schristosvalue @i{login}.@refill
1009a53f50b9Schristos
1010a53f50b9SchristosThus if the password file entry was
1011a53f50b9Schristos
1012a53f50b9Schristos@example
1013a53f50b9Schristos/home/achilles/jsp
1014a53f50b9Schristos@end example
1015a53f50b9Schristos
1016a53f50b9Schristosthe map entry used by @i{Amd} would be
1017a53f50b9Schristos
1018a53f50b9Schristos@example
1019a53f50b9Schristosrfs:=/home/achilles;rhost:=achilles;sublink:=jsp
1020a53f50b9Schristos@end example
1021a53f50b9Schristos
1022a53f50b9SchristosSimilarly, if the password file entry was
1023a53f50b9Schristos
1024a53f50b9Schristos@example
1025a53f50b9Schristos/home/cc/sugar/mjh
1026a53f50b9Schristos@end example
1027a53f50b9Schristos
1028a53f50b9Schristosthe map entry used by @i{Amd} would be
1029a53f50b9Schristos
1030a53f50b9Schristos@example
1031a53f50b9Schristosrfs:=/home/sugar;rhost:=sugar.cc;sublink:=mhj
1032a53f50b9Schristos@end example
1033a53f50b9Schristos
1034a53f50b9Schristos@c ----------------------------------------------------------------
1035a53f50b9Schristos@node Union maps, LDAP maps, Password maps, Map Types
1036a53f50b9Schristos@comment  node-name,  next,  previous,  up
1037a53f50b9Schristos@subsection Union maps
1038a53f50b9Schristos@cindex Union file maps
1039a53f50b9Schristos
1040a53f50b9SchristosThe union map support is provided specifically for use with the union
1041a53f50b9Schristosfilesystem, @pxref{Union Filesystem}.
1042a53f50b9Schristos
1043a53f50b9SchristosIt is identified by the string @samp{union:} which is followed by a
1044a53f50b9Schristoscolon separated list of directories.  The directories are read in order,
1045a53f50b9Schristosand the names of all entries are recorded in the map cache.  Later
1046a53f50b9Schristosdirectories take precedence over earlier ones.  The union filesystem
1047a53f50b9Schristostype then uses the map cache to determine the union of the names in all
1048a53f50b9Schristosthe directories.
1049a53f50b9Schristos
1050a53f50b9Schristos@c ----------------------------------------------------------------
1051a53f50b9Schristos@node LDAP maps, Executable maps, Union maps, Map Types
1052a53f50b9Schristos@comment  node-name,  next,  previous,  up
1053a53f50b9Schristos@subsection LDAP maps
1054a53f50b9Schristos@cindex LDAP maps
1055a53f50b9Schristos@cindex Lightweight Directory Access Protocol
1056a53f50b9Schristos
1057a53f50b9SchristosLDAP (Lightweight Directory Access Protocol) maps do not support cache
1058a53f50b9Schristosmode @samp{all} and, when caching is enabled, have a default cache mode
1059a53f50b9Schristosof @samp{inc}.
1060a53f50b9Schristos
1061a53f50b9SchristosFor example, an @i{Amd} map @samp{amd.home} that looks as follows:
1062a53f50b9Schristos
1063a53f50b9Schristos@example
1064a53f50b9Schristos/defaults    opts:=rw,intr;type:=link
1065a53f50b9Schristos
1066a53f50b9Schristoszing         -rhost:=shekel \
1067a53f50b9Schristos             host==shekel \
1068a53f50b9Schristos             host!=shekel;type:=nfs
1069a53f50b9Schristos@end example
1070a53f50b9Schristos@noindent
1071a53f50b9Schristoswhen converted to LDAP (@pxref{amd2ldif}), will result in the following
1072a53f50b9SchristosLDAP database:
1073a53f50b9Schristos@example
1074a53f50b9Schristos$ amd2ldif amd.home CUCS < amd.home
1075a53f50b9Schristosdn: cn=amdmap timestamp, CUCS
1076a53f50b9Schristoscn             : amdmap timestamp
1077a53f50b9SchristosobjectClass    : amdmapTimestamp
1078a53f50b9SchristosamdmapTimestamp: 873071363
1079a53f50b9Schristos
1080a53f50b9Schristosdn: cn=amdmap amd.home[/defaults], CUCS
1081a53f50b9Schristoscn          : amdmap amd.home[/defaults]
1082a53f50b9SchristosobjectClass : amdmap
1083a53f50b9SchristosamdmapName  : amd.home
1084a53f50b9SchristosamdmapKey   : /defaults
1085a53f50b9SchristosamdmapValue : opts:=rw,intr;type:=link
1086a53f50b9Schristos
1087a53f50b9Schristosdn: cn=amdmap amd.home[], CUCS
1088a53f50b9Schristoscn          : amdmap amd.home[]
1089a53f50b9SchristosobjectClass : amdmap
1090a53f50b9SchristosamdmapName  : amd.home
1091a53f50b9SchristosamdmapKey   :
1092a53f50b9SchristosamdmapValue :
1093a53f50b9Schristos
1094a53f50b9Schristosdn: cn=amdmap amd.home[zing], CUCS
1095a53f50b9Schristoscn          : amdmap amd.home[zing]
1096a53f50b9SchristosobjectClass : amdmap
1097a53f50b9SchristosamdmapName  : amd.home
1098a53f50b9SchristosamdmapKey   : zing
1099a53f50b9SchristosamdmapValue : -rhost:=shekel host==shekel host!=shekel;type:=nfs
1100a53f50b9Schristos@end example
1101a53f50b9Schristos
1102a53f50b9Schristos@c ----------------------------------------------------------------
1103a53f50b9Schristos@node Executable maps, , LDAP maps, Map Types
1104a53f50b9Schristos@comment  node-name,  next,  previous,  up
1105a53f50b9Schristos@subsection Executable maps
1106a53f50b9Schristos@cindex Executable maps
1107a53f50b9Schristos
1108a53f50b9SchristosAn executable map is a dynamic map in which the keys and values for
1109a53f50b9Schristosthe maps are generated on the fly by a program or script.  The program
1110a53f50b9Schristosis expected to take a single parameter argument which is the key to
1111a53f50b9Schristoslookup.  If the key is found, the program should print on stdout the
1112a53f50b9Schristoskey-value pair that were found; if the key was not found, nothing
1113a53f50b9Schristosshould be printed out.  Below is an sample of such a map script:
1114a53f50b9Schristos
1115a53f50b9Schristos@example
1116a53f50b9Schristos#!/bin/sh
1117a53f50b9Schristos# executable map example
1118a53f50b9Schristoscase "$1" in
1119a53f50b9Schristos    "/defaults" )
1120a53f50b9Schristos	echo "/defaults   type:=nfs;rfs:=filer"
1121a53f50b9Schristos	;;
1122a53f50b9Schristos    "a" )
1123a53f50b9Schristos	echo "a   type:=nfs;fs:=/tmp"
1124a53f50b9Schristos	;;
1125a53f50b9Schristos    "b" )
1126a53f50b9Schristos	echo "b   type:=link;fs:=/usr/local"
1127a53f50b9Schristos	;;
1128a53f50b9Schristos    * )  # no match, echo nothing
1129a53f50b9Schristos	;;
1130a53f50b9Schristosesac
1131a53f50b9Schristos@end example
1132a53f50b9Schristos
1133a53f50b9Schristos@xref{exec_map_timeout Parameter}.
1134a53f50b9Schristos
1135a53f50b9Schristos@c ----------------------------------------------------------------
1136a53f50b9Schristos@c subsection Gdbm
1137a53f50b9Schristos@c ----------------------------------------------------------------
1138a53f50b9Schristos@node Key Lookup, Location Format, Map Types, Mount Maps
1139a53f50b9Schristos@comment  node-name,  next,  previous,  up
1140a53f50b9Schristos@section How keys are looked up
1141a53f50b9Schristos@cindex Key lookup
1142a53f50b9Schristos@cindex Map lookup
1143a53f50b9Schristos@cindex Looking up keys
1144a53f50b9Schristos@cindex How keys are looked up
1145a53f50b9Schristos@cindex Wildcards in maps
1146a53f50b9Schristos
1147a53f50b9SchristosThe key is located in the map whose type was determined when the
1148a53f50b9Schristosautomount point was first created.  In general the key is a pathname
1149a53f50b9Schristoscomponent.  In some circumstances this may be modified by variable
1150a53f50b9Schristosexpansion (@pxref{Variable Expansion}) and prefixing.  If the automount
1151a53f50b9Schristospoint has a prefix, specified by the @var{pref} option, then that is
1152a53f50b9Schristosprepended to the search key before the map is searched.
1153a53f50b9Schristos
1154a53f50b9SchristosIf the map cache is a @samp{regexp} cache then the key is treated as an
1155a53f50b9Schristosegrep-style regular expression, otherwise a normal string comparison is
1156a53f50b9Schristosmade.
1157a53f50b9Schristos
1158a53f50b9SchristosIf the key cannot be found then a @dfn{wildcard} match is attempted.
1159a53f50b9Schristos@i{Amd} repeatedly strips the basename from the key, appends @samp{/*} and
1160a53f50b9Schristosattempts a lookup.  Finally, @i{Amd} attempts to locate the special key @samp{*}.
1161a53f50b9Schristos
1162a53f50b9SchristosFor example, the following sequence would be checked if @file{home/dylan/dk2} was
1163a53f50b9Schristosbeing located:
1164a53f50b9Schristos
1165a53f50b9Schristos@example
1166a53f50b9Schristos   home/dylan/dk2
1167a53f50b9Schristos   home/dylan/*
1168a53f50b9Schristos   home/*
1169a53f50b9Schristos   *
1170a53f50b9Schristos@end example
1171a53f50b9Schristos
1172a53f50b9SchristosAt any point when a wildcard is found, @i{Amd} proceeds as if an exact
1173a53f50b9Schristosmatch had been found and the value field is then used to resolve the
1174a53f50b9Schristosmount request, otherwise an error code is propagated back to the kernel.
1175a53f50b9Schristos(@pxref{Filesystem Types}).@refill
1176a53f50b9Schristos
1177a53f50b9Schristos@node Location Format, , Key Lookup, Mount Maps
1178a53f50b9Schristos@comment  node-name,  next,  previous,  up
1179a53f50b9Schristos@section Location Format
1180a53f50b9Schristos@cindex Location format
1181a53f50b9Schristos@cindex Map entry format
1182a53f50b9Schristos@cindex How locations are parsed
1183a53f50b9Schristos
1184a53f50b9SchristosThe value field from the lookup provides the information required to
1185a53f50b9Schristosmount a filesystem.  The information is parsed according to the syntax
1186a53f50b9Schristosshown below.
1187a53f50b9Schristos
1188a53f50b9Schristos@display
1189a53f50b9Schristos@i{location-list}:
1190a53f50b9Schristos                  @i{location-selection}
1191a53f50b9Schristos                  @i{location-list} @i{white-space} @t{||} @i{white-space} @i{location-selection}
1192a53f50b9Schristos@i{location-selection}:
1193a53f50b9Schristos                  @i{location}
1194a53f50b9Schristos                  @i{location-selection} @i{white-space} @i{location}
1195a53f50b9Schristos@i{location}:
1196a53f50b9Schristos                  @i{location-info}
1197a53f50b9Schristos                  @t{-}@i{location-info}
1198a53f50b9Schristos                  @t{-}
1199a53f50b9Schristos@i{location-info}:
1200a53f50b9Schristos                  @i{sel-or-opt}
1201a53f50b9Schristos                  @i{location-info}@t{;}@i{sel-or-opt}
1202a53f50b9Schristos                  @t{;}
1203a53f50b9Schristos@i{sel-or-opt}:
1204a53f50b9Schristos                  @i{selection}
1205a53f50b9Schristos                  @i{opt-ass}
1206a53f50b9Schristos@i{selection}:
1207a53f50b9Schristos                  selector@t{==}@i{value}
1208a53f50b9Schristos                  selector@t{!=}@i{value}
1209a53f50b9Schristos@i{opt-ass}:
1210a53f50b9Schristos                  option@t{:=}@i{value}
1211a53f50b9Schristos@i{white-space}:
1212a53f50b9Schristos                  space
1213a53f50b9Schristos                  tab
1214a53f50b9Schristos@end display
1215a53f50b9Schristos
1216a53f50b9SchristosNote that unquoted whitespace is not allowed in a location description.
1217a53f50b9SchristosWhite space is only allowed, and is mandatory, where shown with non-terminal
1218a53f50b9Schristos@i{white-space}.
1219a53f50b9Schristos
1220a53f50b9SchristosA @dfn{location-selection} is a list of possible volumes with which to
1221a53f50b9Schristossatisfy the request.  Each @dfn{location-selection} is tried
1222a53f50b9Schristossequentially, until either one succeeds or all fail.  This, by the
1223a53f50b9Schristosway, is different from the historically documented behavior, which
1224a53f50b9Schristosclaimed (falsely, at least for last 3 years) that @i{Amd} would
1225a53f50b9Schristosattempt to mount all @dfn{location-selection}s in parallel and the
1226a53f50b9Schristosfirst one to succeed would be used.
1227a53f50b9Schristos
1228a53f50b9Schristos@dfn{location-selection}s are optionally separated by the @samp{||}
1229a53f50b9Schristosoperator.  The effect of this operator is to prevent use of
1230a53f50b9Schristoslocation-selections to its right if any of the location-selections on
1231a53f50b9Schristosits left were selected, whether or not any of them were successfully
1232a53f50b9Schristosmounted (@pxref{Selectors}).@refill
1233a53f50b9Schristos
1234a53f50b9SchristosThe location-selection, and singleton @dfn{location-list},
1235a53f50b9Schristos@samp{type:=ufs;dev:=/dev/xd1g} would inform @i{Amd} to mount a UFS
1236a53f50b9Schristosfilesystem from the block special device @file{/dev/xd1g}.
1237a53f50b9Schristos
1238a53f50b9SchristosThe @dfn{sel-or-opt} component is either the name of an option required
1239a53f50b9Schristosby a specific filesystem, or it is the name of a built-in, predefined
1240a53f50b9Schristosselector such as the architecture type.  The value may be quoted with
1241a53f50b9Schristosdouble quotes @samp{"}, for example
1242a53f50b9Schristos@samp{type:="ufs";dev:="/dev/xd1g"}.  These quotes are stripped when the
1243a53f50b9Schristosvalue is parsed and there is no way to get a double quote into a value
1244a53f50b9Schristosfield.  Double quotes are used to get white space into a value field,
1245a53f50b9Schristoswhich is needed for the program filesystem (@pxref{Program Filesystem}).@refill
1246a53f50b9Schristos
1247a53f50b9Schristos@menu
1248a53f50b9Schristos* Map Defaults::
1249a53f50b9Schristos* Variable Expansion::
1250a53f50b9Schristos* Selectors::
1251a53f50b9Schristos* Map Options::
1252a53f50b9Schristos@end menu
1253a53f50b9Schristos
1254a53f50b9Schristos@node Map Defaults, Variable Expansion, Location Format, Location Format
1255a53f50b9Schristos@comment  node-name,  next,  previous,  up
1256a53f50b9Schristos@subsection Map Defaults
1257a53f50b9Schristos@cindex Map defaults
1258a53f50b9Schristos@cindex How to set default map parameters
1259a53f50b9Schristos@cindex Setting default map parameters
1260a53f50b9Schristos
1261a53f50b9SchristosA location beginning with a dash @samp{-} is used to specify default
1262a53f50b9Schristosvalues for subsequent locations.  Any previously specified defaults in
1263a53f50b9Schristosthe location-list are discarded.  The default string can be empty in
1264a53f50b9Schristoswhich case no defaults apply.
1265a53f50b9Schristos
1266a53f50b9SchristosThe location @samp{-fs:=/mnt;opts:=ro} would set the local mount point
1267a53f50b9Schristosto @file{/mnt} and cause mounts to be read-only by default.  Defaults
1268a53f50b9Schristosspecified this way are appended to, and so override, any global map
1269a53f50b9Schristosdefaults given with @samp{/defaults}).
1270a53f50b9Schristos
1271a53f50b9Schristos@c
1272a53f50b9Schristos@c A @samp{/defaults} value @dfn{gdef} and a location list
1273a53f50b9Schristos@c \begin{quote}
1274a53f50b9Schristos@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$
1275a53f50b9Schristos@c \end{quote}
1276a53f50b9Schristos@c is equivalent to
1277a53f50b9Schristos@c \begin{quote}
1278a53f50b9Schristos@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$
1279a53f50b9Schristos@c \end{quote}
1280a53f50b9Schristos@c which is equivalent to
1281a53f50b9Schristos@c \begin{quote}
1282a53f50b9Schristos@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$
1283a53f50b9Schristos@c \end{quote}
1284a53f50b9Schristos
1285a53f50b9Schristos@node Variable Expansion, Selectors, Map Defaults, Location Format
1286a53f50b9Schristos@comment  node-name,  next,  previous,  up
1287a53f50b9Schristos@subsection Variable Expansion
1288a53f50b9Schristos@cindex Variable expansion
1289a53f50b9Schristos@cindex How variables are expanded
1290a53f50b9Schristos@cindex Pathname operators
1291a53f50b9Schristos@cindex Domain stripping
1292a53f50b9Schristos@cindex Domainname operators
1293a53f50b9Schristos@cindex Stripping the local domain name
1294a53f50b9Schristos@cindex Environment variables
1295a53f50b9Schristos@cindex How to access environment variables in maps
1296a53f50b9Schristos
1297a53f50b9SchristosTo allow generic location specifications @i{Amd} does variable expansion
1298a53f50b9Schristoson each location and also on some of the option strings.  Any option or
1299a53f50b9Schristosselector appearing in the form @code{$@dfn{var}} is replaced by the
1300a53f50b9Schristoscurrent value of that option or selector.  For example, if the value of
1301a53f50b9Schristos@code{$@{key@}} was @samp{bin}, @code{$@{autodir@}} was @samp{/a} and
1302a53f50b9Schristos@code{$@{fs@}} was `@t{$@{autodir@}}@t{/local/}@t{$@{key@}}' then
1303a53f50b9Schristosafter expansion @code{$@{fs@}} would have the value @samp{/a/local/bin}.
1304a53f50b9SchristosAny environment variable can be accessed in a similar way.@refill
1305a53f50b9Schristos
1306a53f50b9SchristosTwo pathname operators are available when expanding a variable.  If the
1307a53f50b9Schristosvariable name begins with @samp{/} then only the last component of the
1308a53f50b9Schristospathname is substituted.  For example, if @code{$@{path@}} was
1309a53f50b9Schristos@samp{/foo/bar} then @code{$@{/path@}} would be expanded to @samp{bar}.
1310a53f50b9SchristosSimilarly, if the variable name ends with @samp{/} then all but the last
1311a53f50b9Schristoscomponent of the pathname is substituted.  In the previous example,
1312a53f50b9Schristos@code{$@{path/@}} would be expanded to @samp{/foo}.@refill
1313a53f50b9Schristos
1314a53f50b9SchristosTwo domain name operators are also provided.  If the variable name
1315a53f50b9Schristosbegins with @samp{.} then only the domain part of the name is
1316a53f50b9Schristossubstituted.  For example, if @code{$@{rhost@}} was
1317a53f50b9Schristos@samp{swan.doc.ic.ac.uk} then @code{$@{.rhost@}} would be expanded to
1318a53f50b9Schristos@samp{doc.ic.ac.uk}.  Similarly, if the variable name ends with @samp{.}
1319a53f50b9Schristosthen only the host component is substituted.  In the previous example,
1320a53f50b9Schristos@code{$@{rhost.@}} would be expanded to @samp{swan}.@refill
1321a53f50b9Schristos
1322a53f50b9SchristosVariable expansion is a two phase process.  Before a location is parsed,
1323a53f50b9Schristosall references to selectors, @i{eg} @code{$@{path@}}, are expanded.  The
1324a53f50b9Schristoslocation is then parsed, selections are evaluated and option assignments
1325a53f50b9Schristosrecorded.  If there were no selections or they all succeeded the
1326a53f50b9Schristoslocation is used and the values of the following options are expanded in
1327a53f50b9Schristosthe order given: @var{sublink}, @var{rfs}, @var{fs}, @var{opts},
1328a53f50b9Schristos@var{remopts}, @var{mount} and @var{unmount}.
1329a53f50b9Schristos
1330a53f50b9SchristosNote that expansion of option values is done after @dfn{all} assignments
1331a53f50b9Schristoshave been completed and not in a purely left to right order as is done
1332a53f50b9Schristosby the shell.  This generally has the desired effect but care must be
1333a53f50b9Schristostaken if one of the options references another, in which case the
1334a53f50b9Schristosordering can become significant.
1335a53f50b9Schristos
1336a53f50b9SchristosThere are two special cases concerning variable expansion:
1337a53f50b9Schristos
1338a53f50b9Schristos@enumerate
1339a53f50b9Schristos@item
1340a53f50b9Schristosbefore a map is consulted, any selectors in the name received
1341a53f50b9Schristosfrom the kernel are expanded.  For example, if the request from the
1342a53f50b9Schristoskernel was for `@t{$@{arch@}}@t{.bin}' and the machine architecture
1343a53f50b9Schristoswas @samp{vax}, the value given to @code{$@{key@}} would be
1344a53f50b9Schristos@samp{vax.bin}.@refill
1345a53f50b9Schristos
1346a53f50b9Schristos@item
1347a53f50b9Schristosthe value of @code{$@{rhost@}} is expanded and normalized before the
1348a53f50b9Schristosother options are expanded.  The normalization process strips any local
1349a53f50b9Schristossub-domain components.  For example, if @code{$@{domain@}} was
1350a53f50b9Schristos@samp{Berkeley.EDU} and @code{$@{rhost@}} was initially
1351a53f50b9Schristos@samp{snow.Berkeley.EDU}, after the normalization it would simply be
1352a53f50b9Schristos@samp{snow}.  Hostname normalization is currently done in a
1353a53f50b9Schristos@emph{case-dependent} manner.@refill
1354a53f50b9Schristos@end enumerate
1355a53f50b9Schristos
1356a53f50b9Schristos@c======================================================================
1357a53f50b9Schristos@node Selectors, Map Options, Variable Expansion, Location Format
1358a53f50b9Schristos@comment  node-name,  next,  previous,  up
1359a53f50b9Schristos@subsection Selectors
1360a53f50b9Schristos@cindex Selectors
1361a53f50b9Schristos
1362a53f50b9SchristosSelectors are used to control the use of a location.  It is possible to
1363a53f50b9Schristosshare a mount map between many machines in such a way that filesystem
1364a53f50b9Schristoslocation, architecture and operating system differences are hidden from
1365a53f50b9Schristosthe users.  A selector of the form @samp{arch==sun3;os==sunos4} would only
1366a53f50b9Schristosapply on Sun-3s running SunOS 4.x.
1367a53f50b9Schristos
1368a53f50b9SchristosSelectors can be negated by using @samp{!=} instead of @samp{==}.  For
1369a53f50b9Schristosexample to select a location on all non-Vax machines the selector
1370a53f50b9Schristos@samp{arch!=vax} would be used.
1371a53f50b9Schristos
1372a53f50b9SchristosSelectors are evaluated left to right.  If a selector fails then that
1373a53f50b9Schristoslocation is ignored.  Thus the selectors form a conjunction and the
1374a53f50b9Schristoslocations form a disjunction.  If all the locations are ignored or
1375a53f50b9Schristosotherwise fail then @i{Amd} uses the @dfn{error} filesystem
1376a53f50b9Schristos(@pxref{Error Filesystem}).  This is equivalent to having a location
1377a53f50b9Schristos@samp{type:=error} at the end of each mount-map entry.@refill
1378a53f50b9Schristos
1379a53f50b9SchristosThe default value of many of the selectors listed here can be overridden
1380a53f50b9Schristosby an @i{Amd} command line switch or in an @i{Amd} configuration file.
1381a53f50b9Schristos@xref{Amd Configuration File}.
1382a53f50b9Schristos
1383a53f50b9SchristosThe following selectors are currently implemented.
1384a53f50b9Schristos
1385a53f50b9Schristos@menu
1386a53f50b9Schristos* arch Selector Variable::
1387a53f50b9Schristos* autodir Selector Variable::
1388a53f50b9Schristos* byte Selector Variable::
1389a53f50b9Schristos* cluster Selector Variable::
1390a53f50b9Schristos* domain Selector Variable::
1391a53f50b9Schristos* dollar Selector Variable::
1392a53f50b9Schristos* host Selector Variable::
1393a53f50b9Schristos* hostd Selector Variable::
1394a53f50b9Schristos* karch Selector Variable::
1395a53f50b9Schristos* os Selector Variable::
1396a53f50b9Schristos* osver Selector Variable::
1397a53f50b9Schristos* full_os Selector Variable::
1398a53f50b9Schristos* vendor Selector Variable::
1399a53f50b9Schristos
1400a53f50b9Schristos* key Selector Variable::
1401a53f50b9Schristos* map Selector Variable::
1402a53f50b9Schristos* netnumber Selector Variable::
1403a53f50b9Schristos* network Selector Variable::
1404a53f50b9Schristos* path Selector Variable::
1405a53f50b9Schristos* wire Selector Variable::
1406a53f50b9Schristos* uid Selector Variable::
1407a53f50b9Schristos* gid Selector Variable::
1408a53f50b9Schristos
1409a53f50b9Schristos* exists Selector Function::
1410a53f50b9Schristos* false Selector Function::
1411a53f50b9Schristos* netgrp Selector Function::
1412a53f50b9Schristos* netgrpd Selector Function::
1413a53f50b9Schristos* in_network Selector Function::
1414a53f50b9Schristos* true Selector Function::
1415a53f50b9Schristos* xhost Selector Function::
1416a53f50b9Schristos@end menu
1417a53f50b9Schristos
1418a53f50b9Schristos@c ----------------------------------------------------------------
1419a53f50b9Schristos@node arch Selector Variable, autodir Selector Variable, Selectors, Selectors
1420a53f50b9Schristos@comment  node-name,  next,  previous,  up
1421a53f50b9Schristos@subsubsection arch Selector Variable
1422a53f50b9Schristos@cindex arch Selector Variable
1423a53f50b9Schristos@cindex arch, mount selector
1424a53f50b9Schristos@cindex Mount selector; arch
1425a53f50b9Schristos@cindex Selector; arch
1426a53f50b9Schristos
1427a53f50b9SchristosThe machine architecture which was automatically determined at compile
1428a53f50b9Schristostime.  The architecture type can be displayed by running the command
1429a53f50b9Schristos@samp{amd -v}.  You can override this value also using the @code{-A}
1430a53f50b9Schristoscommand line option.  @xref{Supported Platforms}.@refill
1431a53f50b9Schristos
1432a53f50b9Schristos@c ----------------------------------------------------------------
1433a53f50b9Schristos@node autodir Selector Variable, byte Selector Variable, arch Selector Variable, Selectors
1434a53f50b9Schristos@comment  node-name,  next,  previous,  up
1435a53f50b9Schristos@subsubsection autodir Selector Variable
1436a53f50b9Schristos@cindex autodir Selector Variable
1437a53f50b9Schristos@cindex autodir, mount selector
1438a53f50b9Schristos@cindex Mount selector; autodir
1439a53f50b9Schristos@cindex Selector; autodir
1440a53f50b9Schristos
1441a53f50b9SchristosThe default directory under which to mount filesystems.  This may be
1442a53f50b9Schristoschanged by the @code{-a} command line option.  @xref{fs Option}.
1443a53f50b9Schristos
1444a53f50b9Schristos@c ----------------------------------------------------------------
1445a53f50b9Schristos@node byte Selector Variable, cluster Selector Variable, autodir Selector Variable, Selectors
1446a53f50b9Schristos@comment  node-name,  next,  previous,  up
1447a53f50b9Schristos@subsubsection byte Selector Variable
1448a53f50b9Schristos@cindex byte Selector Variable
1449a53f50b9Schristos@cindex byte, mount selector
1450a53f50b9Schristos@cindex Mount selector; byte
1451a53f50b9Schristos@cindex Selector; byte
1452a53f50b9Schristos
1453a53f50b9SchristosThe machine's byte ordering.  This is either @samp{little}, indicating
1454a53f50b9Schristoslittle-endian, or @samp{big}, indicating big-endian.  One possible use
1455a53f50b9Schristosis to share @samp{rwho} databases (@pxref{rwho servers}).  Another is to
1456a53f50b9Schristosshare ndbm databases, however this use can be considered a courageous
1457a53f50b9Schristosjuggling act.
1458a53f50b9Schristos
1459a53f50b9Schristos@c ----------------------------------------------------------------
1460a53f50b9Schristos@node cluster Selector Variable, domain Selector Variable, byte Selector Variable, Selectors
1461a53f50b9Schristos@comment  node-name,  next,  previous,  up
1462a53f50b9Schristos@subsubsection cluster Selector Variable
1463a53f50b9Schristos@cindex cluster Selector Variable
1464a53f50b9Schristos@cindex cluster, mount selector
1465a53f50b9Schristos@cindex Mount selector; cluster
1466a53f50b9Schristos@cindex Selector; cluster
1467a53f50b9Schristos
1468a53f50b9SchristosThis is provided as a hook for the name of the local cluster.  This can
1469a53f50b9Schristosbe used to decide which servers to use for copies of replicated
1470a53f50b9Schristosfilesystems.  @code{$@{cluster@}} defaults to the value of
1471a53f50b9Schristos@code{$@{domain@}} unless a different value is set with the @code{-C}
1472a53f50b9Schristoscommand line option.
1473a53f50b9Schristos
1474a53f50b9Schristos@c ----------------------------------------------------------------
1475a53f50b9Schristos@node domain Selector Variable, dollar Selector Variable, cluster Selector Variable, Selectors
1476a53f50b9Schristos@comment  node-name,  next,  previous,  up
1477a53f50b9Schristos@subsubsection domain Selector Variable
1478a53f50b9Schristos@cindex domain Selector Variable
1479a53f50b9Schristos@cindex domain, mount selector
1480a53f50b9Schristos@cindex Mount selector; domain
1481a53f50b9Schristos@cindex Selector; domain
1482a53f50b9Schristos
1483a53f50b9SchristosThe local domain name as specified by the @code{-d} command line option.
1484a53f50b9Schristos@xref{host Selector Variable}.
1485a53f50b9Schristos
1486a53f50b9Schristos@c ----------------------------------------------------------------
1487a53f50b9Schristos@node dollar Selector Variable, host Selector Variable, domain Selector Variable, Selectors
1488a53f50b9Schristos@comment  node-name,  next,  previous,  up
1489a53f50b9Schristos@subsubsection dollar Selector Variable
1490a53f50b9Schristos@cindex dollar Selector Variable
1491a53f50b9Schristos
1492a53f50b9SchristosThis is a special variable, whose sole purpose is to produce a literal
1493a53f50b9Schristosdollar sign in the value of another variable.  For example, if you have
1494a53f50b9Schristosa remote file system whose name is @samp{/disk$s}, you can mount it by
1495a53f50b9Schristossetting the remote file system variable as follows:
1496a53f50b9Schristos
1497a53f50b9Schristos@example
1498a53f50b9Schristosrfs:=/disk$@{dollar@}s
1499a53f50b9Schristos@end example
1500a53f50b9Schristos
1501a53f50b9Schristos@c ----------------------------------------------------------------
1502a53f50b9Schristos@node host Selector Variable, hostd Selector Variable, dollar Selector Variable, Selectors
1503a53f50b9Schristos@comment  node-name,  next,  previous,  up
1504a53f50b9Schristos@subsubsection host Selector Variable
1505a53f50b9Schristos@cindex host Selector Variable
1506a53f50b9Schristos@cindex host, mount selector
1507a53f50b9Schristos@cindex Mount selector; host
1508a53f50b9Schristos@cindex Selector; host
1509a53f50b9Schristos
1510a53f50b9SchristosThe local hostname as determined by @b{gethostname}(2).  If no domain
1511a53f50b9Schristosname was specified on the command line and the hostname contains a
1512a53f50b9Schristosperiod @samp{.} then the string before the period is used as the host
1513a53f50b9Schristosname, and the string after the period is assigned to @code{$@{domain@}}.
1514a53f50b9SchristosFor example, if the hostname is @samp{styx.doc.ic.ac.uk} then
1515a53f50b9Schristos@code{host} would be @samp{styx} and @code{domain} would be
1516a53f50b9Schristos@samp{doc.ic.ac.uk}.  @code{hostd} would be
1517a53f50b9Schristos@samp{styx.doc.ic.ac.uk}.@refill
1518a53f50b9Schristos
1519a53f50b9Schristos@c ----------------------------------------------------------------
1520a53f50b9Schristos@node hostd Selector Variable, karch Selector Variable, host Selector Variable, Selectors
1521a53f50b9Schristos@comment  node-name,  next,  previous,  up
1522a53f50b9Schristos@subsubsection hostd Selector Variable
1523a53f50b9Schristos@cindex hostd Selector Variable
1524a53f50b9Schristos@cindex hostd, mount selector
1525a53f50b9Schristos@cindex Mount selector; hostd
1526a53f50b9Schristos@cindex Selector; hostd
1527a53f50b9Schristos
1528a53f50b9SchristosThis resolves to the @code{$@{host@}} and @code{$@{domain@}}
1529a53f50b9Schristosconcatenated with a @samp{.} inserted between them if required.  If
1530a53f50b9Schristos@code{$@{domain@}} is an empty string then @code{$@{host@}} and
1531a53f50b9Schristos@code{$@{hostd@}} will be identical.
1532a53f50b9Schristos
1533a53f50b9Schristos@c ----------------------------------------------------------------
1534a53f50b9Schristos@node karch Selector Variable, os Selector Variable, hostd Selector Variable, Selectors
1535a53f50b9Schristos@comment  node-name,  next,  previous,  up
1536a53f50b9Schristos@subsubsection karch Selector Variable
1537a53f50b9Schristos@cindex karch Selector Variable
1538a53f50b9Schristos@cindex karch, mount selector
1539a53f50b9Schristos@cindex Mount selector; karch
1540a53f50b9Schristos@cindex Selector; karch
1541a53f50b9Schristos
1542a53f50b9SchristosThis is provided as a hook for the kernel architecture.  This is used on
1543a53f50b9SchristosSunOS 4 and SunOS 5, for example, to distinguish between different
1544a53f50b9Schristos@samp{/usr/kvm} volumes.  @code{$@{karch@}} defaults to the ``machine''
1545a53f50b9Schristosvalue gotten from @b{uname}(2).  If the @b{uname}(2) system call is not
1546a53f50b9Schristosavailable, the value of @code{$@{karch@}} defaults to that of
1547a53f50b9Schristos@code{$@{arch@}}.  Finally, a different value can be set with the @code{-k}
1548a53f50b9Schristoscommand line option.
1549a53f50b9Schristos
1550a53f50b9Schristos@c ----------------------------------------------------------------
1551a53f50b9Schristos@node os Selector Variable, osver Selector Variable, karch Selector Variable, Selectors
1552a53f50b9Schristos@comment  node-name,  next,  previous,  up
1553a53f50b9Schristos@subsubsection os Selector Variable
1554a53f50b9Schristos@cindex os Selector Variable
1555a53f50b9Schristos@cindex os, mount selector
1556a53f50b9Schristos@cindex Mount selector; os
1557a53f50b9Schristos@cindex Selector; os
1558a53f50b9Schristos
1559a53f50b9SchristosThe operating system.  Like the machine architecture, this is
1560a53f50b9Schristosautomatically determined at compile time.  The operating system name can
1561a53f50b9Schristosbe displayed by running the command @samp{amd -v}.  @xref{Supported
1562a53f50b9SchristosPlatforms}.@refill
1563a53f50b9Schristos
1564a53f50b9Schristos@c ----------------------------------------------------------------
1565a53f50b9Schristos@node osver Selector Variable, full_os Selector Variable, os Selector Variable, Selectors
1566a53f50b9Schristos@comment  node-name,  next,  previous,  up
1567a53f50b9Schristos@subsubsection osver Selector Variable
1568a53f50b9Schristos@cindex osver Selector Variable
1569a53f50b9Schristos@cindex osver, mount selector
1570a53f50b9Schristos@cindex Mount selector; osver
1571a53f50b9Schristos@cindex Selector; osver
1572a53f50b9Schristos
1573a53f50b9SchristosThe operating system version.  Like the machine architecture, this is
1574a53f50b9Schristosautomatically determined at compile time.  The operating system name can
1575a53f50b9Schristosbe displayed by running the command @samp{amd -v}.  @xref{Supported
1576a53f50b9SchristosPlatforms}.@refill
1577a53f50b9Schristos
1578a53f50b9Schristos@c ----------------------------------------------------------------
1579a53f50b9Schristos@node full_os Selector Variable, vendor Selector Variable, osver Selector Variable, Selectors
1580a53f50b9Schristos@comment  node-name,  next,  previous,  up
1581a53f50b9Schristos@subsubsection full_os Selector Variable
1582a53f50b9Schristos@cindex full_os Selector Variable
1583a53f50b9Schristos@cindex full_os, mount selector
1584a53f50b9Schristos@cindex Mount selector; full_os
1585a53f50b9Schristos@cindex Selector; full_os
1586a53f50b9Schristos
1587a53f50b9SchristosThe full name of the operating system, including its version.  This
1588a53f50b9Schristosvalue is automatically determined at compile time.  The full operating
1589a53f50b9Schristossystem name and version can be displayed by running the command
1590a53f50b9Schristos@samp{amd -v}.  @xref{Supported Platforms}.@refill
1591a53f50b9Schristos
1592a53f50b9Schristos@c ----------------------------------------------------------------
1593a53f50b9Schristos@node vendor Selector Variable, key Selector Variable, full_os Selector Variable, Selectors
1594a53f50b9Schristos@comment  node-name,  next,  previous,  up
1595a53f50b9Schristos@subsubsection vendor Selector Variable
1596a53f50b9Schristos@cindex vendor Selector Variable
1597a53f50b9Schristos@cindex vendor, mount selector
1598a53f50b9Schristos@cindex Mount selector; vendor
1599a53f50b9Schristos@cindex Selector; vendor
1600a53f50b9Schristos
1601a53f50b9SchristosThe name of the vendor of the operating system.  This value is
1602a53f50b9Schristosautomatically determined at compile time.  The name of the vendor can be
1603a53f50b9Schristosdisplayed by running the command @samp{amd -v}.  @xref{Supported
1604a53f50b9SchristosPlatforms}.@refill
1605a53f50b9Schristos
1606a53f50b9Schristos
1607a53f50b9Schristos@c ----------------------------------------------------------------
1608a53f50b9Schristos@ifhtml
1609a53f50b9Schristos<HR>
1610a53f50b9Schristos@end ifhtml
1611a53f50b9Schristos@sp 3
1612a53f50b9SchristosThe following selectors are also provided.  Unlike the other selectors,
1613a53f50b9Schristosthey vary for each lookup.  Note that when the name from the kernel is
1614a53f50b9Schristosexpanded prior to a map lookup, these selectors are all defined as empty
1615a53f50b9Schristosstrings.
1616a53f50b9Schristos
1617a53f50b9Schristos@c ----------------------------------------------------------------
1618a53f50b9Schristos@node key Selector Variable, map Selector Variable, vendor Selector Variable, Selectors
1619a53f50b9Schristos@comment  node-name,  next,  previous,  up
1620a53f50b9Schristos@subsubsection key Selector Variable
1621a53f50b9Schristos@cindex key Selector Variable
1622a53f50b9Schristos@cindex key, mount selector
1623a53f50b9Schristos@cindex Mount selector; key
1624a53f50b9Schristos@cindex Selector; key
1625a53f50b9Schristos
1626a53f50b9SchristosThe name being resolved.  For example, if @file{/home} is an automount
1627a53f50b9Schristospoint, then accessing @file{/home/foo} would set @code{$@{key@}} to the
1628a53f50b9Schristosstring @samp{foo}.  The key is prefixed by the @var{pref} option set in
1629a53f50b9Schristosthe parent mount point.  The default prefix is an empty string.  If the
1630a53f50b9Schristosprefix was @file{blah/} then @code{$@{key@}} would be set to
1631a53f50b9Schristos@file{blah/foo}.@refill
1632a53f50b9Schristos
1633a53f50b9Schristos@c ----------------------------------------------------------------
1634a53f50b9Schristos@node map Selector Variable, netnumber Selector Variable, key Selector Variable, Selectors
1635a53f50b9Schristos@comment  node-name,  next,  previous,  up
1636a53f50b9Schristos@subsubsection map Selector Variable
1637a53f50b9Schristos@cindex map Selector Variable
1638a53f50b9Schristos@cindex map, mount selector
1639a53f50b9Schristos@cindex Mount selector; map
1640a53f50b9Schristos@cindex Selector; map
1641a53f50b9Schristos
1642a53f50b9SchristosThe name of the mount map being used.
1643a53f50b9Schristos
1644a53f50b9Schristos@c ----------------------------------------------------------------
1645a53f50b9Schristos@node netnumber Selector Variable, network Selector Variable, map Selector Variable, Selectors
1646a53f50b9Schristos@comment  node-name,  next,  previous,  up
1647a53f50b9Schristos@subsubsection netnumber Selector Variable
1648a53f50b9Schristos@cindex netnumber Selector Variable
1649a53f50b9Schristos@cindex netnumber, mount selector
1650a53f50b9Schristos@cindex Mount selector; netnumber
1651a53f50b9Schristos@cindex Selector; netnumber
1652a53f50b9Schristos
1653a53f50b9SchristosThis selector is identical to the @samp{in_network} selector function,
1654a53f50b9Schristossee @ref{in_network Selector Function}.  It will match either the name
1655a53f50b9Schristosor number of @i{any} network interface on which this host is connected
1656a53f50b9Schristosto.  The names and numbers of all attached interfaces are available from
1657a53f50b9Schristosthe output of @samp{amd -v}.
1658a53f50b9Schristos
1659a53f50b9Schristos@c ----------------------------------------------------------------
1660a53f50b9Schristos@node network Selector Variable, path Selector Variable, netnumber Selector Variable, Selectors
1661a53f50b9Schristos@comment  node-name,  next,  previous,  up
1662a53f50b9Schristos@subsubsection network Selector Variable
1663a53f50b9Schristos@cindex network Selector Variable
1664a53f50b9Schristos@cindex network, mount selector
1665a53f50b9Schristos@cindex Mount selector; network
1666a53f50b9Schristos@cindex Selector; network
1667a53f50b9Schristos
1668a53f50b9SchristosThis selector is identical to the @samp{in_network} selector function,
1669a53f50b9Schristossee @ref{in_network Selector Function}.  It will match either the name
1670a53f50b9Schristosor number of @i{any} network interface on which this host is connected
1671a53f50b9Schristosto.  The names and numbers of all attached interfaces are available from
1672a53f50b9Schristosthe output of @samp{amd -v}.
1673a53f50b9Schristos
1674a53f50b9Schristos@c ----------------------------------------------------------------
1675a53f50b9Schristos@node path Selector Variable, wire Selector Variable, network Selector Variable, Selectors
1676a53f50b9Schristos@comment  node-name,  next,  previous,  up
1677a53f50b9Schristos@subsubsection path Selector Variable
1678a53f50b9Schristos@cindex path Selector Variable
1679a53f50b9Schristos@cindex path, mount selector
1680a53f50b9Schristos@cindex Mount selector; path
1681a53f50b9Schristos@cindex Selector; path
1682a53f50b9Schristos
1683a53f50b9SchristosThe full pathname of the name being resolved.  For example
1684a53f50b9Schristos@file{/home/foo} in the example above.
1685a53f50b9Schristos
1686a53f50b9Schristos@c ----------------------------------------------------------------
1687a53f50b9Schristos@node wire Selector Variable, uid Selector Variable, path Selector Variable, Selectors
1688a53f50b9Schristos@comment  node-name,  next,  previous,  up
1689a53f50b9Schristos@subsubsection wire Selector Variable
1690a53f50b9Schristos@cindex wire Selector Variable
1691a53f50b9Schristos@cindex wire, mount selector
1692a53f50b9Schristos@cindex Mount selector; wire
1693a53f50b9Schristos@cindex Selector; wire
1694a53f50b9Schristos
1695a53f50b9SchristosThis selector is identical to the @samp{in_network} selector function,
1696a53f50b9Schristossee @ref{in_network Selector Function}.  It will match either the name
1697a53f50b9Schristosor number of @i{any} network interface on which this host is connected
1698a53f50b9Schristosto.  The names and numbers of all attached interfaces are available from
1699a53f50b9Schristosthe output of @samp{amd -v}.
1700a53f50b9Schristos
1701a53f50b9Schristos@c ----------------------------------------------------------------
1702a53f50b9Schristos@node uid Selector Variable, gid Selector Variable, wire Selector Variable, Selectors
1703a53f50b9Schristos@comment  node-name,  next,  previous,  up
1704a53f50b9Schristos@subsubsection uid Selector Variable
1705a53f50b9Schristos@cindex uid Selector Variable
1706a53f50b9Schristos@cindex uid, mount selector
1707a53f50b9Schristos@cindex Mount selector; uid
1708a53f50b9Schristos@cindex Selector; uid
1709a53f50b9Schristos
1710a53f50b9SchristosThis selector provides the numeric effective user ID (UID) of the user
1711a53f50b9Schristoswhich last accessed an automounted path name.  This simple example shows
1712a53f50b9Schristoshow floppy mounting can be assigned only to machine owners:
1713a53f50b9Schristos
1714a53f50b9Schristos@example
1715a53f50b9Schristosfloppy  -type:=pcfs \
1716a53f50b9Schristos        uid==2301;host==shekel;dev:=/dev/floppy \
1717a53f50b9Schristos        uid==6712;host==titan;dev=/dev/fd0 \
1718a53f50b9Schristos        uid==0;dev:=/dev/fd0c \
1719a53f50b9Schristos        type:=error
1720a53f50b9Schristos@end example
1721a53f50b9Schristos
1722a53f50b9SchristosThe example allows two machine owners to mount floppies on their
1723a53f50b9Schristosdesignated workstations, allows the root user to mount on any host, and
1724a53f50b9Schristosotherwise forces an error.
1725a53f50b9Schristos
1726a53f50b9Schristos@c ----------------------------------------------------------------
1727a53f50b9Schristos@node gid Selector Variable, exists Selector Function, uid Selector Variable, Selectors
1728a53f50b9Schristos@comment  node-name,  next,  previous,  up
1729a53f50b9Schristos@subsubsection gid Selector Variable
1730a53f50b9Schristos@cindex gid Selector Variable
1731a53f50b9Schristos@cindex gid, mount selector
1732a53f50b9Schristos@cindex Mount selector; gid
1733a53f50b9Schristos@cindex Selector; gid
1734a53f50b9Schristos
1735a53f50b9SchristosThis selector provides the numeric effective group ID (GID) of the user
1736a53f50b9Schristoswhich last accessed an automounted path name.
1737a53f50b9Schristos
1738a53f50b9Schristos@c ----------------------------------------------------------------
1739a53f50b9Schristos@ifhtml
1740a53f50b9Schristos<HR>
1741a53f50b9Schristos@end ifhtml
1742a53f50b9Schristos@sp 2
1743a53f50b9SchristosThe following boolean functions are selectors which take an argument
1744a53f50b9Schristos@i{ARG}.  They return a value of true or false, and thus do not need to
1745a53f50b9Schristosbe compared with a value.  Each of these may be negated by prepending
1746a53f50b9Schristos@samp{!} to their name.
1747a53f50b9Schristos
1748a53f50b9Schristos@c ----------------------------------------------------------------
1749a53f50b9Schristos@node exists Selector Function, false Selector Function, gid Selector Variable, Selectors
1750a53f50b9Schristos@comment  node-name,  next,  previous,  up
1751a53f50b9Schristos@subsubsection exists Selector Function
1752a53f50b9Schristos@cindex exists Selector Function
1753a53f50b9Schristos@cindex exists, boolean mount selector
1754a53f50b9Schristos@cindex !exists, boolean mount selector
1755a53f50b9Schristos@cindex Mount selector; exists
1756a53f50b9Schristos@cindex Selector; exists
1757a53f50b9Schristos
1758a53f50b9SchristosIf the file listed by @i{ARG} exists (via @b{lstat}(2)), this function
1759a53f50b9Schristosevaluates to true.  Otherwise it evaluates to false.
1760a53f50b9Schristos
1761a53f50b9Schristos@c ----------------------------------------------------------------
1762a53f50b9Schristos@node false Selector Function, netgrp Selector Function, exists Selector Function, Selectors
1763a53f50b9Schristos@comment  node-name,  next,  previous,  up
1764a53f50b9Schristos@subsubsection false Selector Function
1765a53f50b9Schristos@cindex false Selector Function
1766a53f50b9Schristos@cindex false, boolean mount selector
1767a53f50b9Schristos@cindex !false, boolean mount selector
1768a53f50b9Schristos@cindex Mount selector; false
1769a53f50b9Schristos@cindex Selector; false
1770a53f50b9Schristos
1771a53f50b9SchristosAlways evaluates to false.  @i{ARG} is ignored.
1772a53f50b9Schristos
1773a53f50b9Schristos@c ----------------------------------------------------------------
1774a53f50b9Schristos@node netgrp Selector Function, netgrpd Selector Function, false Selector Function, Selectors
1775a53f50b9Schristos@comment  node-name,  next,  previous,  up
1776a53f50b9Schristos@subsubsection netgrp Selector Function
1777a53f50b9Schristos@cindex netgrp Selector Function
1778a53f50b9Schristos@cindex netgrp, boolean mount selector
1779a53f50b9Schristos@cindex !netgrp, boolean mount selector
1780a53f50b9Schristos@cindex Mount selector; netgrp
1781a53f50b9Schristos@cindex Selector; netgrp
1782a53f50b9Schristos
1783a53f50b9SchristosThe argument @i{ARG} of this selector is a netgroup name followed
1784a53f50b9Schristosoptionally by a comma and a host name.  If the host name is not
1785a53f50b9Schristosspecified, it defaults to @code{$@{host@}}.  If the host name (short
1786a53f50b9Schristosname) is a member of the netgroup, this selector evaluates to true.
1787a53f50b9SchristosOtherwise it evaluates to false.
1788a53f50b9Schristos
1789a53f50b9SchristosFor example, suppose you have a netgroup @samp{ppp-hosts}, and for
1790a53f50b9Schristosreasons of performance, these have a local @file{/home} partition,
1791a53f50b9Schristoswhile all other clients on the faster network can access a shared home
1792a53f50b9Schristosdirectory.  A common map to use for both might look like the
1793a53f50b9Schristosfollowing:
1794a53f50b9Schristos
1795a53f50b9Schristos@example
1796a53f50b9Schristoshome/*  netgrp(ppp-hosts);type:=link;fs:=/local/$@{key@} \
1797a53f50b9Schristos        !netgrp(ppp-hosts);type:=nfs;rhost:=serv1;rfs:=/remote/$@{key@}
1798a53f50b9Schristos@end example
1799a53f50b9Schristos
1800a53f50b9SchristosA more complex example that takes advantage of the two argument netgrp
1801a53f50b9Schristosmount selector is given in the following scenario.  Suppose one wants
1802a53f50b9Schristosto mount the local scratch space from a each host under
1803a53f50b9Schristos@file{scratch/<hostname>} and some hosts have their scratch space in a
1804a53f50b9Schristosdifferent path than others.  Hosts in the netgroup @samp{apple-hosts}
1805a53f50b9Schristoshave their scratch space in the @file{/apple} path, where hosts in the
1806a53f50b9Schristosnetgroup @samp{cherry-hosts} have their scratch space in the
1807a53f50b9Schristos@file{/cherry} path.  For hosts that are neither in the
1808a53f50b9Schristos@samp{apple-hosts} or @samp{cherry-hosts} netgroups we want to make a
1809a53f50b9Schristossymlink pointing to nowhere but provide a descriptive error message in
1810a53f50b9Schristosthe link destination:
1811a53f50b9Schristos
1812a53f50b9Schristos@example
1813a53f50b9Schristosscratch/*	netgrp(apple-hosts,$@{/key@});type:=nfs;rhost:=$@{/key@};\
1814a53f50b9Schristos		    rfs:="/apple" \
1815a53f50b9Schristos		netgrp(cherry-hosts,$@{/key@});type:=nfs;rhost:=$@{/key@};\
1816a53f50b9Schristos		    rfs:="/cherry" \
1817a53f50b9Schristos		type:=link;rfs:="no local partition for $@{/key@}"
1818a53f50b9Schristos@end example
1819a53f50b9Schristos
1820a53f50b9Schristos@c ----------------------------------------------------------------
1821a53f50b9Schristos@node netgrpd Selector Function, in_network Selector Function, netgrp Selector Function, Selectors
1822a53f50b9Schristos@comment  node-name,  next,  previous,  up
1823a53f50b9Schristos@subsubsection netgrpd Selector Function
1824a53f50b9Schristos@cindex netgrpd Selector Function
1825a53f50b9Schristos@cindex netgrpd, boolean mount selector
1826a53f50b9Schristos@cindex !netgrpd, boolean mount selector
1827a53f50b9Schristos@cindex Mount selector; netgrpd
1828a53f50b9Schristos@cindex Selector; netgrpd
1829a53f50b9Schristos
1830a53f50b9SchristosThe argument @i{ARG} of this selector is a netgroup name followed
1831a53f50b9Schristosoptionally by a comma and a host name.  If the host name is not
1832a53f50b9Schristosspecified, it defaults to @code{$@{hostd@}}.  If the host name
1833a53f50b9Schristos(fully-qualified name) is a member of the netgroup, this selector
1834a53f50b9Schristosevaluates to true.  Otherwise it evaluates to false.
1835a53f50b9Schristos
1836a53f50b9SchristosThe @samp{netgrpd} function uses fully-qualified host names to match
1837a53f50b9Schristosnetgroup names, while the @samp{netgrp} function (@pxref{netgrp
1838a53f50b9SchristosSelector Function}) uses short host names.
1839a53f50b9Schristos
1840a53f50b9Schristos@c ----------------------------------------------------------------
1841a53f50b9Schristos@node in_network Selector Function, true Selector Function, netgrpd Selector Function, Selectors
1842a53f50b9Schristos@comment  node-name,  next,  previous,  up
1843a53f50b9Schristos@subsubsection in_network Selector Function
1844a53f50b9Schristos@cindex in_network Selector Function
1845a53f50b9Schristos@cindex in_network, boolean mount selector
1846a53f50b9Schristos@cindex !in_network, boolean mount selector
1847a53f50b9Schristos@cindex Mount selector; in_network
1848a53f50b9Schristos@cindex Selector; in_network
1849a53f50b9Schristos
1850a53f50b9SchristosThis selector matches against any network name or number with an
1851a53f50b9Schristosoptional netmask.  First, if the current host has any network interface that is
1852a53f50b9Schristoslocally attached to the network specified in @i{ARG} (either via name or
1853a53f50b9Schristosnumber), this selector evaluates to true.
1854a53f50b9Schristos
1855a53f50b9SchristosSecond, @samp{in_network} supports a network/netmask syntax such as
1856a53f50b9Schristos@samp{128.59.16.0/255.255.255.0}, @samp{128.59.16.0/24},
1857a53f50b9Schristos@samp{128.59.16.0/0xffffff00}, or @samp{128.59.16.0/}.  Using the last
1858a53f50b9Schristosform, @i{Amd} will match the specified network number against the
1859a53f50b9Schristosdefault netmasks of each of the locally attached interfaces.
1860a53f50b9Schristos
1861a53f50b9SchristosIf the selector does not match, it evaluates to false.
1862a53f50b9Schristos
1863a53f50b9SchristosFor example, suppose you have two servers that have an exportable
1864a53f50b9Schristos@file{/opt} that smaller clients can NFS mount.  The two servers are
1865a53f50b9Schristossay, @samp{serv1} on network @samp{foo-net.site.com} and @samp{serv2} on
1866a53f50b9Schristosnetwork @samp{123.4.5.0}.  You can write a map to be used by all clients
1867a53f50b9Schristosthat will attempt to mount the closest one as follows:
1868a53f50b9Schristos
1869a53f50b9Schristos@example
1870a53f50b9Schristosopt in_network(foo-net.site.com);rhost:=serv1;rfs:=/opt \
1871a53f50b9Schristos    in_network(123.4.5.0);rhost:=serv2;rfs:=/opt \
1872a53f50b9Schristos    rhost:=fallback-server
1873a53f50b9Schristos@end example
1874a53f50b9Schristos
1875a53f50b9Schristos@c ----------------------------------------------------------------
1876a53f50b9Schristos@node true Selector Function, xhost Selector Function, in_network Selector Function, Selectors
1877a53f50b9Schristos@comment  node-name,  next,  previous,  up
1878a53f50b9Schristos@subsubsection true Selector Function
1879a53f50b9Schristos@cindex true Selector Function
1880a53f50b9Schristos@cindex true, boolean mount selector
1881a53f50b9Schristos@cindex !true, boolean mount selector
1882a53f50b9Schristos@cindex Mount selector; true
1883a53f50b9Schristos@cindex Selector; true
1884a53f50b9Schristos
1885a53f50b9SchristosAlways evaluates to true.  @i{ARG} is ignored.
1886a53f50b9Schristos
1887a53f50b9Schristos@c ----------------------------------------------------------------
1888a53f50b9Schristos@node xhost Selector Function, , true Selector Function, Selectors
1889a53f50b9Schristos@comment  node-name,  next,  previous,  up
1890a53f50b9Schristos@subsubsection xhost Selector Function
1891a53f50b9Schristos@cindex xhost Selector Function
1892a53f50b9Schristos@cindex xhost, boolean mount selector
1893a53f50b9Schristos@cindex !xhost, boolean mount selector
1894a53f50b9Schristos@cindex Mount selector; xhost
1895a53f50b9Schristos@cindex Selector; xhost
1896a53f50b9Schristos@cindex CNAMEs
1897a53f50b9Schristos
1898a53f50b9SchristosThis function compares @i{ARG} against the current hostname, similarly
1899a53f50b9Schristosto the @ref{host Selector Variable}.  However, this function will
1900a53f50b9Schristosalso match if @i{ARG} is a CNAME (DNS Canonical Name, or alias) for
1901a53f50b9Schristosthe current host's name.
1902a53f50b9Schristos
1903a53f50b9Schristos@c ================================================================
1904a53f50b9Schristos@node Map Options,  , Selectors, Location Format
1905a53f50b9Schristos@comment  node-name,  next,  previous,  up
1906a53f50b9Schristos@subsection Map Options
1907a53f50b9Schristos@cindex Map options
1908a53f50b9Schristos@cindex Setting map options
1909a53f50b9Schristos
1910a53f50b9SchristosOptions are parsed concurrently with selectors.  The difference is that
1911a53f50b9Schristoswhen an option is seen the string following the @samp{:=} is
1912a53f50b9Schristosrecorded for later use.  As a minimum the @var{type} option must be
1913a53f50b9Schristosspecified.  Each filesystem type has other options which must also be
1914a53f50b9Schristosspecified.  @xref{Filesystem Types}, for details on the filesystem
1915a53f50b9Schristosspecific options.@refill
1916a53f50b9Schristos
1917a53f50b9SchristosSuperfluous option specifications are ignored and are not reported
1918a53f50b9Schristosas errors.
1919a53f50b9Schristos
1920a53f50b9SchristosThe following options apply to more than one filesystem type.
1921a53f50b9Schristos
1922a53f50b9Schristos@menu
1923a53f50b9Schristos* addopts Option::
1924a53f50b9Schristos* delay Option::
1925a53f50b9Schristos* fs Option::
1926a53f50b9Schristos* opts Option::
1927a53f50b9Schristos* remopts Option::
1928a53f50b9Schristos* sublink Option::
1929a53f50b9Schristos* type Option::
1930a53f50b9Schristos@end menu
1931a53f50b9Schristos
1932a53f50b9Schristos@node addopts Option, delay Option, Map Options, Map Options
1933a53f50b9Schristos@comment  node-name,  next,  previous,  up
1934a53f50b9Schristos@subsubsection addopts Option
1935a53f50b9Schristos@cindex Setting additional options on a mount location
1936a53f50b9Schristos@cindex Overriding or adding options to a mount
1937a53f50b9Schristos@cindex addopts, mount option
1938a53f50b9Schristos@cindex Mount option; addopts
1939a53f50b9Schristos
1940a53f50b9SchristosThis option adds additional options to default options normally
1941a53f50b9Schristosspecified in the @samp{/defaults} entry or the defaults of the key entry
1942a53f50b9Schristosbeing processed (@pxref{opts Option}).  Normally when you specify
1943a53f50b9Schristos@samp{opts} in both the @samp{/defaults} and the map entry, the latter
1944a53f50b9Schristosoverrides the former completely.  But with @samp{addopts} it will append
1945a53f50b9Schristosthe options and override any conflicting ones.
1946a53f50b9Schristos
1947a53f50b9Schristos@samp{addopts} also overrides the value of the @samp{remopts} option
1948a53f50b9Schristos(@pxref{remopts Option}), which unless specified defaults to the value
1949a53f50b9Schristosof @samp{opts}.
1950a53f50b9Schristos
1951a53f50b9SchristosOptions which start with @samp{no} will override those with the same
1952a53f50b9Schristosname that do not start with @samp{no} and vice verse.  Special handling
1953a53f50b9Schristosis given to inverted options such as @samp{soft} and @samp{hard},
1954a53f50b9Schristos@samp{bg} and @samp{fg}, @samp{ro} and @samp{rw}, etc.
1955a53f50b9Schristos
1956a53f50b9SchristosFor example, if the default options specified were
1957a53f50b9Schristos@example
1958a53f50b9Schristosopts:=rw,nosuid,intr,rsize=1024,wsize=1024,quota,posix
1959a53f50b9Schristos@end example
1960a53f50b9Schristos
1961a53f50b9Schristosand the ones specified in a map entry were
1962a53f50b9Schristos
1963a53f50b9Schristos@example
1964a53f50b9Schristosaddopts:=grpid,suid,ro,rsize=2048,quota,nointr
1965a53f50b9Schristos@end example
1966a53f50b9Schristos
1967a53f50b9Schristosthen the actual options used would be
1968a53f50b9Schristos
1969a53f50b9Schristos@example
1970a53f50b9Schristoswsize=1024,posix,grpid,suid,ro,rsize=2048,quota,nointr
1971a53f50b9Schristos@end example
1972a53f50b9Schristos
1973a53f50b9Schristos@node delay Option, fs Option, addopts Option, Map Options
1974a53f50b9Schristos@comment  node-name,  next,  previous,  up
1975a53f50b9Schristos@subsubsection delay Option
1976a53f50b9Schristos@cindex Setting a delay on a mount location
1977a53f50b9Schristos@cindex Delaying mounts from specific locations
1978a53f50b9Schristos@cindex Primary server
1979a53f50b9Schristos@cindex Secondary server
1980a53f50b9Schristos@cindex delay, mount option
1981a53f50b9Schristos@cindex Mount option; delay
1982a53f50b9Schristos
1983a53f50b9SchristosThe delay, in seconds, before an attempt will be made to mount from the
1984a53f50b9Schristoscurrent location.  Auxiliary data, such as network address, file handles
1985a53f50b9Schristosand so on are computed regardless of this value.
1986a53f50b9Schristos
1987a53f50b9SchristosA delay can be used to implement the notion of primary and secondary
1988a53f50b9Schristosfile servers.  The secondary servers would have a delay of a few
1989a53f50b9Schristosseconds, thus giving the primary servers a chance to respond first.
1990a53f50b9Schristos
1991a53f50b9Schristos@node fs Option, opts Option, delay Option, Map Options
1992a53f50b9Schristos@comment  node-name,  next,  previous,  up
1993a53f50b9Schristos@subsubsection fs Option
1994a53f50b9Schristos@cindex Setting the local mount point
1995a53f50b9Schristos@cindex Overriding the default mount point
1996a53f50b9Schristos@cindex fs, mount option
1997a53f50b9Schristos@cindex Mount option; fs
1998a53f50b9Schristos
1999a53f50b9SchristosThe local mount point.  The semantics of this option vary between
2000a53f50b9Schristosfilesystems.
2001a53f50b9Schristos
2002a53f50b9SchristosFor NFS and UFS filesystems the value of @code{$@{fs@}} is used as the
2003a53f50b9Schristoslocal mount point.  For other filesystem types it has other meanings
2004a53f50b9Schristoswhich are described in the section describing the respective filesystem
2005a53f50b9Schristostype.  It is important that this string uniquely identifies the
2006a53f50b9Schristosfilesystem being mounted.  To satisfy this requirement, it should
2007a53f50b9Schristoscontain the name of the host on which the filesystem is resident and the
2008a53f50b9Schristospathname of the filesystem on the local or remote host.
2009a53f50b9Schristos
2010a53f50b9SchristosThe reason for requiring the hostname is clear if replicated filesystems
2011a53f50b9Schristosare considered.  If a fileserver goes down and a replacement filesystem
2012a53f50b9Schristosis mounted then the @dfn{local} mount point @dfn{must} be different from
2013a53f50b9Schristosthat of the filesystem which is hung.  Some encoding of the filesystem
2014a53f50b9Schristosname is required if more than one filesystem is to be mounted from any
2015a53f50b9Schristosgiven host.
2016a53f50b9Schristos
2017a53f50b9SchristosIf the hostname is first in the path then all mounts from a particular
2018a53f50b9Schristoshost will be gathered below a single directory.  If that server goes
2019a53f50b9Schristosdown then the hung mount points are less likely to be accidentally
2020a53f50b9Schristosreferenced, for example when @b{getcwd}(3) traverses the namespace to
2021a53f50b9Schristosfind the pathname of the current directory.
2022a53f50b9Schristos
2023a53f50b9SchristosThe @samp{fs} option defaults to
2024a53f50b9Schristos@code{$@{autodir@}/$@{rhost@}$@{rfs@}}.  In addition,
2025a53f50b9Schristos@samp{rhost} defaults to the local host name (@code{$@{host@}}) and
2026a53f50b9Schristos@samp{rfs} defaults to the value of @code{$@{path@}}, which is the full
2027a53f50b9Schristospath of the requested file; @samp{/home/foo} in the example above
2028a53f50b9Schristos(@pxref{Selectors}).  @code{$@{autodir@}} defaults to @samp{/a} but may
2029a53f50b9Schristosbe changed with the @code{-a} command line option.  Sun's automounter
2030a53f50b9Schristosdefaults to @samp{/tmp_mnt}.  Note that there is no @samp{/} between
2031a53f50b9Schristosthe @code{$@{rhost@}} and @code{$@{rfs@}} since @code{$@{rfs@}} begins
2032a53f50b9Schristoswith a @samp{/}.@refill
2033a53f50b9Schristos
2034a53f50b9Schristos@node opts Option, remopts Option, fs Option, Map Options
2035a53f50b9Schristos@comment  node-name,  next,  previous,  up
2036a53f50b9Schristos@subsubsection opts Option
2037a53f50b9Schristos@cindex Setting system mount options
2038a53f50b9Schristos@cindex Passing parameters to the mount system call
2039a53f50b9Schristos@cindex mount system call
2040a53f50b9Schristos@cindex mount system call flags
2041a53f50b9Schristos@cindex The mount system call
2042a53f50b9Schristos@cindex opts, mount option
2043a53f50b9Schristos@cindex Mount option; opts
2044a53f50b9Schristos
2045a53f50b9SchristosThe options to pass to the mount system call.  A leading @samp{-} is
2046a53f50b9Schristossilently ignored.  The mount options supported generally correspond to
2047a53f50b9Schristosthose used by @b{mount}(8) and are listed below.  Some additional
2048a53f50b9Schristospseudo-options are interpreted by @i{Amd} and are also listed.
2049a53f50b9Schristos
2050a53f50b9SchristosUnless specifically overridden, each of the system default mount options
2051a53f50b9Schristosapplies.  Any options not recognized are ignored.  If no options list is
2052a53f50b9Schristossupplied the string @samp{rw,defaults} is used and all the system
2053a53f50b9Schristosdefault mount options apply.  Options which are not applicable for a
2054a53f50b9Schristosparticular operating system are silently ignored.  For example, only 4.4BSD
2055a53f50b9Schristosis known to implement the @code{compress} and @code{spongy} options.
2056a53f50b9Schristos
2057a53f50b9Schristos@table @code
2058a53f50b9Schristos
2059a53f50b9Schristos@item acdirmax=@var{n}
2060a53f50b9Schristos@cindex Mount flags; acdirmax
2061a53f50b9SchristosSet the maximum directory attribute cache timeout to @var{n}.
2062a53f50b9Schristos
2063a53f50b9Schristos@item acdirmin=@var{n}
2064a53f50b9Schristos@cindex Mount flags; acdirmin
2065a53f50b9SchristosSet the minimum directory attribute cache timeout to @var{n}.
2066a53f50b9Schristos
2067a53f50b9Schristos@item acregmax=@var{n}
2068a53f50b9Schristos@cindex Mount flags; acregmax
2069a53f50b9SchristosSet the maximum file attribute cache timeout to @var{n}.
2070a53f50b9Schristos
2071a53f50b9Schristos@item acregmin=@var{n}
2072a53f50b9Schristos@cindex Mount flags; acregmin
2073a53f50b9SchristosSet the minimum file attribute cache timeout to @var{n}.
2074a53f50b9Schristos
2075a53f50b9Schristos@item actimeo=@var{n}
2076a53f50b9Schristos@cindex Mount flags; actimeo
2077a53f50b9SchristosSet the overall attribute cache timeout to @var{n}.
2078a53f50b9Schristos
2079a53f50b9Schristos@item auto
2080a53f50b9Schristos@cindex Mount flags; auto
2081a53f50b9Schristos@itemx ignore
2082a53f50b9Schristos@cindex Mount flags; ignore
2083a53f50b9SchristosIgnore this mount by @b{df}(1).
2084a53f50b9Schristos
2085a53f50b9Schristos@item cache
2086a53f50b9Schristos@cindex Mount flags; cache
2087a53f50b9SchristosAllow data to be cached from a remote server for this mount.
2088a53f50b9Schristos
208914003705Schristos@item closesession
209014003705Schristos@cindex Mount flags; closesession
209114003705SchristosFor UDF mounts, close the session when unmounting.
209214003705Schristos
2093a53f50b9Schristos@item compress
2094a53f50b9Schristos@cindex Mount flags; compress
2095a53f50b9SchristosUse NFS compression protocol.
2096a53f50b9Schristos
2097a53f50b9Schristos@item defperm
2098a53f50b9Schristos@cindex Mount flags; defperm
2099a53f50b9SchristosIgnore the permission mode bits, and default file permissions to 0555,
2100a53f50b9SchristosUID 0, and GID 0.  Useful for CD-ROMs formatted as ISO-9660.
2101a53f50b9Schristos
2102a53f50b9Schristos@item dev
2103a53f50b9Schristos@cindex Mount flags; dev
2104a53f50b9SchristosAllow local special devices on this filesystem.
2105a53f50b9Schristos
2106a53f50b9Schristos@item dirmask=@var{n}
2107a53f50b9Schristos@cindex Mount flags; dirmask
2108a53f50b9SchristosFor PCFS mounts, specify the maximum file permissions for directories
2109a53f50b9Schristosin the file system.  See the @samp{mask} option's description for more
2110a53f50b9Schristosdetails.  The mask value of @var{n} can be specified in decimal,
2111a53f50b9Schristosoctal, or hexadecimal.
2112a53f50b9Schristos
2113a53f50b9Schristos@item dumbtimr
2114a53f50b9Schristos@cindex Mount flags; dumbtimr
2115a53f50b9SchristosTurn off the dynamic retransmit timeout estimator.  This may be useful
2116a53f50b9Schristosfor UDP mounts that exhibit high retry rates, since it is possible that
2117a53f50b9Schristosthe dynamically estimated timeout interval is too short.
2118a53f50b9Schristos
2119a53f50b9Schristos@item extatt
2120a53f50b9Schristos@cindex Mount flags; extatt
2121a53f50b9SchristosEnable extended attributes in ISO-9660 file systems.
2122a53f50b9Schristos
2123a53f50b9Schristos@item fsid
2124a53f50b9Schristos@cindex Mount flags; fsid
2125a53f50b9SchristosSet ID of filesystem.
2126a53f50b9Schristos
2127a53f50b9Schristos@item gens
2128a53f50b9Schristos@cindex Mount flags; gens
2129a53f50b9SchristosEnable generations in ISO-9660 file systems.  Generations allow you to
2130a53f50b9Schristossee all versions of a given file.
2131a53f50b9Schristos
213214003705Schristos@item gmtoff=@var{n}
213314003705Schristos@cindex Mount flags; gmtoff
213414003705SchristosFor UDF mounts, set the time zone offset from UTC to @var{n} seconds,
213514003705Schristoswith positive values indicating east of the Prime Meridian.  If not
213614003705Schristosset, the user's current time zone will be used.
213714003705Schristos
2138a53f50b9Schristos@item group=@var{n}
2139a53f50b9Schristos@cindex Mount flags; group
214014003705SchristosFor PCFS and UDF mounts, set the group of the files in the file system
214114003705Schristosto @var{n} (which can either be a group name or a GID number).  The
2142a53f50b9Schristosdefault group is the group of the directory on which the file system
2143a53f50b9Schristosis being mounted.
2144a53f50b9Schristos
2145a53f50b9Schristos@item grpid
2146a53f50b9Schristos@cindex Mount flags; grpid
2147a53f50b9SchristosUse BSD directory group-id semantics.
2148a53f50b9Schristos
2149a53f50b9Schristos@item int
2150a53f50b9Schristos@cindex Mount flags; int
2151a53f50b9Schristos@itemx intr
2152a53f50b9Schristos@cindex Mount flags; intr
2153a53f50b9SchristosAllow keyboard interrupts on hard mounts.
2154a53f50b9Schristos
2155a53f50b9Schristos@item lock
2156a53f50b9Schristos@cindex Mount flags; lock
2157a53f50b9SchristosUse the NFS locking protocol (default)
2158a53f50b9Schristos
2159a53f50b9Schristos@item longname
2160a53f50b9Schristos@cindex Mount Flags; longname
2161a53f50b9SchristosFor PCFS mounts, force Win95 long names.
2162a53f50b9Schristos
2163a53f50b9Schristos@item mask=@var{n}
2164a53f50b9Schristos@cindex Mount flags; mask
2165a53f50b9SchristosFor PCFS mounts, specify the maximum file permissions for files in the
2166a53f50b9Schristosfile system.  For example, a mask of 755 specifies that, by default,
2167a53f50b9Schristosthe owner should have read, write, and execute permissions for files,
2168a53f50b9Schristosbut others should only have read and execute permissions.  Only the
2169a53f50b9Schristosnine low-order bits of mask are used.  The default mask is taken from
2170a53f50b9Schristosthe directory on which the file system is being mounted.  The mask
2171a53f50b9Schristosvalue of @var{n} can be specified in decimal, octal, or hexadecimal.
2172a53f50b9Schristos
2173a53f50b9Schristos@item multi
2174a53f50b9Schristos@cindex Mount flags; multi
2175a53f50b9SchristosPerform multi-component lookup on files.
2176a53f50b9Schristos
2177a53f50b9Schristos@item maxgroups
2178a53f50b9Schristos@cindex Mount flags; maxgroups
2179a53f50b9SchristosSet the maximum number of groups to allow for this mount.
2180a53f50b9Schristos
2181a53f50b9Schristos@item nfsv3
2182a53f50b9Schristos@cindex Mount flags; nfsv3
2183a53f50b9SchristosUse NFS Version 3 for this mount.
2184a53f50b9Schristos
2185a53f50b9Schristos@item noac
2186a53f50b9Schristos@cindex Mount flags; noac
2187a53f50b9SchristosTurn off the attribute cache.
2188a53f50b9Schristos
2189a53f50b9Schristos@item noauto
2190a53f50b9Schristos@cindex Mount flags; noauto
2191a53f50b9SchristosThis option is used by the mount command in @samp{/etc/fstab} or
2192a53f50b9Schristos@samp{/etc/vfstab} and means not to mount this file system when mount -a
2193a53f50b9Schristosis used.
2194a53f50b9Schristos
2195a53f50b9Schristos@item nocache
2196a53f50b9Schristos@cindex Mount flags; nocache
2197a53f50b9SchristosDo not allow data to be cached from a remote server for this
2198a53f50b9Schristosmount.
2199a53f50b9Schristos
2200544d676eSchristos@item nocasetrans
2201544d676eSchristos@cindex Mount flags; nocasetrans
2202544d676eSchristosDon't do case translation. Useful for CD-ROMS formatted as
2203544d676eSchristosISO-9660.
2204544d676eSchristos
2205a53f50b9Schristos@item noconn
2206a53f50b9Schristos@cindex Mount flags; noconn
2207a53f50b9SchristosDon't make a connection on datagram transports.
2208a53f50b9Schristos
2209a53f50b9Schristos@item nocto
2210a53f50b9Schristos@cindex Mount flags; nocto
2211a53f50b9SchristosNo close-to-open consistency.
2212a53f50b9Schristos
2213a53f50b9Schristos@item nodefperm
2214a53f50b9Schristos@cindex Mount flags; nodefperm
2215a53f50b9SchristosDo not ignore the permission mode bits.  Useful for CD-ROMS formatted as
2216a53f50b9SchristosISO-9660.
2217a53f50b9Schristos
2218a53f50b9Schristos@item nodev
2219a53f50b9Schristos@cindex Mount flags; nodev
2220a53f50b9Schristos@itemx nodevs
2221a53f50b9Schristos@cindex Mount flags; nodevs
2222a53f50b9SchristosDon't allow local special devices on this filesystem.
2223a53f50b9Schristos
2224a53f50b9Schristos@item noexec
2225a53f50b9Schristos@cindex Mount flags; noexec
2226a53f50b9SchristosDon't allow program execution.
2227a53f50b9Schristos
2228a53f50b9Schristos@item noint
2229a53f50b9Schristos@cindex Mount flags; noint
2230a53f50b9SchristosDo not allow keyboard interrupts for this mount
2231a53f50b9Schristos
2232544d676eSchristos@item nojoliet
2233544d676eSchristos@cindex Mount flags; nojoliet
2234544d676eSchristosTurn off the Joliet extensions.  Useful for CD-ROMS formatted as ISO-9660.
2235544d676eSchristos
2236a53f50b9Schristos@item nolock
2237a53f50b9Schristos@cindex Mount flags; nolock
2238a53f50b9SchristosDo not use the NFS locking protocol
2239a53f50b9Schristos
2240a53f50b9Schristos@item nomnttab
2241a53f50b9Schristos@cindex Mount flags; nomnttab
2242a53f50b9SchristosThis option is used internally to tell Amd that a Solaris 8 system using
2243a53f50b9Schristosmntfs is in use.
2244a53f50b9Schristos
2245a53f50b9Schristos@item norrip
2246a53f50b9Schristos@cindex Mount flags; norrip
2247a53f50b9SchristosTurn off using of the Rock Ridge Interchange Protocol (RRIP) extensions
2248a53f50b9Schristosto ISO-9660.
2249a53f50b9Schristos
2250a53f50b9Schristos@item nosub
2251a53f50b9Schristos@cindex Mount flags; nosub
2252a53f50b9SchristosDisallow mounts beneath this mount.
2253a53f50b9Schristos
2254a53f50b9Schristos@item nosuid
2255a53f50b9Schristos@cindex Mount flags; nosuid
2256a53f50b9SchristosDon't allow set-uid or set-gid executables on this filesystem.
2257a53f50b9Schristos
2258a53f50b9Schristos@item noversion
2259a53f50b9Schristos@cindex Mount flags; noversion
2260a53f50b9SchristosStrip the extension @samp{;#} from the version string of files recorded
2261a53f50b9Schristoson an ISO-9660 CD-ROM.
2262a53f50b9Schristos
2263a53f50b9Schristos@item nowin95
2264a53f50b9Schristos@cindex Mount Flags; nowin95
2265a53f50b9SchristosFor PCFS mounts, completely ignore Win95 entries.
2266a53f50b9Schristos
2267a53f50b9Schristos@item optionstr
2268a53f50b9Schristos@cindex Mount flags; optionstr
2269a53f50b9SchristosUnder Solaris 8, provide the kernel a string of options to parse and
2270a53f50b9Schristosshow as part of the special in-kernel mount file system.
2271a53f50b9Schristos
2272a53f50b9Schristos@item overlay
2273a53f50b9Schristos@cindex Mount flags; overlay
2274a53f50b9SchristosOverlay this mount on top of an existing mount, if any.
2275a53f50b9Schristos
2276a53f50b9Schristos@item pgthresh=@var{n}
2277a53f50b9Schristos@cindex Mount flags; pgthresh
2278a53f50b9SchristosSet the paging threshold to @var{n} kilobytes.
2279a53f50b9Schristos
2280a53f50b9Schristos@item port=@var{n}
2281a53f50b9Schristos@cindex Mount flags; port
2282a53f50b9SchristosSet the NFS port to @var{n}.
2283a53f50b9Schristos
2284a53f50b9Schristos@item posix
2285a53f50b9Schristos@cindex Mount flags; posix
2286a53f50b9SchristosTurn on POSIX static pathconf for mounts.
2287a53f50b9Schristos
2288a53f50b9Schristos@item private
2289a53f50b9Schristos@cindex Mount flags; private
2290a53f50b9SchristosUse local locking instead of the NLM protocol, useful for IRIX 6 only.
2291a53f50b9Schristos
2292a53f50b9Schristos@item proplist
2293a53f50b9Schristos@cindex Mount flags; proplist
2294a53f50b9SchristosSupport property lists (ACLs) for this mount, useful primarily for Tru64
2295a53f50b9SchristosUNIX.
2296a53f50b9Schristos
2297a53f50b9Schristos@item proto=@var{s}
2298a53f50b9Schristos@cindex Mount flags; proto
2299a53f50b9SchristosUse transport protocol @var{s} for NFS (can be @code{"tcp"} or @code{"udp"}).
2300a53f50b9Schristos
2301a53f50b9Schristos@item quota
2302a53f50b9Schristos@cindex Mount flags; quota
2303a53f50b9SchristosEnable quota checking on this mount.
2304a53f50b9Schristos
2305a53f50b9Schristos@item rdonly
2306a53f50b9Schristos@cindex Mount flags; rdonly
2307a53f50b9Schristos@itemx ro
2308a53f50b9Schristos@cindex Mount flags; ro
2309a53f50b9SchristosMount this filesystem readonly.
2310a53f50b9Schristos
2311a53f50b9Schristos@item resvport
2312a53f50b9Schristos@cindex Mount flags; resvport
2313a53f50b9SchristosUse a reserved port (smaller than 1024) for remote NFS mounts.  Most
2314a53f50b9Schristossystems assume that, but some allow for mounts to occur on non-reserved
2315a53f50b9Schristosports.   This causes problems when such a system tries to NFS mount one
2316a53f50b9Schristosthat requires reserved ports.  It is recommended that this option always
2317a53f50b9Schristosbe on.
2318a53f50b9Schristos
2319a53f50b9Schristos@item retrans=@i{n}
2320a53f50b9Schristos@cindex Mount flags; retrans
2321a53f50b9SchristosThe number of NFS retransmits made before a user error is generated by a
2322a53f50b9Schristos@samp{soft} mounted filesystem, and before a @samp{hard} mounted
2323a53f50b9Schristosfilesystem reports @samp{NFS server @dfn{yoyo} not responding still
2324a53f50b9Schristostrying}.
2325a53f50b9Schristos
2326a53f50b9Schristos@item retry
2327a53f50b9Schristos@cindex Mount flags; retry
2328a53f50b9SchristosSet the NFS retry counter.
2329a53f50b9Schristos
2330544d676eSchristos@item rrcaseins
2331544d676eSchristos@cindex Mount flags; rrcaseins
2332544d676eSchristosEnable the Rock Ridge Interchange Protocol (RRIP) case insensitive extensions.
2333544d676eSchristosUseful for CD-ROMS formatted as ISO-9660.
2334544d676eSchristos
2335a53f50b9Schristos@item rrip
2336a53f50b9Schristos@cindex Mount flags; rrip
2337a53f50b9SchristosUses the Rock Ridge Interchange Protocol (RRIP) extensions to ISO-9660.
2338a53f50b9Schristos
2339a53f50b9Schristos@item rsize=@var{n}
2340a53f50b9Schristos@cindex Mount flags; rsize
2341a53f50b9SchristosThe NFS read packet size.  You may need to set this if you are using
2342a53f50b9SchristosNFS/UDP through a gateway or a slow link.
2343a53f50b9Schristos
2344a53f50b9Schristos@item rw
2345a53f50b9Schristos@cindex Mount flags; rw
2346a53f50b9SchristosAllow reads and writes on this filesystem.
2347a53f50b9Schristos
234814003705Schristos@item sessionnr=@var{n}
234914003705Schristos@cindex Mount Flags; sessionnr
235014003705SchristosFor multisession UDF mounts, use session number @var{n} when mounting.
235114003705Schristos
2352a53f50b9Schristos@item shortname
2353a53f50b9Schristos@cindex Mount Flags; longname
2354a53f50b9SchristosFor PCFS mounts, force old DOS short names only.
2355a53f50b9Schristos
2356a53f50b9Schristos@item soft
2357a53f50b9Schristos@cindex Mount flags; soft
2358a53f50b9SchristosGive up after @dfn{retrans} retransmissions.
2359a53f50b9Schristos
2360a53f50b9Schristos@item spongy
2361a53f50b9Schristos@cindex Mount flags; spongy
2362a53f50b9SchristosLike @samp{soft} for status requests, and @samp{hard} for data transfers.
2363a53f50b9Schristos
2364a53f50b9Schristos@item suid
2365a53f50b9Schristos@cindex Mount flags; suid
2366a53f50b9SchristosAllow set-uid programs on this mount.
2367a53f50b9Schristos
2368a53f50b9Schristos@item symttl
2369a53f50b9Schristos@cindex Mount flags; symttl
2370a53f50b9SchristosTurn off the symbolic link cache time-to-live.
2371a53f50b9Schristos
2372a53f50b9Schristos@item sync
2373a53f50b9Schristos@cindex Mount flags; sync
2374a53f50b9SchristosPerform synchronous filesystem operations on this mount.
2375a53f50b9Schristos
2376a53f50b9Schristos@item tcp
2377a53f50b9Schristos@cindex Mount flags; tcp
2378a53f50b9SchristosUse TCP/IP instead of UDP/IP, ignored if the NFS implementation does not
2379a53f50b9Schristossupport TCP/IP mounts.
2380a53f50b9Schristos
2381a53f50b9Schristos@item timeo=@var{n}
2382a53f50b9Schristos@cindex Mount flags; timeo
2383a53f50b9SchristosThe NFS timeout, in tenth-seconds, before a request is retransmitted.
2384a53f50b9Schristos
2385a53f50b9Schristos@item user=@var{n}
2386a53f50b9Schristos@cindex Mount flags; user
238714003705SchristosFor PCFS and UDF mounts, set the owner of the files in the file system
238814003705Schristosto @var{n} (which can either be a user name or a UID number).  The
2389a53f50b9Schristosdefault owner is the owner of the directory on which the file system
2390a53f50b9Schristosis being mounted.
2391a53f50b9Schristos
2392a53f50b9Schristos@item vers=@var{n}
2393a53f50b9Schristos@cindex Mount flags; vers
2394a53f50b9SchristosUse NFS protocol version number @var{n} (can be 2 or 3).
2395a53f50b9Schristos
2396a53f50b9Schristos@item wsize=@var{n}
2397a53f50b9Schristos@cindex Mount flags; wsize
2398a53f50b9SchristosThe NFS write packet size.  You may need to set this if you are using
2399a53f50b9SchristosNFS/UDP through a gateway or a slow link.
2400a53f50b9Schristos
2401a53f50b9Schristos@end table
2402a53f50b9Schristos
2403a53f50b9SchristosThe following options are implemented by @i{Amd}, rather than being
2404a53f50b9Schristospassed to the kernel.
2405a53f50b9Schristos
2406a53f50b9Schristos@table @code
2407a53f50b9Schristos
2408a53f50b9Schristos@item nounmount
2409a53f50b9Schristos@cindex Mount flags; nounmount
2410a53f50b9SchristosConfigures the mount so that its time-to-live will never expire.  This
2411a53f50b9Schristosis the default for non-network based filesystem types (such as
2412a53f50b9Schristosmounting local disks, floppies, and CD-ROMs).  See also the related
2413a53f50b9Schristos@i{unmount} option.
2414a53f50b9Schristos@c
2415a53f50b9Schristos@c Implementation broken:
2416a53f50b9Schristos
2417a53f50b9Schristos@item ping=@var{n}
2418a53f50b9Schristos@cindex Mount flags; ping
2419a53f50b9SchristosThe interval, in seconds, between keep-alive pings.  When four
2420a53f50b9Schristosconsecutive pings have failed the mount point is marked as hung.  This
2421a53f50b9Schristosinterval defaults to 30 seconds; if the ping interval is set to zero,
2422a53f50b9Schristos@i{Amd} will use the default 30-second interval.  If the interval is
2423a53f50b9Schristosset to -1 (or any other negative value), no pings are sent and the
2424a53f50b9Schristoshost is assumed to be always up, which can cause unmounts to hang See
2425a53f50b9Schristosthe @i{softlookup} option for a better alternative.  Turning pings off
2426a53f50b9Schristoscan be useful in NFS-HA (High-Availability) sites where the NFS
2427a53f50b9Schristosservice rarely goes down.  Setting the ping value to a large value can
2428a53f50b9Schristosreduce the amount of NFS_NULL chatter on your network considerably,
2429a53f50b9Schristosespecially in large sites.
2430a53f50b9Schristos
2431a53f50b9SchristosNote that if you have multiple @i{Amd} entries using the same file
2432a53f50b9Schristosserver, and each entry sets a different value of N, then each time Amd
2433a53f50b9Schristosmounts a new entry, the ping value will be re-evaluated (and updated,
2434a53f50b9Schristosturned off, or turned back on as needed).  Finally, note that NFS_NULL
2435a53f50b9Schristospings are sent for both UDP and TCP mounts, because even a hung TCP
2436a53f50b9Schristosmount can cause user processes to hang.
2437a53f50b9Schristos
2438a53f50b9Schristos@item public
2439a53f50b9Schristos@cindex Mount flags; public
2440a53f50b9SchristosUse WebNFS multi-component lookup on the public file handle instead of
2441a53f50b9Schristosthe mount protocol to obtain NFS file handles, as documented in the
2442a53f50b9SchristosWebNFS Client Specification, RFC 2054.  This means that @i{Amd} will not
2443a53f50b9Schristosattempt to contact the remote portmapper or remote mountd daemon, and
2444a53f50b9Schristoswill only connect to the well-known NFS port 2049 or the port specified
2445a53f50b9Schristoswith the @i{port} mount option, thus making it easier to use NFS through
2446a53f50b9Schristosa firewall.
2447a53f50b9Schristos
2448a53f50b9Schristos@item retry=@var{n}
2449a53f50b9Schristos@cindex Mount flags; retry=@var{n}
2450a53f50b9SchristosThe number of times to retry the mount system call.
2451a53f50b9Schristos
2452a53f50b9Schristos@item softlookup
2453a53f50b9Schristos@cindex Mount flags; softlookup
2454a53f50b9SchristosConfigures @i{Amd}'s behavior with respect to already-mounted shares from
2455a53f50b9SchristosNFS fileservers that are unreachable.  If softlookup is specified,
2456a53f50b9Schristostrying to access such a share will result in an error (EIO, which is
2457a53f50b9Schristoschanged from the ENOENT 6.0 used to return).  If it is not specified, a
2458a53f50b9Schristosregular symlink is provided and the access will probably hang
2459a53f50b9Schristosin the NFS filesystem.
2460a53f50b9Schristos
2461a53f50b9SchristosThe default behavior depends on whether the mount is 'soft' or 'hard';
2462a53f50b9Schristossoftlookup can be used to change this default. This is changed from 6.0
2463a53f50b9Schristoswhich always behaved as if softlookup was specified.
2464a53f50b9Schristos
2465a53f50b9Schristos@item unmount
2466a53f50b9Schristos@cindex Mount flags; unmount
2467a53f50b9SchristosConfigures the mount so that its time-to-live will indeed expire (and
2468a53f50b9Schristosthus may be automatically unmounted).  This is also the default for
2469a53f50b9Schristosnetwork-based filesystem types (e.g., NFS).  This option is useful for
2470a53f50b9Schristosremovable local media such as CD-ROMs, USB drives, etc. so they can
2471a53f50b9Schristosexpire when not in use, and get unmounted (such drives can get work
2472a53f50b9Schristosout when they keep spinning).  See also the related @i{nounmount}
2473a53f50b9Schristosoption.
2474a53f50b9Schristos
2475a53f50b9Schristos@item utimeout=@var{n}
2476a53f50b9Schristos@cindex Mount flags; utimeout=@var{n}
2477a53f50b9SchristosThe interval, in seconds, that looked up and mounted map entries are
2478a53f50b9Schristoscached.  After that period of time, @i{Amd} will attempt to unmount
2479a53f50b9Schristosthe entries.  If, however, the unmount fails (with EBUSY), then
2480a53f50b9Schristos@i{Amd} will extend the mount's time-to-live by the @i{utimeout} value
2481a53f50b9Schristosbefore the next unmount attempt is made.  In fact the interval is
2482a53f50b9Schristosextended before the unmount is attempted, to avoid thrashing.  The
2483a53f50b9Schristosdefault value is 120 seconds (two minutes) or as set by the @code{-w}
2484a53f50b9Schristoscommand line option.
2485a53f50b9Schristos
2486a53f50b9Schristos@item xlatecookie
2487a53f50b9Schristos@cindex Mount flags; xlatecookie
2488a53f50b9SchristosTranslate directory cookies between 32-long and 64-long lengths.
2489a53f50b9Schristos
2490a53f50b9Schristos@end table
2491a53f50b9Schristos
2492a53f50b9Schristos@node remopts Option, sublink Option, opts Option, Map Options
2493a53f50b9Schristos@comment  node-name,  next,  previous,  up
2494a53f50b9Schristos@subsubsection remopts Option
2495a53f50b9Schristos@cindex Setting system mount options for non-local networks
2496a53f50b9Schristos@cindex remopts, mount option
2497a53f50b9Schristos@cindex Mount option; remopts
2498a53f50b9Schristos
2499a53f50b9SchristosThis option has the same use as @code{$@{opts@}} but applies only when
2500a53f50b9Schristosthe remote host is on a non-local network.  For example, when using NFS
2501a53f50b9Schristosacross a gateway it is often necessary to use smaller values for the
2502a53f50b9Schristosdata read and write sizes.  This can simply be done by specifying the
2503a53f50b9Schristossmall values in @var{remopts}.  When a non-local host is accessed, the
2504a53f50b9Schristossmaller sizes will automatically be used.
2505a53f50b9Schristos
2506a53f50b9Schristos@i{Amd} determines whether a host is local by examining the network
2507a53f50b9Schristosinterface configuration at startup.  Any interface changes made after
2508a53f50b9Schristos@i{Amd} has been started will not be noticed.  The likely effect will
2509a53f50b9Schristosbe that a host may incorrectly be declared non-local.
2510a53f50b9Schristos
2511a53f50b9SchristosUnless otherwise set, the value of @code{$@{remopts@}} is the same as
2512a53f50b9Schristosthe value of @code{$@{opts@}}.
2513a53f50b9Schristos
2514a53f50b9Schristos@node sublink Option, type Option, remopts Option, Map Options
2515a53f50b9Schristos@comment  node-name,  next,  previous,  up
2516a53f50b9Schristos@subsubsection sublink Option
2517a53f50b9Schristos@cindex Setting the sublink option
2518a53f50b9Schristos@cindex sublink, mount option
2519a53f50b9Schristos@cindex Mount option; sublink
2520a53f50b9Schristos
2521a53f50b9SchristosThe subdirectory within the mounted filesystem to which the reference
2522a53f50b9Schristosshould point.  This can be used to prevent duplicate mounts in cases
2523a53f50b9Schristoswhere multiple directories in the same mounted filesystem are used.
2524a53f50b9Schristos
2525a53f50b9Schristos@node type Option, , sublink Option, Map Options
2526a53f50b9Schristos@comment  node-name,  next,  previous,  up
2527a53f50b9Schristos@subsubsection type Option
2528a53f50b9Schristos@cindex Setting the filesystem type option
2529a53f50b9Schristos@cindex type, mount option
2530a53f50b9Schristos@cindex Mount option; type
2531a53f50b9Schristos
2532a53f50b9SchristosThe filesystem type to be used.  @xref{Filesystem Types}, for a full
2533a53f50b9Schristosdescription of each type.@refill
2534a53f50b9Schristos
2535a53f50b9Schristos@c ################################################################
2536a53f50b9Schristos@node Amd Command Line Options, Filesystem Types, Mount Maps, Top
2537a53f50b9Schristos@comment  node-name,  next,  previous,  up
2538a53f50b9Schristos@chapter @i{Amd} Command Line Options
2539a53f50b9Schristos@cindex Command line options, Amd
2540a53f50b9Schristos@cindex Amd command line options
2541a53f50b9Schristos@cindex Overriding defaults on the command line
2542a53f50b9Schristos
2543a53f50b9SchristosMany of @i{Amd}'s parameters can be set from the command line.  The
2544a53f50b9Schristoscommand line is also used to specify automount points and maps.
2545a53f50b9Schristos
2546a53f50b9SchristosThe general format of a command line is
2547a53f50b9Schristos
2548a53f50b9Schristos@example
2549a53f50b9Schristosamd [@i{options}] [@{ @i{directory} @i{map-name} [-@i{map-options}] @} ...]
2550a53f50b9Schristos@end example
2551a53f50b9Schristos
2552a53f50b9SchristosFor each directory and map-name given or specified in the
2553a53f50b9Schristos@file{amd.conf} file, @i{Amd} establishes an automount point.  The
2554a53f50b9Schristos@dfn{map-options} may be any sequence of options or
2555a53f50b9Schristosselectors---@pxref{Location Format}.  The @dfn{map-options} apply only
2556a53f50b9Schristosto @i{Amd}'s mount point.
2557a53f50b9Schristos
2558a53f50b9Schristos@samp{type:=toplvl;cache:=mapdefault;fs:=$@{map@}} is the default value for the
2559a53f50b9Schristosmap options.  Default options for a map are read from a special entry in
2560a53f50b9Schristosthe map whose key is the string @samp{/defaults}.  When default options
2561a53f50b9Schristosare given they are prepended to any options specified in the mount-map
2562a53f50b9Schristoslocations as explained in @ref{Map Defaults}.
2563a53f50b9Schristos
2564a53f50b9SchristosThe @dfn{options} are any combination of those listed below.
2565a53f50b9Schristos
2566a53f50b9SchristosOnce the command line has been parsed, the automount points are mounted.
2567a53f50b9SchristosThe mount points are created if they do not already exist, in which case they
2568a53f50b9Schristoswill be removed when @i{Amd} exits.
2569a53f50b9SchristosFinally, @i{Amd} disassociates itself from its controlling terminal and
2570a53f50b9Schristosforks into the background.
2571a53f50b9Schristos
2572a53f50b9SchristosNote: Even if @i{Amd} has been built with @samp{-DDEBUG} (via
2573a53f50b9Schristos@code{configure --enable-debug}), it will still background itself and
2574a53f50b9Schristosdisassociate itself from the controlling terminal.  To use a debugger it
2575a53f50b9Schristosis necessary to specify @samp{-D daemon} on the command line.
2576a53f50b9SchristosHowever, even with all of this, mounts and unmounts are performed in the
2577a53f50b9Schristosbackground, and @i{Amd} will always fork before doing them.  Therefore,
2578a53f50b9Schristosdebugging what happens closely during un/mounts is more challenging.
2579a53f50b9Schristos
2580a53f50b9Schristos@emph{All} of @i{Amd}'s command options (save @code{-F} and @code{-T})
2581a53f50b9Schristoscan be specified in the @file{amd.conf} file. @xref{Amd Configuration
2582a53f50b9SchristosFile}.  If @i{Amd} is invoked without any command line options, it will
2583a53f50b9Schristosdefault to using the configuration file @file{/etc/amd.conf}, if one
2584a53f50b9Schristosexists.
2585a53f50b9Schristos
2586a53f50b9Schristos@menu
2587a53f50b9Schristos* -a Option::   Automount directory.
2588a53f50b9Schristos* -c Option::   Cache timeout interval.
2589a53f50b9Schristos* -d Option::   Domain name.
2590a53f50b9Schristos* -k Option::   Kernel architecture.
2591a53f50b9Schristos* -l Option::   Log file.
2592a53f50b9Schristos* -n Option::   Hostname normalization.
2593a53f50b9Schristos* -o Option::   Operating system version.
2594a53f50b9Schristos* -p Option::   Output process id.
2595a53f50b9Schristos* -r Option::   Restart existing mounts.
2596a53f50b9Schristos* -t Option::   Kernel RPC timeout.
2597a53f50b9Schristos* -v Option::   Version information.
2598a53f50b9Schristos* -w Option::   Wait interval after failed unmount.
2599a53f50b9Schristos* -x Option::   Log options.
2600a53f50b9Schristos* -y Option::   NIS domain.
2601a53f50b9Schristos* -A Option::   Operating system Architecture.
2602a53f50b9Schristos* -C Option::   Cluster name.
2603a53f50b9Schristos* -D Option::   Debug flags.
2604a53f50b9Schristos* -F Option::   Amd configuration file.
2605a53f50b9Schristos* -H Option::   Show brief help.
2606a53f50b9Schristos* -O Option::   Operating system name.
2607a53f50b9Schristos* -S Option::   Lock executable pages in memory.
2608a53f50b9Schristos* -T Option::   Set tag for configuration file.
2609a53f50b9Schristos@end menu
2610a53f50b9Schristos
2611a53f50b9Schristos@c ----------------------------------------------------------------
2612a53f50b9Schristos@node -a Option, -c Option, Amd Command Line Options, Amd Command Line Options
2613a53f50b9Schristos@comment  node-name,  next,  previous,  up
2614a53f50b9Schristos@section @code{-a} @var{directory}
2615a53f50b9Schristos@cindex Automount directory
2616a53f50b9Schristos@cindex Setting the default mount directory
2617a53f50b9Schristos
2618a53f50b9SchristosSpecifies the default mount directory.  This option changes the variable
2619a53f50b9Schristos@code{$@{autodir@}} which otherwise defaults to @file{/a}.  For example,
2620a53f50b9Schristossome sites prefer @file{/amd} or @file{/n}.
2621a53f50b9Schristos
2622a53f50b9Schristos@example
2623a53f50b9Schristosamd -a /amd ...
2624a53f50b9Schristos@end example
2625a53f50b9Schristos
2626a53f50b9Schristos@c ----------------------------------------------------------------
2627a53f50b9Schristos@node -c Option, -d Option, -a Option, Amd Command Line Options
2628a53f50b9Schristos@comment  node-name,  next,  previous,  up
2629a53f50b9Schristos@section @code{-c} @var{cache-interval}
2630a53f50b9Schristos@cindex Cache interval
2631a53f50b9Schristos@cindex Interval before a filesystem times out
2632a53f50b9Schristos@cindex Setting the interval before a filesystem times out
2633a53f50b9Schristos@cindex Changing the interval before a filesystem times out
2634a53f50b9Schristos
2635a53f50b9SchristosSelects the period, in seconds, for which a name is cached by @i{Amd}.
2636a53f50b9SchristosIf no reference is made to the volume in this period, @i{Amd} discards
2637a53f50b9Schristosthe volume name to filesystem mapping.
2638a53f50b9Schristos
2639a53f50b9SchristosOnce the last reference to a filesystem has been removed, @i{Amd}
2640a53f50b9Schristosattempts to unmount the filesystem.  If the unmount fails the interval
2641a53f50b9Schristosis extended by a further period as specified by the @samp{-w} command
2642a53f50b9Schristosline option or by the @samp{utimeout} mount option.
2643a53f50b9Schristos
2644a53f50b9SchristosThe default @dfn{cache-interval} is 300 seconds (five minutes).
2645a53f50b9Schristos
2646a53f50b9Schristos@c ----------------------------------------------------------------
2647a53f50b9Schristos@node -d Option, -k Option, -c Option, Amd Command Line Options
2648a53f50b9Schristos@comment  node-name,  next,  previous,  up
2649a53f50b9Schristos@section @code{-d} @var{domain}
2650a53f50b9Schristos@cindex Domain name
2651a53f50b9Schristos@cindex Setting the local domain name
2652a53f50b9Schristos@cindex Overriding the local domain name
2653a53f50b9Schristos
2654a53f50b9SchristosSpecifies the host's domain.  This sets the internal variable
2655a53f50b9Schristos@code{$@{domain@}} and affects the @code{$@{hostd@}} variable.
2656a53f50b9Schristos
2657a53f50b9SchristosIf this option is not specified and the hostname already contains the
2658a53f50b9Schristoslocal domain then that is used, otherwise the default value of
2659a53f50b9Schristos@code{$@{domain@}} is @samp{unknown.domain}.
2660a53f50b9Schristos
2661a53f50b9SchristosFor example, if the local domain was @samp{doc.ic.ac.uk}, @i{Amd} could
2662a53f50b9Schristosbe started as follows:
2663a53f50b9Schristos
2664a53f50b9Schristos@example
2665a53f50b9Schristosamd -d doc.ic.ac.uk ...
2666a53f50b9Schristos@end example
2667a53f50b9Schristos
2668a53f50b9Schristos@c ----------------------------------------------------------------
2669a53f50b9Schristos@node -k Option, -l Option, -d Option, Amd Command Line Options
2670a53f50b9Schristos@comment  node-name,  next,  previous,  up
2671a53f50b9Schristos@section @code{-k} @var{kernel-architecture}
2672a53f50b9Schristos@cindex Setting the Kernel architecture
2673a53f50b9Schristos
2674a53f50b9SchristosSpecifies the kernel architecture of the system.  This is usually the
2675a53f50b9Schristosoutput of @samp{uname -m} (the ``machine'' value gotten from
2676a53f50b9Schristos@b{uname}(2)).  If the @b{uname}(2) system call is not available, the
2677a53f50b9Schristosvalue of @code{$@{karch@}} defaults to that of @code{$@{arch@}}.
2678a53f50b9Schristos
2679a53f50b9SchristosThe only effect of this option is to set the variable @code{$@{karch@}}.
2680a53f50b9Schristos
2681a53f50b9SchristosThis option would be used as follows:
2682a53f50b9Schristos
2683a53f50b9Schristos@example
2684a53f50b9Schristosamd -k `arch -k` ...
2685a53f50b9Schristos@end example
2686a53f50b9Schristos
2687a53f50b9Schristos@c ----------------------------------------------------------------
2688a53f50b9Schristos@node -l Option, -n Option, -k Option, Amd Command Line Options
2689a53f50b9Schristos@comment  node-name,  next,  previous,  up
2690a53f50b9Schristos@section @code{-l} @var{log-option}
2691a53f50b9Schristos@cindex Log filename
2692a53f50b9Schristos@cindex Setting the log file
2693a53f50b9Schristos@cindex Using syslog to log errors
2694a53f50b9Schristos@cindex syslog
2695a53f50b9Schristos
2696a53f50b9SchristosSelects the form of logging to be made.  Several special @dfn{log-options}
2697a53f50b9Schristosare recognized.
2698a53f50b9Schristos
2699a53f50b9Schristos@enumerate
2700a53f50b9Schristos@item
2701a53f50b9SchristosIf @dfn{log-option} is the string @samp{syslog}, @i{Amd} will use the
2702a53f50b9Schristos@b{syslog}(3) mechanism.  If your system supports syslog facilities, then
2703a53f50b9Schristosthe default facility used is @samp{LOG_DAEMON}.
2704a53f50b9Schristos
2705a53f50b9Schristos@item
2706a53f50b9Schristos@cindex syslog facility; specifying an alternate
2707a53f50b9SchristosWhen using syslog, if you wish to change the facility, append its name
2708a53f50b9Schristosto the log option name, delimited by a single colon.  For example, if
2709a53f50b9Schristos@dfn{log-options} is the string @samp{syslog:local7} then @b{Amd} will
2710a53f50b9Schristoslog messages via @b{syslog}(3) using the @samp{LOG_LOCAL7} facility.  If
2711a53f50b9Schristosthe facility name specified is not recognized, @i{Amd} will default to
2712a53f50b9Schristos@samp{LOG_DAEMON}.  Note: while you can use any syslog facility
2713a53f50b9Schristosavailable on your system, it is generally a bad idea to use those
2714a53f50b9Schristosreserved for other services such as @samp{kern}, @samp{lpr},
2715a53f50b9Schristos@samp{cron}, etc.
2716a53f50b9Schristos
2717a53f50b9Schristos@item
2718a53f50b9SchristosIf @dfn{log-option} is the string @samp{/dev/stderr}, @i{Amd} will use
2719a53f50b9Schristosstandard error, which is also the default target for log messages.  To
2720a53f50b9Schristosimplement this, @i{Amd} simulates the effect of the @samp{/dev/fd}
2721a53f50b9Schristosdriver.
2722a53f50b9Schristos@end enumerate
2723a53f50b9Schristos
2724a53f50b9SchristosAny other string is taken as a filename to use for logging.  Log
2725a53f50b9Schristosmessages are appended to the file if it already exists, otherwise a new
2726a53f50b9Schristosfile is created.  The file is opened once and then held open, rather
2727a53f50b9Schristosthan being re-opened for each message.
2728a53f50b9Schristos
2729a53f50b9SchristosNormally, when long-running daemons hold an open file descriptor on a
2730a53f50b9Schristoslog file, it is impossible to ``rotate'' the log file and compress older
2731a53f50b9Schristoslogs on a daily basis.  The daemon needs to be told to discard (via
2732a53f50b9Schristos@b{close}(2)) its file handle, and re-open the log file.  This is done
2733a53f50b9Schristosusing @code{amq -l} @i{log-option}. @xref{Amq -l option}.
2734a53f50b9Schristos
2735a53f50b9SchristosIf the @samp{syslog} option is specified but the system does not support
2736a53f50b9Schristossyslog or if the named file cannot be opened or created, @i{Amd} will
2737a53f50b9Schristosuse standard error.  Error messages generated before @i{Amd} has
2738a53f50b9Schristosfinished parsing the command line are printed on standard error.
2739a53f50b9Schristos
2740a53f50b9SchristosSince @i{Amd} tends to generate a lot of logging information (especially
2741a53f50b9Schristosif debugging was turned on), and due to it being an important program
2742a53f50b9Schristosrunning on the system, it is usually best to log to a separate disk
2743a53f50b9Schristosfile.  In that case @i{Amd} would be started as follows:
2744a53f50b9Schristos
2745a53f50b9Schristos@example
2746a53f50b9Schristosamd -l /var/log/amd ...
2747a53f50b9Schristos@end example
2748a53f50b9Schristos
2749a53f50b9Schristos@c ----------------------------------------------------------------
2750a53f50b9Schristos@node -n Option, -o Option, -l Option, Amd Command Line Options
2751a53f50b9Schristos@comment  node-name,  next,  previous,  up
2752a53f50b9Schristos@section @code{-n}
2753a53f50b9Schristos@cindex Hostname normalization
2754a53f50b9Schristos@cindex Aliased hostnames
2755a53f50b9Schristos@cindex Resolving aliased hostnames
2756a53f50b9Schristos@cindex Normalizing hostnames
2757a53f50b9Schristos
2758a53f50b9SchristosNormalizes the remote hostname before using it.  Normalization is done
2759a53f50b9Schristosby replacing the value of @code{$@{rhost@}} with the (generally fully
2760a53f50b9Schristosqualified) primary name returned by a hostname lookup.
2761a53f50b9Schristos
2762a53f50b9SchristosThis option should be used if several names are used to refer to a
2763a53f50b9Schristossingle host in a mount map.
2764a53f50b9Schristos
2765a53f50b9Schristos@c ----------------------------------------------------------------
2766a53f50b9Schristos@node -o Option, -p Option, -n Option, Amd Command Line Options
2767a53f50b9Schristos@comment  node-name,  next,  previous,  up
2768a53f50b9Schristos@section @code{-o} @var{op-sys-ver}
2769a53f50b9Schristos@cindex Operating System version
2770a53f50b9Schristos@cindex Setting the Operating System version
2771a53f50b9Schristos
2772a53f50b9SchristosOverrides the compiled-in version number of the operating system, with
2773a53f50b9Schristos@var{op-sys-ver}.  Useful when the built-in version is not desired for
2774a53f50b9Schristosbackward compatibility reasons.  For example, if the built-in version is
2775a53f50b9Schristos@samp{2.5.1}, you can override it to @samp{5.5.1}, and use older maps
2776a53f50b9Schristosthat were written with the latter in mind.
2777a53f50b9Schristos
2778a53f50b9Schristos@c ----------------------------------------------------------------
2779a53f50b9Schristos@node -p Option, -r Option, -o Option, Amd Command Line Options
2780a53f50b9Schristos@comment  node-name,  next,  previous,  up
2781a53f50b9Schristos@section @code{-p}
2782a53f50b9Schristos@cindex Process id
2783a53f50b9Schristos@cindex Displaying the process id
2784a53f50b9Schristos@cindex process id of Amd daemon
2785a53f50b9Schristos@cindex pid file, creating with -p option
2786a53f50b9Schristos@cindex Creating a pid file
2787a53f50b9Schristos
2788a53f50b9SchristosCauses @i{Amd}'s process id to be printed on standard output.
2789a53f50b9SchristosThis can be redirected to a suitable file for use with kill:
2790a53f50b9Schristos
2791a53f50b9Schristos@example
2792a53f50b9Schristosamd -p > /var/run/amd.pid ...
2793a53f50b9Schristos@end example
2794a53f50b9Schristos
2795a53f50b9SchristosThis option only has an affect if @i{Amd} is running in daemon mode.
2796a53f50b9SchristosIf @i{Amd} is started with the @code{-D daemon} debug flag, this
2797a53f50b9Schristosoption is ignored.
2798a53f50b9Schristos
2799a53f50b9Schristos@c ----------------------------------------------------------------
2800a53f50b9Schristos@node -r Option, -t Option, -p Option, Amd Command Line Options
2801a53f50b9Schristos@comment  node-name,  next,  previous,  up
2802a53f50b9Schristos@section @code{-r}
2803a53f50b9Schristos@cindex Restarting existing mounts
2804a53f50b9Schristos@cindex Picking up existing mounts
2805a53f50b9Schristos
2806a53f50b9SchristosTells @i{Amd} to restart existing mounts (@pxref{Inheritance Filesystem}).
2807a53f50b9Schristos@c @dfn{This option will be made the default in the next release.}
2808a53f50b9Schristos
2809a53f50b9Schristos@c ----------------------------------------------------------------
2810a53f50b9Schristos@node -t Option, -v Option, -r Option, Amd Command Line Options
2811a53f50b9Schristos@comment  node-name,  next,  previous,  up
2812a53f50b9Schristos@section @code{-t} @var{timeout.retransmit}
2813a53f50b9Schristos@cindex Setting Amd's RPC parameters
2814a53f50b9Schristos
2815a53f50b9SchristosSpecifies the RPC @dfn{timeout} interval and the @dfn{retransmit}
2816a53f50b9Schristoscounter used by the kernel to communicate to @i{Amd}.  These are used to
2817a53f50b9Schristosset the @samp{timeo} and @samp{retrans} mount options, respectively.
2818a53f50b9SchristosThe default timeout is 0.8 seconds, and the default number of
2819a53f50b9Schristosretransmissions is 11.
2820a53f50b9Schristos
2821a53f50b9Schristos@i{Amd} relies on the kernel RPC retransmit mechanism to trigger mount
2822a53f50b9Schristosretries.  The values of these parameters change the overall retry
2823a53f50b9Schristosinterval.  Too long an interval gives poor interactive response; too
2824a53f50b9Schristosshort an interval causes excessive retries.
2825a53f50b9Schristos
2826a53f50b9Schristos@c ----------------------------------------------------------------
2827a53f50b9Schristos@node -v Option, -w Option, -t Option, Amd Command Line Options
2828a53f50b9Schristos@comment  node-name,  next,  previous,  up
2829a53f50b9Schristos@section @code{-v}
2830a53f50b9Schristos@cindex Version information
2831a53f50b9Schristos@cindex Discovering version information
2832a53f50b9Schristos@cindex How to discover your version of Amd
2833a53f50b9Schristos
2834a53f50b9SchristosPrint version information on standard error and then exit.  The output
2835a53f50b9Schristosis of the form:
2836a53f50b9Schristos
2837a53f50b9Schristos@example
2838a53f50b9SchristosCopyright (c) 1997-1999 Erez Zadok
2839a53f50b9SchristosCopyright (c) 1990 Jan-Simon Pendry
2840a53f50b9SchristosCopyright (c) 1990 Imperial College of Science, Technology & Medicine
2841a53f50b9SchristosCopyright (c) 1990 The Regents of the University of California.
2842a53f50b9Schristosam-utils version 6.0a15 (build 61).
2843a53f50b9SchristosBuilt by ezk@@example.com on date Wed Oct 22 15:21:03 EDT 1997.
2844a53f50b9Schristoscpu=sparc (big-endian), arch=sun4, karch=sun4u.
2845a53f50b9Schristosfull_os=solaris2.5.1, os=sos5, osver=5.5.1, vendor=sun.
2846a53f50b9SchristosMap support for: root, passwd, union, nisplus, nis, ndbm, file, error.
2847a53f50b9SchristosAMFS: nfs, link, nfsx, nfsl, host, linkx, program, union, inherit,
2848a53f50b9Schristos      ufs, lofs, hsfs, pcfs, auto, direct, toplvl, error.
284914003705SchristosFS: autofs, cachefs, cdfs, lofs, nfs, nfs3, pcfs, tfs, tmpfs, udf, ufs.
2850a53f50b9SchristosNetwork 1: wire="mcl-lab-net.cs.columbia.edu" (netnumber=128.59.13).
2851a53f50b9SchristosNetwork 2: wire="14-net.cs.columbia.edu" (netnumber=128.59.14).
2852a53f50b9SchristosNetwork 3: wire="old-net.cs.columbia.edu" (netnumber=128.59.16).
2853a53f50b9Schristos@end example
2854a53f50b9Schristos
2855a53f50b9SchristosThe information includes the version number, number of times @i{Amd} was
2856a53f50b9Schristoscompiled on the local system, release date and name of the release.
2857a53f50b9SchristosFollowing come the cpu type, byte ordering, and the architecture and
2858a53f50b9Schristoskernel architecture as @code{$@{arch@}} and @code{$@{karch@}},
2859a53f50b9Schristosrespectively.  The next line lists the operating system full name, short
2860a53f50b9Schristosname, version, and vendor.  These four values correspond to the
2861a53f50b9Schristosvariables @code{$@{full_os@}}, @code{$@{os@}}, @code{$@{osver@}}, and
2862a53f50b9Schristos@code{$@{vendor@}}, respectively.  @xref{Supported Platforms}.
2863a53f50b9Schristos
2864a53f50b9SchristosThen come a list of map types supported, filesystems internally
2865a53f50b9Schristossupported by @i{Amd} (AMFS), and generic filesystems available (FS).
2866a53f50b9SchristosFinally all known networks (if any) of this host are listed by name
2867a53f50b9Schristosand number.  They are available via the variables
2868a53f50b9Schristos@code{$@{wire@}} or @code{$@{network@}}, and
2869a53f50b9Schristos@code{$@{netnumber@}} (@pxref{Selectors}) or the @samp{in_network}
2870a53f50b9Schristosselector function (@pxref{in_network Selector Function}).
2871a53f50b9Schristos
2872a53f50b9Schristos@c ----------------------------------------------------------------
2873a53f50b9Schristos@node -w Option, -x Option, -v Option, Amd Command Line Options
2874a53f50b9Schristos@comment  node-name,  next,  previous,  up
2875a53f50b9Schristos@section @code{-w} @var{wait-timeout}
2876a53f50b9Schristos@cindex Setting the interval between unmount attempts
2877a53f50b9Schristos@cindex unmount attempt backoff interval
2878a53f50b9Schristos
2879a53f50b9SchristosSelects the interval in seconds between unmount attempts after the
2880a53f50b9Schristosinitial time-to-live has expired.
2881a53f50b9Schristos
2882a53f50b9SchristosThis defaults to 120 seconds (two minutes).
2883a53f50b9Schristos
2884a53f50b9Schristos@c ----------------------------------------------------------------
2885a53f50b9Schristos@node -x Option, -y Option, -w Option, Amd Command Line Options
2886a53f50b9Schristos@comment  node-name,  next,  previous,  up
2887a53f50b9Schristos@section @code{-x} @var{opts}
2888a53f50b9Schristos@cindex Log message selection
2889a53f50b9Schristos@cindex Selecting specific log messages
2890a53f50b9Schristos@cindex How to select log messages
2891a53f50b9Schristos@cindex syslog priorities
2892a53f50b9Schristos
2893a53f50b9SchristosSpecifies the type and verbosity of log messages.  @dfn{opts} is
2894a53f50b9Schristosa comma separated list selected from the following options:
2895a53f50b9Schristos
2896a53f50b9Schristos@table @code
2897a53f50b9Schristos@item fatal
2898a53f50b9SchristosFatal errors (cannot be turned off)
2899a53f50b9Schristos@item error
2900a53f50b9SchristosNon-fatal errors (cannot be turned off)
2901a53f50b9Schristos@item user
2902a53f50b9SchristosNon-fatal user errors
2903a53f50b9Schristos@item warn
2904a53f50b9SchristosRecoverable errors
2905a53f50b9Schristos@item warning
2906a53f50b9SchristosAlias for @code{warn}
2907a53f50b9Schristos@item info
2908a53f50b9SchristosInformation messages
2909a53f50b9Schristos@item map
2910a53f50b9SchristosMount map usage
2911a53f50b9Schristos@item stats
2912a53f50b9SchristosAdditional statistics
2913a53f50b9Schristos@item all
2914a53f50b9SchristosAll of the above
2915a53f50b9Schristos@item defaults
2916a53f50b9SchristosAn alias for "fatal,error,user,warning,info".
2917a53f50b9Schristos@end table
2918a53f50b9Schristos
2919a53f50b9SchristosInitially a set of default logging flags is enabled.  This is as if
2920a53f50b9Schristos@samp{-x defaults}
2921a53f50b9Schristosor
2922a53f50b9Schristos@samp{-x fatal,error,user,warning,info}
2923a53f50b9Schristoshad been selected.  The command line is
2924a53f50b9Schristosparsed and logging is controlled by the @code{-x} option.  The very first
2925a53f50b9Schristosset of logging flags is saved and can not be subsequently disabled using
2926a53f50b9Schristos@i{Amq}.  This default set of options is useful for general production
2927a53f50b9Schristosuse.@refill
2928a53f50b9Schristos
2929a53f50b9SchristosThe @samp{info} messages include details of what is mounted and
2930a53f50b9Schristosunmounted and when filesystems have timed out.  If you want to have the
2931a53f50b9Schristosdefault set of messages without the @samp{info} messages then you simply
2932a53f50b9Schristosneed @samp{-x noinfo}.  The messages given by @samp{user} relate to
2933a53f50b9Schristoserrors in the mount maps, so these are useful when new maps are
2934a53f50b9Schristosinstalled.  The following table lists the syslog priorities used for each
2935a53f50b9Schristosof the message types.@refill
2936a53f50b9Schristos
2937a53f50b9Schristos@table @code
2938a53f50b9Schristos@item fatal
2939a53f50b9Schristos@samp{LOG_CRIT}
2940a53f50b9Schristos@item error
2941a53f50b9Schristos@samp{LOG_ERR}
2942a53f50b9Schristos@item user
2943a53f50b9Schristos@samp{LOG_WARNING}
2944a53f50b9Schristos@item warning
2945a53f50b9Schristos@samp{LOG_WARNING}
2946a53f50b9Schristos@item info
2947a53f50b9Schristos@samp{LOG_INFO}
2948a53f50b9Schristos@item debug
2949a53f50b9Schristos@samp{LOG_DEBUG}
2950a53f50b9Schristos@item map
2951a53f50b9Schristos@samp{LOG_DEBUG}
2952a53f50b9Schristos@item stats
2953a53f50b9Schristos@samp{LOG_INFO}
2954a53f50b9Schristos@end table
2955a53f50b9Schristos
2956a53f50b9SchristosThe options can be prefixed by the string @samp{no} to indicate
2957a53f50b9Schristosthat this option should be turned off.  For example, to obtain all
2958a53f50b9Schristosbut @samp{info} messages the option @samp{-x all,noinfo} would be used.
2959a53f50b9Schristos
2960a53f50b9SchristosIf @i{Amd} was built with debugging enabled the @code{debug} option is
2961a53f50b9Schristosautomatically enabled regardless of the command line options.
2962a53f50b9Schristos
2963a53f50b9Schristos@c ----------------------------------------------------------------
2964a53f50b9Schristos@node -y Option, -A Option, -x Option, Amd Command Line Options
2965a53f50b9Schristos@comment  node-name,  next,  previous,  up
2966a53f50b9Schristos@section @code{-y} @var{NIS-domain}
2967a53f50b9Schristos@cindex NIS (YP) domain name
2968a53f50b9Schristos@cindex Overriding the NIS (YP) domain name
2969a53f50b9Schristos@cindex Setting the NIS (YP) domain name
2970a53f50b9Schristos@cindex YP domain name
2971a53f50b9Schristos
2972a53f50b9SchristosSelects an alternate NIS domain.  This is useful for debugging and
2973a53f50b9Schristoscross-domain shared mounting.  If this flag is specified, @i{Amd}
2974a53f50b9Schristosimmediately attempts to bind to a server for this domain.
2975a53f50b9Schristos@c @i{Amd} refers to NIS maps when it starts, unless the @code{-m} option
2976a53f50b9Schristos@c is specified, and whenever required in a mount map.
2977a53f50b9Schristos
2978a53f50b9Schristos@c ----------------------------------------------------------------
2979a53f50b9Schristos@node -A Option, -C Option, -y Option, Amd Command Line Options
2980a53f50b9Schristos@comment  node-name,  next,  previous,  up
2981a53f50b9Schristos@section @code{-A} @var{architecture}
2982a53f50b9Schristos@cindex Setting the operating system architecture
2983a53f50b9Schristos
2984a53f50b9SchristosSpecifies the OS architecture of the system.
2985a53f50b9SchristosThe only effect of this option is to set the variable @code{$@{arch@}}.
2986a53f50b9Schristos
2987a53f50b9SchristosThis option would be used as follows:
2988a53f50b9Schristos
2989a53f50b9Schristos@example
2990a53f50b9Schristosamd -A i386 ...
2991a53f50b9Schristos@end example
2992a53f50b9Schristos
2993a53f50b9Schristos@c ----------------------------------------------------------------
2994a53f50b9Schristos@node -C Option, -D Option, -A Option, Amd Command Line Options
2995a53f50b9Schristos@comment  node-name,  next,  previous,  up
2996a53f50b9Schristos@section @code{-C} @var{cluster-name}
2997a53f50b9Schristos@cindex Cluster names
2998a53f50b9Schristos@cindex Setting the cluster name
2999a53f50b9Schristos
3000a53f50b9SchristosSpecifies the name of the cluster of which the local machine is a member.
3001a53f50b9SchristosThe only effect is to set the variable @code{$@{cluster@}}.
3002a53f50b9SchristosThe @dfn{cluster-name} is will usually obtained by running another command which uses
3003a53f50b9Schristosa database to map the local hostname into a cluster name.
3004a53f50b9Schristos@code{$@{cluster@}} can then be used as a selector to restrict mounting of
3005a53f50b9Schristosreplicated data.
3006a53f50b9SchristosIf this option is not given, @code{$@{cluster@}} has the same value as @code{$@{domain@}}.
3007a53f50b9SchristosThis would be used as follows:
3008a53f50b9Schristos
3009a53f50b9Schristos@example
3010a53f50b9Schristosamd -C `clustername` ...
3011a53f50b9Schristos@end example
3012a53f50b9Schristos
3013a53f50b9Schristos@c ----------------------------------------------------------------
3014a53f50b9Schristos@node -D Option, -F Option, -C Option, Amd Command Line Options
3015a53f50b9Schristos@comment  node-name,  next,  previous,  up
3016a53f50b9Schristos@section @code{-D} @var{opts}
3017a53f50b9Schristos@cindex Debug options
3018a53f50b9Schristos@cindex Setting debug flags
3019a53f50b9Schristos
3020a53f50b9SchristosControls the verbosity and coverage of the debugging trace; @dfn{opts}
3021a53f50b9Schristosis a comma separated list of debugging options.  The @code{-D} option is
3022a53f50b9Schristosonly available if @i{Amd} was compiled with @samp{-DDEBUG}, or
3023a53f50b9Schristosconfigured with @code{configure --enable-debug}.  The memory debugging
3024a53f50b9Schristosfacilities (@samp{mem}) are only available if @i{Amd} was compiled with
3025a53f50b9Schristos@samp{-DDEBUG_MEM} (in addition to @samp{-DDEBUG}), or configured with
3026a53f50b9Schristos@code{configure --enable-debug=mem}.
3027a53f50b9Schristos
3028a53f50b9SchristosThe most common options to use are @samp{-D trace} and @samp{-D test}
3029a53f50b9Schristos(which turns on all the useful debug options).  As usual, every option
3030a53f50b9Schristoscan be prefixed with @samp{no} to turn it off.
3031a53f50b9Schristos
3032a53f50b9Schristos@table @code
3033a53f50b9Schristos@item all
3034a53f50b9Schristosall options (excluding hrtime and mtab)
3035a53f50b9Schristos@item defaults
3036a53f50b9Schristos``sensible'' default options (all--excluding hrtime, mtab, and xdrtrace)
3037a53f50b9Schristos@item test
3038a53f50b9Schristosfull debug options plus mtab,nodaemon,nofork,noamq
3039a53f50b9Schristos@item amq
3040a53f50b9Schristosregister @i{Amd} with the RPC portmapper, for @i{Amq}
3041a53f50b9Schristos@item daemon
3042a53f50b9Schristosenter daemon mode
3043a53f50b9Schristos@item fork
3044a53f50b9Schristosfork child worker (hlfsd only)
3045a53f50b9Schristos@item full
3046a53f50b9Schristosprogram trace
3047a53f50b9Schristos@item hrtime
3048a53f50b9Schristosprint high resolution time stamps (only if @b{syslog}(3) is not used)
3049a53f50b9Schristos@item info
3050a53f50b9Schristos@cindex debugging hesiod resolver service
3051a53f50b9Schristos@cindex Hesiod; turning on RES_DEBUG
3052a53f50b9Schristosinfo service specific debugging (hesiod, nis, etc.)  In the case of
3053a53f50b9Schristoshesiod maps, turns on the hesiod RES_DEBUG internal debugging option.
3054a53f50b9Schristos@item mem
3055a53f50b9Schristostrace memory allocations.  Needs to be explicitly enabled at compile
3056a53f50b9Schristostime with --enable-debug=mem.
3057a53f50b9Schristos@item mtab
3058a53f50b9Schristosuse local mount-table file (defaults to @file{/tmp/mtab}, @pxref{debug_mtab_file Parameter})
3059a53f50b9Schristos@item readdir
3060a53f50b9Schristosshow readdir progress
3061a53f50b9Schristos@item str
3062a53f50b9Schristosdebug string munging
3063a53f50b9Schristos@item trace
3064a53f50b9Schristostrace RPC protocol and NFS mount arguments
3065a53f50b9Schristos@item xdrtrace
3066a53f50b9Schristostrace XDR routines
3067a53f50b9Schristos@end table
3068a53f50b9Schristos
3069a53f50b9SchristosYou may also refer to the program source for a more detailed explanation
3070a53f50b9Schristosof the available options.
3071a53f50b9Schristos
3072a53f50b9Schristos@c ----------------------------------------------------------------
3073a53f50b9Schristos@node -F Option, -H Option, -D Option, Amd Command Line Options
3074a53f50b9Schristos@comment  node-name,  next,  previous,  up
3075a53f50b9Schristos@section @code{-F} @var{conf-file}
3076a53f50b9Schristos@cindex Amd configuration file; specifying name
3077a53f50b9Schristos@cindex Amd configuration file
3078a53f50b9Schristos@cindex amd.conf file
3079a53f50b9Schristos
3080a53f50b9SchristosSpecify an @i{Amd} configuration file @var{conf-file} to use.  For a
3081a53f50b9Schristosdescription of the format and syntax, @pxref{Amd Configuration File}.
3082a53f50b9SchristosThis configuration file is used to specify any options in lieu of typing
3083a53f50b9Schristosmany of them on the command line.  The @file{amd.conf} file includes
3084a53f50b9Schristosdirectives for every command line option @i{Amd} has, and many more that
3085a53f50b9Schristosare only available via the configuration file facility.  The
3086a53f50b9Schristosconfiguration file specified by this option is processed after all other
3087a53f50b9Schristosoptions had been processed, regardless of the actual location of this
3088a53f50b9Schristosoption on the command line.
3089a53f50b9Schristos
3090a53f50b9Schristos@c ----------------------------------------------------------------
3091a53f50b9Schristos@node -H Option, -O Option, -F Option, Amd Command Line Options
3092a53f50b9Schristos@comment  node-name,  next,  previous,  up
3093a53f50b9Schristos@section @code{-H}
3094a53f50b9Schristos@cindex Displaying brief help
3095a53f50b9Schristos@cindex Help; showing from Amd
3096a53f50b9Schristos
3097a53f50b9SchristosPrint a brief help and usage string.
3098a53f50b9Schristos
3099a53f50b9Schristos@c ----------------------------------------------------------------
3100a53f50b9Schristos@node -O Option, -S Option, -H Option, Amd Command Line Options
3101a53f50b9Schristos@comment  node-name,  next,  previous,  up
3102a53f50b9Schristos@section @code{-O} @var{op-sys-name}
3103a53f50b9Schristos@cindex Operating System name
3104a53f50b9Schristos@cindex Setting the Operating System name
3105a53f50b9Schristos
3106a53f50b9SchristosOverrides the compiled-in name of the operating system, with
3107a53f50b9Schristos@var{op-sys-name}.  Useful when the built-in name is not desired for
3108a53f50b9Schristosbackward compatibility reasons.  For example, if the build in name is
3109a53f50b9Schristos@samp{sunos5}, you can override it to the old name @samp{sos5}, and use
3110a53f50b9Schristosolder maps which were written with the latter in mind.
3111a53f50b9Schristos
3112a53f50b9Schristos@c ----------------------------------------------------------------
3113a53f50b9Schristos@node -S Option, -T Option, -O Option, Amd Command Line Options
3114a53f50b9Schristos@comment  node-name,  next,  previous,  up
3115a53f50b9Schristos@section @code{-S}
3116a53f50b9Schristos@cindex plock; using
3117a53f50b9Schristos@cindex mlockall; using
3118a53f50b9Schristos@cindex locking executable pages in memory
3119a53f50b9Schristos
3120a53f50b9SchristosDo @emph{not} lock the running executable pages of @i{Amd} into memory.
3121a53f50b9SchristosTo improve @i{Amd}'s performance, systems that support the @b{plock}(3)
3122a53f50b9Schristosor @b{mlockall}(2)
3123a53f50b9Schristoscall lock the @i{Amd} process into memory.  This way there is less
3124a53f50b9Schristoschance the operating system will schedule, page out, and swap the
3125a53f50b9Schristos@i{Amd} process as needed.  This tends to improve @i{Amd}'s performance,
3126a53f50b9Schristosat the cost of reserving the memory used by the @i{Amd} process (making
3127a53f50b9Schristosit unavailable for other processes).  If this behavior is not desired,
3128a53f50b9Schristosuse the @code{-S} option.
3129a53f50b9Schristos
3130a53f50b9Schristos@c ----------------------------------------------------------------
3131a53f50b9Schristos@node -T Option, , -S Option, Amd Command Line Options
3132a53f50b9Schristos@comment  node-name,  next,  previous,  up
3133a53f50b9Schristos@section @code{-T} @var{tag}
3134a53f50b9Schristos@cindex Tags for Amd configuration file
3135a53f50b9Schristos@cindex Configuration file; tags
3136a53f50b9Schristos
3137a53f50b9SchristosSpecify a tag to use with @file{amd.conf}.  All map entries tagged with
3138a53f50b9Schristos@var{tag} will be processed.  Map entries that are not tagged are always
3139a53f50b9Schristosprocessed.  Map entries that are tagged with a tag other than @var{tag}
3140a53f50b9Schristoswill not be processed.
3141a53f50b9Schristos
3142a53f50b9Schristos@c ################################################################
3143a53f50b9Schristos@node Filesystem Types, Amd Configuration File, Amd Command Line Options, Top
3144a53f50b9Schristos@comment  node-name,  next,  previous,  up
3145a53f50b9Schristos@chapter Filesystem Types
3146a53f50b9Schristos@cindex Filesystem types
3147a53f50b9Schristos@cindex Mount types
3148a53f50b9Schristos@cindex Types of filesystem
3149a53f50b9Schristos
3150a53f50b9SchristosTo mount a volume, @i{Amd} must be told the type of filesystem to be
3151a53f50b9Schristosused.  Each filesystem type typically requires additional information
3152a53f50b9Schristossuch as the fileserver name for NFS.
3153a53f50b9Schristos
3154a53f50b9SchristosFrom the point of view of @i{Amd}, a @dfn{filesystem} is anything that
3155a53f50b9Schristoscan resolve an incoming name lookup.  An important feature is support
3156a53f50b9Schristosfor multiple filesystem types.  Some of these filesystems are
3157a53f50b9Schristosimplemented in the local kernel and some on remote fileservers, whilst
3158a53f50b9Schristosthe others are implemented internally by @i{Amd}.@refill
3159a53f50b9Schristos
3160a53f50b9SchristosThe two common filesystem types are UFS and NFS.  Four other user
3161a53f50b9Schristosaccessible filesystems (@samp{link}, @samp{program}, @samp{auto} and
3162a53f50b9Schristos@samp{direct}) are also implemented internally by @i{Amd} and these are
3163a53f50b9Schristosdescribed below.  There are two additional filesystem types internal to
3164a53f50b9Schristos@i{Amd} which are not directly accessible to the user (@samp{inherit}
3165a53f50b9Schristosand @samp{error}).  Their use is described since they may still have an
3166a53f50b9Schristoseffect visible to the user.@refill
3167a53f50b9Schristos
3168a53f50b9Schristos@menu
3169a53f50b9Schristos* Network Filesystem::          A single NFS filesystem.
3170a53f50b9Schristos* Network Host Filesystem::     NFS mount a host's entire export tree.
3171a53f50b9Schristos* Network Filesystem Group::    An atomic group of NFS filesystems.
3172a53f50b9Schristos* Unix Filesystem::             Native disk filesystem.
3173a53f50b9Schristos* Caching Filesystem::          Caching from remote server filesystem.
3174a53f50b9Schristos* CD-ROM Filesystem::           ISO9660 CD ROM.
317514003705Schristos* UDF Filesystem::              Universal Disk Format filesystem.
3176a53f50b9Schristos* Loopback Filesystem::         Local loopback-mount filesystem.
3177a53f50b9Schristos* Memory/RAM Filesystem::       A memory or RAM-based filesystem.
3178a53f50b9Schristos* Null Filesystem::             4.4BSD's loopback-mount filesystem.
3179a53f50b9Schristos* Floppy Filesystem::           MS-DOS Floppy filesystem.
3180a53f50b9Schristos* Translucent Filesystem::      The directory merging filesystem.
3181a53f50b9Schristos* Shared Memory+Swap Filesystem:: Sun's tmpfs filesystem.
3182a53f50b9Schristos* User ID Mapping Filesystem::  4.4BSD's umapfs filesystem.
3183a53f50b9Schristos* Program Filesystem::          Generic Program mounts.
3184a53f50b9Schristos* Symbolic Link Filesystem::    Local link.
3185a53f50b9Schristos* Symbolic Link Filesystem II:: Local link referencing existing filesystem.
3186a53f50b9Schristos* NFS-Link Filesystem::         Link if path exists, NFS otherwise.
3187a53f50b9Schristos* Automount Filesystem::
3188a53f50b9Schristos* Direct Automount Filesystem::
3189a53f50b9Schristos* Union Filesystem::
3190a53f50b9Schristos* Error Filesystem::
3191a53f50b9Schristos* Top-level Filesystem::
3192a53f50b9Schristos* Root Filesystem::
3193a53f50b9Schristos* Inheritance Filesystem::
3194a53f50b9Schristos@end menu
3195a53f50b9Schristos
3196a53f50b9Schristos@c ----------------------------------------------------------------
3197a53f50b9Schristos@node Network Filesystem, Network Host Filesystem, Filesystem Types, Filesystem Types
3198a53f50b9Schristos@comment  node-name,  next,  previous,  up
3199a53f50b9Schristos@section Network Filesystem (@samp{nfs})
3200a53f50b9Schristos@cindex NFS
3201a53f50b9Schristos@cindex Mounting an NFS filesystem
3202a53f50b9Schristos@cindex How to mount and NFS filesystem
3203a53f50b9Schristos@cindex nfs, filesystem type
3204a53f50b9Schristos@cindex Filesystem type; nfs
3205a53f50b9Schristos
3206a53f50b9SchristosThe @dfn{nfs} (@samp{type:=nfs}) filesystem type provides access to Sun's NFS.
3207a53f50b9Schristos
3208a53f50b9Schristos@noindent
3209a53f50b9SchristosThe following options must be specified:
3210a53f50b9Schristos
3211a53f50b9Schristos@table @code
3212a53f50b9Schristos@cindex rhost, mount option
3213a53f50b9Schristos@cindex Mount option; rhost
3214a53f50b9Schristos@item rhost
3215a53f50b9Schristosthe remote fileserver.  This must be an entry in the hosts database.  IP
3216a53f50b9Schristosaddresses are not accepted.  The default value is taken
3217a53f50b9Schristosfrom the local host name (@code{$@{host@}}) if no other value is
3218a53f50b9Schristosspecified.
3219a53f50b9Schristos
3220a53f50b9Schristos@cindex rfs, mount option
3221a53f50b9Schristos@cindex Mount option; rfs
3222a53f50b9Schristos@item rfs
3223a53f50b9Schristosthe remote filesystem.
3224a53f50b9SchristosIf no value is specified for this option, an internal default of
3225a53f50b9Schristos@code{$@{path@}} is used.
3226a53f50b9Schristos@end table
3227a53f50b9Schristos
3228a53f50b9SchristosNFS mounts require a two stage process.  First, the @dfn{file handle} of
3229a53f50b9Schristosthe remote file system must be obtained from the server.  Then a mount
3230a53f50b9Schristossystem call must be done on the local system.  @i{Amd} keeps a cache
3231a53f50b9Schristosof file handles for remote file systems.  The cache entries have a
3232a53f50b9Schristoslifetime of a few minutes.
3233a53f50b9Schristos
3234a53f50b9SchristosIf a required file handle is not in the cache, @i{Amd} sends a request
3235a53f50b9Schristosto the remote server to obtain it.
3236a53f50b9Schristos@c  @i{Amd} @dfn{does not} wait for
3237a53f50b9Schristos@c a response; it notes that one of the locations needs retrying, but
3238a53f50b9Schristos@c continues with any remaining locations.  When the file handle becomes
3239a53f50b9Schristos@c available, and assuming none of the other locations was successfully
3240a53f50b9Schristos@c mounted, @i{Amd} will retry the mount.  This mechanism allows several
3241a53f50b9Schristos@c NFS filesystems to be mounted in parallel.
3242a53f50b9Schristos@c @footnote{The mechanism
3243a53f50b9Schristos@c is general, however NFS is the only filesystem
3244a53f50b9Schristos@c for which the required hooks have been written.}
3245a53f50b9Schristos@c The first one which responds with a valid file handle will be used.
3246a53f50b9Schristos
3247a53f50b9SchristosHistorically, this documentation has maintained that @i{Amd} will try
3248a53f50b9Schristosall the locations in parallel and use the first one which responds
3249a53f50b9Schristoswith a valid file handle. This has not been the case for quite some
3250a53f50b9Schristostime, however. Instead, @i{Amd} will go through each location, one by
3251a53f50b9Schristosone, and will only skip to the next one if the previous one either
3252a53f50b9Schristosfails or times out.
3253a53f50b9Schristos
3254a53f50b9Schristos@noindent
3255a53f50b9SchristosAn NFS entry might be:
3256a53f50b9Schristos
3257a53f50b9Schristos@example
3258a53f50b9Schristosjsp  host!=charm;type:=nfs;rhost:=charm;rfs:=/home/charm;sublink:=jsp
3259a53f50b9Schristos@end example
3260a53f50b9Schristos
3261a53f50b9SchristosThe mount system call and any unmount attempts are always done
3262a53f50b9Schristosin a new task to avoid the possibility of blocking @i{Amd}.
3263a53f50b9Schristos
3264a53f50b9Schristos@c ----------------------------------------------------------------
3265a53f50b9Schristos@node Network Host Filesystem, Network Filesystem Group, Network Filesystem, Filesystem Types
3266a53f50b9Schristos@comment  node-name,  next,  previous,  up
3267a53f50b9Schristos@section Network Host Filesystem (@samp{host})
3268a53f50b9Schristos@cindex Network host filesystem
3269a53f50b9Schristos@cindex Mounting entire export trees
3270a53f50b9Schristos@cindex How to mount all NFS exported filesystems
3271a53f50b9Schristos@cindex host, filesystem type
3272a53f50b9Schristos@cindex Filesystem type; host
3273a53f50b9Schristos
3274a53f50b9Schristos@c NOTE: the current implementation of the @dfn{host} filesystem type
3275a53f50b9Schristos@c sometimes fails to maintain a consistent view of the remote mount tree.
3276a53f50b9Schristos@c This happens when the mount times out and only some of the remote mounts
3277a53f50b9Schristos@c are successfully unmounted.  To prevent this from occurring, use the
3278a53f50b9Schristos@c @samp{nounmount} mount option.
3279a53f50b9Schristos
3280a53f50b9SchristosThe @dfn{host} (@samp{type:=host}) filesystem allows access to the entire export tree of an
3281a53f50b9SchristosNFS server.  The implementation is layered above the @samp{nfs}
3282a53f50b9Schristosimplementation so keep-alives work in the same way.  The only option
3283a53f50b9Schristoswhich needs to be specified is @samp{rhost} which is the name of the
3284a53f50b9Schristosfileserver to mount.
3285a53f50b9Schristos
3286a53f50b9SchristosThe @samp{host} filesystem type works by querying the mount daemon on
3287a53f50b9Schristosthe given fileserver to obtain its export list.  @i{Amd} then obtains
3288a53f50b9Schristosfilehandles for each of the exported filesystems.  Any errors at this
3289a53f50b9Schristosstage cause that particular filesystem to be ignored.  Finally each
3290a53f50b9Schristosfilesystem is mounted.  Again, errors are logged but ignored.  One
3291a53f50b9Schristoscommon reason for mounts to fail is that the mount point does not exist.
3292a53f50b9SchristosAlthough @i{Amd} attempts to automatically create the mount point, it
3293a53f50b9Schristosmay be on a remote filesystem to which @i{Amd} does not have write
3294a53f50b9Schristospermission.
3295a53f50b9Schristos
3296a53f50b9SchristosWhen an attempt to unmount a @samp{host} filesystem mount fails, @i{Amd}
3297a53f50b9Schristosremounts any filesystems which had successfully been unmounted.  To do
3298a53f50b9Schristosthis @i{Amd} queries the mount daemon again and obtains a fresh copy of
3299a53f50b9Schristosthe export list.  @i{Amd} then tries to mount any exported filesystems
3300a53f50b9Schristoswhich are not currently mounted.
3301a53f50b9Schristos
3302a53f50b9SchristosSun's automounter provides a special @samp{-hosts} map.  To achieve the
3303a53f50b9Schristossame effect with @i{Amd} requires two steps.  First a mount map must
3304a53f50b9Schristosbe created as follows:
3305a53f50b9Schristos
3306a53f50b9Schristos@example
3307a53f50b9Schristos*       type:=host;rhost:=$@{key@};fs:=$@{autodir@}/$@{rhost@}/root
3308a53f50b9Schristos@end example
3309a53f50b9Schristos
3310a53f50b9Schristos@noindent
3311a53f50b9Schristosand then start @i{Amd} with the following command
3312a53f50b9Schristos
3313a53f50b9Schristos@example
3314a53f50b9Schristosamd /net net.map
3315a53f50b9Schristos@end example
3316a53f50b9Schristos
3317a53f50b9Schristos@noindent
3318a53f50b9Schristoswhere @samp{net.map} is the name of map described above.  Note that the
3319a53f50b9Schristosvalue of @code{$@{fs@}} is overridden in the map.  This is done to avoid
3320a53f50b9Schristosa clash between the mount tree and any other filesystem already mounted
3321a53f50b9Schristosfrom the same fileserver.
3322a53f50b9Schristos
3323a53f50b9SchristosIf different mount options are needed for different hosts then
3324a53f50b9Schristosadditional entries can be added to the map, for example
3325a53f50b9Schristos
3326a53f50b9Schristos@example
3327a53f50b9Schristoshost2       opts:=ro,nosuid,soft
3328a53f50b9Schristos@end example
3329a53f50b9Schristos
3330a53f50b9Schristos@noindent
3331a53f50b9Schristoswould soft mount @samp{host2} read-only.
3332a53f50b9Schristos
3333a53f50b9Schristos@c ----------------------------------------------------------------
3334a53f50b9Schristos@node Network Filesystem Group, Unix Filesystem, Network Host Filesystem, Filesystem Types
3335a53f50b9Schristos@comment  node-name,  next,  previous,  up
3336a53f50b9Schristos@section Network Filesystem Group (@samp{nfsx})
3337a53f50b9Schristos@cindex Network filesystem group
3338a53f50b9Schristos@cindex Atomic NFS mounts
3339a53f50b9Schristos@cindex Mounting an atomic group of NFS filesystems
3340a53f50b9Schristos@cindex How to mount an atomic group of NFS filesystems
3341a53f50b9Schristos@cindex nfsx, filesystem type
3342a53f50b9Schristos@cindex Filesystem type; nfsx
3343a53f50b9Schristos
3344a53f50b9SchristosThe @dfn{nfsx} (@samp{type:=nfsx}) filesystem allows a group of filesystems to be mounted
3345a53f50b9Schristosfrom a single NFS server.  The implementation is layered above the
3346a53f50b9Schristos@samp{nfs} implementation so keep-alives work in the same way.
3347a53f50b9Schristos
3348a53f50b9Schristos@emph{WARNING}: @samp{nfsx} is meant to be a ``last resort'' kind of
3349a53f50b9Schristossolution. It is racy and poorly supported. The authors @emph{highly}
3350a53f50b9Schristosrecommend that other solutions be considered before relying on it.
3351a53f50b9Schristos
3352a53f50b9SchristosThe options are the same as for the @samp{nfs} filesystem with one
3353a53f50b9Schristosdifference for @samp{rfs}, as explained below.
3354a53f50b9Schristos
3355a53f50b9Schristos@noindent
3356a53f50b9SchristosThe following options should be specified:
3357a53f50b9Schristos
3358a53f50b9Schristos@table @code
3359a53f50b9Schristos@item rhost
3360a53f50b9Schristosthe remote fileserver.  The default value is taken from the local
3361a53f50b9Schristoshost name (@code{$@{host@}}) if no other value is specified.
3362a53f50b9Schristos
3363a53f50b9Schristos@item rfs
3364a53f50b9Schristosis a list of filesystems to mount, and must be specified.
3365a53f50b9SchristosThe list is in the form of a comma separated strings.
3366a53f50b9Schristos@end table
3367a53f50b9Schristos
3368a53f50b9Schristos@noindent
3369a53f50b9SchristosFor example:
3370a53f50b9Schristos
3371a53f50b9Schristos@example
3372a53f50b9Schristospub  type:=nfsx;rhost:=gould;\
3373a53f50b9Schristos     rfs:=/public,/,graphics,usenet;fs:=$@{autodir@}/$@{rhost@}/root
3374a53f50b9Schristos@end example
3375a53f50b9Schristos
3376a53f50b9SchristosThe first string defines the root of the tree, and is applied as a
3377a53f50b9Schristosprefix to the remaining members of the list which define the individual
3378a53f50b9Schristosfilesystems.  The first string is @emph{not} used as a filesystem name.
3379a53f50b9SchristosA serial operation is used to determine the local mount points to
3380a53f50b9Schristosensure a consistent layout of a tree of mounts.
3381a53f50b9Schristos
3382a53f50b9SchristosHere, the @emph{three} filesystems, @samp{/public},
3383a53f50b9Schristos@samp{/public/graphics} and @samp{/public/usenet}, would be mounted.@refill
3384a53f50b9Schristos
3385a53f50b9SchristosA local mount point, @code{$@{fs@}}, @emph{must} be specified.  The
3386a53f50b9Schristosdefault local mount point will not work correctly in the general case.
3387a53f50b9SchristosA suggestion is to use @samp{fs:=$@{autodir@}/$@{rhost@}/root}.@refill
3388a53f50b9Schristos
3389a53f50b9Schristos@c ----------------------------------------------------------------
3390a53f50b9Schristos@node Unix Filesystem, Caching Filesystem, Network Filesystem Group, Filesystem Types
3391a53f50b9Schristos@comment  node-name,  next,  previous,  up
3392a53f50b9Schristos@section Unix Filesystem (@samp{ufs}, @samp{xfs}, or @samp{efs})
3393a53f50b9Schristos@cindex Unix filesystem
3394a53f50b9Schristos@cindex UFS
3395a53f50b9Schristos@cindex XFS
3396a53f50b9Schristos@cindex EFS
3397a53f50b9Schristos@cindex Mounting a UFS filesystem
3398a53f50b9Schristos@cindex Mounting a local disk
3399a53f50b9Schristos@cindex How to mount a UFS filesystems
3400a53f50b9Schristos@cindex How to mount a local disk
3401a53f50b9Schristos@cindex Disk filesystems
3402a53f50b9Schristos@cindex ufs, filesystem type
3403a53f50b9Schristos@cindex Filesystem type; ufs
3404a53f50b9Schristos@cindex xfs, filesystem type
3405a53f50b9Schristos@cindex Filesystem type; xfs
3406a53f50b9Schristos@cindex efs, filesystem type
3407a53f50b9Schristos@cindex Filesystem type; efs
3408a53f50b9Schristos
3409a53f50b9SchristosThe @dfn{ufs} (@samp{type:=ufs}) filesystem type provides access to the system's standard
3410a53f50b9Schristosdisk filesystem---usually a derivative of the Berkeley Fast Filesystem.
3411a53f50b9Schristos
3412a53f50b9Schristos@noindent
3413a53f50b9SchristosThe following option must be specified:
3414a53f50b9Schristos
3415a53f50b9Schristos@table @code
3416a53f50b9Schristos@cindex dev, mount option
3417a53f50b9Schristos@cindex Mount option; dev
3418a53f50b9Schristos@item dev
3419a53f50b9Schristosthe block special device to be mounted.
3420a53f50b9Schristos@end table
3421a53f50b9Schristos
3422a53f50b9SchristosA UFS entry might be:
3423a53f50b9Schristos
3424a53f50b9Schristos@example
3425a53f50b9Schristosjsp   host==charm;type:=ufs;dev:=/dev/sd0d;sublink:=jsp
3426a53f50b9Schristos@end example
3427a53f50b9Schristos
3428a53f50b9SchristosUFS is the default Unix disk-based file system, which Am-utils picks up
3429a53f50b9Schristosduring the autoconfiguration phase.  Some systems have more than one
3430a53f50b9Schristostype, such as IRIX, that comes with EFS (Extent File System) and XFS
3431a53f50b9Schristos(Extended File System).  In those cases, you may explicitly set the file
3432a53f50b9Schristossystem type, by using entries such:
3433a53f50b9Schristos
3434a53f50b9Schristos@example
3435a53f50b9Schristosez1   type:=efs;dev:=/dev/xd0a
3436a53f50b9Schristosez2   type:=xfs;dev:=/dev/sd3c
3437a53f50b9Schristos@end example
3438a53f50b9Schristos
3439a53f50b9SchristosThe UFS/XFS/EFS filesystems are never timed out by default, i.e. they
3440a53f50b9Schristoswill never be unmounted by @i{Amd}. If automatic unmounting is
3441a53f50b9Schristosdesired, the ``unmount'' option should be added to the mount options
3442a53f50b9Schristosfor the entry.
3443a53f50b9Schristos
3444a53f50b9Schristos@c ----------------------------------------------------------------
3445a53f50b9Schristos@node Caching Filesystem, CD-ROM Filesystem, Unix Filesystem, Filesystem Types
3446a53f50b9Schristos@comment  node-name,  next,  previous,  up
3447a53f50b9Schristos@section Caching Filesystem (@samp{cachefs})
3448a53f50b9Schristos@cindex Caching Filesystem
3449a53f50b9Schristos@cindex cachefs, filesystem type
3450a53f50b9Schristos@cindex Filesystem type; cachefs
3451a53f50b9Schristos
3452a53f50b9SchristosThe @dfn{cachefs} (@samp{type:=cachefs}) filesystem caches files from
3453a53f50b9Schristosone location onto another, presumably providing faster access.  It is
3454a53f50b9Schristosparticularly useful to cache from a larger and remote (slower) NFS
3455a53f50b9Schristospartition to a smaller and local (faster) UFS directory.
3456a53f50b9Schristos
3457a53f50b9Schristos@noindent
3458a53f50b9SchristosThe following options must be specified:
3459a53f50b9Schristos
3460a53f50b9Schristos@table @code
3461a53f50b9Schristos@cindex cachedir, mount option
3462a53f50b9Schristos@cindex Mount option; cachedir
3463a53f50b9Schristos@item cachedir
3464a53f50b9Schristosthe directory where the cache is stored.
3465a53f50b9Schristos@item rfs
3466a53f50b9Schristosthe path name to the ``back file system'' to be cached from.
3467a53f50b9Schristos@item fs
3468a53f50b9Schristosthe ``front file system'' mount point to the cached files, where @i{Amd}
3469a53f50b9Schristoswill set a symbolic link pointing to.
3470a53f50b9Schristos@end table
3471a53f50b9Schristos
3472a53f50b9SchristosA CacheFS entry for, say, the @file{/import} @i{Amd} mount point, might
3473a53f50b9Schristosbe:
3474a53f50b9Schristos
3475a53f50b9Schristos@example
3476a53f50b9Schristoscopt  type:=cachefs;cachedir:=/cache;rfs:=/import/opt;fs:=/n/import/copt
3477a53f50b9Schristos@end example
3478a53f50b9Schristos
3479a53f50b9SchristosAccess to the pathname @file{/import/copt} will follow a symbolic link
3480a53f50b9Schristosto @file{/n/import/copt}.  The latter is the mount point for a caching
3481a53f50b9Schristosfile system, that caches from @file{/import/opt} to @file{/cache}.
3482a53f50b9Schristos
3483a53f50b9SchristosThe cachefs filesystem is never timed out by default, i.e. it will
3484a53f50b9Schristosnever be unmounted by @i{Amd}. If automatic unmounting is desired, the
3485a53f50b9Schristos``unmount'' option should be added to the mount options for the entry.
3486a53f50b9Schristos
3487a53f50b9Schristos@b{Caveats}:
3488a53f50b9Schristos@enumerate
3489a53f50b9Schristos@item This file system is currently only implemented for Solaris 2.x!
3490a53f50b9Schristos@item Before being used for the first time, the cache directory @i{must} be
3491a53f50b9Schristosinitialized with @samp{cfsadmin -c @var{cachedir}}.  See the manual page for
3492a53f50b9Schristos@b{cfsadmin}(1M) for more information.
3493a53f50b9Schristos@item The ``back file system'' mounted must be a complete file system, not
3494a53f50b9Schristosa subdirectory thereof; otherwise you will get an error ``Invalid Argument''.
3495a53f50b9Schristos@item If @i{Amd} aborts abnormally, the state of the cache may be
3496a53f50b9Schristosinconsistent, requiring running the command @file{fsck -F cachefs
3497a53f50b9Schristos@var{cachedir}}.  Otherwise you will get the error ``No Space Left on Device''.
3498a53f50b9Schristos@end enumerate
3499a53f50b9Schristos
3500a53f50b9Schristos@c ----------------------------------------------------------------
350114003705Schristos@node CD-ROM Filesystem, UDF Filesystem, Caching Filesystem, Filesystem Types
3502a53f50b9Schristos@comment  node-name,  next,  previous,  up
3503a53f50b9Schristos@section CD-ROM Filesystem (@samp{cdfs})
3504a53f50b9Schristos@cindex CD-ROM Filesystem
3505a53f50b9Schristos@cindex cdfs, filesystem type
3506a53f50b9Schristos@cindex Filesystem type; cdfs
3507a53f50b9Schristos
3508a53f50b9SchristosThe @dfn{cdfs} (@samp{type:=cdfs}) filesystem mounts a CD-ROM with an
3509a53f50b9SchristosISO9660 format filesystem on it.
3510a53f50b9Schristos
3511a53f50b9Schristos@noindent
3512a53f50b9SchristosThe following option must be specified:
3513a53f50b9Schristos
3514a53f50b9Schristos@table @code
3515a53f50b9Schristos@cindex dev, mount option
3516a53f50b9Schristos@cindex Mount option; dev
3517a53f50b9Schristos@item dev
3518a53f50b9Schristosthe block special device to be mounted.
3519a53f50b9Schristos@end table
3520a53f50b9Schristos
3521a53f50b9SchristosSome operating systems will fail to mount read-only CDs unless the
3522a53f50b9Schristos@samp{ro} option is specified.  A cdfs entry might be:
3523a53f50b9Schristos
3524a53f50b9Schristos@example
3525a53f50b9Schristoscdfs      os==sunos4;type:=cdfs;dev:=/dev/sr0 \
3526a53f50b9Schristos          os==sunos5;addopts:=ro;type:=cdfs;dev:=/dev/dsk/c0t6d0s2
3527a53f50b9Schristos@end example
3528a53f50b9Schristos
3529a53f50b9Schristos@c ----------------------------------------------------------------
353014003705Schristos@node UDF Filesystem, Loopback Filesystem, CD-ROM Filesystem, Filesystem Types
353114003705Schristos@comment  node-name,  next,  previous,  up
353214003705Schristos@section CD-ROM Filesystem (@samp{udf})
353314003705Schristos@cindex CD-ROM Filesystem
353414003705Schristos@cindex udf, filesystem type
353514003705Schristos@cindex Filesystem type; udf
353614003705Schristos
353714003705SchristosThe @dfn{udf} (@samp{type:=udf}) filesystem mounts media with a
353814003705SchristosUniversal Disk Format (UDF) filesystem on it, e.g., a video DVD.
353914003705Schristos
354014003705Schristos@noindent
354114003705SchristosThe following option must be specified:
354214003705Schristos
354314003705Schristos@table @code
354414003705Schristos@cindex dev, mount option
354514003705Schristos@cindex Mount option; dev
354614003705Schristos@item dev
354714003705Schristosthe block special device to be mounted.
354814003705Schristos@end table
354914003705Schristos
355014003705SchristosSome operating systems will fail to mount read-only media unless the
355114003705Schristos@samp{ro} option is specified.  A udf entry might be:
355214003705Schristos
355314003705Schristos@example
355414003705Schristosudf      os==sunos4;type:=udf;dev:=/dev/sr0 \
355514003705Schristos         os==sunos5;addopts:=ro;type:=udf;dev:=/dev/dsk/c0t6d0s2
355614003705Schristos@end example
355714003705Schristos
355814003705Schristos@c ----------------------------------------------------------------
355914003705Schristos@node Loopback Filesystem, Memory/RAM Filesystem, UDF Filesystem, Filesystem Types
3560a53f50b9Schristos@comment  node-name,  next,  previous,  up
3561a53f50b9Schristos@section Loopback Filesystem (@samp{lofs})
3562a53f50b9Schristos@cindex Loopback Filesystem
3563a53f50b9Schristos@cindex lofs, filesystem type
3564a53f50b9Schristos@cindex Filesystem type; lofs
3565a53f50b9Schristos
3566a53f50b9SchristosThe @dfn{lofs} (@samp{type:=lofs}) filesystem is also called the
3567a53f50b9Schristosloopback filesystem.  It mounts a local directory on another, thus
3568a53f50b9Schristosproviding mount-time binding to another location (unlike symbolic
3569a53f50b9Schristoslinks).
3570a53f50b9Schristos
3571a53f50b9SchristosThe loopback filesystem is particularly useful within the context of a
3572a53f50b9Schristoschroot-ed directory (via @b{chroot}(2)), to provide access to
3573a53f50b9Schristosdirectories otherwise inaccessible.
3574a53f50b9Schristos
3575a53f50b9Schristos@noindent
3576a53f50b9SchristosThe following option must be specified:
3577a53f50b9Schristos
3578a53f50b9Schristos@table @code
3579a53f50b9Schristos@cindex rfs, mount option
3580a53f50b9Schristos@cindex Mount option; rfs
3581a53f50b9Schristos@item rfs
3582a53f50b9Schristosthe pathname to be mounted on top of @code{$@{fs@}}.
3583a53f50b9Schristos@end table
3584a53f50b9Schristos
3585a53f50b9SchristosUsually, the FTP server runs in a chroot-ed environment, for security
3586a53f50b9Schristosreasons.  In this example, lofs is used to provide a subdirectory within
3587a53f50b9Schristosa user's home directory, also available for public ftp.
3588a53f50b9Schristos
3589a53f50b9Schristos@example
3590a53f50b9Schristoslofs      type:=lofs;rfs:=/home/ezk/myftpdir;fs:=/usr/ftp/pub/ezk
3591a53f50b9Schristos@end example
3592a53f50b9Schristos
3593a53f50b9Schristos@c ----------------------------------------------------------------
3594a53f50b9Schristos@node Memory/RAM Filesystem, Null Filesystem, Loopback Filesystem, Filesystem Types
3595a53f50b9Schristos@comment  node-name,  next,  previous,  up
3596a53f50b9Schristos@section Memory/RAM Filesystem (@samp{mfs})
3597a53f50b9Schristos@cindex Memory/RAM Filesystem
3598a53f50b9Schristos@cindex mfs, filesystem type
3599a53f50b9Schristos@cindex Filesystem type; mfs
3600a53f50b9Schristos
3601a53f50b9SchristosThe @dfn{mfs} (@samp{type:=mfs}) filesystem is available in 4.4BSD,
3602a53f50b9SchristosLinux, and other systems.  It creates a filesystem in a portion of the
3603a53f50b9Schristossystem's memory, thus providing very fast file (volatile) access.
3604a53f50b9Schristos
3605a53f50b9SchristosXXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3606a53f50b9Schristos
3607a53f50b9Schristos@c ----------------------------------------------------------------
3608a53f50b9Schristos@node Null Filesystem, Floppy Filesystem, Memory/RAM Filesystem, Filesystem Types
3609a53f50b9Schristos@comment  node-name,  next,  previous,  up
3610a53f50b9Schristos@section Null Filesystem (@samp{nullfs})
3611a53f50b9Schristos@cindex Null Filesystem
3612a53f50b9Schristos@cindex nullfs, filesystem type
3613a53f50b9Schristos@cindex Filesystem type; nullfs
3614a53f50b9Schristos
3615a53f50b9SchristosThe @dfn{nullfs} (@samp{type:=nullfs}) filesystem is available from 4.4BSD,
3616a53f50b9Schristosand is very similar to the loopback filesystem, @dfn{lofs}.
3617a53f50b9Schristos
3618a53f50b9SchristosXXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3619a53f50b9Schristos
3620a53f50b9Schristos@c ----------------------------------------------------------------
3621a53f50b9Schristos@node Floppy Filesystem, Translucent Filesystem, Null Filesystem, Filesystem Types
3622a53f50b9Schristos@comment  node-name,  next,  previous,  up
3623a53f50b9Schristos@section Floppy Filesystem (@samp{pcfs})
3624a53f50b9Schristos@cindex Floppy Filesystem
3625a53f50b9Schristos@cindex pcfs, filesystem type
3626a53f50b9Schristos@cindex Filesystem type; pcfs
3627a53f50b9Schristos
3628a53f50b9SchristosThe @dfn{pcfs} (@samp{type:=pcfs}) filesystem mounts a floppy previously
3629a53f50b9Schristosformatted for the MS-DOS format.
3630a53f50b9Schristos
3631a53f50b9Schristos@noindent
3632a53f50b9SchristosThe following option must be specified:
3633a53f50b9Schristos
3634a53f50b9Schristos@table @code
3635a53f50b9Schristos@cindex dev, mount option
3636a53f50b9Schristos@cindex Mount option; dev
3637a53f50b9Schristos@item dev
3638a53f50b9Schristosthe block special device to be mounted.
3639a53f50b9Schristos@end table
3640a53f50b9Schristos
3641a53f50b9SchristosA pcfs entry might be:
3642a53f50b9Schristos
3643a53f50b9Schristos@example
3644a53f50b9Schristospcfs      os==sunos4;type:=pcfs;dev:=/dev/fd0 \
3645a53f50b9Schristos          os==sunos5;type:=pcfs;dev:=/dev/diskette
3646a53f50b9Schristos@end example
3647a53f50b9Schristos
3648a53f50b9Schristos@c ----------------------------------------------------------------
3649a53f50b9Schristos@node Translucent Filesystem, Shared Memory+Swap Filesystem, Floppy Filesystem, Filesystem Types
3650a53f50b9Schristos@comment  node-name,  next,  previous,  up
3651a53f50b9Schristos@section Translucent Filesystem (@samp{tfs})
3652a53f50b9Schristos@cindex Translucent Filesystem
3653a53f50b9Schristos@cindex tfs, filesystem type
3654a53f50b9Schristos@cindex Filesystem type; tfs
3655a53f50b9Schristos
3656a53f50b9SchristosThe @dfn{tfs} (@samp{type:=tfs}) filesystem is an older version of the
3657a53f50b9Schristos4.4BSD @dfn{unionfs}.
3658a53f50b9Schristos
3659a53f50b9SchristosXXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3660a53f50b9Schristos
3661a53f50b9Schristos@c ----------------------------------------------------------------
3662a53f50b9Schristos@node Shared Memory+Swap Filesystem, User ID Mapping Filesystem, Translucent Filesystem, Filesystem Types
3663a53f50b9Schristos@comment  node-name,  next,  previous,  up
3664a53f50b9Schristos@section Shared Memory+Swap Filesystem (@samp{tmpfs})
3665a53f50b9Schristos@cindex Shared Memory and Swap Filesystem
3666a53f50b9Schristos@cindex tmpfs, filesystem type
3667a53f50b9Schristos@cindex Filesystem type; tmpfs
3668a53f50b9Schristos
3669a53f50b9SchristosThe @dfn{tmpfs} (@samp{type:=tmpfs}) filesystem shares memory between a
3670a53f50b9Schristosthe swap device and the rest of the system.  It is generally used to
3671a53f50b9Schristosprovide a fast access @file{/tmp} directory, one that uses memory that
3672a53f50b9Schristosis otherwise unused.  This filesystem is available in SunOS 4.x and 5.x.
3673a53f50b9Schristos
3674a53f50b9SchristosXXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3675a53f50b9Schristos
3676a53f50b9Schristos@c ----------------------------------------------------------------
3677a53f50b9Schristos@node User ID Mapping Filesystem, Program Filesystem, Shared Memory+Swap Filesystem, Filesystem Types
3678a53f50b9Schristos@comment  node-name,  next,  previous,  up
3679a53f50b9Schristos@section User ID Mapping Filesystem (@samp{umapfs})
3680a53f50b9Schristos@cindex User ID Mapping Filesystem
3681a53f50b9Schristos@cindex umapfs, filesystem type
3682a53f50b9Schristos@cindex Filesystem type; umapfs
3683a53f50b9Schristos
3684a53f50b9SchristosThe @dfn{umapfs} (@samp{type:=umapfs}) filesystem maps User IDs of file
3685a53f50b9Schristosownership, and is available from 4.4BSD.
3686a53f50b9Schristos
3687a53f50b9SchristosXXX: THIS FILESYSTEM IS NOT IMPLEMENTED YET!
3688a53f50b9Schristos
3689a53f50b9Schristos@c ----------------------------------------------------------------
3690a53f50b9Schristos@node Program Filesystem, Symbolic Link Filesystem, User ID Mapping Filesystem, Filesystem Types
3691a53f50b9Schristos@comment  node-name,  next,  previous,  up
3692a53f50b9Schristos@section Program Filesystem (@samp{program})
3693a53f50b9Schristos@cindex Program filesystem
3694a53f50b9Schristos@cindex Mount a filesystem under program control
3695a53f50b9Schristos@cindex program, filesystem type
3696a53f50b9Schristos@cindex Filesystem type; program
3697a53f50b9Schristos
3698a53f50b9SchristosThe @dfn{program} (@samp{type:=program}) filesystem type allows a
3699a53f50b9Schristosprogram to be run whenever a mount or unmount is required.  This allows
3700a53f50b9Schristoseasy addition of support for other filesystem types, such as MIT's
3701a53f50b9SchristosRemote Virtual Disk (RVD) which has a programmatic interface via the
3702a53f50b9Schristoscommands @samp{rvdmount} and @samp{rvdunmount}.
3703a53f50b9Schristos
3704a53f50b9Schristos@noindent
3705a53f50b9SchristosBoth of the following options must be specified:
3706a53f50b9Schristos
3707a53f50b9Schristos@table @code
3708a53f50b9Schristos@cindex mount, mount option
3709a53f50b9Schristos@cindex Mount option; mount
3710a53f50b9Schristos@item mount
3711a53f50b9Schristosthe program which will perform the mount.
3712a53f50b9Schristos
3713a53f50b9Schristos@cindex unmount, mount option
3714a53f50b9Schristos@cindex umount, mount option
3715a53f50b9Schristos@cindex Mount option; unmount
3716a53f50b9Schristos@cindex Mount option; umount
3717a53f50b9Schristos@item unmount
3718a53f50b9Schristos@item umount
3719a53f50b9Schristosthe program which will perform the unmount.  For convenience, you may
3720a53f50b9Schristosuse either @samp{unmount} or @samp{umount} but not both.  If neither
3721a53f50b9Schristosis defined, @i{Amd} will default to @samp{umount $@{fs@}} (the actual
3722a53f50b9Schristosunmount program pathname will be automatically determined at the time
3723a53f50b9SchristosGNU @code{configure} runs.)
3724a53f50b9Schristos@end table
3725a53f50b9Schristos
3726a53f50b9SchristosThe exit code from these two programs is interpreted as a Unix error
3727a53f50b9Schristoscode.  As usual, exit code zero indicates success.  To execute the
3728a53f50b9Schristosprogram, @i{Amd} splits the string on whitespace to create an array of
3729a53f50b9Schristossubstrings.  Single quotes @samp{'} can be used to quote whitespace
3730a53f50b9Schristosif that is required in an argument.  There is no way to escape or change
3731a53f50b9Schristosthe single quote character.
3732a53f50b9Schristos
3733a53f50b9SchristosTo run e.g. the program @samp{rvdmount} with a host name and filesystem as
3734a53f50b9Schristosarguments, it would be specified by
3735a53f50b9Schristos@samp{fs:=$@{autodir@}$@{path@};type:=program;mount:="/etc/rvdmount
3736a53f50b9Schristosrvdmount fserver $@{fs@}";unmount:="/etc/rdvumount rvdumount $@{fs@}"}.
3737a53f50b9Schristos
3738a53f50b9SchristosThe first element in the array is taken as the pathname of the program
3739a53f50b9Schristosto execute.  The other members of the array form the argument vector
3740a53f50b9Schristosto be passed to the program, @dfn{including argument zero}.  The array
3741a53f50b9Schristosis exactly the same as the array passed to the execv() system call
3742a53f50b9Schristos(man execv for details).  The split string must have at least two
3743a53f50b9Schristoselements.  The programs are directly executed by @i{Amd}, not via a
3744a53f50b9Schristosshell.  Therefore, if a script is to be used as a mount/umount
3745a53f50b9Schristosprogram, it @dfn{must} begin with a @code{#!} interpreter specification.
3746a53f50b9Schristos
3747a53f50b9SchristosOften, this program mount type is used for Samba mounts, where you
3748a53f50b9Schristosneed a double slash in pathnames.  However, @i{Amd} normalizes
3749a53f50b9Schristossequences of slashes into one slash.  Therefore, you must use an
3750a53f50b9Schristosescaped slash, preceded by an escaped backslash.  So to get a double
3751a53f50b9Schristosslash in the mount command, you need the eight character sequence
3752a53f50b9Schristos@samp{\\\/\\\/} in your map.  For example:
3753a53f50b9Schristos
3754a53f50b9Schristos@samp{mount="/sbin/mount mount -r -t smbfs -o-N,-Ihostname \\\/\\\/guest@@venus/mp3"}
3755a53f50b9Schristos
3756a53f50b9SchristosIf a filesystem type is to be heavily used, it may be worthwhile adding
3757a53f50b9Schristosa new filesystem type into @i{Amd}, but for most uses the program
3758a53f50b9Schristosfilesystem should suffice.
3759a53f50b9Schristos
3760a53f50b9SchristosWhen the program is run, standard input and standard error are inherited
3761a53f50b9Schristosfrom the current values used by @i{Amd}.  Standard output is a
3762a53f50b9Schristosduplicate of standard error.  The value specified with the @code{-l}
3763a53f50b9Schristoscommand line option has no effect on standard error.
3764a53f50b9Schristos
3765a53f50b9Schristos@i{Amd} guarantees that the mountpoint will be created before calling
3766a53f50b9Schristosthe mount program, and that it will be removed after the umount
3767a53f50b9Schristosprogram returns success.
3768a53f50b9Schristos
3769a53f50b9Schristos@c ----------------------------------------------------------------
3770a53f50b9Schristos@node Symbolic Link Filesystem, Symbolic Link Filesystem II, Program Filesystem, Filesystem Types
3771a53f50b9Schristos@comment  node-name,  next,  previous,  up
3772a53f50b9Schristos@section Symbolic Link Filesystem (@samp{link})
3773a53f50b9Schristos@cindex Symbolic link filesystem
3774a53f50b9Schristos@cindex Referencing part of the local name space
3775a53f50b9Schristos@cindex Mounting part of the local name space
3776a53f50b9Schristos@cindex How to reference part of the local name space
3777a53f50b9Schristos@cindex link, filesystem type
3778a53f50b9Schristos@cindex symlink, link filesystem type
3779a53f50b9Schristos@cindex Filesystem type; link
3780a53f50b9Schristos
3781a53f50b9SchristosEach filesystem type creates a symbolic link to point from the volume
3782a53f50b9Schristosname to the physical mount point.  The @samp{link} filesystem does the
3783a53f50b9Schristossame without any other side effects.  This allows any part of the
3784a53f50b9Schristosmachines name space to be accessed via @i{Amd}.
3785a53f50b9Schristos
3786a53f50b9SchristosOne common use for the symlink filesystem is @file{/homes} which can be
3787a53f50b9Schristosmade to contain an entry for each user which points to their
3788a53f50b9Schristos(auto-mounted) home directory.  Although this may seem rather expensive,
3789a53f50b9Schristosit provides a great deal of administrative flexibility.
3790a53f50b9Schristos
3791a53f50b9Schristos@noindent
3792a53f50b9SchristosThe following option must be defined:
3793a53f50b9Schristos
3794a53f50b9Schristos@table @code
3795a53f50b9Schristos@item fs
3796a53f50b9SchristosThe value of @var{fs} option specifies the destination of the link, as
3797a53f50b9Schristosmodified by the @var{sublink} option.  If @var{sublink} is non-null, it
3798a53f50b9Schristosis appended to @code{$@{fs@}}@code{/} and the resulting string is used
3799a53f50b9Schristosas the target.
3800a53f50b9Schristos@end table
3801a53f50b9Schristos
3802a53f50b9SchristosThe @samp{link} filesystem can be thought of as identical to the
3803a53f50b9Schristos@samp{ufs} filesystem but without actually mounting anything.
3804a53f50b9Schristos
3805a53f50b9SchristosAn example entry might be:
3806a53f50b9Schristos
3807a53f50b9Schristos@example
3808a53f50b9Schristosjsp   host==charm;type:=link;fs:=/home/charm;sublink:=jsp
3809a53f50b9Schristos@end example
3810a53f50b9Schristoswhich would return a symbolic link pointing to @file{/home/charm/jsp}.
3811a53f50b9Schristos
3812a53f50b9Schristos@c ----------------------------------------------------------------
3813a53f50b9Schristos@node Symbolic Link Filesystem II, NFS-Link Filesystem, Symbolic Link Filesystem, Filesystem Types
3814a53f50b9Schristos@comment  node-name,  next,  previous,  up
3815a53f50b9Schristos@section Symbolic Link Filesystem II (@samp{linkx})
3816a53f50b9Schristos@cindex Symbolic link filesystem II
3817a53f50b9Schristos@cindex Referencing an existing part of the local name space
3818a53f50b9Schristos@cindex Mounting an existing part of the local name space
3819a53f50b9Schristos@cindex How to reference an existing part of the local name space
3820a53f50b9Schristos@cindex linkx, filesystem type
3821a53f50b9Schristos@cindex symlink, linkx filesystem type
3822a53f50b9Schristos@cindex Filesystem type; linkx
3823a53f50b9Schristos
3824a53f50b9SchristosThe @dfn{linkx} (@samp{type:=linkx}) filesystem type is identical to @samp{link} with the
3825a53f50b9Schristosexception that the target of the link must exist.  Existence is checked
3826a53f50b9Schristoswith the @b{lstat}(2) system call.
3827a53f50b9Schristos
3828a53f50b9SchristosThe @samp{linkx} filesystem type is particularly useful for wildcard map
3829a53f50b9Schristosentries.  In this case, a list of possible targets can be given and
3830a53f50b9Schristos@i{Amd} will choose the first one which exists on the local machine.
3831a53f50b9Schristos
3832a53f50b9Schristos@c ----------------------------------------------------------------
3833a53f50b9Schristos@node NFS-Link Filesystem, Automount Filesystem, Symbolic Link Filesystem II, Filesystem Types
3834a53f50b9Schristos@comment  node-name,  next,  previous,  up
3835a53f50b9Schristos@section NFS-Link Filesystem (@samp{nfsl})
3836a53f50b9Schristos@cindex NFS-Link filesystem II
3837a53f50b9Schristos@cindex Referencing an existing part of the name space if target exists
3838a53f50b9Schristos@cindex Mounting a remote part of the name space if target is missing
3839a53f50b9Schristos@cindex Symlink if target exists, NFS otherwise
3840a53f50b9Schristos@cindex nfsl, filesystem type
3841a53f50b9Schristos@cindex symlink, nfsl filesystem type
3842a53f50b9Schristos@cindex Filesystem type; nfsl
3843a53f50b9Schristos
3844a53f50b9SchristosThe @dfn{nfsl} (@samp{type:=nfsl}) filesystem type is a combination of two others:
3845a53f50b9Schristos@samp{link} and @samp{nfs}.  If the local host name is equal to the
3846a53f50b9Schristosvalue of @code{$@{rhost@}} @emph{and} the target pathname listed in
3847a53f50b9Schristos@code{$@{fs@}} exists, @samp{nfsl} will behave exactly as
3848a53f50b9Schristos@samp{type:=link}, and refer to the target as a symbolic link.  If the
3849a53f50b9Schristoslocal host name is not equal to the value of @code{$@{rhost@}}, or if
3850a53f50b9Schristosthe target of the link does not exist, @i{Amd} will treat it as
3851a53f50b9Schristos@samp{type:=nfs}, and will mount a remote pathname for it.
3852a53f50b9Schristos
3853a53f50b9SchristosThe @samp{nfsl} filesystem type is particularly useful as a shorthand
3854a53f50b9Schristosfor the more cumbersome and yet one of the most popular @i{Amd}
3855a53f50b9Schristosentries.  For example, you can simplify all map entries that look like:
3856a53f50b9Schristos
3857a53f50b9Schristos@example
3858a53f50b9Schristoszing    -fs:=/n/shekel/u/zing \
3859a53f50b9Schristos        host!=shekel;type:=nfs;rhost:=shekel;rfs:=$@{fs@} \
3860a53f50b9Schristos        host==shekel;type:=link
3861a53f50b9Schristos@end example
3862a53f50b9Schristos
3863a53f50b9Schristosor
3864a53f50b9Schristos
3865a53f50b9Schristos@example
3866a53f50b9Schristoszing    -fs:=/n/shekel/u/zing \
3867a53f50b9Schristos        exists($@{fs@});type:=link \
3868a53f50b9Schristos        !exists($@{fs@});type:=nfs;rhost:=shekel;rfs:=$@{fs@}
3869a53f50b9Schristos@end example
3870a53f50b9Schristos
3871a53f50b9Schristosinto a shorter form
3872a53f50b9Schristos
3873a53f50b9Schristos@example
3874a53f50b9Schristoszing    type:=nfsl;fs:=/n/shekel/u/zing;rhost:=shekel;rfs:=$@{fs@}
3875a53f50b9Schristos@end example
3876a53f50b9Schristos
3877a53f50b9SchristosNot just does it make the maps smaller and simpler, but it avoids
3878a53f50b9Schristospossible mistakes that often happen when forgetting to set up the two
3879a53f50b9Schristosentries (one for @samp{type:=nfs} and the other for @samp{type:=link})
3880a53f50b9Schristosnecessary to perform transparent mounts of existing or remote mounts.
3881a53f50b9Schristos
3882a53f50b9Schristos@c ----------------------------------------------------------------
3883a53f50b9Schristos@node Automount Filesystem, Direct Automount Filesystem, NFS-Link Filesystem, Filesystem Types
3884a53f50b9Schristos@comment  node-name,  next,  previous,  up
3885a53f50b9Schristos@section Automount Filesystem (@samp{auto})
3886a53f50b9Schristos@cindex Automount filesystem
3887a53f50b9Schristos@cindex Map cache types
3888a53f50b9Schristos@cindex Setting map cache parameters
3889a53f50b9Schristos@cindex How to set map cache parameters
3890a53f50b9Schristos@cindex How to start an indirect automount point
3891a53f50b9Schristos@cindex auto, filesystem type
3892a53f50b9Schristos@cindex Filesystem type; auto
3893a53f50b9Schristos@cindex SIGHUP signal
3894a53f50b9Schristos@cindex Map cache synchronizing
3895a53f50b9Schristos@cindex Synchronizing the map cache
3896a53f50b9Schristos@cindex Map cache options
3897a53f50b9Schristos@cindex Regular expressions in maps
3898a53f50b9Schristos
3899a53f50b9SchristosThe @dfn{auto} (@samp{type:=auto}) filesystem type creates a new automount point below an
3900a53f50b9Schristosexisting automount point.  Top-level automount points appear as system
3901a53f50b9Schristosmount points.  An automount mount point can also appear as a
3902a53f50b9Schristossub-directory of an existing automount point.  This allows some
3903a53f50b9Schristosadditional structure to be added, for example to mimic the mount tree of
3904a53f50b9Schristosanother machine.
3905a53f50b9Schristos
3906a53f50b9SchristosThe following options may be specified:
3907a53f50b9Schristos
3908a53f50b9Schristos@table @code
3909a53f50b9Schristos@cindex cache, mount map option
3910a53f50b9Schristos@cindex Mount map option; cache
3911a53f50b9Schristos@item cache
3912a53f50b9Schristosspecifies whether the data in this mount-map should be
3913a53f50b9Schristoscached.  The default value is @samp{none}, in which case
3914a53f50b9Schristosno caching is done in order to conserve memory.
3915a53f50b9Schristos
3916a53f50b9SchristosHowever, better performance and reliability can be obtained by caching
3917a53f50b9Schristossome or all of a mount-map.
3918a53f50b9Schristos
3919a53f50b9SchristosIf the cache option specifies @samp{all},
3920a53f50b9Schristosthe entire map is enumerated when the mount point is created.
3921a53f50b9Schristos
3922a53f50b9SchristosIf the cache option specifies @samp{inc}, caching is done incrementally
3923a53f50b9Schristosas and when data is required.
3924a53f50b9SchristosSome map types do not support cache mode @samp{all}, in which case @samp{inc}
3925a53f50b9Schristosis used whenever @samp{all} is requested.
3926a53f50b9Schristos
3927a53f50b9SchristosCaching can be entirely disabled by using cache mode @samp{none}.
3928a53f50b9Schristos
3929a53f50b9SchristosIf the cache option specifies @samp{regexp} then the entire map will be
3930a53f50b9Schristosenumerated and each key will be treated as an egrep-style regular
3931a53f50b9Schristosexpression.  The order in which a cached map is searched does not
3932a53f50b9Schristoscorrespond to the ordering in the source map so the regular expressions
3933a53f50b9Schristosshould be mutually exclusive to avoid confusion.
3934a53f50b9Schristos
3935a53f50b9SchristosEach mount map type has a default cache type, usually @samp{inc}, which
3936a53f50b9Schristoscan be selected by specifying @samp{mapdefault}.
3937a53f50b9Schristos
3938a53f50b9SchristosThe cache mode for a mount map can only be selected on the command line.
3939a53f50b9SchristosStarting @i{Amd} with the command:
3940a53f50b9Schristos
3941a53f50b9Schristos@example
3942a53f50b9Schristosamd /homes hesiod.homes -cache:=inc
3943a53f50b9Schristos@end example
3944a53f50b9Schristos
3945a53f50b9Schristoswill cause @samp{/homes} to be automounted using the @dfn{Hesiod} name
3946a53f50b9Schristosserver with local incremental caching of all successfully resolved names.
3947a53f50b9Schristos
3948a53f50b9SchristosAll cached data is forgotten whenever @i{Amd} receives a @samp{SIGHUP}
3949a53f50b9Schristossignal and, if cache @samp{all} mode was selected, the cache will be
3950a53f50b9Schristosreloaded.  This can be used to inform @i{Amd} that a map has been
3951a53f50b9Schristosupdated.  In addition, whenever a cache lookup fails and @i{Amd} needs
3952a53f50b9Schristosto examine a map, the map's modify time is examined.  If the cache is
3953a53f50b9Schristosout of date with respect to the map then it is flushed as if a
3954a53f50b9Schristos@samp{SIGHUP} had been received.
3955a53f50b9Schristos
3956a53f50b9SchristosAn additional option (@samp{sync}) may be specified to force @i{Amd} to
3957a53f50b9Schristoscheck the map's modify time whenever a cached entry is being used.  For
3958a53f50b9Schristosexample, an incremental, synchronized cache would be created by the
3959a53f50b9Schristosfollowing command:
3960a53f50b9Schristos
3961a53f50b9Schristos@example
3962a53f50b9Schristosamd /homes hesiod.homes -cache:=inc,sync
3963a53f50b9Schristos@end example
3964a53f50b9Schristos
3965a53f50b9Schristos@item fs
3966a53f50b9Schristosspecifies the name of the mount map to use for the new mount point.
3967a53f50b9Schristos
3968a53f50b9SchristosArguably this should have been specified with the @code{$@{rfs@}} option but
3969a53f50b9Schristoswe are now stuck with it due to historical accident.
3970a53f50b9Schristos
3971a53f50b9Schristos@c %If the string @samp{.} is used then the same map is used;
3972a53f50b9Schristos@c %in addition the lookup prefix is set to the name of the mount point followed
3973a53f50b9Schristos@c %by a slash @samp{/}.
3974a53f50b9Schristos@c %This is the same as specifying @samp{fs:=\$@{map@};pref:=\$@{key@}/}.
3975a53f50b9Schristos@c
3976a53f50b9Schristos
3977a53f50b9Schristos@item pref
3978a53f50b9Schristosalters the name that is looked up in the mount map.  If
3979a53f50b9Schristos@code{$@{pref@}}, the @dfn{prefix}, is non-null then it is prepended
3980a53f50b9Schristosto the name requested by the kernel @dfn{before} the map is
3981a53f50b9Schristossearched. The default prefix is the prefix of the parent map (if any)
3982a53f50b9Schristoswith name of the auto node appended to it. That means if you want no
3983a53f50b9Schristosprefix you must say so in the map: @samp{pref:=null}.
3984a53f50b9Schristos
3985a53f50b9Schristos@item opts
3986a53f50b9SchristosNormally, @samp{auto} style maps are not browsable even if you turn on
3987a53f50b9Schristosdirectory browsability (@pxref{browsable_dirs Parameter}).  To enable
3988a53f50b9Schristosbrowsing entries in @samp{auto} maps, specify @samp{opts:=browsable}
3989a53f50b9Schristosor @samp{opts:=fullybrowsable} in
3990a53f50b9Schristosthe description of this map.
3991a53f50b9Schristos
3992a53f50b9Schristos@end table
3993a53f50b9Schristos
3994a53f50b9SchristosThe server @samp{dylan.doc.ic.ac.uk} has two user disks:
3995a53f50b9Schristos@samp{/dev/dsk/2s0} and @samp{/dev/dsk/5s0}.  These are accessed as
3996a53f50b9Schristos@samp{/home/dylan/dk2} and @samp{/home/dylan/dk5} respectively.  Since
3997a53f50b9Schristos@samp{/home} is already an automount point, this naming is achieved with
3998a53f50b9Schristosthe following map entries:@refill
3999a53f50b9Schristos
4000a53f50b9Schristos@example
4001a53f50b9Schristosdylan        type:=auto;fs:=$@{map@};pref:=$@{key@}/
4002a53f50b9Schristosdylan/dk2    type:=ufs;dev:=/dev/dsk/2s0
4003a53f50b9Schristosdylan/dk5    type:=ufs;dev:=/dev/dsk/5s0
4004a53f50b9Schristos@end example
4005a53f50b9Schristos
4006a53f50b9Schristos@c ----------------------------------------------------------------
4007a53f50b9Schristos@node Direct Automount Filesystem, Union Filesystem, Automount Filesystem, Filesystem Types
4008a53f50b9Schristos@comment  node-name,  next,  previous,  up
4009a53f50b9Schristos@section Direct Automount Filesystem (@samp{direct})
4010a53f50b9Schristos@cindex Direct automount filesystem
4011a53f50b9Schristos@cindex How to start a direct automount point
4012a53f50b9Schristos@cindex direct, filesystem type
4013a53f50b9Schristos@cindex Filesystem type; direct
4014a53f50b9Schristos
4015a53f50b9SchristosThe @dfn{direct} (@samp{type:=direct}) filesystem is almost identical to
4016a53f50b9Schristosthe automount filesystem.  Instead of appearing to be a directory of
4017a53f50b9Schristosmount points, it appears as a symbolic link to a mounted filesystem.
4018a53f50b9SchristosThe mount is done at the time the link is accessed.  @xref{Automount
4019a53f50b9SchristosFilesystem}, for a list of required options.
4020a53f50b9Schristos
4021a53f50b9SchristosDirect automount points are created by specifying the @samp{direct}
4022a53f50b9Schristosfilesystem type on the command line:
4023a53f50b9Schristos
4024a53f50b9Schristos@example
4025a53f50b9Schristosamd ... /usr/man auto.direct -type:=direct
4026a53f50b9Schristos@end example
4027a53f50b9Schristos
4028a53f50b9Schristoswhere @samp{auto.direct} would contain an entry such as:
4029a53f50b9Schristos
4030a53f50b9Schristos@example
4031a53f50b9Schristosusr/man    -type:=nfs;rfs:=/usr/man \
4032a53f50b9Schristos           rhost:=man-server1  rhost:=man-server2
4033a53f50b9Schristos@end example
4034a53f50b9Schristos
4035a53f50b9SchristosIn this example, @samp{man-server1} and @samp{man-server2} are file
4036a53f50b9Schristosservers which export copies of the manual pages.  Note that the key
4037a53f50b9Schristoswhich is looked up is the name of the automount point without the
4038a53f50b9Schristosleading @samp{/}.
4039a53f50b9Schristos
4040a53f50b9SchristosNote that the implementation of the traditional @dfn{direct} filesystem is
4041a53f50b9Schristosessentially a hack (pretending that the root of an NFS filesystem is a
4042a53f50b9Schristossymlink) and many modern operating systems get very unhappy about
4043a53f50b9Schristosit. For example, Linux kernel 2.4+ completely disallows it, and Solaris
4044a53f50b9Schristos2.8 fails to unmount it when @i{Amd} shuts down. Therefore, the use of
4045a53f50b9Schristosthe traditional @dfn{direct} filesystem is strongly discouraged; it is
4046a53f50b9Schristosonly semi-supported, at best.
4047a53f50b9Schristos
4048a53f50b9SchristosThe autofs implementations that permit direct mounts are fully
4049a53f50b9Schristossupported, however. That currently includes all versions of
4050a53f50b9SchristosSolaris. Linux autofs does NOT support direct mounts at all.
4051a53f50b9Schristos
4052a53f50b9Schristos@c ----------------------------------------------------------------
4053a53f50b9Schristos@node Union Filesystem, Error Filesystem, Direct Automount Filesystem, Filesystem Types
4054a53f50b9Schristos@comment  node-name,  next,  previous,  up
4055a53f50b9Schristos@section Union Filesystem (@samp{union})
4056a53f50b9Schristos@cindex Union filesystem
4057a53f50b9Schristos@cindex union, filesystem type
4058a53f50b9Schristos@cindex Filesystem type; union
4059a53f50b9Schristos
4060a53f50b9SchristosThe @dfn{union} (@samp{type:=union}) filesystem type allows the contents of several
4061a53f50b9Schristosdirectories to be merged and made visible in a single directory.  This
4062a53f50b9Schristoscan be used to overcome one of the major limitations of the Unix mount
4063a53f50b9Schristosmechanism which only allows complete directories to be mounted.
4064a53f50b9Schristos
4065a53f50b9SchristosFor example, supposing @file{/tmp} and @file{/var/tmp} were to be merged
4066a53f50b9Schristosinto a new directory called @file{/mtmp}, with files in @file{/var/tmp}
4067a53f50b9Schristostaking precedence.  The following command could be used to achieve this
4068a53f50b9Schristoseffect:
4069a53f50b9Schristos
4070a53f50b9Schristos@example
4071a53f50b9Schristosamd ... /mtmp union:/tmp:/var/tmp -type:=union
4072a53f50b9Schristos@end example
4073a53f50b9Schristos
4074a53f50b9SchristosCurrently, the unioned directories must @emph{not} be automounted.  That
4075a53f50b9Schristoswould cause a deadlock.  This seriously limits the current usefulness of
4076a53f50b9Schristosthis filesystem type and the problem will be addressed in a future
4077a53f50b9Schristosrelease of @i{Amd}.
4078a53f50b9Schristos
4079a53f50b9SchristosFiles created in the union directory are actually created in the last
4080a53f50b9Schristosnamed directory.  This is done by creating a wildcard entry which points
4081a53f50b9Schristosto the correct directory.  The wildcard entry is visible if the union
4082a53f50b9Schristosdirectory is listed, so allowing you to see which directory has
4083a53f50b9Schristospriority.
4084a53f50b9Schristos
4085a53f50b9SchristosThe files visible in the union directory are computed at the time
4086a53f50b9Schristos@i{Amd} is started, and are not kept up-to-date with respect to the
4087a53f50b9Schristosunderlying directories.  Similarly, if a link is removed, for example
4088a53f50b9Schristoswith the @samp{rm} command, it will be lost forever.
4089a53f50b9Schristos
4090a53f50b9Schristos@c ----------------------------------------------------------------
4091a53f50b9Schristos@node Error Filesystem, Top-level Filesystem, Union Filesystem, Filesystem Types
4092a53f50b9Schristos@comment  node-name,  next,  previous,  up
4093a53f50b9Schristos@section Error Filesystem (@samp{error})
4094a53f50b9Schristos@cindex Error filesystem
4095a53f50b9Schristos@cindex error, filesystem type
4096a53f50b9Schristos@cindex Filesystem type; error
4097a53f50b9Schristos
4098a53f50b9SchristosThe @dfn{error} (@samp{type:=error}) filesystem type is used internally as a catch-all in the
4099a53f50b9Schristoscase where none of the other filesystems was selected, or some other
4100a53f50b9Schristoserror occurred.  Lookups and mounts always fail with ``No such file or
4101a53f50b9Schristosdirectory''.  All other operations trivially succeed.
4102a53f50b9Schristos
4103a53f50b9SchristosThe error filesystem is not directly accessible.
4104a53f50b9Schristos
4105a53f50b9Schristos@c ----------------------------------------------------------------
4106a53f50b9Schristos@node Top-level Filesystem, Root Filesystem, Error Filesystem, Filesystem Types
4107a53f50b9Schristos@comment  node-name,  next,  previous,  up
4108a53f50b9Schristos@section Top-level Filesystem (@samp{toplvl})
4109a53f50b9Schristos@cindex Top level filesystem
4110a53f50b9Schristos@cindex toplvl, filesystem type
4111a53f50b9Schristos@cindex Filesystem type; toplvl
4112a53f50b9Schristos
4113a53f50b9SchristosThe @dfn{toplvl} (@samp{type:=toplvl}) filesystems is derived from the @samp{auto} filesystem
4114a53f50b9Schristosand is used to mount the top-level automount nodes.  Requests of this
4115a53f50b9Schristostype are automatically generated from the command line arguments.
4116a53f50b9Schristos
4117a53f50b9Schristos@c ----------------------------------------------------------------
4118a53f50b9Schristos@node Root Filesystem, Inheritance Filesystem, Top-level Filesystem, Filesystem Types
4119a53f50b9Schristos@comment  node-name,  next,  previous,  up
4120a53f50b9Schristos@section Root Filesystem (@samp{root})
4121a53f50b9Schristos@cindex Root filesystem
4122a53f50b9Schristos@cindex root, filesystem type
4123a53f50b9Schristos@cindex Filesystem type; root
4124a53f50b9Schristos
4125a53f50b9SchristosThe @dfn{root} (@samp{type:=root}) filesystem type acts as an internal
4126a53f50b9Schristosplaceholder onto which @i{Amd} can pin @samp{toplvl} mounts.  Only one
4127a53f50b9Schristosnode of this type need ever exist and one is created automatically
4128a53f50b9Schristosduring startup.  The effect of having more than one root node is
4129a53f50b9Schristosundefined.
4130a53f50b9Schristos
4131a53f50b9SchristosThe root filesystem is not directly accessible.
4132a53f50b9Schristos
4133a53f50b9Schristos@c ----------------------------------------------------------------
4134a53f50b9Schristos@node Inheritance Filesystem, , Root Filesystem, Filesystem Types
4135a53f50b9Schristos@comment  node-name,  next,  previous,  up
4136a53f50b9Schristos@section Inheritance Filesystem (@samp{inherit})
4137a53f50b9Schristos@cindex Inheritance filesystem
4138a53f50b9Schristos@cindex Nodes generated on a restart
4139a53f50b9Schristos@cindex inherit, filesystem type
4140a53f50b9Schristos@cindex Filesystem type; inherit
4141a53f50b9Schristos
4142a53f50b9SchristosThe @dfn{inheritance} (@samp{type:=inherit}) filesystem is not directly
4143a53f50b9Schristosaccessible.  Instead, internal mount nodes of this type are
4144a53f50b9Schristosautomatically generated when @i{Amd} is started with the @code{-r} option.
4145a53f50b9SchristosAt this time the system mount table is scanned to locate any filesystems
4146a53f50b9Schristoswhich are already mounted.  If any reference to these filesystems is
4147a53f50b9Schristosmade through @i{Amd} then instead of attempting to mount it, @i{Amd}
4148a53f50b9Schristossimulates the mount and @dfn{inherits} the filesystem.  This allows a
4149a53f50b9Schristosnew version of @i{Amd} to be installed on a live system simply by
4150a53f50b9Schristoskilling the old daemon with @samp{SIGTERM} and starting the new one.@refill
4151a53f50b9Schristos
4152a53f50b9SchristosThis filesystem type is not generally visible externally, but it is
4153a53f50b9Schristospossible that the output from @samp{amq -m} may list @samp{inherit} as
4154a53f50b9Schristosthe filesystem type.  This happens when an inherit operation cannot
4155a53f50b9Schristosbe completed for some reason, usually because a fileserver is down.
4156a53f50b9Schristos
4157a53f50b9Schristos@c ################################################################
4158a53f50b9Schristos@node Amd Configuration File, Run-time Administration, Filesystem Types, Top
4159a53f50b9Schristos@comment  node-name,  next,  previous,  up
4160a53f50b9Schristos@chapter Amd Configuration File
4161a53f50b9Schristos@cindex  Amd Configuration File
4162a53f50b9Schristos@cindex amd.conf
4163a53f50b9Schristos
4164a53f50b9SchristosThe @samp{amd.conf} file is the configuration file for @i{Amd}, as part
4165a53f50b9Schristosof the am-utils suite.  This file contains runtime configuration
4166a53f50b9Schristosinformation for the @i{Amd} automounter program.
4167a53f50b9Schristos
4168a53f50b9Schristos@menu
4169a53f50b9Schristos* File Format::
4170a53f50b9Schristos* The Global Section::
4171a53f50b9Schristos* Regular Map Sections::
4172a53f50b9Schristos* Common Parameters::
4173a53f50b9Schristos* Global Parameters::
4174a53f50b9Schristos* Regular Map Parameters::
4175a53f50b9Schristos* amd.conf Examples::
4176a53f50b9Schristos@end menu
4177a53f50b9Schristos
4178a53f50b9Schristos@c ================================================================
4179a53f50b9Schristos@node File Format, The Global Section, Amd Configuration File, Amd Configuration File
4180a53f50b9Schristos@comment  node-name,  next,  previous,  up
4181a53f50b9Schristos@section File Format
4182a53f50b9Schristos@cindex amd.conf file format
4183a53f50b9Schristos
4184a53f50b9SchristosThe @samp{amd.conf} file consists of sections and parameters.  A section
4185a53f50b9Schristosbegins with the name of the section in square brackets @samp{[]} and
4186a53f50b9Schristoscontinues until the next section begins or the end of the file is reached.
4187a53f50b9SchristosSections contain parameters of the form @samp{name = value}.
4188a53f50b9Schristos
4189a53f50b9SchristosThe file is line-based --- that is, each newline-terminated line
4190a53f50b9Schristosrepresents either a comment, a section name or a parameter.  No
4191a53f50b9Schristosline-continuation syntax is available.
4192a53f50b9Schristos
4193a53f50b9SchristosSection names, parameter names and their values are case sensitive.
4194a53f50b9Schristos
4195a53f50b9SchristosOnly the first equals sign in a parameter is significant.  Whitespace
4196a53f50b9Schristosbefore or after the first equals sign is discarded.  Leading, trailing
4197a53f50b9Schristosand internal whitespace in section and parameter names is irrelevant.
4198a53f50b9SchristosLeading and trailing whitespace in a parameter value is discarded.
4199a53f50b9SchristosInternal whitespace within a parameter value is not allowed, unless the
4200a53f50b9Schristoswhole parameter value is quoted with double quotes as in @samp{name =
4201a53f50b9Schristos"some value"}.
4202a53f50b9Schristos
4203a53f50b9SchristosAny line beginning with a pound sign @samp{#} is ignored, as are lines
4204a53f50b9Schristoscontaining only whitespace.
4205a53f50b9Schristos
4206a53f50b9SchristosThe values following the equals sign in parameters are all either a
4207a53f50b9Schristosstring (no quotes needed if string does not include spaces) or a
4208a53f50b9Schristosboolean, which may be given as @samp{yes}/@samp{no}.  Case is significant in all
4209a53f50b9Schristosvalues.  Some items such as cache timeouts are numeric.
4210a53f50b9Schristos
4211a53f50b9Schristos@c ================================================================
4212a53f50b9Schristos@node The Global Section, Regular Map Sections, File Format, Amd Configuration File
4213a53f50b9Schristos@comment  node-name,  next,  previous,  up
4214a53f50b9Schristos@section The Global Section
4215a53f50b9Schristos@cindex amd.conf global section
4216a53f50b9Schristos
4217a53f50b9SchristosThe global section must be specified as @samp{[global]}.  Parameters in
4218a53f50b9Schristosthis section either apply to @i{Amd} as a whole, or to all other regular map
4219a53f50b9Schristossections which follow.  There should be only one global section defined
4220a53f50b9Schristosin one configuration file.
4221a53f50b9Schristos
4222a53f50b9SchristosIt is highly recommended that this section be specified first in the
4223a53f50b9Schristosconfiguration file.  If it is not, then regular map sections which
4224a53f50b9Schristosprecede it will not use global values defined later.
4225a53f50b9Schristos
4226a53f50b9Schristos@c ================================================================
4227a53f50b9Schristos@node Regular Map Sections, Common Parameters, The Global Section, Amd Configuration File
4228a53f50b9Schristos@comment  node-name,  next,  previous,  up
4229a53f50b9Schristos@section Regular Map Sections
4230a53f50b9Schristos@cindex amd.conf regular map sections
4231a53f50b9Schristos
4232a53f50b9SchristosParameters in regular (non-global) sections apply to a single map entry.
4233a53f50b9SchristosFor example, if the map section @samp{[/homes]} is defined, then all
4234a53f50b9Schristosparameters following it will be applied to the @file{/homes}
4235a53f50b9Schristos@i{Amd}-managed mount point.
4236a53f50b9Schristos
4237a53f50b9Schristos@c ================================================================
4238a53f50b9Schristos@node Common Parameters, Global Parameters, Regular Map Sections, Amd Configuration File
4239a53f50b9Schristos@comment  node-name,  next,  previous,  up
4240a53f50b9Schristos@section Common Parameters
4241a53f50b9Schristos@cindex amd.conf common parameters
4242a53f50b9Schristos
4243a53f50b9SchristosThese parameters can be specified either in the global or a map-specific
4244a53f50b9Schristossection.  Entries specified in a map-specific section override the default
4245a53f50b9Schristosvalue or one defined in the global section.   If such a common parameter is
4246a53f50b9Schristosspecified only in the global section, it is applicable to all regular map
4247a53f50b9Schristossections that follow.
4248a53f50b9Schristos
4249a53f50b9Schristos@menu
4250a53f50b9Schristos* autofs_use_lofs Parameter::
4251a53f50b9Schristos* browsable_dirs Parameter::
4252a53f50b9Schristos* map_defaults Parameter::
4253a53f50b9Schristos* map_options Parameter::
4254a53f50b9Schristos* map_type Parameter::
4255a53f50b9Schristos* mount_type Parameter::
4256a53f50b9Schristos* search_path Parameter::
4257a53f50b9Schristos* selectors_in_defaults Parameter::
4258a53f50b9Schristos* sun_map_syntax Parameter::
4259a53f50b9Schristos@end menu
4260a53f50b9Schristos
4261a53f50b9Schristos@c ----------------------------------------------------------------
4262a53f50b9Schristos@node autofs_use_lofs Parameter, browsable_dirs Parameter, Common Parameters, Common Parameters
4263a53f50b9Schristos@comment  node-name,  next,  previous,  up
4264a53f50b9Schristos@subsection @t{autofs_use_lofs} Parameter
4265a53f50b9Schristos@cindex autofs_use_lofs Parameter
4266a53f50b9Schristos
4267a53f50b9Schristos(type=string, default=@samp{yes}).
4268a53f50b9SchristosWhen set to @samp{yes}, @i{Amd}'s autofs code will use lofs-type
4269a53f50b9Schristos(loopback) mounts for @code{type:=link} mounts, as well as several
4270a53f50b9Schristosother cases that require local references.  This has the advantage
4271a53f50b9Schristosthat @i{Amd} does not use a secondary mount point and users do not see
4272a53f50b9Schristosexternal pathnames (the infamous @code{/bin/pwd} problem, where it
4273a53f50b9Schristosreports a different path than the user chdir'ed into).  One of the
4274a53f50b9Schristosdisadvantages of using this option is that the autofs code is
4275a53f50b9Schristosrelatively new and the in-place mounts have not been throughly tested.
4276a53f50b9Schristos
4277a53f50b9SchristosIf this option is set to @samp{no}, then @i{Amd}'s autofs code will
4278a53f50b9Schristosuse symlinks instead of lofs-type mounts for local references.  This
4279a53f50b9Schristoshas the advantage of using simpler (more stable) code, but at the
4280a53f50b9Schristosexpense of negating one of autofs's big advantages: the hiding of
4281a53f50b9Schristos@i{Amd}'s internal paths.  Note that symlinks are not supported in all
4282a53f50b9Schristosautofs implementations, especially those derived from Solaris Autofs
4283a53f50b9Schristosv1.  Also, on Solaris 2.6 and newer, autofs symlinks are not cached,
4284a53f50b9Schristosresulting in repeated up-call requests to @i{Amd}.
4285a53f50b9Schristos
4286a53f50b9Schristos@c ----------------------------------------------------------------
4287a53f50b9Schristos@node browsable_dirs Parameter, map_defaults Parameter, autofs_use_lofs Parameter, Common Parameters
4288a53f50b9Schristos@comment  node-name,  next,  previous,  up
4289a53f50b9Schristos@subsection @t{browsable_dirs} Parameter
4290a53f50b9Schristos@cindex browsable_dirs Parameter
4291a53f50b9Schristos
4292a53f50b9Schristos(type=string, default=@samp{no}).  If @samp{yes}, then @i{Amd}'s top-level
4293a53f50b9Schristosmount points will be browsable to @b{readdir}(3) calls.  This means you
4294a53f50b9Schristoscould run for example @b{ls}(1) and see what keys are available to mount
4295a53f50b9Schristosin that directory.  Not all entries are made visible to @b{readdir}(3):
4296a53f50b9Schristosthe @samp{/defaults} entry, wildcard entries, and those with a @file{/}
4297a53f50b9Schristosin them are not included.  If you specify @samp{full} to this option,
4298a53f50b9Schristosall but the @samp{/defaults} entry will be visible.  Note that if you run
4299a53f50b9Schristosa command which will attempt to @b{stat}(2) the entries, such as often
4300a53f50b9Schristosdone by @samp{ls -l} or @samp{ls -F}, @i{Amd} will attempt to mount
4301a53f50b9Schristos@i{every} entry in that map.  This is often called a ``mount storm''.
4302a53f50b9Schristos
4303a53f50b9SchristosNote that mount storms are mostly avoided by using autofs mounts
4304a53f50b9Schristos(@samp{mount_type = autofs}).
4305a53f50b9Schristos
4306a53f50b9Schristos@c ----------------------------------------------------------------
4307a53f50b9Schristos@node map_defaults Parameter, map_options Parameter, browsable_dirs Parameter, Common Parameters
4308a53f50b9Schristos@comment  node-name,  next,  previous,  up
4309a53f50b9Schristos@subsection @t{map_defaults} Parameter
4310a53f50b9Schristos@cindex map_defaults Parameter
4311a53f50b9Schristos
4312a53f50b9Schristos(type=string, default to empty).  This option sets a string to be used
4313a53f50b9Schristosas the map's @code{/defaults} entry, overriding any @code{/defaults}
4314a53f50b9Schristosspecified in the map.  This allows local users to override a given
4315a53f50b9Schristosmap's defaults without modifying maps globally (which is impossible in
4316a53f50b9Schristossites where the maps are managed by a different administrative group).
4317a53f50b9Schristos
4318a53f50b9Schristos@c ----------------------------------------------------------------
4319a53f50b9Schristos@node map_options Parameter, map_type Parameter, map_defaults Parameter, Common Parameters
4320a53f50b9Schristos@comment  node-name,  next,  previous,  up
4321a53f50b9Schristos@subsection @t{map_options} Parameter
4322a53f50b9Schristos@cindex map_options Parameter
4323a53f50b9Schristos
4324a53f50b9Schristos(type=string, default no options).  This option is the same as
4325a53f50b9Schristosspecifying map options on the command line to @i{Amd}, such as
4326a53f50b9Schristos@samp{cache:=all}.
4327a53f50b9Schristos
4328a53f50b9Schristos@c ----------------------------------------------------------------
4329a53f50b9Schristos@node map_type Parameter, mount_type Parameter, map_options Parameter, Common Parameters
4330a53f50b9Schristos@comment  node-name,  next,  previous,  up
4331a53f50b9Schristos@subsection @t{map_type} Parameter
4332a53f50b9Schristos@cindex map_type Parameter
4333a53f50b9Schristos
4334a53f50b9Schristos(type=string, default search all map types).  If specified, @i{Amd} will
4335a53f50b9Schristosinitialize the map only for the type given.  This is useful to avoid the
4336a53f50b9Schristosdefault map search type used by @i{Amd} which takes longer and can have
4337a53f50b9Schristosundesired side-effects such as initializing NIS even if not used.
4338a53f50b9SchristosPossible values are
4339a53f50b9Schristos
4340a53f50b9Schristos@table @samp
4341a53f50b9Schristos@item file
4342a53f50b9Schristosplain files
4343a53f50b9Schristos@item hesiod
4344a53f50b9SchristosHesiod name service from MIT
4345a53f50b9Schristos@item ldap
4346a53f50b9SchristosLightweight Directory Access Protocol
4347a53f50b9Schristos@item ndbm
4348a53f50b9Schristos(New) dbm style hash files
4349a53f50b9Schristos@item nis
4350a53f50b9SchristosNetwork Information Services (version 2)
4351a53f50b9Schristos@item nisplus
4352a53f50b9SchristosNetwork Information Services Plus (version 3)
4353a53f50b9Schristos@item passwd
4354a53f50b9Schristoslocal password files
4355a53f50b9Schristos@item union
4356a53f50b9Schristosunion maps
4357a53f50b9Schristos@end table
4358a53f50b9Schristos
4359a53f50b9Schristos@c ----------------------------------------------------------------
4360a53f50b9Schristos@node mount_type Parameter, search_path Parameter, map_type Parameter, Common Parameters
4361a53f50b9Schristos@comment  node-name,  next,  previous,  up
4362a53f50b9Schristos@subsection @t{mount_type} Parameter
4363a53f50b9Schristos@cindex mount_type Parameter
4364a53f50b9Schristos
4365a53f50b9Schristos(type=string, default=@samp{nfs}).  All @i{Amd} mount types default to NFS.
4366a53f50b9SchristosThat is, @i{Amd} is an NFS server on the map mount points, for the local
4367a53f50b9Schristoshost it is running on.  If @samp{autofs} is specified, @i{Amd} will be
4368a53f50b9Schristosan autofs server for those mount points.
4369a53f50b9Schristos
4370a53f50b9Schristos@c ----------------------------------------------------------------
4371a53f50b9Schristos@node search_path Parameter, selectors_in_defaults Parameter, mount_type Parameter, Common Parameters
4372a53f50b9Schristos@comment  node-name,  next,  previous,  up
4373a53f50b9Schristos@subsection @t{search_path} Parameter
4374a53f50b9Schristos@cindex search_path Parameter
4375a53f50b9Schristos
4376a53f50b9Schristos(type=string, default no search path).  This provides a
4377a53f50b9Schristos(colon-delimited) search path for file maps.  Using a search path,
4378a53f50b9Schristossites can allow for local map customizations and overrides, and can
4379a53f50b9Schristosdistributed maps in several locations as needed.
4380a53f50b9Schristos
4381a53f50b9Schristos@c ----------------------------------------------------------------
4382a53f50b9Schristos@node selectors_in_defaults Parameter, sun_map_syntax Parameter, search_path Parameter, Common Parameters
4383a53f50b9Schristos@comment  node-name,  next,  previous,  up
4384a53f50b9Schristos@subsection @t{selectors_in_defaults} Parameter
4385a53f50b9Schristos@cindex selectors_in_defaults Parameter
4386a53f50b9Schristos
4387a53f50b9Schristos(type=boolean, default=@samp{no}).  If @samp{yes}, then the
4388a53f50b9Schristos@samp{/defaults} entry of maps will search for and process any
4389a53f50b9Schristosselectors before setting defaults for all other keys in that map.
4390a53f50b9SchristosUseful when you want to set different options for a complete map based
4391a53f50b9Schristoson some parameters.  For example, you may want to better the NFS
4392a53f50b9Schristosperformance over slow slip-based networks as follows:
4393a53f50b9Schristos
4394a53f50b9Schristos@example
4395a53f50b9Schristos/defaults \
4396a53f50b9Schristos    wire==slip-net;opts:=intr,rsize=1024,wsize=1024 \
4397a53f50b9Schristos    wire!=slip-net;opts:=intr,rsize=8192,wsize=8192
4398a53f50b9Schristos@end example
4399a53f50b9Schristos
4400a53f50b9SchristosDeprecated form: selectors_on_default.
4401a53f50b9Schristos
4402a53f50b9Schristos@c ----------------------------------------------------------------
4403a53f50b9Schristos@node sun_map_syntax Parameter, , selectors_in_defaults Parameter, Common Parameters
4404a53f50b9Schristos@comment  node-name,  next,  previous,  up
4405a53f50b9Schristos@subsection @t{sun_map_syntax} Parameter
4406a53f50b9Schristos@cindex sun_map_syntax Parameter
4407a53f50b9Schristos
4408a53f50b9Schristos(type=boolean, default=@samp{no}).  If @samp{yes}, then @i{Amd} will
4409a53f50b9Schristosparse the map according to the Sun Automount syntax.
4410a53f50b9Schristos
4411a53f50b9Schristos
4412a53f50b9Schristos@c ================================================================
4413a53f50b9Schristos@node Global Parameters, Regular Map Parameters, Common Parameters, Amd Configuration File
4414a53f50b9Schristos@comment  node-name,  next,  previous,  up
4415a53f50b9Schristos@section Global Parameters
4416a53f50b9Schristos@cindex amd.conf global parameters
4417a53f50b9Schristos
4418a53f50b9SchristosThe following parameters are applicable to the @samp{[global]} section only.
4419a53f50b9Schristos
4420a53f50b9Schristos@menu
4421a53f50b9Schristos* arch Parameter::
4422a53f50b9Schristos* auto_attrcache Parameter::
4423a53f50b9Schristos* auto_dir Parameter::
4424a53f50b9Schristos* cache_duration Parameter::
4425a53f50b9Schristos* cluster Parameter::
4426a53f50b9Schristos* debug_mtab_file Parameter::
4427a53f50b9Schristos* debug_options Parameter::
4428a53f50b9Schristos* dismount_interval Parameter::
4429a53f50b9Schristos* domain_strip Parameter::
4430a53f50b9Schristos* exec_map_timeout Parameter::
4431a53f50b9Schristos* forced_unmounts Parameter::
4432a53f50b9Schristos* full_os Parameter::
4433a53f50b9Schristos* fully_qualified_hosts Parameter::
4434a53f50b9Schristos* hesiod_base Parameter::
4435a53f50b9Schristos* karch Parameter::
4436a53f50b9Schristos* ldap_base Parameter::
4437a53f50b9Schristos* ldap_cache_maxmem Parameter::
4438a53f50b9Schristos* ldap_cache_seconds Parameter::
4439a53f50b9Schristos* ldap_hostports Parameter::
4440a53f50b9Schristos* ldap_proto_version Parameter::
4441a53f50b9Schristos* local_domain Parameter::
4442a53f50b9Schristos* localhost_address Parameter::
4443a53f50b9Schristos* log_file Parameter::
4444a53f50b9Schristos* log_options Parameter::
4445a53f50b9Schristos* map_reload_interval Parameter::
4446a53f50b9Schristos* nfs_allow_any_interface Parameter::
4447a53f50b9Schristos* nfs_allow_insecure_port Parameter::
4448a53f50b9Schristos* nfs_proto Parameter::
4449a53f50b9Schristos* nfs_retransmit_counter Parameter::
4450a53f50b9Schristos* nfs_retransmit_counter_udp Parameter::
4451a53f50b9Schristos* nfs_retransmit_counter_tcp Parameter::
4452a53f50b9Schristos* nfs_retransmit_counter_toplvl Parameter::
4453a53f50b9Schristos* nfs_retry_interval Parameter::
4454a53f50b9Schristos* nfs_retry_interval_udp Parameter::
4455a53f50b9Schristos* nfs_retry_interval_tcp Parameter::
4456a53f50b9Schristos* nfs_retry_interval_toplvl Parameter::
4457a53f50b9Schristos* nfs_vers Parameter::
4458a53f50b9Schristos* nis_domain Parameter::
4459a53f50b9Schristos* normalize_hostnames Parameter::
4460a53f50b9Schristos* normalize_slashes Parameter::
4461a53f50b9Schristos* os Parameter::
4462a53f50b9Schristos* osver Parameter::
4463a53f50b9Schristos* pid_file Parameter::
4464a53f50b9Schristos* plock Parameter::
4465a53f50b9Schristos* portmap_program Parameter::
4466a53f50b9Schristos* preferred_amq_port Parameter::
4467a53f50b9Schristos* print_pid Parameter::
4468a53f50b9Schristos* print_version Parameter::
4469a53f50b9Schristos* restart_mounts Parameter::
4470a53f50b9Schristos* show_statfs_entries Parameter::
4471a53f50b9Schristos* truncate_log Parameter::
4472a53f50b9Schristos* unmount_on_exit Parameter::
4473a53f50b9Schristos* use_tcpwrappers Parameter::
4474a53f50b9Schristos* vendor Parameter::
4475a53f50b9Schristos@end menu
4476a53f50b9Schristos
4477a53f50b9Schristos@c ----------------------------------------------------------------
4478a53f50b9Schristos@node arch Parameter, auto_attrcache Parameter, Global Parameters, Global Parameters
4479a53f50b9Schristos@comment  node-name,  next,  previous,  up
4480a53f50b9Schristos@subsection @t{arch} Parameter
4481a53f50b9Schristos@cindex arch Parameter
4482a53f50b9Schristos
4483a53f50b9Schristos(type=string, default to compiled in value).  Same as the @code{-A}
4484a53f50b9Schristosoption to @i{Amd}.  Allows you to override the value of the @i{arch}
4485a53f50b9Schristos@i{Amd} variable.
4486a53f50b9Schristos
4487a53f50b9Schristos@c ----------------------------------------------------------------
4488a53f50b9Schristos@node auto_attrcache Parameter, auto_dir Parameter, arch Parameter, Global Parameters
4489a53f50b9Schristos@comment  node-name,  next,  previous,  up
4490a53f50b9Schristos@subsection @t{auto_attrcache} Parameter
4491a53f50b9Schristos@cindex auto_attrcache Parameter
4492a53f50b9Schristos
4493a53f50b9Schristos(type=numeric, default=0).  Specify in seconds (or units of 0.1
4494a53f50b9Schristosseconds, depending on the OS), what is the (kernel-side) NFS attribute
4495a53f50b9Schristoscache timeout for @i{Amd}'s own automount points.  A value of 0 is
4496a53f50b9Schristossupposed to turn off attribute caching, meaning that @i{Amd} will be
4497a53f50b9Schristosconsulted via a kernel-RPC each time someone stat()'s the mount point
4498a53f50b9Schristos(which could be abused as a denial-of-service attack).
4499a53f50b9Schristos
4500a53f50b9Schristos@emph{WARNING}: @i{Amd} depends on being able to turn off the NFS
4501a53f50b9Schristosattribute cache of the client OS.  If it cannot be turned off, then
4502a53f50b9Schristosusers may get ESTALE errors or symlinks that point to the wrong
4503a53f50b9Schristosplaces.  This is more likely under heavy use of @i{Amd}, for example
4504a53f50b9Schristosif your system is experiencing frequent map changes or frequent
4505a53f50b9Schristosmounts/unmounts.  Therefore, under normal circumstances, this
4506a53f50b9Schristosparameter should remain set to 0, to ensure that the attribute cache
4507a53f50b9Schristosis indeed off.
4508a53f50b9Schristos
4509a53f50b9SchristosUnfortunately, some kernels (e.g., certain BSDs) don't have a way to
4510a53f50b9Schristosturn off the NFS attribute cache.  Setting this parameter to 0 is
4511a53f50b9Schristossupposed to turn off attribute caching entirely, but unfortunately it
4512a53f50b9Schristosdoes not; instead, the attribute cache is set to some internal
4513a53f50b9Schristoshard-coded default (usually anywhere from 5-30 seconds).  If you
4514a53f50b9Schristossuspect that your OS doesn't have a reliable way of turning off the
4515a53f50b9Schristosattribute cache, then it is better to set this parameter to the
4516a53f50b9Schristossmallest possible non-zero value (set @samp{auto_attrcache=1} in your
4517a53f50b9Schristos@code{amd.conf}).  This will not eliminate the problem, but reduce the
4518a53f50b9Schristosrisk window somewhat.  The best solutions are (1) to use @i{Amd} in
4519a53f50b9SchristosAutofs mode, if it's supported in your OS, and (2) talk to your OS
4520a53f50b9Schristosvendor to support a true @samp{noac} flag.  See the
4521a53f50b9Schristos@uref{http://www.am-utils.org/docs/am-utils/attrcache.txt,README.attrcache}
4522a53f50b9Schristosdocument for more details.
4523a53f50b9Schristos
4524a53f50b9SchristosIf you are able to turn off the attribute cache on your OS, alas,
4525a53f50b9Schristos@i{Amd}'s performance may degrade (when not using Autofs) because
4526a53f50b9Schristosevery traversal of an automounter-controlled pathname will result in a
4527a53f50b9Schristoslookup request from the kernel to @i{Amd}.  Under heavy loads, for
4528a53f50b9Schristosexample when using recursive tools like @samp{find}, @samp{rdist}, or
4529a53f50b9Schristos@samp{rsync}, this performance degradation can be noticeable.  There
4530a53f50b9Schristosare two possible solutions that some administrators have chosen to
4531a53f50b9Schristosimprove performance:
4532a53f50b9Schristos
4533a53f50b9Schristos@enumerate
4534a53f50b9Schristos
4535a53f50b9Schristos@item
4536a53f50b9SchristosFirst, you can turn off unmounting using the @samp{nounmount} mount
4537a53f50b9Schristosoption.  This will ensure that no @i{Amd} symlink could ever change,
4538a53f50b9Schristosthereby the kernel's attribute cache and @i{Amd} will always be in
4539a53f50b9Schristossync.  However, this method will cause the number of mounts to keep
4540a53f50b9Schristosgrowing, even if some are no longer in use; this has the disadvantage
4541a53f50b9Schristosthat your system could be more susceptible to hangs if even one of
4542a53f50b9Schristosthose accumulating mounts hangs due to a downed server.
4543a53f50b9Schristos
4544a53f50b9Schristos@item
4545a53f50b9SchristosSecond, you can turn on attribute caching carefully by setting a small
4546a53f50b9Schristosautomounter attribute cache value (say, one second), and a relatively
4547a53f50b9Schristoslarge dismount interval (say, one hour).  (@xref{dismount_interval
4548a53f50b9SchristosParameter}.)  For example, you can set this in your @code{amd.conf}:
4549a53f50b9Schristos
4550a53f50b9Schristos@example
4551a53f50b9Schristos[global]
4552a53f50b9Schristosauto_attrcache = 1
4553a53f50b9Schristosdismount_interval = 3600
4554a53f50b9Schristos@end example
4555a53f50b9Schristos
4556a53f50b9SchristosThis has the benefit of using the kernel's attribute cache and thus
4557a53f50b9Schristosimproving performance.  The disadvantage with this option is that the
4558a53f50b9Schristoswindow of vulnerability is not eliminated entirely: it is only made
4559a53f50b9Schristossmaller.
4560a53f50b9Schristos
4561a53f50b9Schristos@end enumerate
4562a53f50b9Schristos
4563a53f50b9Schristos@c ----------------------------------------------------------------
4564a53f50b9Schristos@node auto_dir Parameter, cache_duration Parameter, auto_attrcache Parameter, Global Parameters
4565a53f50b9Schristos@comment  node-name,  next,  previous,  up
4566a53f50b9Schristos@subsection @t{auto_dir} Parameter
4567a53f50b9Schristos@cindex auto_dir Parameter
4568a53f50b9Schristos
4569a53f50b9Schristos(type=string, default=@samp{/a}).  Same as the @code{-a} option to @i{Amd}.
4570a53f50b9SchristosThis sets the private directory where @i{Amd} will create
4571a53f50b9Schristossub-directories for its real mount points.
4572a53f50b9Schristos
4573a53f50b9Schristos@c ----------------------------------------------------------------
4574a53f50b9Schristos@node cache_duration Parameter, cluster Parameter, auto_dir Parameter, Global Parameters
4575a53f50b9Schristos@comment  node-name,  next,  previous,  up
4576a53f50b9Schristos@subsection @t{cache_duration} Parameter
4577a53f50b9Schristos@cindex cache_duration Parameter
4578a53f50b9Schristos
4579a53f50b9Schristos(type=numeric, default=300).  Same as the @code{-c} option to @i{Amd}.
4580a53f50b9SchristosSets the duration in seconds that looked-up or mounted map entries
4581a53f50b9Schristosremain in the cache.
4582a53f50b9Schristos
4583a53f50b9Schristos@c ----------------------------------------------------------------
4584a53f50b9Schristos@node cluster Parameter, debug_mtab_file Parameter, cache_duration Parameter, Global Parameters
4585a53f50b9Schristos@comment  node-name,  next,  previous,  up
4586a53f50b9Schristos@subsection @t{cluster} Parameter
4587a53f50b9Schristos@cindex cluster Parameter
4588a53f50b9Schristos
4589a53f50b9Schristos(type=string, default no cluster).  Same as the @code{-C} option to
4590a53f50b9Schristos@i{Amd}.  Specifies the alternate HP-UX cluster to use.
4591a53f50b9Schristos
4592a53f50b9Schristos@c ----------------------------------------------------------------
4593a53f50b9Schristos@node debug_mtab_file Parameter, debug_options Parameter, cluster Parameter, Global Parameters
4594a53f50b9Schristos@comment  node-name,  next,  previous,  up
4595a53f50b9Schristos@subsection @t{debug_mtab_file} Parameter
4596a53f50b9Schristos@cindex debug_mtab_file Parameter
4597a53f50b9Schristos
4598a53f50b9Schristos(type=string, default="/tmp/mtab").  Path to mtab file that is used
4599a53f50b9Schristosby @i{Amd} to store a list of mounted file systems during debug-mtab mode.
4600a53f50b9SchristosThis option only applies to systems that store mtab information on disk.
4601a53f50b9Schristos
4602a53f50b9Schristos@c ----------------------------------------------------------------
4603a53f50b9Schristos@node debug_options Parameter, dismount_interval Parameter, debug_mtab_file Parameter, Global Parameters
4604a53f50b9Schristos@comment  node-name,  next,  previous,  up
4605a53f50b9Schristos@subsection @t{debug_options} Parameter
4606a53f50b9Schristos@cindex debug_options Parameter
4607a53f50b9Schristos
4608a53f50b9Schristos(type=string, default no debug options).  Same as the @code{-D} option
4609a53f50b9Schristosto @i{Amd}.  Specify any debugging options for @i{Amd}.  Works only if
4610a53f50b9Schristosam-utils was configured for debugging using the @code{--enable-debug}
4611a53f50b9Schristosoption.  The additional @samp{mem} option can be turned on via
4612a53f50b9Schristos@code{--enable-debug=mem}.  Otherwise debugging options are ignored.
4613a53f50b9SchristosOptions are comma delimited, and can be preceded by the string
4614a53f50b9Schristos@samp{no} to negate their meaning.  You can get the list of supported
4615a53f50b9Schristosdebugging and logging options by running @code{amd -H}.  Possible
4616a53f50b9Schristosvalues those listed for the -D option.  @xref{-D Option}.
4617a53f50b9Schristos
4618a53f50b9Schristos@c ----------------------------------------------------------------
4619a53f50b9Schristos@node dismount_interval Parameter, domain_strip Parameter, debug_options Parameter, Global Parameters
4620a53f50b9Schristos@comment  node-name,  next,  previous,  up
4621a53f50b9Schristos@subsection @t{dismount_interval} Parameter
4622a53f50b9Schristos@cindex dismount_interval Parameter
4623a53f50b9Schristos
4624a53f50b9Schristos(type=numeric, default=120).  Same as the @code{-w} option to
4625a53f50b9Schristos@i{Amd}.  Specify in seconds, the time between attempts to dismount file
4626a53f50b9Schristossystems that have exceeded their cached times.
4627a53f50b9Schristos
4628a53f50b9Schristos@c ----------------------------------------------------------------
4629a53f50b9Schristos@node domain_strip Parameter, exec_map_timeout Parameter, dismount_interval Parameter, Global Parameters
4630a53f50b9Schristos@comment  node-name,  next,  previous,  up
4631a53f50b9Schristos@subsection @t{domain_strip} Parameter
4632a53f50b9Schristos@cindex domain_strip Parameter
4633a53f50b9Schristos
4634a53f50b9Schristos(type=boolean, default=@samp{yes}).  If @samp{yes}, then the domain
4635a53f50b9Schristosname part referred to by @code{$@{rhost@}} is stripped off.  This is
4636a53f50b9Schristosuseful to keep logs and smaller.  If @samp{no}, then the domain name
4637a53f50b9Schristospart is left changed.  This is useful when using multiple domains with
4638a53f50b9Schristosthe same maps (as you may have hosts whose domain-stripped name is
4639a53f50b9Schristosidentical).
4640a53f50b9Schristos
4641a53f50b9Schristos@c ----------------------------------------------------------------
4642a53f50b9Schristos@node exec_map_timeout Parameter, forced_unmounts Parameter, domain_strip Parameter, Global Parameters
4643a53f50b9Schristos@comment  node-name,  next,  previous,  up
4644a53f50b9Schristos@subsection @t{exec_map_timeout} Parameter
4645a53f50b9Schristos@cindex exec_map_timeout Parameter
4646a53f50b9Schristos
4647a53f50b9Schristos(type=numeric, default=10).  The timeout in seconds that @i{Amd} will
4648a53f50b9Schristoswait for an executable map program before an answer is returned from
4649a53f50b9Schristosthat program (or script).  This value should be set to as small as
4650a53f50b9Schristospossible while still allowing normal replies to be returned before the
4651a53f50b9Schristostimer expires, because during the time that the executable map program
4652a53f50b9Schristosis queried, @i{Amd} is essentially waiting and is thus not responding
4653a53f50b9Schristosto any other queries.  @xref{Executable maps}.
4654a53f50b9Schristos
4655a53f50b9Schristos@c ----------------------------------------------------------------
4656a53f50b9Schristos@node forced_unmounts Parameter, full_os Parameter, exec_map_timeout Parameter, Global Parameters
4657a53f50b9Schristos@comment  node-name,  next,  previous,  up
4658a53f50b9Schristos@subsection @t{forced_unmounts} Parameter
4659a53f50b9Schristos@cindex forced_unmounts Parameter
4660a53f50b9Schristos
4661a53f50b9Schristos(type=boolean, default=@samp{no}).
4662a53f50b9SchristosSometimes, mount points are hung due to unrecoverable conditions, such
4663a53f50b9Schristosas when NFS servers migrate, change their IP address, are down
4664a53f50b9Schristospermanently, or due to hardware failures, and more.  In this case,
4665a53f50b9Schristosattempting to unmount an existing mount point, or even just to
4666a53f50b9Schristos@b{stat}(2) it, results in one of three fatal errors: EIO, ESTALE, or
4667a53f50b9SchristosEBUSY.  At that point, @i{Amd} can do little to recover that hung
4668a53f50b9Schristospoint (in fact, the OS cannot automatically recover either).  For that
4669a53f50b9Schristosreason, some OSs support special kinds of forced unmounts, which must
4670a53f50b9Schristosbe used very carefully: they will force an unmount immediately (or
4671a53f50b9Schristoslazily on Linux), which could result in application data loss.
4672a53f50b9SchristosHowever, that may be the only way to recover the entire host (without
4673a53f50b9Schristosrebooting).  Once a hung mount point is forced out, @i{Amd} can then
4674a53f50b9Schristosre-mount a replacement one (if available), bringing a mostly-hung
4675a53f50b9Schristossystem back to operation and avoiding a potentially costly reboot.
4676a53f50b9Schristos
4677a53f50b9SchristosIf the @samp{forced_unmounts} option is set to @samp{yes}, and the
4678a53f50b9Schristosclient OS supports forced or lazy unmounts, then @i{Amd} will attempt
4679a53f50b9Schristosto use them if it gets any of the three serious error conditions
4680a53f50b9Schristoslisted above.  Note that @i{Amd} will force the unmount of mount
4681a53f50b9Schristospoints that returned EBUSY only for @samp{type:=toplvl} mounts
4682a53f50b9Schristos(@pxref{Top-level Filesystem}): that is, @i{Amd}'s own mount points.
4683a53f50b9SchristosThis is useful to recover from a previously hung @i{Amd}, and to
4684a53f50b9Schristosensure that an existing @i{Amd} can shutdown cleanly even if some
4685a53f50b9Schristosprocesses are keeping its mount points busy (i.e., when a user's shell
4686a53f50b9Schristosprocess uses @code{cd} to set its CWD to @i{Amd}'s own mount point).
4687a53f50b9Schristos
4688a53f50b9SchristosIf this option is set to @samp{no} (the default), then @i{Amd} will
4689a53f50b9Schristosnot attempt this special recovery procedure.
4690a53f50b9Schristos
4691a53f50b9Schristos@c ----------------------------------------------------------------
4692a53f50b9Schristos@node full_os Parameter, fully_qualified_hosts Parameter, forced_unmounts Parameter, Global Parameters
4693a53f50b9Schristos@comment  node-name,  next,  previous,  up
4694a53f50b9Schristos@subsection @t{full_os} Parameter
4695a53f50b9Schristos@cindex full_os Parameter
4696a53f50b9Schristos
4697a53f50b9Schristos(type=string, default to compiled in value).  The full name of the
4698a53f50b9Schristosoperating system, along with its version.  Allows you to override the
4699a53f50b9Schristoscompiled-in full name and version of the operating system.  Useful when
4700a53f50b9Schristosthe compiled-in name is not desired.  For example, the full operating
4701a53f50b9Schristossystem name on linux comes up as @samp{linux}, but you can override it
4702a53f50b9Schristosto @samp{linux-2.2.5}.
4703a53f50b9Schristos
4704a53f50b9Schristos@c ----------------------------------------------------------------
4705a53f50b9Schristos@node fully_qualified_hosts Parameter, hesiod_base Parameter, full_os Parameter, Global Parameters
4706a53f50b9Schristos@comment  node-name,  next,  previous,  up
4707a53f50b9Schristos@subsection @t{fully_qualified_hosts} Parameter
4708a53f50b9Schristos@cindex fully_qualified_hosts Parameter
4709a53f50b9Schristos
4710a53f50b9Schristos(type=string, default=@samp{no}).  If @samp{yes}, @i{Amd} will perform RPC
4711a53f50b9Schristosauthentication using fully-qualified host names.  This is necessary for
4712a53f50b9Schristossome systems, and especially when performing cross-domain mounting.  For
4713a53f50b9Schristosthis function to work, the @i{Amd} variable @samp{$@{hostd@}} is used,
4714a53f50b9Schristosrequiring that @samp{$@{domain@}} not be null.
4715a53f50b9Schristos
4716a53f50b9Schristos@c ----------------------------------------------------------------
4717a53f50b9Schristos@node hesiod_base Parameter, karch Parameter, fully_qualified_hosts Parameter, Global Parameters
4718a53f50b9Schristos@comment  node-name,  next,  previous,  up
4719a53f50b9Schristos@subsection @t{hesiod_base} Parameter
4720a53f50b9Schristos@cindex hesiod_base Parameter
4721a53f50b9Schristos
4722a53f50b9Schristos(type=string, default=@samp{automount}).  Specify the base name for
4723a53f50b9Schristoshesiod maps.
4724a53f50b9Schristos
4725a53f50b9Schristos@c ----------------------------------------------------------------
4726a53f50b9Schristos@node karch Parameter, ldap_base Parameter, hesiod_base Parameter, Global Parameters
4727a53f50b9Schristos@comment  node-name,  next,  previous,  up
4728a53f50b9Schristos@subsection @t{karch} Parameter
4729a53f50b9Schristos@cindex karch Parameter
4730a53f50b9Schristos
4731a53f50b9Schristos(type=string, default to karch of the system).  Same as the @code{-k}
4732a53f50b9Schristosoption to @i{Amd}.  Allows you to override the kernel-architecture of
4733a53f50b9Schristosyour system.  Useful for example on Sun (Sparc) machines, where you can
4734a53f50b9Schristosbuild one @i{Amd} binary, and run it on multiple machines, yet you want
4735a53f50b9Schristoseach one to get the correct @i{karch} variable set (for example, sun4c,
4736a53f50b9Schristossun4m, sun4u, etc.)  Note that if not specified, @i{Amd} will use
4737a53f50b9Schristos@b{uname}(2) to figure out the kernel architecture of the machine.
4738a53f50b9Schristos
4739a53f50b9Schristos@c ----------------------------------------------------------------
4740a53f50b9Schristos@node ldap_base Parameter, ldap_cache_maxmem Parameter, karch Parameter, Global Parameters
4741a53f50b9Schristos@comment  node-name,  next,  previous,  up
4742a53f50b9Schristos@subsection @t{ldap_base} Parameter
4743a53f50b9Schristos@cindex ldap_base Parameter
4744a53f50b9Schristos
4745a53f50b9Schristos(type=string, default not set).
4746a53f50b9SchristosSpecify the base name for LDAP.  This often includes LDAP-specific
4747a53f50b9Schristosvalues such as country and organization.
4748a53f50b9Schristos
4749a53f50b9Schristos@c ----------------------------------------------------------------
4750a53f50b9Schristos@node ldap_cache_maxmem Parameter, ldap_cache_seconds Parameter, ldap_base Parameter, Global Parameters
4751a53f50b9Schristos@comment  node-name,  next,  previous,  up
4752a53f50b9Schristos@subsection @t{ldap_cache_maxmem} Parameter
4753a53f50b9Schristos@cindex ldap_cache_maxmem Parameter
4754a53f50b9Schristos
4755a53f50b9Schristos(type=numeric, default=131072).  Specify the maximum memory @i{Amd}
4756a53f50b9Schristosshould use to cache LDAP entries.
4757a53f50b9Schristos
4758a53f50b9Schristos@c ----------------------------------------------------------------
4759a53f50b9Schristos@node ldap_cache_seconds Parameter, ldap_hostports Parameter, ldap_cache_maxmem Parameter, Global Parameters
4760a53f50b9Schristos@comment  node-name,  next,  previous,  up
4761a53f50b9Schristos@subsection @t{ldap_cache_seconds} Parameter
4762a53f50b9Schristos@cindex ldap_cache_seconds Parameter
4763a53f50b9Schristos
4764a53f50b9Schristos(type=numeric, default=0).  Specify the number of seconds to keep
4765a53f50b9Schristosentries in the cache.
4766a53f50b9Schristos
4767a53f50b9Schristos@c ----------------------------------------------------------------
4768a53f50b9Schristos@node ldap_hostports Parameter, ldap_proto_version Parameter, ldap_cache_seconds Parameter, Global Parameters
4769a53f50b9Schristos@comment  node-name,  next,  previous,  up
4770a53f50b9Schristos@subsection @t{ldap_hostports} Parameter
4771a53f50b9Schristos@cindex ldap_hostports Parameter
4772a53f50b9Schristos
4773a53f50b9Schristos(type=string, default not set).
4774a53f50b9SchristosSpecify the LDAP host and port values.
4775a53f50b9Schristos
4776a53f50b9Schristos@c ----------------------------------------------------------------
4777a53f50b9Schristos@node ldap_proto_version Parameter, local_domain Parameter, ldap_hostports Parameter, Global Parameters
4778a53f50b9Schristos@comment  node-name,  next,  previous,  up
4779a53f50b9Schristos@subsection @t{ldap_proto_version} Parameter
4780a53f50b9Schristos@cindex ldap_proto_version Parameter
4781a53f50b9Schristos
4782a53f50b9Schristos(type=numeric, default=2).  Specify the LDAP protocol version to use.
4783a53f50b9SchristosWith a value of 3 will use LDAPv3 protocol.
4784a53f50b9Schristos
4785a53f50b9Schristos@c ----------------------------------------------------------------
4786a53f50b9Schristos@node local_domain Parameter, localhost_address Parameter, ldap_proto_version Parameter, Global Parameters
4787a53f50b9Schristos@comment  node-name,  next,  previous,  up
4788a53f50b9Schristos@subsection @t{local_domain} Parameter
4789a53f50b9Schristos@cindex local_domain Parameter
4790a53f50b9Schristos
4791a53f50b9Schristos(type=string, default no sub-domain).  Same as the @code{-d} option
4792a53f50b9Schristosto @i{Amd}.  Specify the local domain name.  If this option is not given
4793a53f50b9Schristosthe domain name is determined from the hostname, by removing the first
4794a53f50b9Schristoscomponent of the fully-qualified host name.
4795a53f50b9Schristos
4796a53f50b9Schristos@c ----------------------------------------------------------------
4797a53f50b9Schristos@node localhost_address Parameter, log_file Parameter, local_domain Parameter, Global Parameters
4798a53f50b9Schristos@comment  node-name,  next,  previous,  up
4799a53f50b9Schristos@subsection @t{localhost_address} Parameter
4800a53f50b9Schristos@cindex localhost_address Parameter
4801a53f50b9Schristos
4802a53f50b9Schristos(type=string, default to localhost or 127.0.0.1).  Specify the name or
4803a53f50b9SchristosIP address for @i{Amd} to use when connecting the sockets for the
4804a53f50b9Schristoslocal NFS server and the RPC server.  This defaults to 127.0.0.1 or
4805a53f50b9Schristoswhatever the host reports as its local address.  This parameter is
4806a53f50b9Schristosuseful on hosts with multiple addresses where you want to force
4807a53f50b9Schristos@i{Amd} to connect to a specific address.
4808a53f50b9Schristos
4809a53f50b9Schristos@c ----------------------------------------------------------------
4810a53f50b9Schristos@node log_file Parameter, log_options Parameter, localhost_address Parameter, Global Parameters
4811a53f50b9Schristos@comment  node-name,  next,  previous,  up
4812a53f50b9Schristos@subsection @t{log_file} Parameter
4813a53f50b9Schristos@cindex log_file Parameter
4814a53f50b9Schristos
4815a53f50b9Schristos(type=string, default=@samp{stderr}).  Same as the @code{-l} option to
4816a53f50b9Schristos@i{Amd}.  Specify a file name to log @i{Amd} events to.
4817a53f50b9SchristosIf the string @samp{/dev/stderr} is specified,
4818a53f50b9Schristos@i{Amd} will send its events to the standard error file descriptor.
4819a53f50b9Schristos
4820a53f50b9SchristosIf the string @samp{syslog} is given, @i{Amd} will record its events
4821a53f50b9Schristoswith the system logger @b{syslogd}(8).  If your system supports syslog
4822a53f50b9Schristosfacilities, then the default facility used is @samp{LOG_DAEMON}.
4823a53f50b9Schristos
4824a53f50b9SchristosWhen using syslog, if you wish to change the facility, append its name
4825a53f50b9Schristosto the option name, delimited by a single colon.  For example, if it is
4826a53f50b9Schristosthe string @samp{syslog:local7} then @i{Amd} will log messages via
4827a53f50b9Schristos@b{syslog}(3) using the @samp{LOG_LOCAL7} facility.  If the facility
4828a53f50b9Schristosname specified is not recognized, @i{Amd} will default to @samp{LOG_DAEMON}.
4829a53f50b9SchristosNote: while you can use any syslog facility available on your system, it
4830a53f50b9Schristosis generally a bad idea to use those reserved for other services such as
4831a53f50b9Schristos@samp{kern}, @samp{lpr}, @samp{cron}, etc.
4832a53f50b9Schristos
4833a53f50b9Schristos@c ----------------------------------------------------------------
4834a53f50b9Schristos@node log_options Parameter, map_reload_interval Parameter, log_file Parameter, Global Parameters
4835a53f50b9Schristos@comment  node-name,  next,  previous,  up
4836a53f50b9Schristos@subsection @t{log_options} Parameter
4837a53f50b9Schristos@cindex log_options Parameter
4838a53f50b9Schristos
4839a53f50b9Schristos(type=string, default=``defaults'').  Same as the @code{-x}
4840a53f50b9Schristosoption to @i{Amd}.  Specify any logging options for @i{Amd}.  Options
4841a53f50b9Schristosare comma delimited, and can be preceded by the string @samp{no} to
4842a53f50b9Schristosnegate their meaning.  The @samp{debug} logging option is only available
4843a53f50b9Schristosif am-utils was configured with @code{--enable-debug}.  You can get the
4844a53f50b9Schristoslist of supported debugging options by running @code{amd -H}.  Possible
4845a53f50b9Schristosvalues are:
4846a53f50b9Schristos
4847a53f50b9Schristos@table @samp
4848a53f50b9Schristos@item all
4849a53f50b9Schristosall messages
4850a53f50b9Schristos@item defaults
4851a53f50b9Schristosan alias for "fatal,error,user,warning,info"
4852a53f50b9Schristos@item debug
4853a53f50b9Schristosdebug messages
4854a53f50b9Schristos@item error
4855a53f50b9Schristosnon-fatal system errors (cannot be turned off)
4856a53f50b9Schristos@item fatal
4857a53f50b9Schristosfatal errors (cannot be turned off)
4858a53f50b9Schristos@item info
4859a53f50b9Schristosinformation
4860a53f50b9Schristos@item map
4861a53f50b9Schristosmap errors
4862a53f50b9Schristos@item stats
4863a53f50b9Schristosadditional statistical information
4864a53f50b9Schristos@item user
4865a53f50b9Schristosnon-fatal user errors
4866a53f50b9Schristos@item warn
4867a53f50b9Schristoswarnings
4868a53f50b9Schristos@item warning
4869a53f50b9Schristoswarnings
4870a53f50b9Schristos@end table
4871a53f50b9Schristos
4872a53f50b9Schristos@c ----------------------------------------------------------------
4873a53f50b9Schristos@node map_reload_interval Parameter, nfs_allow_any_interface Parameter, log_options Parameter, Global Parameters
4874a53f50b9Schristos@comment  node-name,  next,  previous,  up
4875a53f50b9Schristos@subsection @t{map_reload_interval} Parameter
4876a53f50b9Schristos@cindex map_reload_interval Parameter
4877a53f50b9Schristos
4878a53f50b9Schristos(type=numeric, default=3600).  The number of seconds that @i{Amd} will
4879a53f50b9Schristoswait before it checks to see if any maps have changed at their source
4880a53f50b9Schristos(NIS servers, LDAP servers, files, etc.).  @i{Amd} will reload only
4881a53f50b9Schristosthose maps that have changed.
4882a53f50b9Schristos
4883a53f50b9Schristos@c ----------------------------------------------------------------
4884a53f50b9Schristos@node nfs_allow_any_interface Parameter, nfs_allow_insecure_port Parameter, map_reload_interval Parameter, Global Parameters
4885a53f50b9Schristos@comment  node-name,  next,  previous,  up
4886a53f50b9Schristos@subsection @t{nfs_allow_any_interface} Parameter
4887a53f50b9Schristos@cindex nfs_allow_any_interface Parameter
4888a53f50b9Schristos
4889a53f50b9Schristos(type=string, default=@samp{no}).  Normally @i{Amd} accepts local NFS
4890a53f50b9Schristospackets only from 127.0.0.1.  If this parameter is set to @samp{yes},
4891a53f50b9Schristosthen @i{amd} will accept local NFS packets from any local interface;
4892a53f50b9Schristosthis is useful on hosts that may have multiple interfaces where the
4893a53f50b9Schristossystem is forced to send all outgoing packets (even those bound to the
4894a53f50b9Schristossame host) via an address other than 127.0.0.1.
4895a53f50b9Schristos
4896a53f50b9Schristos@c ----------------------------------------------------------------
4897a53f50b9Schristos@node nfs_allow_insecure_port Parameter, nfs_proto Parameter, nfs_allow_any_interface Parameter, Global Parameters
4898a53f50b9Schristos@comment  node-name,  next,  previous,  up
4899a53f50b9Schristos@subsection @t{nfs_allow_insecure_port} Parameter
4900a53f50b9Schristos@cindex nfs_allow_insecure_port Parameter
4901a53f50b9Schristos
4902a53f50b9Schristos(type=string, default=@samp{no}).  Normally @i{Amd} will refuse requests
4903a53f50b9Schristoscoming from unprivileged ports (i.e., ports >= 1024 on Unix systems),
4904a53f50b9Schristosso that only privileged users and the kernel can send NFS requests to
4905a53f50b9Schristosit.  However, some kernels (certain versions of Darwin, MacOS X, and
4906a53f50b9SchristosLinux) have bugs that cause them to use unprivileged ports in certain
4907a53f50b9Schristossituations, which causes @i{Amd} to stop dead in its tracks.  This
4908a53f50b9Schristosparameter allows @i{Amd} to operate normally even on such systems, at the
4909a53f50b9Schristosexpense of a slight decrease in the security of its operations.  If
4910a53f50b9Schristosyou see messages like ``ignoring request from foo:1234, port not
4911a53f50b9Schristosreserved'' in your @i{Amd} log, try enabling this parameter and give it
4912a53f50b9Schristosanother go.
4913a53f50b9Schristos
4914a53f50b9Schristos@c ----------------------------------------------------------------
4915a53f50b9Schristos@node nfs_proto Parameter, nfs_retransmit_counter Parameter, nfs_allow_insecure_port Parameter, Global Parameters
4916a53f50b9Schristos@comment  node-name,  next,  previous,  up
4917a53f50b9Schristos@subsection @t{nfs_proto} Parameter
4918a53f50b9Schristos@cindex nfs_proto Parameter
4919a53f50b9Schristos
4920a53f50b9Schristos(type=string, default to trying version tcp then udp).  By default,
4921a53f50b9Schristos@i{Amd} tries @code{tcp} and then @code{udp}.  This option forces the
4922a53f50b9Schristosoverall NFS protocol used to TCP or UDP.  It overrides what is in the
4923a53f50b9Schristos@i{Amd} maps, and is useful when @i{Amd} is compiled with TCP support
4924a53f50b9Schristosin NFSv2/NFSv3 that may not be stable.  With this option you can turn
4925a53f50b9Schristosoff the complete usage of TCP for NFS dynamically (without having to
4926a53f50b9Schristosrecompile @i{Amd}), and use UDP only, until such time as TCP support
4927a53f50b9Schristosis desired again.
4928a53f50b9Schristos
4929a53f50b9Schristos@c ----------------------------------------------------------------
4930a53f50b9Schristos@node nfs_retransmit_counter Parameter, nfs_retransmit_counter_udp Parameter, nfs_proto Parameter, Global Parameters
4931a53f50b9Schristos@comment  node-name,  next,  previous,  up
4932a53f50b9Schristos@subsection @t{nfs_retransmit_counter} Parameter
4933a53f50b9Schristos@cindex nfs_retransmit_counter Parameter
4934a53f50b9Schristos
4935a53f50b9Schristos(type=numeric, default=11).  Same as the @i{retransmit} part of the
4936a53f50b9Schristos@code{-t} @i{timeout.retransmit} option to @i{Amd}.  Specifies the
4937a53f50b9Schristosnumber of NFS retransmissions that the kernel will use to communicate
4938a53f50b9Schristoswith @i{Amd} using either UDP or TCP mounts.  @xref{-t Option}.
4939a53f50b9Schristos
4940a53f50b9Schristos@c ----------------------------------------------------------------
4941a53f50b9Schristos@node nfs_retransmit_counter_udp Parameter, nfs_retransmit_counter_tcp Parameter, nfs_retransmit_counter Parameter, Global Parameters
4942a53f50b9Schristos@comment  node-name,  next,  previous,  up
4943a53f50b9Schristos@subsection @t{nfs_retransmit_counter_udp} Parameter
4944a53f50b9Schristos@cindex nfs_retransmit_counter_udp Parameter
4945a53f50b9Schristos@cindex nfs_retransmit_counter Parameter
4946a53f50b9Schristos@cindex UDP
4947a53f50b9Schristos
4948a53f50b9Schristos(type=numeric, default=11).  Same as the @i{nfs_retransmit_counter}
4949a53f50b9Schristosparameter, but applied globally only to UDP mounts.
4950a53f50b9Schristos@xref{nfs_retransmit_counter Parameter}.
4951a53f50b9Schristos
4952a53f50b9Schristos@c ----------------------------------------------------------------
4953a53f50b9Schristos@node nfs_retransmit_counter_tcp Parameter, nfs_retransmit_counter_toplvl Parameter, nfs_retransmit_counter_udp Parameter, Global Parameters
4954a53f50b9Schristos@comment  node-name,  next,  previous,  up
4955a53f50b9Schristos@subsection @t{nfs_retransmit_counter_tcp} Parameter
4956a53f50b9Schristos@cindex nfs_retransmit_counter_tcp Parameter
4957a53f50b9Schristos@cindex nfs_retransmit_counter Parameter
4958a53f50b9Schristos@cindex TCP
4959a53f50b9Schristos
4960a53f50b9Schristos(type=numeric, default=11).  Same as the @i{nfs_retransmit_counter}
4961a53f50b9Schristosparameter, but applied globally only to TCP mounts.
4962a53f50b9Schristos@xref{nfs_retransmit_counter Parameter}.
4963a53f50b9Schristos
4964a53f50b9Schristos@c ----------------------------------------------------------------
4965a53f50b9Schristos@node nfs_retransmit_counter_toplvl Parameter, nfs_retry_interval Parameter, nfs_retransmit_counter_tcp Parameter, Global Parameters
4966a53f50b9Schristos@comment  node-name,  next,  previous,  up
4967a53f50b9Schristos@subsection @t{nfs_retransmit_counter_toplvl} Parameter
4968a53f50b9Schristos@cindex nfs_retransmit_counter_toplvl Parameter
4969a53f50b9Schristos@cindex nfs_retransmit_counter Parameter
4970a53f50b9Schristos@cindex UDP
4971a53f50b9Schristos
4972a53f50b9Schristos(type=numeric, default=11).  Same as the @i{nfs_retransmit_counter}
4973a53f50b9Schristosparameter, applied only for @i{Amd}'s top-level UDP mounts.  On some
4974a53f50b9Schristossystems it is useful to set this differently than the OS default, so
4975a53f50b9Schristosas to better tune @i{Amd}'s responsiveness under heavy scheduler
4976a53f50b9Schristosloads.  @xref{nfs_retransmit_counter Parameter}.
4977a53f50b9Schristos
4978a53f50b9Schristos@c ----------------------------------------------------------------
4979a53f50b9Schristos@node nfs_retry_interval Parameter, nfs_retry_interval_udp Parameter, nfs_retransmit_counter_toplvl Parameter, Global Parameters
4980a53f50b9Schristos@comment  node-name,  next,  previous,  up
4981a53f50b9Schristos@subsection @t{nfs_retry_interval} Parameter
4982a53f50b9Schristos@cindex nfs_retry_interval Parameter
4983a53f50b9Schristos
4984a53f50b9Schristos(type=numeric, default=8).  Same as the @i{timeout} part of the
4985a53f50b9Schristos@code{-t} @i{timeout.retransmit} option to @i{Amd}.  Specifies the NFS
4986a53f50b9Schristostimeout interval, in @emph{tenths} of seconds, between NFS/RPC retries
4987a53f50b9Schristos(for UDP or TCP).  This is the value that the kernel will use to
4988a53f50b9Schristoscommunicate with @i{Amd}.  @xref{-t Option}.
4989a53f50b9Schristos
4990a53f50b9Schristos@i{Amd} relies on the kernel RPC retransmit mechanism to trigger mount
4991a53f50b9Schristosretries.  The values of the @i{nfs_retransmit_counter} and the
4992a53f50b9Schristos@i{nfs_retry_interval} parameters change the overall retry interval.
4993a53f50b9SchristosToo long an interval gives poor interactive response; too short an
4994a53f50b9Schristosinterval causes excessive retries.
4995a53f50b9Schristos
4996a53f50b9Schristos@c ----------------------------------------------------------------
4997a53f50b9Schristos@node nfs_retry_interval_udp Parameter, nfs_retry_interval_tcp Parameter, nfs_retry_interval Parameter, Global Parameters
4998a53f50b9Schristos@comment  node-name,  next,  previous,  up
4999a53f50b9Schristos@subsection @t{nfs_retry_interval_udp} Parameter
5000a53f50b9Schristos@cindex nfs_retry_interval_udp Parameter
5001a53f50b9Schristos@cindex nfs_retry_interval Parameter
5002a53f50b9Schristos@cindex UDP
5003a53f50b9Schristos
5004a53f50b9Schristos(type=numeric, default=8).  Same as the @i{nfs_retry_interval}
5005a53f50b9Schristosparameter, but applied globally only to UDP mounts.
5006a53f50b9Schristos@xref{nfs_retry_interval Parameter}.
5007a53f50b9Schristos
5008a53f50b9Schristos@c ----------------------------------------------------------------
5009a53f50b9Schristos@node nfs_retry_interval_tcp Parameter, nfs_retry_interval_toplvl Parameter, nfs_retry_interval_udp Parameter, Global Parameters
5010a53f50b9Schristos@comment  node-name,  next,  previous,  up
5011a53f50b9Schristos@subsection @t{nfs_retry_interval_tcp} Parameter
5012a53f50b9Schristos@cindex nfs_retry_interval_tcp Parameter
5013a53f50b9Schristos@cindex nfs_retry_interval Parameter
5014a53f50b9Schristos@cindex TCP
5015a53f50b9Schristos
5016a53f50b9Schristos(type=numeric, default=8).  Same as the @i{nfs_retry_interval}
5017a53f50b9Schristosparameter, but applied globally only to TCP mounts.
5018a53f50b9Schristos@xref{nfs_retry_interval Parameter}.
5019a53f50b9Schristos
5020a53f50b9Schristos@c ----------------------------------------------------------------
5021a53f50b9Schristos@node nfs_retry_interval_toplvl Parameter, nfs_vers Parameter, nfs_retry_interval_tcp Parameter, Global Parameters
5022a53f50b9Schristos@comment  node-name,  next,  previous,  up
5023a53f50b9Schristos@subsection @t{nfs_retry_interval_toplvl} Parameter
5024a53f50b9Schristos@cindex nfs_retry_interval_toplvl Parameter
5025a53f50b9Schristos@cindex nfs_retry_interval Parameter
5026a53f50b9Schristos@cindex UDP
5027a53f50b9Schristos
5028a53f50b9Schristos(type=numeric, default=8).  Same as the @i{nfs_retry_interval}
5029a53f50b9Schristosparameter, applied only for @i{Amd}'s top-level UDP mounts.  On some
5030a53f50b9Schristossystems it is useful to set this differently than the OS default, so
5031a53f50b9Schristosas to better tune @i{Amd}'s responsiveness under heavy scheduler
5032a53f50b9Schristosloads.  @xref{nfs_retry_interval Parameter}.
5033a53f50b9Schristos
5034a53f50b9Schristos@c ----------------------------------------------------------------
5035a53f50b9Schristos@node nfs_vers Parameter, nis_domain Parameter, nfs_retry_interval_toplvl Parameter, Global Parameters
5036a53f50b9Schristos@comment  node-name,  next,  previous,  up
5037a53f50b9Schristos@subsection @t{nfs_vers} Parameter
5038a53f50b9Schristos@cindex nfs_vers Parameter
5039a53f50b9Schristos
5040a53f50b9Schristos(type=numeric, default to trying version 3 then 2).  By default,
5041a53f50b9Schristos@i{Amd} tries version 3 and then version 2.  This option forces the
5042a53f50b9Schristosoverall NFS protocol used to version 3 or 2.  It overrides what is in
5043a53f50b9Schristosthe @i{Amd} maps, and is useful when @i{Amd} is compiled with NFSv3
5044a53f50b9Schristossupport that may not be stable.  With this option you can turn off the
5045a53f50b9Schristoscomplete usage of NFSv3 dynamically (without having to recompile
5046a53f50b9Schristos@i{Amd}), and use NFSv2 only, until such time as NFSv3 support is
5047a53f50b9Schristosdesired again.
5048a53f50b9Schristos
5049a53f50b9Schristos@c ----------------------------------------------------------------
5050a53f50b9Schristos@node nis_domain Parameter, normalize_hostnames Parameter, nfs_vers Parameter, Global Parameters
5051a53f50b9Schristos@comment  node-name,  next,  previous,  up
5052a53f50b9Schristos@subsection @t{nis_domain} Parameter
5053a53f50b9Schristos@cindex nis_domain Parameter
5054a53f50b9Schristos
5055a53f50b9Schristos(type=string, default to local NIS domain name).  Same as the
5056a53f50b9Schristos@code{-y} option to @i{Amd}.  Specify an alternative NIS domain from
5057a53f50b9Schristoswhich to fetch the NIS maps.  The default is the system domain name.
5058a53f50b9SchristosThis option is ignored if NIS support is not available.
5059a53f50b9Schristos
5060a53f50b9Schristos@c ----------------------------------------------------------------
5061a53f50b9Schristos@node normalize_hostnames Parameter, normalize_slashes Parameter, nis_domain Parameter, Global Parameters
5062a53f50b9Schristos@comment  node-name,  next,  previous,  up
5063a53f50b9Schristos@subsection @t{normalize_hostnames} Parameter
5064a53f50b9Schristos@cindex normalize_hostnames Parameter
5065a53f50b9Schristos
5066a53f50b9Schristos(type=boolean, default=@samp{no}).  Same as the @code{-n} option to @i{Amd}.
5067a53f50b9SchristosIf @samp{yes}, then the name referred to by @code{$@{rhost@}} is normalized
5068a53f50b9Schristosrelative to the host database before being used.  The effect is to
5069a53f50b9Schristostranslate aliases into ``official'' names.
5070a53f50b9Schristos
5071a53f50b9Schristos@c ----------------------------------------------------------------
5072a53f50b9Schristos@node normalize_slashes Parameter, os Parameter, normalize_hostnames Parameter, Global Parameters
5073a53f50b9Schristos@comment  node-name,  next,  previous,  up
5074a53f50b9Schristos@subsection @t{normalize_slashes} Parameter
5075a53f50b9Schristos@cindex normalize_slashes Parameter
5076a53f50b9Schristos
5077a53f50b9Schristos(type=boolean, default=@samp{yes}).  If @samp{yes} then amd will
5078a53f50b9Schristoscondense all multiple @code{/} (slash) characters into one and remove
5079a53f50b9Schristosall trailing slashes.  If @samp{no}, then amd will not touch strings
5080a53f50b9Schristosthat may contain repeated or trailing slashes.  The latter is
5081a53f50b9Schristossometimes useful with SMB mounts, which often require multiple slash
5082a53f50b9Schristoscharacters in pathnames.
5083a53f50b9Schristos
5084a53f50b9Schristos@c ----------------------------------------------------------------
5085a53f50b9Schristos@node os Parameter, osver Parameter, normalize_slashes Parameter, Global Parameters
5086a53f50b9Schristos@comment  node-name,  next,  previous,  up
5087a53f50b9Schristos@subsection @t{os} Parameter
5088a53f50b9Schristos@cindex os Parameter
5089a53f50b9Schristos
5090a53f50b9Schristos(type=string, default to compiled in value).  Same as the @code{-O}
5091a53f50b9Schristosoption to @i{Amd}.  Allows you to override the compiled-in name of the
5092a53f50b9Schristosoperating system.  Useful when the built-in name is not desired for
5093a53f50b9Schristosbackward compatibility reasons.  For example, if the built-in name is
5094a53f50b9Schristos@samp{sunos5}, you can override it to @samp{sos5}, and use older maps
5095a53f50b9Schristoswhich were written with the latter in mind.
5096a53f50b9Schristos
5097a53f50b9Schristos
5098a53f50b9Schristos@c ----------------------------------------------------------------
5099a53f50b9Schristos@node osver Parameter, pid_file Parameter, os Parameter, Global Parameters
5100a53f50b9Schristos@comment  node-name,  next,  previous,  up
5101a53f50b9Schristos@subsection @t{osver} Parameter
5102a53f50b9Schristos@cindex osver Parameter
5103a53f50b9Schristos
5104a53f50b9Schristos(type=string, default to compiled in value).  Same as the @code{-o}
5105a53f50b9Schristosoption to @i{Amd}.  Allows you to override the compiled-in version
5106a53f50b9Schristosnumber of the operating system.  Useful when the built-in version is not
5107a53f50b9Schristosdesired for backward compatibility reasons.  For example, if the build
5108a53f50b9Schristosin version is @samp{2.5.1}, you can override it to @samp{5.5.1}, and use
5109a53f50b9Schristosolder maps that were written with the latter in mind.
5110a53f50b9Schristos
5111a53f50b9Schristos@c ----------------------------------------------------------------
5112a53f50b9Schristos@node pid_file Parameter, plock Parameter, osver Parameter, Global Parameters
5113a53f50b9Schristos@comment  node-name,  next,  previous,  up
5114a53f50b9Schristos@subsection @t{pid_file} Parameter
5115a53f50b9Schristos@cindex pid_file Parameter
5116a53f50b9Schristos
5117a53f50b9Schristos(type=string, default=@samp{/dev/stdout}).  Specify a file to store the process
5118a53f50b9SchristosID of the running daemon into.  If not specified, @i{Amd} will print its
5119a53f50b9Schristosprocess id onto the standard output.  Useful for killing @i{Amd} after
5120a53f50b9Schristosit had run.  Note that the PID of a running @i{Amd} can also be
5121a53f50b9Schristosretrieved via @i{Amq} (@pxref{Amq -p option}).
5122a53f50b9Schristos
5123a53f50b9SchristosThis file is used only if the @samp{print_pid} option is on
5124a53f50b9Schristos(@pxref{print_pid Parameter}).
5125a53f50b9Schristos
5126a53f50b9Schristos@c ----------------------------------------------------------------
5127a53f50b9Schristos@node plock Parameter, portmap_program Parameter, pid_file Parameter, Global Parameters
5128a53f50b9Schristos@comment  node-name,  next,  previous,  up
5129a53f50b9Schristos@subsection @t{plock} Parameter
5130a53f50b9Schristos@cindex plock Parameter
5131a53f50b9Schristos
5132a53f50b9Schristos(type=boolean, default=@samp{yes}).  Same as the @code{-S} option to @i{Amd}.
5133a53f50b9SchristosIf @samp{yes}, lock the running executable pages of @i{Amd} into memory.
5134a53f50b9SchristosTo improve @i{Amd}'s performance, systems that support the @b{plock}(3)
5135a53f50b9Schristosor @b{mlockall}(2)
5136a53f50b9Schristoscall can lock the @i{Amd} process into memory.  This way there is less
5137a53f50b9Schristoschance the operating system will schedule, page out, and swap the
5138a53f50b9Schristos@i{Amd} process as needed.  This improves @i{Amd}'s performance, at the
5139a53f50b9Schristoscost of reserving the memory used by the @i{Amd} process (making it
5140a53f50b9Schristosunavailable for other processes).
5141a53f50b9Schristos
5142a53f50b9Schristos@c ----------------------------------------------------------------
5143a53f50b9Schristos@node portmap_program Parameter, preferred_amq_port Parameter, plock Parameter, Global Parameters
5144a53f50b9Schristos@comment  node-name,  next,  previous,  up
5145a53f50b9Schristos@subsection @t{portmap_program} Parameter
5146a53f50b9Schristos@cindex portmap_program Parameter
5147a53f50b9Schristos
5148a53f50b9Schristos(type=numeric, default=300019).  Specify an alternate Port-mapper RPC
5149a53f50b9Schristosprogram number, other than the official number.  This is useful when
5150a53f50b9Schristosrunning multiple @i{Amd} processes.  For example, you can run another
5151a53f50b9Schristos@i{Amd} in ``test'' mode, without affecting the primary @i{Amd} process
5152a53f50b9Schristosin any way.  For safety reasons, the alternate program numbers that can
5153a53f50b9Schristosbe specified must be in the range 300019-300029, inclusive.  @i{Amq} has
5154a53f50b9Schristosan option @code{-P} which can be used to specify an alternate program
5155a53f50b9Schristosnumber of an @i{Amd} to contact.  In this way, amq can fully control any
5156a53f50b9Schristosnumber of @i{Amd} processes running on the same host.
5157a53f50b9Schristos
5158a53f50b9Schristos@c ----------------------------------------------------------------
5159a53f50b9Schristos@node preferred_amq_port Parameter, print_pid Parameter, portmap_program Parameter, Global Parameters
5160a53f50b9Schristos@comment  node-name,  next,  previous,  up
5161a53f50b9Schristos@subsection @t{preferred_amq_port} Parameter
5162a53f50b9Schristos@cindex preferred_amq_port Parameter
5163a53f50b9Schristos
5164a53f50b9Schristos(type=numeric, default=0).  Specify an alternate Port-mapper RPC port
5165a53f50b9Schristosnumber for @i{Amd}'s @i{Amq} service.  This is used for both UDP and
5166a53f50b9SchristosTCP.  Setting this value to 0 (or not defining it) will cause @i{Amd}
5167a53f50b9Schristosto select an arbitrary port number.  Setting the @i{Amq} RPC service
5168a53f50b9Schristosport to a specific number is useful in firewalled or NAT'ed
5169a53f50b9Schristosenvironments, where you need to know which port @i{Amd} will listen
5170a53f50b9Schristoson.
5171a53f50b9Schristos
5172a53f50b9Schristos@c ----------------------------------------------------------------
5173a53f50b9Schristos@node print_pid Parameter, print_version Parameter, preferred_amq_port Parameter, Global Parameters
5174a53f50b9Schristos@comment  node-name,  next,  previous,  up
5175a53f50b9Schristos@subsection @t{print_pid} Parameter
5176a53f50b9Schristos@cindex print_pid Parameter
5177a53f50b9Schristos
5178a53f50b9Schristos(type=boolean, default=@samp{no}).  Same as the @code{-p} option to @i{Amd}.
5179a53f50b9SchristosIf @samp{yes}, @i{Amd} will print its process ID upon starting.
5180a53f50b9Schristos
5181a53f50b9Schristos@c ----------------------------------------------------------------
5182a53f50b9Schristos@node print_version Parameter, restart_mounts Parameter, print_pid Parameter, Global Parameters
5183a53f50b9Schristos@comment  node-name,  next,  previous,  up
5184a53f50b9Schristos@subsection @t{print_version} Parameter
5185a53f50b9Schristos@cindex print_version Parameter
5186a53f50b9Schristos
5187a53f50b9Schristos(type=boolean, default=@samp{no}).  Same as the @code{-v} option to @i{Amd},
5188a53f50b9Schristosbut the version prints and @i{Amd} continues to run.  If @samp{yes}, @i{Amd}
5189a53f50b9Schristoswill print its version information string, which includes some
5190a53f50b9Schristosconfiguration and compilation values.
5191a53f50b9Schristos
5192a53f50b9Schristos@c ----------------------------------------------------------------
5193a53f50b9Schristos@node restart_mounts Parameter, show_statfs_entries Parameter, print_version Parameter, Global Parameters
5194a53f50b9Schristos@comment  node-name,  next,  previous,  up
5195a53f50b9Schristos@subsection @t{restart_mounts} Parameter
5196a53f50b9Schristos@cindex restart_mounts Parameter
5197a53f50b9Schristos
5198a53f50b9Schristos(type=boolean, default=@samp{no}).  Same as the @code{-r} option to @i{Amd}.
5199a53f50b9SchristosIf @samp{yes} @i{Amd} will scan the mount table to determine which file
5200a53f50b9Schristossystems are currently mounted.  Whenever one of these would have been
5201a53f50b9Schristosauto-mounted, @i{Amd} inherits it.
5202a53f50b9Schristos
5203a53f50b9Schristos@c ----------------------------------------------------------------
5204a53f50b9Schristos@node show_statfs_entries Parameter, truncate_log Parameter, restart_mounts Parameter, Global Parameters
5205a53f50b9Schristos@comment  node-name,  next,  previous,  up
5206a53f50b9Schristos@subsection @t{show_statfs_entries} Parameter
5207a53f50b9Schristos@cindex show_statfs_entries Parameter
5208a53f50b9Schristos
5209a53f50b9Schristos(type=boolean), default=@samp{no}).  If @samp{yes}, then all maps which are
5210a53f50b9Schristosbrowsable will also show the number of entries (keys) they have when
5211a53f50b9Schristos@b{df}(1) runs. (This is accomplished by returning non-zero values to
5212a53f50b9Schristosthe @b{statfs}(2) system call).
5213a53f50b9Schristos
5214a53f50b9Schristos@c ----------------------------------------------------------------
5215a53f50b9Schristos@node truncate_log Parameter, unmount_on_exit Parameter, show_statfs_entries Parameter, Global Parameters
5216a53f50b9Schristos@comment  node-name,  next,  previous,  up
5217a53f50b9Schristos@subsection @t{truncate_log} Parameter
5218a53f50b9Schristos@cindex truncate_log Parameter
5219a53f50b9Schristos
5220a53f50b9Schristos(type=boolean), default=@samp{no}).  If @samp{yes}, then @i{Amd} will
5221a53f50b9Schristostruncate the log file (if it's a regular file) on startup.  This could
5222a53f50b9Schristosbe useful when conducting extensive testing on @i{Amd} maps (or
5223a53f50b9Schristos@i{Amd} itself) and you don't want to see log data from a previous run
5224a53f50b9Schristosin the same file.
5225a53f50b9Schristos
5226a53f50b9Schristos@c ----------------------------------------------------------------
5227a53f50b9Schristos@node unmount_on_exit Parameter, use_tcpwrappers Parameter, truncate_log Parameter, Global Parameters
5228a53f50b9Schristos@comment  node-name,  next,  previous,  up
5229a53f50b9Schristos@subsection @t{unmount_on_exit} Parameter
5230a53f50b9Schristos@cindex unmount_on_exit Parameter
5231a53f50b9Schristos
5232a53f50b9Schristos(type=boolean, default=@samp{no}).  If @samp{yes}, then @i{Amd} will attempt
5233a53f50b9Schristosto unmount all file systems which it knows about.  Normally it leaves
5234a53f50b9Schristosall (esp. NFS) mounted file systems intact.  Note that @i{Amd} does not
5235a53f50b9Schristosknow about file systems mounted before it starts up, unless the
5236a53f50b9Schristos@samp{restart_mounts} option is used (@pxref{restart_mounts Parameter}).
5237a53f50b9Schristos
5238a53f50b9Schristos@c ----------------------------------------------------------------
5239a53f50b9Schristos@node use_tcpwrappers Parameter, vendor Parameter, unmount_on_exit Parameter, Global Parameters
5240a53f50b9Schristos@comment  node-name,  next,  previous,  up
5241a53f50b9Schristos@subsection @t{use_tcpwrappers} Parameter
5242a53f50b9Schristos@cindex use_tcpwrappers Parameter
5243a53f50b9Schristos
5244a53f50b9Schristos(type=boolean), default=@samp{yes}).  If @samp{yes}, then amd will use
5245a53f50b9Schristosthe tcpwrappers (tcpd/librwap) library (if available) to control
5246a53f50b9Schristosaccess to @i{Amd} via the @code{/etc/hosts.allow} and
5247a53f50b9Schristos@code{/etc/hosts.deny} files.  @i{Amd} will verify that the host
5248a53f50b9Schristosrunning @i{Amq} is authorized to connect.  The @code{amd} service name
5249a53f50b9Schristosmust used in the @code{/etc/hosts.allow} and @code{/etc/hosts.deny}
5250a53f50b9Schristosfiles.  For example, to allow only localhost to connect to @i{Amd},
5251a53f50b9Schristosadd this line to @code{/etc/hosts.allow}:
5252a53f50b9Schristos
5253a53f50b9Schristos@example
5254a53f50b9Schristosamd: localhost
5255a53f50b9Schristos@end example
5256a53f50b9Schristos
5257a53f50b9Schristosand this line to @code{/etc/hosts.deny}:
5258a53f50b9Schristos
5259a53f50b9Schristos@example
5260a53f50b9Schristosamd: ALL
5261a53f50b9Schristos@end example
5262a53f50b9Schristos
5263a53f50b9SchristosConsult the man pages for @b{hosts_access}(5) for more information on using
5264a53f50b9Schristosthe tcpwrappers access-control library.
5265a53f50b9Schristos
5266a53f50b9SchristosNote that in particular, you should not configure your @code{hosts.allow}
5267a53f50b9Schristosfile to spawn a command for @i{Amd}: that will cause @i{Amd} to not be able
5268a53f50b9Schristosto @code{waitpid} on the child process ID of any background un/mount that
5269a53f50b9Schristos@i{Amd} issued, resulting in a confused @i{Amd} that does not know what
5270a53f50b9Schristoshappened to those background un/mount requests.
5271a53f50b9Schristos
5272a53f50b9Schristos@c ----------------------------------------------------------------
5273a53f50b9Schristos@node vendor Parameter, , use_tcpwrappers Parameter, Global Parameters
5274a53f50b9Schristos@comment  node-name,  next,  previous,  up
5275a53f50b9Schristos@subsection @t{vendor} Parameter
5276a53f50b9Schristos@cindex vendor Parameter
5277a53f50b9Schristos
5278a53f50b9Schristos(type=string, default to compiled in value).  The name of the vendor of
5279a53f50b9Schristosthe operating system.  Overrides the compiled-in vendor name.  Useful
5280a53f50b9Schristoswhen the compiled-in name is not desired.  For example, most Intel based
5281a53f50b9Schristossystems set the vendor name to @samp{unknown}, but you can set it to
5282a53f50b9Schristos@samp{redhat}.
5283a53f50b9Schristos
5284a53f50b9Schristos@c ================================================================
5285a53f50b9Schristos@node Regular Map Parameters, amd.conf Examples, Global Parameters, Amd Configuration File
5286a53f50b9Schristos@comment  node-name,  next,  previous,  up
5287a53f50b9Schristos@section Regular Map Parameters
5288a53f50b9Schristos@cindex amd.conf regular map parameters
5289a53f50b9Schristos
5290a53f50b9SchristosThe following parameters are applicable only to regular map sections.
5291a53f50b9Schristos
5292a53f50b9Schristos@menu
5293a53f50b9Schristos* map_name Parameter::
5294a53f50b9Schristos* tag Parameter::
5295a53f50b9Schristos@end menu
5296a53f50b9Schristos
5297a53f50b9Schristos@c ----------------------------------------------------------------
5298a53f50b9Schristos@node map_name Parameter, tag Parameter, Regular Map Parameters, Regular Map Parameters
5299a53f50b9Schristos@comment  node-name,  next,  previous,  up
5300a53f50b9Schristos@subsection map_name Parameter
5301a53f50b9Schristos@cindex map_name Parameter
5302a53f50b9Schristos
5303a53f50b9Schristos(type=string, must be specified).  Name of the map where the keys are
5304a53f50b9Schristoslocated.
5305a53f50b9Schristos
5306a53f50b9Schristos@c ----------------------------------------------------------------
5307a53f50b9Schristos@node tag Parameter, , map_name Parameter, Regular Map Parameters
5308a53f50b9Schristos@comment  node-name,  next,  previous,  up
5309a53f50b9Schristos@subsection tag Parameter
5310a53f50b9Schristos@cindex tag Parameter
5311a53f50b9Schristos
5312a53f50b9Schristos(type=string, default no tag).  Each map entry in the configuration file
5313a53f50b9Schristoscan be tagged.  If no tag is specified, that map section will always be
5314a53f50b9Schristosprocessed by @i{Amd}.  If it is specified, then @i{Amd} will process the map
5315a53f50b9Schristosif the @code{-T} option was given to @i{Amd}, and the value given to that
5316a53f50b9Schristoscommand-line option matches that in the map section.
5317a53f50b9Schristos
5318a53f50b9Schristos@c ================================================================
5319a53f50b9Schristos@node amd.conf Examples, , Regular Map Parameters, Amd Configuration File
5320a53f50b9Schristos@comment  node-name,  next,  previous,  up
5321a53f50b9Schristos@section amd.conf Examples
5322a53f50b9Schristos@cindex amd.conf examples
5323a53f50b9Schristos
5324a53f50b9SchristosThe following is the actual @code{amd.conf} file I used at the
5325a53f50b9SchristosComputer Science Department of Columbia University.
5326a53f50b9Schristos
5327a53f50b9Schristos@example
5328a53f50b9Schristos# GLOBAL OPTIONS SECTION
5329a53f50b9Schristos[ global ]
5330a53f50b9Schristosnormalize_hostnames =    no
5331a53f50b9Schristosprint_pid =              no
5332a53f50b9Schristos#pid_file =              /var/run/amd.pid
5333a53f50b9Schristosrestart_mounts =         yes
5334a53f50b9Schristos#unmount_on_exit =       yes
5335a53f50b9Schristosauto_dir =               /n
5336a53f50b9Schristoslog_file =               /var/log/amd
5337a53f50b9Schristoslog_options =            all
5338a53f50b9Schristos#debug_options =         defaults
5339a53f50b9Schristosplock =                  no
5340a53f50b9Schristosselectors_in_defaults =  yes
5341a53f50b9Schristos# config.guess picks up "sunos5" and I don't want to edit my maps yet
5342a53f50b9Schristosos =                     sos5
5343a53f50b9Schristos# if you print_version after setting up "os", it will show it.
5344a53f50b9Schristosprint_version =          no
5345a53f50b9Schristosmap_type =               file
5346a53f50b9Schristossearch_path =            /etc/amdmaps:/usr/lib/amd:/usr/local/AMD/lib
5347a53f50b9Schristosbrowsable_dirs =         yes
5348a53f50b9Schristosfully_qualified_hosts =  no
5349a53f50b9Schristos
5350a53f50b9Schristos# DEFINE AN AMD MOUNT POINT
5351a53f50b9Schristos[ /u ]
5352a53f50b9Schristosmap_name =               amd.u
5353a53f50b9Schristos
5354a53f50b9Schristos[ /proj ]
5355a53f50b9Schristosmap_name =               amd.proj
5356a53f50b9Schristos
5357a53f50b9Schristos[ /src ]
5358a53f50b9Schristosmap_name =               amd.src
5359a53f50b9Schristos
5360a53f50b9Schristos[ /misc ]
5361a53f50b9Schristosmap_name =               amd.misc
5362a53f50b9Schristos
5363a53f50b9Schristos[ /import ]
5364a53f50b9Schristosmap_name =               amd.import
5365a53f50b9Schristos
5366a53f50b9Schristos[ /tftpboot/.amd ]
5367a53f50b9Schristostag =                    tftpboot
5368a53f50b9Schristosmap_name =               amd.tftpboot
5369a53f50b9Schristos@end example
5370a53f50b9Schristos
5371a53f50b9Schristos@c ################################################################
5372a53f50b9Schristos@node Run-time Administration, FSinfo, Amd Configuration File, Top
5373a53f50b9Schristos@comment  node-name,  next,  previous,  up
5374a53f50b9Schristos@chapter Run-time Administration
5375a53f50b9Schristos@cindex Run-time administration
5376a53f50b9Schristos@cindex Amq command
5377a53f50b9Schristos
5378a53f50b9Schristos@menu
5379a53f50b9Schristos* Starting Amd::
5380a53f50b9Schristos* Stopping Amd::
5381a53f50b9Schristos* Restarting Amd::
5382a53f50b9Schristos* Controlling Amd::
5383a53f50b9Schristos@end menu
5384a53f50b9Schristos
5385a53f50b9Schristos@node Starting Amd, Stopping Amd, Run-time Administration, Run-time Administration
5386a53f50b9Schristos@comment  node-name,  next,  previous,  up
5387a53f50b9Schristos@section Starting @i{Amd}
5388a53f50b9Schristos@cindex Starting Amd
5389a53f50b9Schristos@cindex Additions to /etc/rc.local
5390a53f50b9Schristos@cindex /etc/rc.local additions
5391a53f50b9Schristos@cindex ctl-amd
5392a53f50b9Schristos
5393a53f50b9Schristos@i{Amd} is best started from @samp{/etc/rc.local} on BSD systems, or
5394a53f50b9Schristosfrom the appropriate start-level script in @samp{/etc/init.d} on System V
5395a53f50b9Schristossystems.
5396a53f50b9Schristos
5397a53f50b9Schristos@example
5398a53f50b9Schristosif [ -f /usr/local/sbin/ctl-amd ]; then
5399a53f50b9Schristos    /usr/local/sbin/ctl-amd start; (echo -n ' amd') > /dev/console
5400a53f50b9Schristosfi
5401a53f50b9Schristos@end example
5402a53f50b9Schristos
5403a53f50b9Schristos@noindent
5404a53f50b9SchristosThe shell script, @samp{ctl-amd} is used to start, stop, or restart
5405a53f50b9Schristos@i{Amd}.  It is a relatively generic script.  All options you want to
5406a53f50b9Schristosset should not be made in this script, but rather updated in the
5407a53f50b9Schristos@file{amd.conf} file. @xref{Amd Configuration File}.
5408a53f50b9Schristos
5409a53f50b9SchristosIf you do not wish to use an @i{Amd} configuration file, you may start
5410a53f50b9Schristos@i{Amd} manually.  For example, getting the map entries via NIS:
5411a53f50b9Schristos
5412a53f50b9Schristos@example
5413a53f50b9Schristosamd -r -l /var/log/amd `ypcat -k auto.master`
5414a53f50b9Schristos@end example
5415a53f50b9Schristos
5416a53f50b9Schristos@node Stopping Amd, Restarting Amd, Starting Amd, Run-time Administration
5417a53f50b9Schristos@comment  node-name,  next,  previous,  up
5418a53f50b9Schristos@section Stopping @i{Amd}
5419a53f50b9Schristos@cindex Stopping Amd
5420a53f50b9Schristos@cindex SIGTERM signal
5421a53f50b9Schristos@cindex SIGINT signal
5422a53f50b9Schristos
5423a53f50b9Schristos@i{Amd} stops in response to two signals.
5424a53f50b9Schristos
5425a53f50b9Schristos@table @samp
5426a53f50b9Schristos@item SIGTERM
5427a53f50b9Schristoscauses the top-level automount points to be unmounted and then @i{Amd}
5428a53f50b9Schristosto exit.  Any automounted filesystems are left mounted.  They can be
5429a53f50b9Schristosrecovered by restarting @i{Amd} with the @code{-r} command line option.@refill
5430a53f50b9Schristos
5431a53f50b9Schristos@item SIGINT
5432a53f50b9Schristoscauses @i{Amd} to attempt to unmount any filesystems which it has
5433a53f50b9Schristosautomounted, in addition to the actions of @samp{SIGTERM}.  This signal
5434a53f50b9Schristosis primarily used for debugging.@refill
5435a53f50b9Schristos@end table
5436a53f50b9Schristos
5437a53f50b9SchristosActions taken for other signals are undefined.
5438a53f50b9Schristos
5439a53f50b9SchristosThe easiest and safest way to stop @i{Amd}, without having to find its
5440a53f50b9Schristosprocess ID by hand, is to use the @file{ctl-amd} script, as with:
5441a53f50b9Schristos
5442a53f50b9Schristos@example
5443a53f50b9Schristosctl-amd stop
5444a53f50b9Schristos@end example
5445a53f50b9Schristos
5446a53f50b9Schristos@node Restarting Amd, Controlling Amd, Stopping Amd, Run-time Administration
5447a53f50b9Schristos@comment  node-name,  next,  previous,  up
5448a53f50b9Schristos@section Restarting @i{Amd}
5449a53f50b9Schristos@cindex Restarting Amd
5450a53f50b9Schristos@cindex Killing and starting Amd
5451a53f50b9Schristos
5452a53f50b9SchristosBefore @i{Amd} can be started, it is vital to ensure that no other
5453a53f50b9Schristos@i{Amd} processes are managing any of the mount points, and that the
5454a53f50b9Schristosprevious process(es) have terminated cleanly.  When a terminating signal
5455a53f50b9Schristosis set to @i{Amd}, the automounter does @emph{not} terminate right then.
5456a53f50b9SchristosRather, it starts by unmounting all of its managed mount mounts in the
5457a53f50b9Schristosbackground, and then terminates.  It usually takes a few seconds for
5458a53f50b9Schristosthis process to happen, but it can take an arbitrarily longer time.  If
5459a53f50b9Schristostwo or more @i{Amd} processes attempt to manage the same mount point, it
5460a53f50b9Schristosusually will result in a system lockup.
5461a53f50b9Schristos
5462a53f50b9SchristosThe easiest and safest way to restart @i{Amd}, without having to find
5463a53f50b9Schristosits process ID by hand, sending it the @samp{SIGTERM} signal, waiting for @i{Amd}
5464a53f50b9Schristosto die cleanly, and verifying so, is to use the @file{ctl-amd} script,
5465a53f50b9Schristosas with:
5466a53f50b9Schristos
5467a53f50b9Schristos@example
5468a53f50b9Schristosctl-amd restart
5469a53f50b9Schristos@end example
5470a53f50b9Schristos
5471a53f50b9SchristosThe script will locate the process ID of @i{Amd}, kill it, and wait for
5472a53f50b9Schristosit to die cleanly before starting a new instance of the automounter.
5473a53f50b9Schristos@file{ctl-amd} will wait for a total of 30 seconds for @i{Amd} to die,
5474a53f50b9Schristosand will check once every 5 seconds if it had.
5475a53f50b9Schristos
5476a53f50b9Schristos@node Controlling Amd, , Restarting Amd, Run-time Administration
5477a53f50b9Schristos@comment  node-name,  next,  previous,  up
5478a53f50b9Schristos@section Controlling @i{Amd}
5479a53f50b9Schristos@cindex Controlling Amd
5480a53f50b9Schristos@cindex Discovering what is going on at run-time
5481a53f50b9Schristos@cindex Listing currently mounted filesystems
5482a53f50b9Schristos
5483a53f50b9SchristosIt is sometimes desirable or necessary to exercise external control
5484a53f50b9Schristosover some of @i{Amd}'s internal state.  To support this requirement,
5485a53f50b9Schristos@i{Amd} implements an RPC interface which is used by the @dfn{Amq} program.
5486a53f50b9SchristosA variety of information is available.
5487a53f50b9Schristos
5488a53f50b9Schristos@i{Amq} generally applies an operation, specified by a single letter option,
5489a53f50b9Schristosto a list of mount points.  The default operation is to obtain statistics
5490a53f50b9Schristosabout each mount point.  This is similar to the output shown above
5491a53f50b9Schristosbut includes information about the number and type of accesses to each
5492a53f50b9Schristosmount point.
5493a53f50b9Schristos
5494a53f50b9Schristos@menu
5495a53f50b9Schristos* Amq default::       Default command behavior.
5496a53f50b9Schristos* Amq -f option::     Flushing the map cache.
5497a53f50b9Schristos* Amq -h option::     Controlling a non-local host.
5498a53f50b9Schristos* Amq -H option::     Print help message.
5499a53f50b9Schristos* Amq -l option::     Controlling the log file.
5500a53f50b9Schristos* Amq -m option::     Obtaining mount statistics.
5501a53f50b9Schristos* Amq -p option::     Getting Amd's process ID.
5502a53f50b9Schristos* Amq -P option::     Contacting alternate Amd processes.
550314003705Schristos* Amq -q option::     Suppress synchronous unmounting errors.
5504a53f50b9Schristos* Amq -s option::     Obtaining global statistics.
5505a53f50b9Schristos* Amq -T option::     Use TCP transport.
5506a53f50b9Schristos* Amq -U option::     Use UDP transport.
5507a53f50b9Schristos* Amq -u option::     Forcing volumes to time out.
5508a53f50b9Schristos* Amq -v option::     Version information.
5509a53f50b9Schristos* Amq -w option::     Print Amd current working directory.
5510a53f50b9Schristos* Other Amq options:: Three other special options.
5511a53f50b9Schristos@end menu
5512a53f50b9Schristos
5513a53f50b9Schristos@c ----------------------------------------------------------------
5514a53f50b9Schristos@node Amq default, Amq -f option, Controlling Amd, Controlling Amd
5515a53f50b9Schristos@comment  node-name,  next,  previous,  up
5516a53f50b9Schristos@subsection @i{Amq} default information
5517a53f50b9Schristos
5518a53f50b9SchristosWith no arguments, @dfn{Amq} obtains a brief list of all existing
5519a53f50b9Schristosmounts created by @i{Amd}.  This is different from the list displayed by
5520a53f50b9Schristos@b{df}(1) since the latter only includes system mount points.
5521a53f50b9Schristos
5522a53f50b9Schristos@noindent
5523a53f50b9SchristosThe output from this option includes the following information:
5524a53f50b9Schristos
5525a53f50b9Schristos@itemize @bullet
5526a53f50b9Schristos@item
5527a53f50b9Schristosthe automount point,
5528a53f50b9Schristos@item
5529a53f50b9Schristosthe filesystem type,
5530a53f50b9Schristos@item
5531a53f50b9Schristosthe mount map or mount information,
5532a53f50b9Schristos@item
5533a53f50b9Schristosthe internal, or system mount point.
5534a53f50b9Schristos@end itemize
5535a53f50b9Schristos
5536a53f50b9Schristos@noindent
5537a53f50b9SchristosFor example:
5538a53f50b9Schristos
5539a53f50b9Schristos@example
5540a53f50b9Schristos/            root   "root"                    sky:(pid75)
5541a53f50b9Schristos/homes       toplvl /usr/local/etc/amd.homes  /homes
5542a53f50b9Schristos/home        toplvl /usr/local/etc/amd.home   /home
5543a53f50b9Schristos/homes/jsp   nfs    charm:/home/charm         /a/charm/home/charm/jsp
5544a53f50b9Schristos/homes/phjk  nfs    toytown:/home/toytown     /a/toytown/home/toytown/ai/phjk
5545a53f50b9Schristos@end example
5546a53f50b9Schristos
5547a53f50b9Schristos@noindent
5548a53f50b9SchristosIf an argument is given then statistics for that volume name will
5549a53f50b9Schristosbe output.  For example:
5550a53f50b9Schristos
5551a53f50b9Schristos@example
5552a53f50b9SchristosWhat         Uid   Getattr Lookup RdDir   RdLnk   Statfs Mounted@@
5553a53f50b9Schristos/homes       0     1196    512    22      0       30     90/09/14 12:32:55
5554a53f50b9Schristos/homes/jsp   0     0       0      0       1180    0      90/10/13 12:56:58
5555a53f50b9Schristos@end example
5556a53f50b9Schristos
5557a53f50b9Schristos@table @code
5558a53f50b9Schristos@item What
5559a53f50b9Schristosthe volume name.
5560a53f50b9Schristos
5561a53f50b9Schristos@item Uid
5562a53f50b9Schristosignored.
5563a53f50b9Schristos
5564a53f50b9Schristos@item Getattr
5565a53f50b9Schristosthe count of NFS @dfn{getattr} requests on this node.  This should only be
5566a53f50b9Schristosnon-zero for directory nodes.
5567a53f50b9Schristos
5568a53f50b9Schristos@item Lookup
5569a53f50b9Schristosthe count of NFS @dfn{lookup} requests on this node.  This should only be
5570a53f50b9Schristosnon-zero for directory nodes.
5571a53f50b9Schristos
5572a53f50b9Schristos@item RdDir
5573a53f50b9Schristosthe count of NFS @dfn{readdir} requests on this node.  This should only
5574a53f50b9Schristosbe non-zero for directory nodes.
5575a53f50b9Schristos
5576a53f50b9Schristos@item RdLnk
5577a53f50b9Schristosthe count of NFS @dfn{readlink} requests on this node.  This should be
5578a53f50b9Schristoszero for directory nodes.
5579a53f50b9Schristos
5580a53f50b9Schristos@item Statfs
5581a53f50b9Schristosthe count of NFS @dfn{statfs} requests on this node.  This should only
5582a53f50b9Schristosbe non-zero for top-level automount points.
5583a53f50b9Schristos
5584a53f50b9Schristos@item Mounted@@
5585a53f50b9Schristosthe date and time the volume name was first referenced.
5586a53f50b9Schristos@end table
5587a53f50b9Schristos
5588a53f50b9Schristos@c ----------------------------------------------------------------
5589a53f50b9Schristos@node Amq -f option, Amq -h option, Amq default, Controlling Amd
5590a53f50b9Schristos@comment  node-name,  next,  previous,  up
5591a53f50b9Schristos@subsection @i{Amq} @code{-f} option
5592a53f50b9Schristos@cindex Flushing the map cache
5593a53f50b9Schristos@cindex Map cache, flushing
5594a53f50b9Schristos
5595a53f50b9SchristosThe @code{-f} option causes @i{Amd} to flush the internal mount map cache.
5596a53f50b9SchristosThis is useful for example in Hesiod maps since @i{Amd} will not
5597a53f50b9Schristosautomatically notice when they have been updated.  The map cache can
5598a53f50b9Schristosalso be synchronized with the map source by using the @samp{sync} option
5599a53f50b9Schristos(@pxref{Automount Filesystem}).@refill
5600a53f50b9Schristos
5601a53f50b9Schristos@c ----------------------------------------------------------------
5602a53f50b9Schristos@node Amq -h option, Amq -H option, Amq -f option, Controlling Amd
5603a53f50b9Schristos@comment  node-name,  next,  previous,  up
5604a53f50b9Schristos@subsection @i{Amq} @code{-h} option
5605a53f50b9Schristos@cindex Querying an alternate host
5606a53f50b9Schristos
5607a53f50b9SchristosBy default the local host is used.  In an HP-UX cluster the root server
5608a53f50b9Schristosis used since that is the only place in the cluster where @i{Amd} will
5609a53f50b9Schristosbe running.  To query @i{Amd} on another host the @code{-h} option should
5610a53f50b9Schristosbe used.
5611a53f50b9Schristos
5612a53f50b9Schristos@c ----------------------------------------------------------------
5613a53f50b9Schristos@node Amq -H option, Amq -l option, Amq -h option, Controlling Amd
5614a53f50b9Schristos@comment  node-name,  next,  previous,  up
5615a53f50b9Schristos@subsection @i{Amq} @code{-H} option
5616a53f50b9Schristos@cindex Displaying brief help
5617a53f50b9Schristos@cindex Help; showing from Amq
5618a53f50b9Schristos
5619a53f50b9SchristosPrint a brief help and usage string.
5620a53f50b9Schristos
5621a53f50b9Schristos@c ----------------------------------------------------------------
5622a53f50b9Schristos@node Amq -l option, Amq -m option, Amq -H option, Controlling Amd
5623a53f50b9Schristos@comment  node-name,  next,  previous,  up
5624a53f50b9Schristos@subsection @i{Amq} @code{-l} option
5625a53f50b9Schristos@cindex Resetting the Amd log file
5626a53f50b9Schristos@cindex Setting the Amd log file via Amq
5627a53f50b9Schristos@cindex Log file, resetting
5628a53f50b9Schristos
5629a53f50b9SchristosTell @i{Amd} to use @i{log_file} as the log file name.  For security
5630a53f50b9Schristosreasons, this @emph{must} be the same log file which @i{Amd} used when
5631a53f50b9Schristosstarted.  This option is therefore only useful to refresh @i{Amd}'s open
5632a53f50b9Schristosfile handle on the log file, so that it can be rotated and compressed
5633a53f50b9Schristosvia daily cron jobs.
5634a53f50b9Schristos
5635a53f50b9Schristos@c ----------------------------------------------------------------
5636a53f50b9Schristos@node Amq -m option, Amq -p option, Amq -l option, Controlling Amd
5637a53f50b9Schristos@comment  node-name,  next,  previous,  up
5638a53f50b9Schristos@subsection @i{Amq} @code{-m} option
5639a53f50b9Schristos
5640a53f50b9SchristosThe @code{-m} option displays similar information about mounted
5641a53f50b9Schristosfilesystems, rather than automount points.  The output includes the
5642a53f50b9Schristosfollowing information:
5643a53f50b9Schristos
5644a53f50b9Schristos@itemize @bullet
5645a53f50b9Schristos@item
5646a53f50b9Schristosthe mount information,
5647a53f50b9Schristos@item
5648a53f50b9Schristosthe mount point,
5649a53f50b9Schristos@item
5650a53f50b9Schristosthe filesystem type,
5651a53f50b9Schristos@item
5652a53f50b9Schristosthe number of references to this filesystem,
5653a53f50b9Schristos@item
5654a53f50b9Schristosthe server hostname,
5655a53f50b9Schristos@item
5656a53f50b9Schristosthe state of the file server,
5657a53f50b9Schristos@item
5658a53f50b9Schristosany error which has occurred.
5659a53f50b9Schristos@end itemize
5660a53f50b9Schristos
5661a53f50b9SchristosFor example:
5662a53f50b9Schristos
5663a53f50b9Schristos@example
5664a53f50b9Schristos"root"           truth:(pid602)     root   1 localhost is up
5665a53f50b9Schristoshesiod.home      /home              toplvl 1 localhost is up
5666a53f50b9Schristoshesiod.vol       /vol               toplvl 1 localhost is up
5667a53f50b9Schristoshesiod.homes     /homes             toplvl 1 localhost is up
5668a53f50b9Schristosamy:/home/amy    /a/amy/home/amy    nfs    5 amy is up
5669a53f50b9Schristosswan:/home/swan  /a/swan/home/swan  nfs    0 swan is up (Permission denied)
5670a53f50b9Schristosex:/home/ex      /a/ex/home/ex      nfs    0 ex is down
5671a53f50b9Schristos@end example
5672a53f50b9Schristos
5673a53f50b9SchristosWhen the reference count is zero the filesystem is not mounted but
5674a53f50b9Schristosthe mount point and server information is still being maintained
5675a53f50b9Schristosby @i{Amd}.
5676a53f50b9Schristos
5677a53f50b9Schristos@c ----------------------------------------------------------------
5678a53f50b9Schristos@ignore
5679a53f50b9Schristos@comment Retained for future consideration: from the description of the
5680a53f50b9Schristos@comment amq -M option removed in amd 6.0.5.
5681a53f50b9Schristos
5682a53f50b9SchristosA future release of @i{Amd} will include code to allow the @b{mount}(8)
5683a53f50b9Schristoscommand to mount automount points:
5684a53f50b9Schristos
5685a53f50b9Schristos@example
5686a53f50b9Schristosmount -t amd /vol hesiod.vol
5687a53f50b9Schristos@end example
5688a53f50b9Schristos
5689a53f50b9SchristosThis will then allow @i{Amd} to be controlled from the standard system
5690a53f50b9Schristosfilesystem mount list.
5691a53f50b9Schristos
5692a53f50b9Schristos@end ignore
5693a53f50b9Schristos
5694a53f50b9Schristos@c ----------------------------------------------------------------
5695a53f50b9Schristos@node Amq -p option, Amq -P option, Amq -m option, Controlling Amd
5696a53f50b9Schristos@comment  node-name,  next,  previous,  up
5697a53f50b9Schristos@subsection @i{Amq} @code{-p} option
5698a53f50b9Schristos@cindex Process ID; Amd
5699a53f50b9Schristos@cindex Amd's process ID
5700a53f50b9Schristos@cindex Amd's PID
5701a53f50b9Schristos@cindex PID; Amd
5702a53f50b9Schristos
5703a53f50b9SchristosReturn the process ID of the remote or locally running @i{Amd}.  Useful
5704a53f50b9Schristoswhen you need to send a signal to the local @i{Amd} process, and would
5705a53f50b9Schristosrather not have to search through the process table.  This option is
5706a53f50b9Schristosused in the @file{ctl-amd} script.
5707a53f50b9Schristos
5708a53f50b9Schristos@c ----------------------------------------------------------------
570914003705Schristos@node Amq -P option, Amq -q option, Amq -p option, Controlling Amd
5710a53f50b9Schristos@comment  node-name,  next,  previous,  up
5711a53f50b9Schristos@subsection @i{Amq} @code{-P} option
5712a53f50b9Schristos@cindex Multiple Amd processes
5713a53f50b9Schristos@cindex Running multiple Amd
5714a53f50b9Schristos@cindex Debugging a new Amd configuration
5715a53f50b9Schristos@cindex RPC Program numbers; Amd
5716a53f50b9Schristos
5717a53f50b9SchristosContact an alternate running @i{Amd} that had registered itself on a
5718a53f50b9Schristosdifferent RPC @var{program_number} and apply all other operations to
5719a53f50b9Schristosthat instance of the automounter.  This is useful when you run multiple
5720a53f50b9Schristoscopies of @i{Amd}, and need to manage each one separately.  If not
5721a53f50b9Schristosspecified, @i{Amq} will use the default program number for @i{Amd}, 300019.
5722a53f50b9SchristosFor security reasons, the only alternate program numbers @i{Amd} can use
5723a53f50b9Schristosrange from 300019 to 300029, inclusive.
5724a53f50b9Schristos
5725a53f50b9SchristosFor example, to kill an alternate running @i{Amd}:
5726a53f50b9Schristos
5727a53f50b9Schristos@example
5728a53f50b9Schristoskill `amq -p -P 300020`
5729a53f50b9Schristos@end example
5730a53f50b9Schristos
5731a53f50b9Schristos@c ----------------------------------------------------------------
573214003705Schristos@node Amq -q option, Amq -s option, Amq -P option, Controlling Amd
573314003705Schristos@comment  node-name,  next,  previous,  up
573414003705Schristos@subsection @i{Amq} @code{-q} option
573514003705Schristos@cindex Unmounting a filesystem
573614003705Schristos
573714003705SchristosSuppress any error messages produced when a synchronous unmount fails.
573814003705SchristosSee @ref{Amq -u option}.
573914003705Schristos
574014003705Schristos@c ----------------------------------------------------------------
574114003705Schristos@node Amq -s option, Amq -T option, Amq -q option, Controlling Amd
5742a53f50b9Schristos@comment  node-name,  next,  previous,  up
5743a53f50b9Schristos@subsection @i{Amq} @code{-s} option
5744a53f50b9Schristos@cindex Global statistics
5745a53f50b9Schristos@cindex Statistics
5746a53f50b9Schristos
5747a53f50b9SchristosThe @code{-s} option displays global statistics.  If any other options are specified
5748a53f50b9Schristosor any filesystems named then this option is ignored.  For example:
5749a53f50b9Schristos
5750a53f50b9Schristos@example
5751a53f50b9Schristosrequests  stale     mount     mount     unmount
5752a53f50b9Schristosdeferred  fhandles  ok        failed    failed
5753a53f50b9Schristos1054      1         487       290       7017
5754a53f50b9Schristos@end example
5755a53f50b9Schristos
5756a53f50b9Schristos@table @samp
5757a53f50b9Schristos@item Deferred requests
5758a53f50b9Schristosare those for which an immediate reply could not be constructed.  For
5759a53f50b9Schristosexample, this would happen if a background mount was required.
5760a53f50b9Schristos
5761a53f50b9Schristos@item Stale filehandles
5762a53f50b9Schristoscounts the number of times the kernel passes a stale filehandle to @i{Amd}.
5763a53f50b9SchristosLarge numbers indicate problems.
5764a53f50b9Schristos
5765a53f50b9Schristos@item Mount ok
5766a53f50b9Schristoscounts the number of automounts which were successful.
5767a53f50b9Schristos
5768a53f50b9Schristos@item Mount failed
5769a53f50b9Schristoscounts the number of automounts which failed.
5770a53f50b9Schristos
5771a53f50b9Schristos@item Unmount failed
5772a53f50b9Schristoscounts the number of times a filesystem could not be unmounted.  Very
5773a53f50b9Schristoslarge numbers here indicate that the time between unmount attempts
5774a53f50b9Schristosshould be increased.
5775a53f50b9Schristos@end table
5776a53f50b9Schristos
5777a53f50b9Schristos@c ----------------------------------------------------------------
5778a53f50b9Schristos@node Amq -T option, Amq -U option, Amq -s option, Controlling Amd
5779a53f50b9Schristos@comment  node-name,  next,  previous,  up
5780a53f50b9Schristos@subsection @i{Amq} @code{-T} option
5781a53f50b9Schristos@cindex Forcing Amq to use a TCP transport
5782a53f50b9Schristos@cindex TCP; using with Amq
5783a53f50b9Schristos
5784a53f50b9SchristosThe @code{-T} option causes the @i{Amq} to contact @i{Amd} using the TCP
5785a53f50b9Schristostransport only (connection oriented).  Normally, @i{Amq} will use TCP
5786a53f50b9Schristosfirst, and if that failed, will try UDP.
5787a53f50b9Schristos
5788a53f50b9Schristos@c ----------------------------------------------------------------
5789a53f50b9Schristos@node Amq -U option, Amq -u option, Amq -T option, Controlling Amd
5790a53f50b9Schristos@comment  node-name,  next,  previous,  up
5791a53f50b9Schristos@subsection @i{Amq} @code{-U} option
5792a53f50b9Schristos@cindex Forcing Amq to use a UDP transport
5793a53f50b9Schristos@cindex UDP; using with Amq
5794a53f50b9Schristos
5795a53f50b9SchristosThe @code{-U} option causes the @i{Amq} to contact @i{Amd} using the UDP
5796a53f50b9Schristostransport only (connectionless).  Normally, @i{Amq} will use TCP first,
5797a53f50b9Schristosand if that failed, will try UDP.
5798a53f50b9Schristos
5799a53f50b9Schristos@c ----------------------------------------------------------------
5800a53f50b9Schristos@node Amq -u option, Amq -v option, Amq -U option, Controlling Amd
5801a53f50b9Schristos@comment  node-name,  next,  previous,  up
5802a53f50b9Schristos@subsection @i{Amq} @code{-u} option
5803a53f50b9Schristos@cindex Forcing filesystem to time out
5804a53f50b9Schristos@cindex Unmounting a filesystem
5805a53f50b9Schristos
580614003705SchristosThe @code{-u} option causes the time-to-live interval of the named
580714003705Schristosmount points to be expired, thus causing an unmount attempt.  This is
580814003705Schristosthe only safe way to unmount an automounted filesystem.  If @code{-u}
580914003705Schristosis repeated, then @i{Amd} will attempt to unmount the filesystem
581014003705Schristossynchronously.  This makes things like
581114003705Schristos
581214003705Schristos@example
581314003705Schristosamq -uu /t/cd0d && eject cd0
581414003705Schristos@end example
581514003705Schristos
581614003705Schristos@noindent
581714003705Schristoswork as expected.  Any error messages this might produce can be
581814003705Schristossuppressed with the @code{-q} option.  See @ref{Amq -q option}.
5819a53f50b9Schristos
5820a53f50b9Schristos@c The @code{-H} option informs @i{Amd} that the specified mount point
5821a53f50b9Schristos@c has hung - as if its keepalive timer had expired.
5822a53f50b9Schristos
5823a53f50b9Schristos@c ----------------------------------------------------------------
5824a53f50b9Schristos@node Amq -v option, Amq -w option, Amq -u option, Controlling Amd
5825a53f50b9Schristos@comment  node-name,  next,  previous,  up
5826a53f50b9Schristos@subsection @i{Amq} @code{-v} option
5827a53f50b9Schristos@cindex Version information at run-time
5828a53f50b9Schristos
5829a53f50b9SchristosThe @code{-v} option displays the version of @i{Amd} in a similar way to
5830a53f50b9Schristos@i{Amd}'s @code{-v} option.
5831a53f50b9Schristos
5832a53f50b9Schristos@c ----------------------------------------------------------------
5833a53f50b9Schristos@node Amq -w option, Other Amq options, Amq -v option, Controlling Amd
5834a53f50b9Schristos@comment  node-name,  next,  previous,  up
5835a53f50b9Schristos@subsection @i{Amq} @code{-w} option
5836a53f50b9Schristos@cindex Getting real working directory
5837a53f50b9Schristos
5838a53f50b9SchristosThe @code{-w} option translates a full pathname as returned by
5839a53f50b9Schristos@b{getpwd}(3) into a short @i{Amd} pathname that goes through its mount
5840a53f50b9Schristospoints.  This option requires that @i{Amd} is running.
5841a53f50b9Schristos
5842a53f50b9Schristos@c ----------------------------------------------------------------
5843a53f50b9Schristos@node Other Amq options, , Amq -w option, Controlling Amd
5844a53f50b9Schristos@comment  node-name,  next,  previous,  up
5845a53f50b9Schristos@subsection Other @i{Amq} options
5846a53f50b9Schristos@cindex Logging options via Amq
5847a53f50b9Schristos@cindex Debugging options via Amq
5848a53f50b9Schristos
5849a53f50b9SchristosTwo other operations are implemented.  These modify the state of @i{Amd}
5850a53f50b9Schristosas a whole, rather than any particular filesystem.  The @code{-x} and
5851a53f50b9Schristos@code{-D} options have exactly the same effect as @i{Amd}'s corresponding
5852a53f50b9Schristoscommand line options.
5853a53f50b9Schristos
5854a53f50b9SchristosWhen @i{Amd} receives the @code{-x} flag, it disallows turning off the
5855a53f50b9Schristos@samp{fatal} or @samp{error} flags.  Both are on by default.  They are
5856a53f50b9Schristosmandatory so that @i{Amd} could report important errors, including
5857a53f50b9Schristoserrors relating to turning flags on/off.
5858a53f50b9Schristos
5859a53f50b9Schristos@c ################################################################
5860a53f50b9Schristos@node FSinfo, Hlfsd, Run-time Administration, Top
5861a53f50b9Schristos@comment  node-name,  next,  previous,  up
5862a53f50b9Schristos@chapter FSinfo
5863a53f50b9Schristos@cindex FSinfo
5864a53f50b9Schristos@cindex Filesystem info package
5865a53f50b9Schristos
5866a53f50b9SchristosXXX: this chapter should be reviewed by someone knowledgeable with
5867a53f50b9Schristosfsinfo.
5868a53f50b9Schristos
5869a53f50b9Schristos@menu
5870a53f50b9Schristos* FSinfo Overview::                 Introduction to FSinfo.
5871a53f50b9Schristos* Using FSinfo::                    Basic concepts.
5872a53f50b9Schristos* FSinfo Grammar::                  Language syntax, semantics and examples.
5873a53f50b9Schristos* FSinfo host definitions::         Defining a new host.
5874a53f50b9Schristos* FSinfo host attributes::          Definable host attributes.
5875a53f50b9Schristos* FSinfo filesystems::              Defining locally attached filesystems.
5876a53f50b9Schristos* FSinfo static mounts::            Defining additional static mounts.
5877a53f50b9Schristos* FSinfo automount definitions::
5878a53f50b9Schristos* FSinfo Command Line Options::
5879a53f50b9Schristos* FSinfo errors::
5880a53f50b9Schristos@end menu
5881a53f50b9Schristos
5882a53f50b9Schristos@node FSinfo Overview, Using FSinfo, FSinfo, FSinfo
5883a53f50b9Schristos@comment  node-name,  next,  previous,  up
5884a53f50b9Schristos@section @i{FSinfo} overview
5885a53f50b9Schristos@cindex FSinfo overview
5886a53f50b9Schristos
5887a53f50b9Schristos@i{FSinfo} is a filesystem management tool.  It has been designed to
5888a53f50b9Schristoswork with @i{Amd} to help system administrators keep track of the ever
5889a53f50b9Schristosincreasing filesystem namespace under their control.
5890a53f50b9Schristos
5891a53f50b9SchristosThe purpose of @i{FSinfo} is to generate all the important standard
5892a53f50b9Schristosfilesystem data files from a single set of input data.  Starting with a
5893a53f50b9Schristossingle data source guarantees that all the generated files are
5894a53f50b9Schristosself-consistent.  One of the possible output data formats is a set of
5895a53f50b9Schristos@i{Amd} maps which can be used among the set of hosts described in the
5896a53f50b9Schristosinput data.
5897a53f50b9Schristos
5898a53f50b9Schristos@i{FSinfo} implements a declarative language.  This language is
5899a53f50b9Schristosspecifically designed for describing filesystem namespace and physical
5900a53f50b9Schristoslayouts.  The basic declaration defines a mounted filesystem including
5901a53f50b9Schristosits device name, mount point, and all the volumes and access
5902a53f50b9Schristospermissions.  @i{FSinfo} reads this information and builds an internal
5903a53f50b9Schristosmap of the entire network of hosts.  Using this map, many different data
5904a53f50b9Schristosformats can be produced including @file{/etc/fstab},
5905a53f50b9Schristos@file{/etc/exports}, @i{Amd} mount maps and
5906a53f50b9Schristos@file{/etc/bootparams}.@refill
5907a53f50b9Schristos
5908a53f50b9Schristos@node Using FSinfo, FSinfo Grammar, FSinfo Overview, FSinfo
5909a53f50b9Schristos@comment  node-name,  next,  previous,  up
5910a53f50b9Schristos@section Using @i{FSinfo}
5911a53f50b9Schristos@cindex Using FSinfo
5912a53f50b9Schristos
5913a53f50b9SchristosThe basic strategy when using @i{FSinfo} is to gather all the
5914a53f50b9Schristosinformation about all disks on all machines into one set of
5915a53f50b9Schristosdeclarations.  For each machine being managed, the following data is
5916a53f50b9Schristosrequired:
5917a53f50b9Schristos
5918a53f50b9Schristos@itemize @bullet
5919a53f50b9Schristos@item
5920a53f50b9SchristosHostname
5921a53f50b9Schristos@item
5922a53f50b9SchristosList of all filesystems and, optionally, their mount points.
5923a53f50b9Schristos@item
5924a53f50b9SchristosNames of volumes stored on each filesystem.
5925a53f50b9Schristos@item
5926a53f50b9SchristosNFS export information for each volume.
5927a53f50b9Schristos@item
5928a53f50b9SchristosThe list of static filesystem mounts.
5929a53f50b9Schristos@end itemize
5930a53f50b9Schristos
5931a53f50b9SchristosThe following information can also be entered into the same
5932a53f50b9Schristosconfiguration files so that all data can be kept in one place.
5933a53f50b9Schristos
5934a53f50b9Schristos@itemize @bullet
5935a53f50b9Schristos@item
5936a53f50b9SchristosList of network interfaces
5937a53f50b9Schristos@item
5938a53f50b9SchristosIP address of each interface
5939a53f50b9Schristos@item
5940a53f50b9SchristosHardware address of each interface
5941a53f50b9Schristos@item
5942a53f50b9SchristosDumpset to which each filesystem belongs
5943a53f50b9Schristos@item
5944a53f50b9Schristosand more @dots{}
5945a53f50b9Schristos@end itemize
5946a53f50b9Schristos
5947a53f50b9SchristosTo generate @i{Amd} mount maps, the automount tree must also be defined
5948a53f50b9Schristos(@pxref{FSinfo automount definitions}).  This will have been designed at
5949a53f50b9Schristosthe time the volume names were allocated.  Some volume names will not be
5950a53f50b9Schristosautomounted, so @i{FSinfo} needs an explicit list of which volumes
5951a53f50b9Schristosshould be automounted.@refill
5952a53f50b9Schristos
5953a53f50b9SchristosHostnames are required at several places in the @i{FSinfo} language.  It
5954a53f50b9Schristosis important to stick to either fully qualified names or unqualified
5955a53f50b9Schristosnames.  Using a mixture of the two will inevitably result in confusion.
5956a53f50b9Schristos
5957a53f50b9SchristosSometimes volumes need to be referenced which are not defined in the set
5958a53f50b9Schristosof hosts being managed with @i{FSinfo}.  The required action is to add a
5959a53f50b9Schristosdummy set of definitions for the host and volume names required.  Since
5960a53f50b9Schristosthe files generated for those particular hosts will not be used on them,
5961a53f50b9Schristosthe exact values used is not critical.
5962a53f50b9Schristos
5963a53f50b9Schristos@node FSinfo Grammar, FSinfo host definitions, Using FSinfo, FSinfo
5964a53f50b9Schristos@comment  node-name,  next,  previous,  up
5965a53f50b9Schristos@section @i{FSinfo} grammar
5966a53f50b9Schristos@cindex FSinfo grammar
5967a53f50b9Schristos@cindex Grammar, FSinfo
5968a53f50b9Schristos
5969a53f50b9Schristos@i{FSinfo} has a relatively simple grammar.  Distinct syntactic
5970a53f50b9Schristosconstructs exist for each of the different types of data, though they
5971a53f50b9Schristosshare a common flavor.  Several conventions are used in the grammar
5972a53f50b9Schristosfragments below.
5973a53f50b9Schristos
5974a53f50b9SchristosThe notation, @i{list(}@t{xxx}@i{)}, indicates a list of zero or more
5975a53f50b9Schristos@t{xxx}'s.  The notation, @i{opt(}@t{xxx}@i{)}, indicates zero or one
5976a53f50b9Schristos@t{xxx}.  Items in double quotes, @i{eg} @t{"host"}, represent input
5977a53f50b9Schristostokens.  Items in angle brackets, @i{eg} @var{<hostname>}, represent
5978a53f50b9Schristosstrings in the input.  Strings need not be in double quotes, except to
5979a53f50b9Schristosdifferentiate them from reserved words.  Quoted strings may include the
5980a53f50b9Schristosusual set of C ``@t{\}'' escape sequences with one exception: a
5981a53f50b9Schristosbackslash-newline-whitespace sequence is squashed into a single space
5982a53f50b9Schristoscharacter.  To defeat this feature, put a further backslash at the start
5983a53f50b9Schristosof the second line.
5984a53f50b9Schristos
5985a53f50b9SchristosAt the outermost level of the grammar, the input consists of a
5986a53f50b9Schristossequence of host and automount declarations.  These declarations are
5987a53f50b9Schristosall parsed before they are analyzed.  This means they can appear in
5988a53f50b9Schristosany order and cyclic host references are possible.
5989a53f50b9Schristos
5990a53f50b9Schristos@example
5991a53f50b9Schristosfsinfo      : @i{list(}fsinfo_attr@i{)} ;
5992a53f50b9Schristos
5993a53f50b9Schristosfsinfo_attr : host | automount ;
5994a53f50b9Schristos@end example
5995a53f50b9Schristos
5996a53f50b9Schristos@menu
5997a53f50b9Schristos* FSinfo host definitions::
5998a53f50b9Schristos* FSinfo automount definitions::
5999a53f50b9Schristos@end menu
6000a53f50b9Schristos
6001a53f50b9Schristos@node FSinfo host definitions, FSinfo host attributes, FSinfo Grammar, FSinfo
6002a53f50b9Schristos@comment  node-name,  next,  previous,  up
6003a53f50b9Schristos@section @i{FSinfo} host definitions
6004a53f50b9Schristos@cindex FSinfo host definitions
6005a53f50b9Schristos@cindex Defining a host, FSinfo
6006a53f50b9Schristos
6007a53f50b9SchristosA host declaration consists of three parts: a set of machine attribute
6008a53f50b9Schristosdata, a list of filesystems physically attached to the machine, and a
6009a53f50b9Schristoslist of additional statically mounted filesystems.
6010a53f50b9Schristos
6011a53f50b9Schristos@example
6012a53f50b9Schristoshost        : "host" host_data @i{list(}filesystem@i{@i{)}} @i{list(}mount@i{@i{)}} ;
6013a53f50b9Schristos@end example
6014a53f50b9Schristos
6015a53f50b9SchristosEach host must be declared in this way exactly once.  Such things as the
6016a53f50b9Schristoshardware address, the architecture and operating system types and the
6017a53f50b9Schristoscluster name are all specified within the @dfn{host data}.
6018a53f50b9Schristos
6019a53f50b9SchristosAll the disks the machine has should then be described in the @dfn{list
6020a53f50b9Schristosof filesystems}.  When describing disks, you can specify what
6021a53f50b9Schristos@dfn{volname} the disk/partition should have and all such entries are
6022a53f50b9Schristosbuilt up into a dictionary which can then be used for building the
6023a53f50b9Schristosautomounter maps.
6024a53f50b9Schristos
6025a53f50b9SchristosThe @dfn{list of mounts} specifies all the filesystems that should be
6026a53f50b9Schristosstatically mounted on the machine.
6027a53f50b9Schristos
6028a53f50b9Schristos@menu
6029a53f50b9Schristos* FSinfo host attributes::
6030a53f50b9Schristos* FSinfo filesystems::
6031a53f50b9Schristos* FSinfo static mounts::
6032a53f50b9Schristos@end menu
6033a53f50b9Schristos
6034a53f50b9Schristos@node FSinfo host attributes, FSinfo filesystems, FSinfo host definitions , FSinfo host definitions
6035a53f50b9Schristos@comment  node-name,  next,  previous,  up
6036a53f50b9Schristos@section @i{FSinfo} host attributes
6037a53f50b9Schristos@cindex FSinfo host attributes
6038a53f50b9Schristos@cindex Defining host attributes, FSinfo
6039a53f50b9Schristos
6040a53f50b9SchristosThe host data, @dfn{host_data}, always includes the @dfn{hostname}.  In
6041a53f50b9Schristosaddition, several other host attributes can be given.
6042a53f50b9Schristos
6043a53f50b9Schristos@example
6044a53f50b9Schristoshost_data   : @var{<hostname>}
6045a53f50b9Schristos            | "@{" @i{list(}host_attrs@i{)} "@}" @var{<hostname>}
6046a53f50b9Schristos            ;
6047a53f50b9Schristos
6048a53f50b9Schristoshost_attrs  : host_attr "=" @var{<string>}
6049a53f50b9Schristos            | netif
6050a53f50b9Schristos            ;
6051a53f50b9Schristos
6052a53f50b9Schristoshost_attr   : "config"
6053a53f50b9Schristos            | "arch"
6054a53f50b9Schristos            | "os"
6055a53f50b9Schristos            | "cluster"
6056a53f50b9Schristos            ;
6057a53f50b9Schristos@end example
6058a53f50b9Schristos
6059a53f50b9SchristosThe @dfn{hostname} is, typically, the fully qualified hostname of the
6060a53f50b9Schristosmachine.
6061a53f50b9Schristos
6062a53f50b9SchristosExamples:
6063a53f50b9Schristos
6064a53f50b9Schristos@example
6065a53f50b9Schristoshost dylan.doc.ic.ac.uk
6066a53f50b9Schristos
6067a53f50b9Schristoshost @{
6068a53f50b9Schristos    os = hpux
6069a53f50b9Schristos    arch = hp300
6070a53f50b9Schristos@} dougal.doc.ic.ac.uk
6071a53f50b9Schristos@end example
6072a53f50b9Schristos
6073a53f50b9SchristosThe options that can be given as host attributes are shown below.
6074a53f50b9Schristos
6075a53f50b9Schristos@menu
6076a53f50b9Schristos* FSinfo netif Option::         FSinfo host netif.
6077a53f50b9Schristos* FSinfo config Option::        FSinfo host config.
6078a53f50b9Schristos* FSinfo arch Option::          FSinfo host arch.
6079a53f50b9Schristos* FSinfo os Option::            FSinfo host os.
6080a53f50b9Schristos* FSinfo cluster Option::       FSinfo host cluster.
6081a53f50b9Schristos@end menu
6082a53f50b9Schristos
6083a53f50b9Schristos@node FSinfo netif Option, FSinfo config Option, , FSinfo host attributes
6084a53f50b9Schristos@comment  node-name,  next,  previous,  up
6085a53f50b9Schristos@subsection netif Option
6086a53f50b9Schristos
6087a53f50b9SchristosThis defines the set of network interfaces configured on the machine.
6088a53f50b9SchristosThe interface attributes collected by @i{FSinfo} are the IP address,
6089a53f50b9Schristossubnet mask and hardware address.  Multiple interfaces may be defined
6090a53f50b9Schristosfor hosts with several interfaces by an entry for each interface.  The
6091a53f50b9Schristosvalues given are sanity checked, but are currently unused for anything
6092a53f50b9Schristoselse.
6093a53f50b9Schristos
6094a53f50b9Schristos@example
6095a53f50b9Schristosnetif       : "netif" @var{<string>} "@{" @i{list(}netif_attrs@i{)} "@}" ;
6096a53f50b9Schristos
6097a53f50b9Schristosnetif_attrs : netif_attr "=" @var{<string>} ;
6098a53f50b9Schristos
6099a53f50b9Schristosnetif_attr  : "inaddr" | "netmask" | "hwaddr" ;
6100a53f50b9Schristos@end example
6101a53f50b9Schristos
6102a53f50b9SchristosExamples:
6103a53f50b9Schristos
6104a53f50b9Schristos@example
6105a53f50b9Schristosnetif ie0 @{
6106a53f50b9Schristos    inaddr  = 129.31.81.37
6107a53f50b9Schristos    netmask = 0xfffffe00
6108a53f50b9Schristos    hwaddr  = "08:00:20:01:a6:a5"
6109a53f50b9Schristos@}
6110a53f50b9Schristos
6111a53f50b9Schristosnetif ec0 @{ @}
6112a53f50b9Schristos@end example
6113a53f50b9Schristos
6114a53f50b9Schristos@node FSinfo config Option, FSinfo arch Option, FSinfo netif Option, FSinfo host attributes
6115a53f50b9Schristos@comment  node-name,  next,  previous,  up
6116a53f50b9Schristos@subsection config Option
6117a53f50b9Schristos@cindex FSinfo config host attribute
6118a53f50b9Schristos@cindex config, FSinfo host attribute
6119a53f50b9Schristos
6120a53f50b9SchristosThis option allows you to specify configuration variables for the
6121a53f50b9Schristosstartup scripts (@file{rc} scripts).  A simple string should immediately
6122a53f50b9Schristosfollow the keyword.
6123a53f50b9Schristos
6124a53f50b9SchristosExample:
6125a53f50b9Schristos
6126a53f50b9Schristos@example
6127a53f50b9Schristosconfig "NFS_SERVER=true"
6128a53f50b9Schristosconfig "ZEPHYR=true"
6129a53f50b9Schristos@end example
6130a53f50b9Schristos
6131a53f50b9SchristosThis option is currently unsupported.
6132a53f50b9Schristos
6133a53f50b9Schristos@node FSinfo arch Option, FSinfo os Option, FSinfo config Option, FSinfo host attributes
6134a53f50b9Schristos@comment  node-name,  next,  previous,  up
6135a53f50b9Schristos@subsection arch Option
6136a53f50b9Schristos@cindex FSinfo arch host attribute
6137a53f50b9Schristos@cindex arch, FSinfo host attribute
6138a53f50b9Schristos
6139a53f50b9SchristosThis defines the architecture of the machine.  For example:
6140a53f50b9Schristos
6141a53f50b9Schristos@example
6142a53f50b9Schristosarch = hp300
6143a53f50b9Schristos@end example
6144a53f50b9Schristos
6145a53f50b9SchristosThis is intended to be of use when building architecture specific
6146a53f50b9Schristosmountmaps, however, the option is currently unsupported.
6147a53f50b9Schristos
6148a53f50b9Schristos@node FSinfo os Option, FSinfo cluster Option, FSinfo arch Option, FSinfo host attributes
6149a53f50b9Schristos@comment  node-name,  next,  previous,  up
6150a53f50b9Schristos@subsection os Option
6151a53f50b9Schristos@cindex FSinfo os host attribute
6152a53f50b9Schristos@cindex os, FSinfo host attribute
6153a53f50b9Schristos
6154a53f50b9SchristosThis defines the operating system type of the host.  For example:
6155a53f50b9Schristos
6156a53f50b9Schristos@example
6157a53f50b9Schristosos = hpux
6158a53f50b9Schristos@end example
6159a53f50b9Schristos
6160a53f50b9SchristosThis information is used when creating the @file{fstab} files, for
6161a53f50b9Schristosexample in choosing which format to use for the @file{fstab} entries
6162a53f50b9Schristoswithin the file.
6163a53f50b9Schristos
6164a53f50b9Schristos@node FSinfo cluster Option, , FSinfo os Option, FSinfo host attributes
6165a53f50b9Schristos@comment  node-name,  next,  previous,  up
6166a53f50b9Schristos@subsection cluster Option
6167a53f50b9Schristos@cindex FSinfo cluster host attribute
6168a53f50b9Schristos@cindex cluster, FSinfo host attribute
6169a53f50b9Schristos
6170a53f50b9SchristosThis is used for specifying in which cluster the machine belongs.  For
6171a53f50b9Schristosexample:
6172a53f50b9Schristos
6173a53f50b9Schristos@example
6174a53f50b9Schristoscluster = "theory"
6175a53f50b9Schristos@end example
6176a53f50b9Schristos
6177a53f50b9SchristosThe cluster is intended to be used when generating the automount maps,
6178a53f50b9Schristosalthough it is currently unsupported.
6179a53f50b9Schristos
6180a53f50b9Schristos@node FSinfo filesystems, FSinfo static mounts, FSinfo host attributes, FSinfo host definitions
6181a53f50b9Schristos@comment  node-name,  next,  previous,  up
6182a53f50b9Schristos@section @i{FSinfo} filesystems
6183a53f50b9Schristos@cindex FSinfo filesystems
6184a53f50b9Schristos
6185a53f50b9SchristosThe list of physically attached filesystems follows the machine
6186a53f50b9Schristosattributes.  These should define all the filesystems available from this
6187a53f50b9Schristosmachine, whether exported or not.  In addition to the device name,
6188a53f50b9Schristosfilesystems have several attributes, such as filesystem type, mount
6189a53f50b9Schristosoptions, and @samp{fsck} pass number which are needed to generate
6190a53f50b9Schristos@file{fstab} entries.
6191a53f50b9Schristos
6192a53f50b9Schristos@example
6193a53f50b9Schristosfilesystem  : "fs" @var{<device>} "@{" @i{list(}fs_data@i{)} "@}" ;
6194a53f50b9Schristos
6195a53f50b9Schristosfs_data     : fs_data_attr "=" @var{<string>}
6196a53f50b9Schristos            | mount
6197a53f50b9Schristos            ;
6198a53f50b9Schristos
6199a53f50b9Schristosfs_data_attr
6200a53f50b9Schristos            : "fstype" | "opts" | "passno"
6201a53f50b9Schristos            | "freq" | "dumpset" | "log"
6202a53f50b9Schristos            ;
6203a53f50b9Schristos@end example
6204a53f50b9Schristos
6205a53f50b9SchristosHere, @var{<device>} is the device name of the disk (for example,
6206a53f50b9Schristos@file{/dev/dsk/2s0}).  The device name is used for building the mount
6207a53f50b9Schristosmaps and for the @file{fstab} file.  The attributes that can be
6208a53f50b9Schristosspecified are shown in the following section.
6209a53f50b9Schristos
6210a53f50b9SchristosThe @i{FSinfo} configuration file for @code{dylan.doc.ic.ac.uk} is listed below.
6211a53f50b9Schristos
6212a53f50b9Schristos@example
6213a53f50b9Schristoshost dylan.doc.ic.ac.uk
6214a53f50b9Schristos
6215a53f50b9Schristosfs /dev/dsk/0s0 @{
6216a53f50b9Schristos        fstype = swap
6217a53f50b9Schristos@}
6218a53f50b9Schristos
6219a53f50b9Schristosfs /dev/dsk/0s0 @{
6220a53f50b9Schristos        fstype = hfs
6221a53f50b9Schristos        opts = rw,noquota,grpid
6222a53f50b9Schristos        passno = 0;
6223a53f50b9Schristos        freq = 1;
6224a53f50b9Schristos        mount / @{ @}
6225a53f50b9Schristos@}
6226a53f50b9Schristos
6227a53f50b9Schristosfs /dev/dsk/1s0 @{
6228a53f50b9Schristos        fstype = hfs
6229a53f50b9Schristos        opts = defaults
6230a53f50b9Schristos        passno = 1;
6231a53f50b9Schristos        freq = 1;
6232a53f50b9Schristos        mount /usr @{
6233a53f50b9Schristos                local @{
6234a53f50b9Schristos                        exportfs "dougal eden dylan zebedee brian"
6235a53f50b9Schristos                        volname /nfs/hp300/local
6236a53f50b9Schristos                @}
6237a53f50b9Schristos        @}
6238a53f50b9Schristos@}
6239a53f50b9Schristos
6240a53f50b9Schristosfs /dev/dsk/2s0 @{
6241a53f50b9Schristos        fstype = hfs
6242a53f50b9Schristos        opts = defaults
6243a53f50b9Schristos        passno = 1;
6244a53f50b9Schristos        freq = 1;
6245a53f50b9Schristos        mount default @{
6246a53f50b9Schristos                exportfs "toytown_clients hangers_on"
6247a53f50b9Schristos                volname /home/dylan/dk2
6248a53f50b9Schristos        @}
6249a53f50b9Schristos@}
6250a53f50b9Schristos
6251a53f50b9Schristosfs /dev/dsk/3s0 @{
6252a53f50b9Schristos        fstype = hfs
6253a53f50b9Schristos        opts = defaults
6254a53f50b9Schristos        passno = 1;
6255a53f50b9Schristos        freq = 1;
6256a53f50b9Schristos        mount default @{
6257a53f50b9Schristos                exportfs "toytown_clients hangers_on"
6258a53f50b9Schristos                volname /home/dylan/dk3
6259a53f50b9Schristos        @}
6260a53f50b9Schristos@}
6261a53f50b9Schristos
6262a53f50b9Schristosfs /dev/dsk/5s0 @{
6263a53f50b9Schristos        fstype = hfs
6264a53f50b9Schristos        opts = defaults
6265a53f50b9Schristos        passno = 1;
6266a53f50b9Schristos        freq = 1;
6267a53f50b9Schristos        mount default @{
6268a53f50b9Schristos                exportfs "toytown_clients hangers_on"
6269a53f50b9Schristos                volname /home/dylan/dk5
6270a53f50b9Schristos        @}
6271a53f50b9Schristos@}
6272a53f50b9Schristos@end example
6273a53f50b9Schristos
6274a53f50b9Schristos@menu
6275a53f50b9Schristos* FSinfo fstype Option::        FSinfo filesystems fstype.
6276a53f50b9Schristos* FSinfo opts Option::          FSinfo filesystems opts.
6277a53f50b9Schristos* FSinfo passno Option::        FSinfo filesystems passno.
6278a53f50b9Schristos* FSinfo freq Option::          FSinfo filesystems freq.
6279a53f50b9Schristos* FSinfo mount Option::         FSinfo filesystems mount.
6280a53f50b9Schristos* FSinfo dumpset Option::       FSinfo filesystems dumpset.
6281a53f50b9Schristos* FSinfo log Option::           FSinfo filesystems log.
6282a53f50b9Schristos@end menu
6283a53f50b9Schristos
6284a53f50b9Schristos@node FSinfo fstype Option, FSinfo opts Option, , FSinfo filesystems
6285a53f50b9Schristos@comment  node-name,  next,  previous,  up
6286a53f50b9Schristos@subsection fstype Option
6287a53f50b9Schristos@cindex FSinfo fstype filesystems option
6288a53f50b9Schristos@cindex fstype, FSinfo filesystems option
6289a53f50b9Schristos@cindex export, FSinfo special fstype
6290a53f50b9Schristos
6291a53f50b9SchristosThis specifies the type of filesystem being declared and will be placed
6292a53f50b9Schristosinto the @file{fstab} file as is.  The value of this option will be
6293a53f50b9Schristoshanded to @code{mount} as the filesystem type---it should have such
6294a53f50b9Schristosvalues as @code{4.2}, @code{nfs} or @code{swap}.  The value is not
6295a53f50b9Schristosexamined for correctness.
6296a53f50b9Schristos
6297a53f50b9SchristosThere is one special case.  If the filesystem type is specified as
6298a53f50b9Schristos@samp{export} then the filesystem information will not be added to the
6299a53f50b9Schristoshost's @file{fstab} information, but it will still be visible on the
6300a53f50b9Schristosnetwork.  This is useful for defining hosts which contain referenced
6301a53f50b9Schristosvolumes but which are not under full control of @i{FSinfo}.
6302a53f50b9Schristos
6303a53f50b9SchristosExample:
6304a53f50b9Schristos
6305a53f50b9Schristos@example
6306a53f50b9Schristosfstype = swap
6307a53f50b9Schristos@end example
6308a53f50b9Schristos
6309a53f50b9Schristos@node FSinfo opts Option, FSinfo passno Option, FSinfo fstype Option, FSinfo filesystems
6310a53f50b9Schristos@comment  node-name,  next,  previous,  up
6311a53f50b9Schristos@subsection opts Option
6312a53f50b9Schristos@cindex FSinfo opts filesystems option
6313a53f50b9Schristos@cindex opts, FSinfo filesystems option
6314a53f50b9Schristos
6315a53f50b9SchristosThis defines any options that should be given to @b{mount}(8) in the
6316a53f50b9Schristos@file{fstab} file.  For example:
6317a53f50b9Schristos
6318a53f50b9Schristos@example
6319a53f50b9Schristosopts = rw,nosuid,grpid
6320a53f50b9Schristos@end example
6321a53f50b9Schristos
6322a53f50b9Schristos@node FSinfo passno Option, FSinfo freq Option, FSinfo opts Option, FSinfo filesystems
6323a53f50b9Schristos@comment  node-name,  next,  previous,  up
6324a53f50b9Schristos@subsection passno Option
6325a53f50b9Schristos@cindex FSinfo passno filesystems option
6326a53f50b9Schristos@cindex passno, FSinfo filesystems option
6327a53f50b9Schristos
6328a53f50b9SchristosThis defines the @b{fsck}(8) pass number in which to check the
6329a53f50b9Schristosfilesystem.  This value will be placed into the @file{fstab} file.
6330a53f50b9Schristos
6331a53f50b9SchristosExample:
6332a53f50b9Schristos
6333a53f50b9Schristos@example
6334a53f50b9Schristospassno = 1
6335a53f50b9Schristos@end example
6336a53f50b9Schristos
6337a53f50b9Schristos@node FSinfo freq Option, FSinfo mount Option, FSinfo passno Option, FSinfo filesystems
6338a53f50b9Schristos@comment  node-name,  next,  previous,  up
6339a53f50b9Schristos@subsection freq Option
6340a53f50b9Schristos@cindex FSinfo freq filesystems option
6341a53f50b9Schristos@cindex freq, FSinfo filesystems option
6342a53f50b9Schristos
6343a53f50b9SchristosThis defines the interval (in days) between dumps.  The value is placed
6344a53f50b9Schristosas is into the @file{fstab} file.
6345a53f50b9Schristos
6346a53f50b9SchristosExample:
6347a53f50b9Schristos
6348a53f50b9Schristos@example
6349a53f50b9Schristosfreq = 3
6350a53f50b9Schristos@end example
6351a53f50b9Schristos
6352a53f50b9Schristos@node FSinfo mount Option, FSinfo dumpset Option, FSinfo freq Option, FSinfo filesystems
6353a53f50b9Schristos@comment  node-name,  next,  previous,  up
6354a53f50b9Schristos@subsection mount Option
6355a53f50b9Schristos@cindex FSinfo mount filesystems option
6356a53f50b9Schristos@cindex mount, FSinfo filesystems option
6357a53f50b9Schristos@cindex exportfs, FSinfo mount option
6358a53f50b9Schristos@cindex volname, FSinfo mount option
6359a53f50b9Schristos@cindex sel, FSinfo mount option
6360a53f50b9Schristos
6361a53f50b9SchristosThis defines the mountpoint at which to place the filesystem.  If the
6362a53f50b9Schristosmountpoint of the filesystem is specified as @code{default}, then the
6363a53f50b9Schristosfilesystem will be mounted in the automounter's tree under its volume
6364a53f50b9Schristosname and the mount will automatically be inherited by the automounter.
6365a53f50b9Schristos
6366a53f50b9SchristosFollowing the mountpoint, namespace information for the filesystem may
6367a53f50b9Schristosbe described.  The options that can be given here are @code{exportfs},
6368a53f50b9Schristos@code{volname} and @code{sel}.
6369a53f50b9Schristos
6370a53f50b9SchristosThe format is:
6371a53f50b9Schristos
6372a53f50b9Schristos@example
6373a53f50b9Schristosmount       : "mount" vol_tree ;
6374a53f50b9Schristos
6375a53f50b9Schristosvol_tree    : @i{list(}vol_tree_attr@i{)} ;
6376a53f50b9Schristos
6377a53f50b9Schristosvol_tree_attr
6378a53f50b9Schristos            :  @var{<string>} "@{" @i{list(}vol_tree_info@i{)} vol_tree "@}" ;
6379a53f50b9Schristos
6380a53f50b9Schristosvol_tree_info
6381a53f50b9Schristos            : "exportfs" @var{<export-data>}
6382a53f50b9Schristos            | "volname" @var{<volname>}
6383a53f50b9Schristos            | "sel" @var{<selector-list>}
6384a53f50b9Schristos            ;
6385a53f50b9Schristos@end example
6386a53f50b9Schristos
6387a53f50b9SchristosExample:
6388a53f50b9Schristos
6389a53f50b9Schristos@example
6390a53f50b9Schristosmount default @{
6391a53f50b9Schristos    exportfs "dylan dougal florence zebedee"
6392a53f50b9Schristos    volname /vol/andrew
6393a53f50b9Schristos@}
6394a53f50b9Schristos@end example
6395a53f50b9Schristos
6396a53f50b9SchristosIn the above example, the filesystem currently being declared will have
6397a53f50b9Schristosan entry placed into the @file{exports} file allowing the filesystem to
6398a53f50b9Schristosbe exported to the machines @code{dylan}, @code{dougal}, @code{florence}
6399a53f50b9Schristosand @code{zebedee}.  The volume name by which the filesystem will be
6400a53f50b9Schristosreferred to remotely, is @file{/vol/andrew}.  By declaring the
6401a53f50b9Schristosmountpoint to be @code{default}, the filesystem will be mounted on the
6402a53f50b9Schristoslocal machine in the automounter tree, where @i{Amd} will automatically
6403a53f50b9Schristosinherit the mount as @file{/vol/andrew}.@refill
6404a53f50b9Schristos
6405a53f50b9Schristos@table @samp
6406a53f50b9Schristos@item exportfs
6407a53f50b9Schristosa string defining which machines the filesystem may be exported to.
6408a53f50b9SchristosThis is copied, as is, into the @file{exports} file---no sanity checking
6409a53f50b9Schristosis performed on this string.@refill
6410a53f50b9Schristos
6411a53f50b9Schristos@item volname
6412a53f50b9Schristosa string which declares the remote name by which to reference the
6413a53f50b9Schristosfilesystem.  The string is entered into a dictionary and allows you to
6414a53f50b9Schristosrefer to this filesystem in other places by this volume name.@refill
6415a53f50b9Schristos
6416a53f50b9Schristos@item sel
6417a53f50b9Schristosa string which is placed into the automounter maps as a selector for the
6418a53f50b9Schristosfilesystem.@refill
6419a53f50b9Schristos
6420a53f50b9Schristos@end table
6421a53f50b9Schristos
6422a53f50b9Schristos@node FSinfo dumpset Option, FSinfo log Option, FSinfo mount Option, FSinfo filesystems
6423a53f50b9Schristos@comment  node-name,  next,  previous,  up
6424a53f50b9Schristos@subsection dumpset Option
6425a53f50b9Schristos@cindex FSinfo dumpset filesystems option
6426a53f50b9Schristos@cindex dumpset, FSinfo filesystems option
6427a53f50b9Schristos
6428a53f50b9SchristosThis provides support for Imperial College's local file backup tools and
6429a53f50b9Schristosis not documented further here.
6430a53f50b9Schristos
6431a53f50b9Schristos@node FSinfo log Option, , FSinfo dumpset Option, FSinfo filesystems
6432a53f50b9Schristos@comment  node-name,  next,  previous,  up
6433a53f50b9Schristos@subsection log Option
6434a53f50b9Schristos@cindex FSinfo log filesystems option
6435a53f50b9Schristos@cindex log, FSinfo filesystems option
6436a53f50b9Schristos
6437a53f50b9SchristosSpecifies the log device for the current filesystem. This is ignored if
6438a53f50b9Schristosnot required by the particular filesystem type.
6439a53f50b9Schristos
6440a53f50b9Schristos@node FSinfo static mounts, FSinfo automount definitions , FSinfo filesystems, FSinfo host definitions
6441a53f50b9Schristos@comment  node-name,  next,  previous,  up
6442a53f50b9Schristos@section @i{FSinfo} static mounts
6443a53f50b9Schristos@cindex FSinfo static mounts
6444a53f50b9Schristos@cindex Statically mounts filesystems, FSinfo
6445a53f50b9Schristos
6446a53f50b9SchristosEach host may also have a number of statically mounted filesystems.  For
6447a53f50b9Schristosexample, the host may be a diskless workstation in which case it will
6448a53f50b9Schristoshave no @code{fs} declarations.  In this case the @code{mount}
6449a53f50b9Schristosdeclaration is used to determine from where its filesystems will be
6450a53f50b9Schristosmounted.  In addition to being added to the @file{fstab} file, this
6451a53f50b9Schristosinformation can also be used to generate a suitable @file{bootparams}
6452a53f50b9Schristosfile.@refill
6453a53f50b9Schristos
6454a53f50b9Schristos@example
6455a53f50b9Schristosmount       : "mount" @var{<volname>} @i{list(}localinfo@i{)} ;
6456a53f50b9Schristos
6457a53f50b9Schristoslocalinfo   : localinfo_attr @var{<string>} ;
6458a53f50b9Schristos
6459a53f50b9Schristoslocalinfo_attr
6460a53f50b9Schristos            : "as"
6461a53f50b9Schristos            | "from"
6462a53f50b9Schristos            | "fstype"
6463a53f50b9Schristos            | "opts"
6464a53f50b9Schristos            ;
6465a53f50b9Schristos@end example
6466a53f50b9Schristos
6467a53f50b9SchristosThe filesystem specified to be mounted will be searched for in the
6468a53f50b9Schristosdictionary of volume names built when scanning the list of hosts'
6469a53f50b9Schristosdefinitions.
6470a53f50b9Schristos
6471a53f50b9SchristosThe attributes have the following semantics:
6472a53f50b9Schristos@table @samp
6473a53f50b9Schristos@item from @var{machine}
6474a53f50b9Schristosmount the filesystem from the machine with the hostname of
6475a53f50b9Schristos@dfn{machine}.@refill
6476a53f50b9Schristos
6477a53f50b9Schristos@item as @var{mountpoint}
6478a53f50b9Schristosmount the filesystem locally as the name given, in case this is
6479a53f50b9Schristosdifferent from the advertised volume name of the filesystem.
6480a53f50b9Schristos
6481a53f50b9Schristos@item opts @var{options}
6482a53f50b9Schristosnative @b{mount}(8) options.
6483a53f50b9Schristos
6484a53f50b9Schristos@item fstype @var{type}
6485a53f50b9Schristostype of filesystem to be mounted.
6486a53f50b9Schristos@end table
6487a53f50b9Schristos
6488a53f50b9SchristosAn example:
6489a53f50b9Schristos
6490a53f50b9Schristos@example
6491a53f50b9Schristosmount /export/exec/hp300/local as /usr/local
6492a53f50b9Schristos@end example
6493a53f50b9Schristos
6494a53f50b9SchristosIf the mountpoint specified is either @file{/} or @file{swap}, the
6495a53f50b9Schristosmachine will be considered to be booting off the net and this will be
6496a53f50b9Schristosnoted for use in generating a @file{bootparams} file for the host which
6497a53f50b9Schristosowns the filesystems.
6498a53f50b9Schristos
6499a53f50b9Schristos@node FSinfo automount definitions, FSinfo Command Line Options, FSinfo static mounts, FSinfo
6500a53f50b9Schristos@comment  node-name,  next,  previous,  up
6501a53f50b9Schristos@section Defining an @i{Amd} Mount Map in @i{FSinfo}
6502a53f50b9Schristos@cindex FSinfo automount definitions
6503a53f50b9Schristos@cindex Defining an Amd mount map, FSinfo
6504a53f50b9Schristos
6505a53f50b9SchristosThe maps used by @i{Amd} can be constructed from @i{FSinfo} by defining
6506a53f50b9Schristosall the automount trees.  @i{FSinfo} takes all the definitions found and
6507a53f50b9Schristosbuilds one map for each top level tree.
6508a53f50b9Schristos
6509a53f50b9SchristosThe automount tree is usually defined last.  A single automount
6510a53f50b9Schristosconfiguration will usually apply to an entire management domain.  One
6511a53f50b9Schristos@code{automount} declaration is needed for each @i{Amd} automount point.
6512a53f50b9Schristos@i{FSinfo} determines whether the automount point is @dfn{direct}
6513a53f50b9Schristos(@pxref{Direct Automount Filesystem}) or @dfn{indirect}
6514a53f50b9Schristos(@pxref{Top-level Filesystem}).  Direct automount points are
6515a53f50b9Schristosdistinguished by the fact that there is no underlying
6516a53f50b9Schristos@dfn{automount_tree}.@refill
6517a53f50b9Schristos
6518a53f50b9Schristos@example
6519a53f50b9Schristosautomount   : "automount" @i{opt(}auto_opts@i{)} automount_tree ;
6520a53f50b9Schristos
6521a53f50b9Schristosauto_opts   : "opts" @var{<mount-options>} ;
6522a53f50b9Schristos
6523a53f50b9Schristosautomount_tree
6524a53f50b9Schristos            : @i{list(}automount_attr@i{)}
6525a53f50b9Schristos            ;
6526a53f50b9Schristos
6527a53f50b9Schristosautomount_attr
6528a53f50b9Schristos            : @var{<string>} "=" @var{<volname>}
6529a53f50b9Schristos            | @var{<string>} "->" @var{<symlink>}
6530a53f50b9Schristos            | @var{<string>} "@{" automount_tree "@}"
6531a53f50b9Schristos            ;
6532a53f50b9Schristos@end example
6533a53f50b9Schristos
6534a53f50b9SchristosIf @var{<mount-options>} is given, then it is the string to be placed in
6535a53f50b9Schristosthe maps for @i{Amd} for the @code{opts} option.
6536a53f50b9Schristos
6537a53f50b9SchristosA @dfn{map} is typically a tree of filesystems, for example @file{home}
6538a53f50b9Schristosnormally contains a tree of filesystems representing other machines in
6539a53f50b9Schristosthe network.
6540a53f50b9Schristos
6541a53f50b9SchristosA map can either be given as a name representing an already defined
6542a53f50b9Schristosvolume name, or it can be a tree.  A tree is represented by placing
6543a53f50b9Schristosbraces after the name.  For example, to define a tree @file{/vol}, the
6544a53f50b9Schristosfollowing map would be defined:
6545a53f50b9Schristos
6546a53f50b9Schristos@example
6547a53f50b9Schristosautomount /vol @{ @}
6548a53f50b9Schristos@end example
6549a53f50b9Schristos
6550a53f50b9SchristosWithin a tree, the only items that can appear are more maps.
6551a53f50b9SchristosFor example:
6552a53f50b9Schristos
6553a53f50b9Schristos@example
6554a53f50b9Schristosautomount /vol @{
6555a53f50b9Schristos    andrew @{ @}
6556a53f50b9Schristos    X11 @{ @}
6557a53f50b9Schristos@}
6558a53f50b9Schristos@end example
6559a53f50b9Schristos
6560a53f50b9SchristosIn this case, @i{FSinfo} will look for volumes named @file{/vol/andrew}
6561a53f50b9Schristosand @file{/vol/X11} and a map entry will be generated for each.  If the
6562a53f50b9Schristosvolumes are defined more than once, then @i{FSinfo} will generate
6563a53f50b9Schristosa series of alternate entries for them in the maps.@refill
6564a53f50b9Schristos
6565a53f50b9SchristosInstead of a tree, either a link (@var{name} @code{->}
6566a53f50b9Schristos@var{destination}) or a reference can be specified (@var{name} @code{=}
6567a53f50b9Schristos@var{destination}).  A link creates a symbolic link to the string
6568a53f50b9Schristosspecified, without further processing the entry.  A reference will
6569a53f50b9Schristosexamine the destination filesystem and optimize the reference.  For
6570a53f50b9Schristosexample, to create an entry for @code{njw} in the @file{/homes} map,
6571a53f50b9Schristoseither of the two forms can be used:@refill
6572a53f50b9Schristos
6573a53f50b9Schristos@example
6574a53f50b9Schristosautomount /homes @{
6575a53f50b9Schristos    njw -> /home/dylan/njw
6576a53f50b9Schristos@}
6577a53f50b9Schristos@end example
6578a53f50b9Schristos
6579a53f50b9Schristosor
6580a53f50b9Schristos
6581a53f50b9Schristos@example
6582a53f50b9Schristosautomount /homes @{
6583a53f50b9Schristos    njw = /home/dylan/njw
6584a53f50b9Schristos@}
6585a53f50b9Schristos@end example
6586a53f50b9Schristos
6587a53f50b9SchristosIn the first example, when @file{/homes/njw} is referenced from @i{Amd},
6588a53f50b9Schristosa link will be created leading to @file{/home/dylan/njw} and the
6589a53f50b9Schristosautomounter will be referenced a second time to resolve this filename.
6590a53f50b9SchristosThe map entry would be:
6591a53f50b9Schristos
6592a53f50b9Schristos@example
6593a53f50b9Schristosnjw type:=link;fs:=/home/dylan/njw
6594a53f50b9Schristos@end example
6595a53f50b9Schristos
6596a53f50b9SchristosIn the second example, the destination directory is analyzed and found
6597a53f50b9Schristosto be in the filesystem @file{/home/dylan} which has previously been
6598a53f50b9Schristosdefined in the maps. Hence the map entry will look like:
6599a53f50b9Schristos
6600a53f50b9Schristos@example
6601a53f50b9Schristosnjw rhost:=dylan;rfs:=/home/dylan;sublink:=njw
6602a53f50b9Schristos@end example
6603a53f50b9Schristos
6604a53f50b9SchristosCreating only one symbolic link, and one access to @i{Amd}.
6605a53f50b9Schristos
6606a53f50b9Schristos@node FSinfo Command Line Options, FSinfo errors, FSinfo automount definitions, FSinfo
6607a53f50b9Schristos@comment  node-name,  next,  previous,  up
6608a53f50b9Schristos@section @i{FSinfo} Command Line Options
6609a53f50b9Schristos@cindex FSinfo command line options
6610a53f50b9Schristos@cindex Command line options, FSinfo
6611a53f50b9Schristos
6612a53f50b9Schristos@i{FSinfo} is started from the command line by using the command:
6613a53f50b9Schristos
6614a53f50b9Schristos@example
6615a53f50b9Schristosfsinfo [@i{options}] @i{files} ...
6616a53f50b9Schristos@end example
6617a53f50b9Schristos
6618a53f50b9SchristosThe input to @i{FSinfo} is a single set of definitions of machines and
6619a53f50b9Schristosautomount maps.  If multiple files are given on the command-line, then
6620a53f50b9Schristosthe files are concatenated together to form the input source.  The files
6621a53f50b9Schristosare passed individually through the C pre-processor before being parsed.
6622a53f50b9Schristos
6623a53f50b9SchristosSeveral options define a prefix for the name of an output file.  If the
6624a53f50b9Schristosprefix is not specified no output of that type is produced.  The suffix
6625a53f50b9Schristosused will correspond either to the hostname to which a file belongs, or
6626a53f50b9Schristosto the type of output if only one file is produced.  Dumpsets and the
6627a53f50b9Schristos@file{bootparams} file are in the latter class.  To put the output into
6628a53f50b9Schristosa subdirectory simply put a @file{/} at the end of the prefix, making
6629a53f50b9Schristossure that the directory has already been made before running
6630a53f50b9Schristos@i{Fsinfo}.
6631a53f50b9Schristos
6632a53f50b9Schristos@menu
6633a53f50b9Schristos* -a FSinfo Option::    Amd automount directory:
6634a53f50b9Schristos* -b FSinfo Option::    Prefix for bootparams files.
6635a53f50b9Schristos* -d FSinfo Option::    Prefix for dumpset data files.
6636a53f50b9Schristos* -e FSinfo Option::    Prefix for exports files.
6637a53f50b9Schristos* -f FSinfo Option::    Prefix for fstab files.
6638a53f50b9Schristos* -h FSinfo Option::    Local hostname.
6639a53f50b9Schristos* -m FSinfo Option::    Prefix for automount maps.
6640a53f50b9Schristos* -q FSinfo Option::    Ultra quiet mode.
6641a53f50b9Schristos* -v FSinfo Option::    Verbose mode.
6642a53f50b9Schristos* -I FSinfo Option::    Define new #include directory.
6643a53f50b9Schristos* -D-FSinfo Option::    Define macro.
6644a53f50b9Schristos* -U FSinfo Option::    Undefine macro.
6645a53f50b9Schristos@end menu
6646a53f50b9Schristos
6647a53f50b9Schristos@node -a FSinfo Option, -b FSinfo Option, FSinfo Command Line Options, FSinfo Command Line Options
6648a53f50b9Schristos@comment  node-name,  next,  previous,  up
6649a53f50b9Schristos@subsection @code{-a} @var{autodir}
6650a53f50b9Schristos
6651a53f50b9SchristosSpecifies the directory name in which to place the automounter's
6652a53f50b9Schristosmountpoints.  This defaults to @file{/a}.  Some sites have the autodir set
6653a53f50b9Schristosto be @file{/amd}, and this would be achieved by:
6654a53f50b9Schristos
6655a53f50b9Schristos@example
6656a53f50b9Schristosfsinfo -a /amd ...
6657a53f50b9Schristos@end example
6658a53f50b9Schristos
6659a53f50b9Schristos@node -b FSinfo Option, -d FSinfo Option, -a FSinfo Option, FSinfo Command Line Options
6660a53f50b9Schristos@comment  node-name,  next,  previous,  up
6661a53f50b9Schristos@subsection @code{-b} @var{bootparams}
6662a53f50b9Schristos@cindex bootparams, FSinfo prefix
6663a53f50b9Schristos
6664a53f50b9SchristosThis specifies the prefix for the @file{bootparams} filename.  If it is
6665a53f50b9Schristosnot given, then the file will not be generated.  The @file{bootparams}
6666a53f50b9Schristosfile will be constructed for the destination machine and will be placed
6667a53f50b9Schristosinto a file named @file{bootparams} and prefixed by this string.  The
6668a53f50b9Schristosfile generated contains a list of entries describing each diskless
6669a53f50b9Schristosclient that can boot from the destination machine.
6670a53f50b9Schristos
6671a53f50b9SchristosAs an example, to create a @file{bootparams} file in the directory
6672a53f50b9Schristos@file{generic}, the following would be used:
6673a53f50b9Schristos
6674a53f50b9Schristos@example
6675a53f50b9Schristosfsinfo -b generic/ ...
6676a53f50b9Schristos@end example
6677a53f50b9Schristos
6678a53f50b9Schristos@node -d FSinfo Option, -e FSinfo Option, -b FSinfo Option, FSinfo Command Line Options
6679a53f50b9Schristos@comment  node-name,  next,  previous,  up
6680a53f50b9Schristos@subsection @code{-d} @var{dumpsets}
6681a53f50b9Schristos@cindex dumpset, FSinfo prefix
6682a53f50b9Schristos
6683a53f50b9SchristosThis specifies the prefix for the @file{dumpsets} file.  If it is not
6684a53f50b9Schristosspecified, then the file will not be generated.  The file will be for
6685a53f50b9Schristosthe destination machine and will be placed into a filename
6686a53f50b9Schristos@file{dumpsets}, prefixed by this string.  The @file{dumpsets} file is
6687a53f50b9Schristosfor use by Imperial College's local backup system.
6688a53f50b9Schristos
6689a53f50b9SchristosFor example, to create a @file{dumpsets} file in the directory @file{generic},
6690a53f50b9Schristosthen you would use the following:
6691a53f50b9Schristos
6692a53f50b9Schristos@example
6693a53f50b9Schristosfsinfo -d generic/ ...
6694a53f50b9Schristos@end example
6695a53f50b9Schristos
6696a53f50b9Schristos@node -e FSinfo Option, -f FSinfo Option, -d FSinfo Option, FSinfo Command Line Options
6697a53f50b9Schristos@comment  node-name,  next,  previous,  up
6698a53f50b9Schristos@subsection @code{-e} @var{exportfs}
6699a53f50b9Schristos@cindex exports, FSinfo prefix
6700a53f50b9Schristos
6701a53f50b9SchristosDefines the prefix for the @file{exports} files.  If it is not given,
6702a53f50b9Schristosthen the file will not be generated.  For each machine defined in the
6703a53f50b9Schristosconfiguration files as having disks, an @file{exports} file is
6704a53f50b9Schristosconstructed and given a filename determined by the name of the machine,
6705a53f50b9Schristosprefixed with this string.  If a machine is defined as diskless, then no
6706a53f50b9Schristos@file{exports} file will be created for it.  The files contain entries
6707a53f50b9Schristosfor directories on the machine that may be exported to clients.
6708a53f50b9Schristos
6709a53f50b9SchristosExample: To create the @file{exports} files for each diskfull machine
6710a53f50b9Schristosand place them into the directory @file{exports}:
6711a53f50b9Schristos
6712a53f50b9Schristos@example
6713a53f50b9Schristosfsinfo -e exports/ ...
6714a53f50b9Schristos@end example
6715a53f50b9Schristos
6716a53f50b9Schristos@node -f FSinfo Option, -h FSinfo Option, -e FSinfo Option, FSinfo Command Line Options
6717a53f50b9Schristos@comment  node-name,  next,  previous,  up
6718a53f50b9Schristos@subsection @code{-f} @var{fstab}
6719a53f50b9Schristos@cindex fstab, FSinfo prefix
6720a53f50b9Schristos
6721a53f50b9SchristosThis defines the prefix for the @file{fstab} files.  The files will only
6722a53f50b9Schristosbe created if this prefix is defined.  For each machine defined in the
6723a53f50b9Schristosconfiguration files, a @file{fstab} file is created with the filename
6724a53f50b9Schristosdetermined by prefixing this string with the name of the machine.  These
6725a53f50b9Schristosfiles contain entries for filesystems and partitions to mount at boot
6726a53f50b9Schristostime.
6727a53f50b9Schristos
6728a53f50b9SchristosExample, to create the files in the directory @file{fstabs}:
6729a53f50b9Schristos
6730a53f50b9Schristos@example
6731a53f50b9Schristosfsinfo -f fstabs/ ...
6732a53f50b9Schristos@end example
6733a53f50b9Schristos
6734a53f50b9Schristos@node -h FSinfo Option, -m FSinfo Option, -f FSinfo Option, FSinfo Command Line Options
6735a53f50b9Schristos@comment  node-name,  next,  previous,  up
6736a53f50b9Schristos@subsection @code{-h} @var{hostname}
6737a53f50b9Schristos@cindex hostname, FSinfo command line option
6738a53f50b9Schristos
6739a53f50b9SchristosDefines the hostname of the destination machine to process for.  If this
6740a53f50b9Schristosis not specified, it defaults to the local machine name, as returned by
6741a53f50b9Schristos@b{gethostname}(2).
6742a53f50b9Schristos
6743a53f50b9SchristosExample:
6744a53f50b9Schristos
6745a53f50b9Schristos@example
6746a53f50b9Schristosfsinfo -h dylan.doc.ic.ac.uk ...
6747a53f50b9Schristos@end example
6748a53f50b9Schristos
6749a53f50b9Schristos@node -m FSinfo Option, -q FSinfo Option, -h FSinfo Option, FSinfo Command Line Options
6750a53f50b9Schristos@comment  node-name,  next,  previous,  up
6751a53f50b9Schristos@subsection @code{-m} @var{mount-maps}
6752a53f50b9Schristos@cindex maps, FSinfo command line option
6753a53f50b9Schristos
6754a53f50b9SchristosDefines the prefix for the automounter files.  The maps will only be
6755a53f50b9Schristosproduced if this prefix is defined.  The mount maps suitable for the
6756a53f50b9Schristosnetwork defined by the configuration files will be placed into files
6757a53f50b9Schristoswith names calculated by prefixing this string to the name of each map.
6758a53f50b9Schristos
6759a53f50b9SchristosFor example, to create the automounter maps and place them in the
6760a53f50b9Schristosdirectory @file{automaps}:
6761a53f50b9Schristos
6762a53f50b9Schristos@example
6763a53f50b9Schristosfsinfo -m automaps/ ...
6764a53f50b9Schristos@end example
6765a53f50b9Schristos
6766a53f50b9Schristos@node -q FSinfo Option, -v FSinfo Option, -m FSinfo Option, FSinfo Command Line Options
6767a53f50b9Schristos@comment  node-name,  next,  previous,  up
6768a53f50b9Schristos@subsection @code{-q}
6769a53f50b9Schristos@cindex quiet, FSinfo command line option
6770a53f50b9Schristos
6771a53f50b9SchristosSelects quiet mode.  @i{FSinfo} suppress the ``running commentary'' and
6772a53f50b9Schristosonly outputs any error messages which are generated.
6773a53f50b9Schristos
6774a53f50b9Schristos@node -v FSinfo Option, -D-FSinfo Option, -q FSinfo Option, FSinfo Command Line Options
6775a53f50b9Schristos@comment  node-name,  next,  previous,  up
6776a53f50b9Schristos@subsection @code{-v}
6777a53f50b9Schristos@cindex verbose, FSinfo command line option
6778a53f50b9Schristos
6779a53f50b9SchristosSelects verbose mode.  When this is activated, the program will display
6780a53f50b9Schristosmore messages, and display all the information discovered when
6781a53f50b9Schristosperforming the semantic analysis phase.  Each verbose message is output
6782a53f50b9Schristosto @file{stdout} on a line starting with a @samp{#} character.
6783a53f50b9Schristos
6784a53f50b9Schristos@node -D-FSinfo Option, -I FSinfo Option, -v FSinfo Option, FSinfo Command Line Options
6785a53f50b9Schristos@comment  node-name,  next,  previous,  up
6786a53f50b9Schristos@subsection @code{-D} @var{name}@i{[=defn]}
6787a53f50b9Schristos
6788a53f50b9SchristosDefines a symbol @dfn{name} for the preprocessor when reading the
6789a53f50b9Schristosconfiguration files.  Equivalent to @code{#define} directive.
6790a53f50b9Schristos
6791a53f50b9Schristos@node -I FSinfo Option, -U FSinfo Option, -D-FSinfo Option, FSinfo Command Line Options
6792a53f50b9Schristos@comment  node-name,  next,  previous,  up
6793a53f50b9Schristos@subsection @code{-I} @var{directory}
6794a53f50b9Schristos
6795a53f50b9SchristosThis option is passed into the preprocessor for the configuration files.
6796a53f50b9SchristosIt specifies directories in which to find include files
6797a53f50b9Schristos
6798a53f50b9Schristos@node -U FSinfo Option, , -I FSinfo Option, FSinfo Command Line Options
6799a53f50b9Schristos@comment  node-name,  next,  previous,  up
6800a53f50b9Schristos@subsection @code{-U} @var{name}
6801a53f50b9Schristos
6802a53f50b9SchristosRemoves any initial definition of the symbol @dfn{name}.  Inverse of the
6803a53f50b9Schristos@code{-D} option.
6804a53f50b9Schristos
6805a53f50b9Schristos@node FSinfo errors, , FSinfo Command Line Options, FSinfo
6806a53f50b9Schristos@comment  node-name,  next,  previous,  up
6807a53f50b9Schristos@section Errors produced by @i{FSinfo}
6808a53f50b9Schristos@cindex FSinfo error messages
6809a53f50b9Schristos
6810a53f50b9SchristosThe following table documents the errors and warnings which @i{FSinfo} may produce.
6811a53f50b9Schristos
6812a53f50b9Schristos@table @t
6813a53f50b9Schristos
6814a53f50b9Schristos@item " expected
6815a53f50b9SchristosOccurs if an unescaped newline is found in a quoted string.
6816a53f50b9Schristos
6817a53f50b9Schristos@item ambiguous mount: @var{volume} is a replicated filesystem
6818a53f50b9SchristosIf several filesystems are declared as having the same volume name, they
6819a53f50b9Schristoswill be considered replicated filesystems.  To mount a replicated
6820a53f50b9Schristosfilesystem statically, a specific host will need to be named, to say
6821a53f50b9Schristoswhich particular copy to try and mount, else this error will
6822a53f50b9Schristosresult.
6823a53f50b9Schristos
6824a53f50b9Schristos@item can't open @var{filename} for writing
6825a53f50b9SchristosOccurs if any errors are encountered when opening an output file.
6826a53f50b9Schristos
6827a53f50b9Schristos@item cannot determine localname since volname @var{volume} is not uniquely defined
6828a53f50b9SchristosIf a volume is replicated and an attempt is made to mount the filesystem
6829a53f50b9Schristosstatically without specifying a local mountpoint, @i{FSinfo} cannot
6830a53f50b9Schristoscalculate a mountpoint, as the desired pathname would be
6831a53f50b9Schristosambiguous.
6832a53f50b9Schristos
6833a53f50b9Schristos@item @var{device} has duplicate exportfs data
6834a53f50b9SchristosProduced if the @samp{exportfs} option is used multiple times within the
6835a53f50b9Schristossame branch of a filesystem definition. For example, if you attempt to
6836a53f50b9Schristosset the @samp{exportfs} data at different levels of the mountpoint
6837a53f50b9Schristosdirectory tree.
6838a53f50b9Schristos
6839a53f50b9Schristos@item dump frequency for @var{host}:@var{device} is non-zero
6840a53f50b9SchristosOccurs if @var{device} has its @samp{fstype} declared to be @samp{swap}
6841a53f50b9Schristosor @samp{export} and the @samp{dump} option is set to a value greater
6842a53f50b9Schristosthan zero.  Swap devices should not be dumped.
6843a53f50b9Schristos
6844a53f50b9Schristos@item duplicate host @var{hostname}!
6845a53f50b9SchristosIf a host has more than one definition.
6846a53f50b9Schristos
6847a53f50b9Schristos@item end of file within comment
6848a53f50b9SchristosA comment was unterminated before the end of one of the configuration
6849a53f50b9Schristosfiles.
6850a53f50b9Schristos
6851a53f50b9Schristos@item @var{filename}: cannot open for reading
6852a53f50b9SchristosIf a file specified on the command line as containing configuration data
6853a53f50b9Schristoscould not be opened.
6854a53f50b9Schristos
6855a53f50b9Schristos@item @var{filesystem} has a volname but no exportfs data
6856a53f50b9SchristosOccurs when a volume name is declared for a file system, but the string
6857a53f50b9Schristosspecifying what machines the filesystem can be exported to is
6858a53f50b9Schristosmissing.
6859a53f50b9Schristos
6860a53f50b9Schristos@item fs field "@var{field-name}" already set
6861a53f50b9SchristosOccurs when multiple definitions are given for one of the attributes of a
6862a53f50b9Schristoshost's filesystem.
6863a53f50b9Schristos
6864a53f50b9Schristos@item host field "@var{field-name}" already set
6865a53f50b9SchristosIf duplicate definitions are given for any of the fields with a host
6866a53f50b9Schristosdefinition.
6867a53f50b9Schristos
6868a53f50b9Schristos@item @var{host}:@var{device} has more than one mount point
6869a53f50b9SchristosOccurs if the mount option for a host's filesystem specifies multiple
6870a53f50b9Schristostrees at which to place the mountpoint.
6871a53f50b9Schristos
6872a53f50b9Schristos@item @var{host}:@var{device} has no mount point
6873a53f50b9SchristosOccurs if the @samp{mount} option is not specified for a host's
6874a53f50b9Schristosfilesystem.
6875a53f50b9Schristos
6876a53f50b9Schristos@item @var{host}:@var{device} needs field "@var{field-name}"
6877a53f50b9SchristosOccurs when a filesystem is missing a required field. @var{field-name} could
6878a53f50b9Schristosbe one of @samp{fstype}, @samp{opts}, @samp{passno} or
6879a53f50b9Schristos@samp{mount}.
6880a53f50b9Schristos
6881a53f50b9Schristos@item @var{host}:mount field specified for swap partition
6882a53f50b9SchristosOccurs if a mountpoint is given for a filesystem whose type is declared
6883a53f50b9Schristosto be @samp{swap}.
6884a53f50b9Schristos
6885a53f50b9Schristos@item malformed IP dotted quad: @var{address}
6886a53f50b9SchristosIf the Internet address of an interface is incorrectly specified.  An
6887a53f50b9SchristosInternet address definition is handled to @b{inet_addr}(3N) to see if it
6888a53f50b9Schristoscan cope.  If not, then this message will be displayed.
6889a53f50b9Schristos
6890a53f50b9Schristos@item malformed netmask: @var{netmask}
6891a53f50b9SchristosIf the netmask cannot be decoded as though it were a hexadecimal number,
6892a53f50b9Schristosthen this message will be displayed.  It will typically be caused by
6893a53f50b9Schristosincorrect characters in the @var{netmask} value.
6894a53f50b9Schristos
6895a53f50b9Schristos@item mount field "@var{field-name}" already set
6896a53f50b9SchristosOccurs when a static mount has multiple definitions of the same field.
6897a53f50b9Schristos
6898a53f50b9Schristos@item mount tree field "@var{field-name}" already set
6899a53f50b9SchristosOccurs when the @var{field-name} is defined more than once during the
6900a53f50b9Schristosdefinition of a filesystems mountpoint.
6901a53f50b9Schristos
6902a53f50b9Schristos@item netif field @var{field-name} already set
6903a53f50b9SchristosOccurs if you attempt to define an attribute of an interface more than
6904a53f50b9Schristosonce.
6905a53f50b9Schristos
6906a53f50b9Schristos@item network booting requires both root and swap areas
6907a53f50b9SchristosOccurs if a machine has mount declarations for either the root partition
6908a53f50b9Schristosor the swap area, but not both.  You cannot define a machine to only
6909a53f50b9Schristospartially boot via the network.
6910a53f50b9Schristos
6911a53f50b9Schristos@item no disk mounts on @var{hostname}
6912a53f50b9SchristosIf there are no static mounts, nor local disk mounts specified for a
6913a53f50b9Schristosmachine, this message will be displayed.
6914a53f50b9Schristos
6915a53f50b9Schristos@item no volname given for @var{host}:@var{device}
6916a53f50b9SchristosOccurs when a filesystem is defined to be mounted on @file{default}, but
6917a53f50b9Schristosno volume name is given for the file system, then the mountpoint cannot
6918a53f50b9Schristosbe determined.
6919a53f50b9Schristos
6920a53f50b9Schristos@item not allowed '/' in a directory name
6921a53f50b9SchristosOccurs when a pathname with multiple directory elements is specified as
6922a53f50b9Schristosthe name for an automounter tree.  A tree should only have one name at
6923a53f50b9Schristoseach level.
6924a53f50b9Schristos
6925a53f50b9Schristos@item pass number for @var{host}:@var{device} is non-zero
6926a53f50b9SchristosOccurs if @var{device} has its @samp{fstype} declared to be @samp{swap}
6927a53f50b9Schristosor @samp{export} and the @b{fsck}(8) pass number is set. Swap devices
6928a53f50b9Schristosshould not be fsck'd.  @xref{FSinfo fstype Option}.
6929a53f50b9Schristos
6930a53f50b9Schristos@item sub-directory @var{directory} of @var{directory-tree} starts with '/'
6931a53f50b9SchristosWithin the filesystem specification for a host, if an element
6932a53f50b9Schristos@var{directory} of the mountpoint begins with a @samp{/} and it is not
6933a53f50b9Schristosthe start of the tree.
6934a53f50b9Schristos
6935a53f50b9Schristos@item sub-directory of @var{directory-tree} is named "default"
6936a53f50b9Schristos@samp{default} is a keyword used to specify if a mountpoint should be
6937a53f50b9Schristosautomatically calculated by @i{FSinfo}.  If you attempt to specify a
6938a53f50b9Schristosdirectory name as this, it will use the filename of @file{default} but
6939a53f50b9Schristoswill produce this warning.
6940a53f50b9Schristos
6941a53f50b9Schristos@item unknown \ sequence
6942a53f50b9SchristosOccurs if an unknown escape sequence is found inside a string.  Within a
6943a53f50b9Schristosstring, you can give the standard C escape sequences for strings, such
6944a53f50b9Schristosas newlines and tab characters.
6945a53f50b9Schristos
6946a53f50b9Schristos@item unknown directory attribute
6947a53f50b9SchristosIf an unknown keyword is found while reading the definition of a host's
6948a53f50b9Schristosfilesystem mount option.
6949a53f50b9Schristos
6950a53f50b9Schristos@item unknown filesystem attribute
6951a53f50b9SchristosOccurs if an unrecognized keyword is used when defining a host's
6952a53f50b9Schristosfilesystems.
6953a53f50b9Schristos
6954a53f50b9Schristos@item unknown host attribute
6955a53f50b9SchristosOccurs if an unrecognized keyword is used when defining a host.
6956a53f50b9Schristos
6957a53f50b9Schristos@item unknown mount attribute
6958a53f50b9SchristosOccurs if an unrecognized keyword is found while parsing the list of
6959a53f50b9Schristosstatic mounts.
6960a53f50b9Schristos
6961a53f50b9Schristos@item unknown volname @var{volume} automounted @i{[} on @i{name} @i{]}
6962a53f50b9SchristosOccurs if @var{volume} is used in a definition of an automount map but the volume
6963a53f50b9Schristosname has not been declared during the host filesystem definitions.
6964a53f50b9Schristos
6965a53f50b9Schristos@item volname @var{volume} is unknown
6966a53f50b9SchristosOccurs if an attempt is made to mount or reference a volume name which
6967a53f50b9Schristoshas not been declared during the host filesystem definitions.
6968a53f50b9Schristos
6969a53f50b9Schristos@item volname @var{volume} not exported from @var{machine}
6970a53f50b9SchristosOccurs if you attempt to mount the volume @var{volume} from a machine
6971a53f50b9Schristoswhich has not declared itself to have such a filesystem
6972a53f50b9Schristosavailable.
6973a53f50b9Schristos
6974a53f50b9Schristos@end table
6975a53f50b9Schristos
6976a53f50b9Schristos@c ################################################################
6977a53f50b9Schristos@node Hlfsd, Assorted Tools, FSinfo, Top
6978a53f50b9Schristos@comment  node-name,  next,  previous,  up
6979a53f50b9Schristos@chapter Hlfsd
6980a53f50b9Schristos@pindex Hlfsd
6981a53f50b9Schristos@cindex Home-Link Filesystem
6982a53f50b9Schristos
6983a53f50b9Schristos@i{Hlfsd} is a daemon which implements a filesystem containing a
6984a53f50b9Schristossymbolic link to subdirectory within a user's home directory, depending
6985a53f50b9Schristoson the user which accessed that link.  It was primarily designed to
6986a53f50b9Schristosredirect incoming mail to users' home directories, so that it can be read
6987a53f50b9Schristosfrom anywhere.  It was designed and implemented by
6988a53f50b9Schristos@uref{http://www.cs.sunysb.edu/~ezk,Erez Zadok} and
6989a53f50b9Schristos@email{dupuy AT cs.columbia.edu,Alexander Dupuy}, at the
6990a53f50b9Schristos@uref{http://www.cs.columbia.edu/,Computer Science Department} of
6991a53f50b9Schristos@uref{http://www.columbia.edu/,Columbia University}.  A
6992a53f50b9Schristos@uref{http://www.fsl.cs.sunysb.edu/docs/hlfsd/hlfsd.html,paper}
6993a53f50b9Schristoson @i{Hlfsd} was presented at the Usenix LISA VII conference in 1993.
6994a53f50b9Schristos
6995a53f50b9Schristos@i{Hlfsd} operates by mounting itself as an NFS server for the directory
6996a53f50b9Schristoscontaining @i{linkname}, which defaults to @file{/hlfs/home}.  Lookups
6997a53f50b9Schristoswithin that directory are handled by @i{Hlfsd}, which uses the
6998a53f50b9Schristospassword map to determine how to resolve the lookup.  The directory will
6999a53f50b9Schristosbe created if it doesn't already exist.  The symbolic link will be to
7000a53f50b9Schristosthe accessing user's home directory, with @i{subdir} appended to it.  If
7001a53f50b9Schristosnot specified, @i{subdir} defaults to @file{.hlfsdir}.  This directory
7002a53f50b9Schristoswill also be created if it does not already exist.
7003a53f50b9Schristos
7004a53f50b9SchristosA @samp{SIGTERM} sent to @i{Hlfsd} will cause it to shutdown.  A
7005a53f50b9Schristos@samp{SIGHUP} will flush the internal caches, and reload the password
7006a53f50b9Schristosmap.  It will also close and reopen the log file, to enable the original
7007a53f50b9Schristoslog file to be removed or rotated.  A @samp{SIGUSR1} will cause it to
7008a53f50b9Schristosdump its internal table of user IDs and home directories to the file
7009a53f50b9Schristos@file{/tmp/hlfsddump}.
7010a53f50b9Schristos
7011a53f50b9Schristos@menu
7012a53f50b9Schristos* Introduction to Hlfsd::
7013a53f50b9Schristos* Background to Mail Delivery::
7014a53f50b9Schristos* Using Hlfsd::
7015a53f50b9Schristos@end menu
7016a53f50b9Schristos
7017a53f50b9Schristos@c ================================================================
7018a53f50b9Schristos@node Introduction to Hlfsd, Background to Mail Delivery, Hlfsd, Hlfsd
7019a53f50b9Schristos@comment  node-name,  next,  previous,  up
7020a53f50b9Schristos@section Introduction to Hlfsd
7021a53f50b9Schristos@cindex Introduction to Hlfsd
7022a53f50b9Schristos@cindex Hlfsd; introduction
7023a53f50b9Schristos
7024a53f50b9SchristosElectronic mail has become one of the major applications for many
7025a53f50b9Schristoscomputer networks, and use of this service is expected to increase over
7026a53f50b9Schristostime, as networks proliferate and become faster.  Providing a convenient
7027a53f50b9Schristosenvironment for users to read, compose, and send electronic mail has
7028a53f50b9Schristosbecome a requirement for systems administrators (SAs).
7029a53f50b9Schristos
7030a53f50b9SchristosWidely used methods for handling mail usually require users to be logged
7031a53f50b9Schristosinto a designated ``home'' machine, where their mailbox files reside.
7032a53f50b9SchristosOnly on that one machine can they read newly arrived mail.  Since users
7033a53f50b9Schristoshave to be logged into that system to read their mail, they often find
7034a53f50b9Schristosit convenient to run all of their other processes on that system as
7035a53f50b9Schristoswell, including memory and CPU-intensive jobs.  For example, in our
7036a53f50b9Schristosdepartment, we have allocated and configured several multi-processor
7037a53f50b9Schristosservers to handle such demanding CPU/memory applications, but these were
7038a53f50b9Schristosunderutilized, in large part due to the inconvenience of not being able
7039a53f50b9Schristosto read mail on those machines.  (No home directories were located on
7040a53f50b9Schristosthese designated CPU-servers, since we did not want NFS service for
7041a53f50b9Schristosusers' home directories to have to compete with CPU-intensive jobs.  At the
7042a53f50b9Schristossame time, we discouraged users from running demanding applications on
7043a53f50b9Schristostheir home machines.)
7044a53f50b9Schristos
7045a53f50b9SchristosMany different solutions have been proposed to allow users to read their
7046a53f50b9Schristosmail on any host.  However, all of these solutions fail in one or more
7047a53f50b9Schristosof several ways:
7048a53f50b9Schristos
7049a53f50b9Schristos@itemize @bullet
7050a53f50b9Schristos
7051a53f50b9Schristos@item
7052a53f50b9Schristosthey introduce new single points of failure
7053a53f50b9Schristos
7054a53f50b9Schristos@item
7055a53f50b9Schristosthey require using different mail transfer agents (MTAs) or user agents
7056a53f50b9Schristos(UAs)
7057a53f50b9Schristos
7058a53f50b9Schristos@item
7059a53f50b9Schristosthey do not solve the problem for all cases, i.e.  the solution is only
7060a53f50b9Schristospartially successful for a particular environment.
7061a53f50b9Schristos
7062a53f50b9Schristos@end itemize
7063a53f50b9Schristos
7064a53f50b9SchristosWe have designed a simple filesystem, called the @dfn{Home-Link File
7065a53f50b9SchristosSystem}, to provide the ability to deliver mail to users' home
7066a53f50b9Schristosdirectories, without modification to mail-related applications. We have
7067a53f50b9Schristosendeavored to make it as stable as possible.  Of great importance to us
7068a53f50b9Schristoswas to make sure the HLFS daemon, @file{hlfsd} , would not hang under
7069a53f50b9Schristosany circumstances, and would take the next-best action when faced with
7070a53f50b9Schristosproblems.  Compared to alternative methods, @i{Hlfsd} is a stable, more
7071a53f50b9Schristosgeneral solution, and easier to install/use.  In fact, in some ways, we
7072a53f50b9Schristoshave even managed to improve the reliability and security of mail
7073a53f50b9Schristosservice.
7074a53f50b9Schristos
7075a53f50b9SchristosOur server implements a small filesystem containing a symbolic link
7076a53f50b9Schristosto a subdirectory of the invoking user's home directory, and named symbolic
7077a53f50b9Schristoslinks to users' mailbox files.
7078a53f50b9Schristos
7079a53f50b9SchristosThe @i{Hlfsd} server finds out the @var{uid} of the process that is
7080a53f50b9Schristosaccessing its mount point, and resolves the pathname component @samp{home} as a
7081a53f50b9Schristossymbolic link to a subdirectory within the home directory given by the
7082a53f50b9Schristos@var{uid}'s entry in the password file.  If the @var{gid} of the process
7083a53f50b9Schristosthat attempts to access a mailbox file is a special one (called
7084a53f50b9SchristosHLFS_GID), then the server maps the name of the @emph{next} pathname
7085a53f50b9Schristoscomponent directly to the user's mailbox.  This is necessary so that
7086a53f50b9Schristosaccess to a mailbox file by users other than the owner can succeed.  The
7087a53f50b9Schristosserver has safety features in case of failures such as hung filesystems
7088a53f50b9Schristosor home directory filesystems that are inaccessible or full.
7089a53f50b9Schristos
7090a53f50b9SchristosOn most of our machines, mail gets delivered to the directory
7091a53f50b9Schristos@file{/var/spool/mail}. Many programs, including UAs, depend on that
7092a53f50b9Schristospath.  @i{Hlfsd} creates a directory @file{/mail}, and mounts itself on
7093a53f50b9Schristostop of that directory.  @i{Hlfsd} implements the path name component
7094a53f50b9Schristoscalled @samp{home}, pointing to a subdirectory of the user's home directory.
7095a53f50b9SchristosWe have made @file{/var/spool/mail} a symbolic link to
7096a53f50b9Schristos@file{/mail/home}, so that accessing @file{/var/spool/mail} actually
7097a53f50b9Schristoscauses access to a subdirectory within a user's home directory.
7098a53f50b9Schristos
7099a53f50b9SchristosThe following table shows an example of how resolving the pathname
7100a53f50b9Schristos@file{/var/mail/@i{NAME}} to @file{/users/ezk/.mailspool/@i{NAME}} proceeds.
7101a53f50b9Schristos
7102a53f50b9Schristos@multitable {Resolving Component} {Pathname left to resolve} {Value if symbolic link}
7103a53f50b9Schristos
7104a53f50b9Schristos@item @b{Resolving Component}
7105a53f50b9Schristos@tab @b{Pathname left to resolve}
7106a53f50b9Schristos@tab @b{Value if symbolic link}
7107a53f50b9Schristos
7108a53f50b9Schristos@item @t{/}
7109a53f50b9Schristos@tab @t{var/mail/}@i{NAME}
7110a53f50b9Schristos
7111a53f50b9Schristos@item @t{var/}
7112a53f50b9Schristos@tab @t{mail/}@i{NAME}
7113a53f50b9Schristos
7114a53f50b9Schristos@item @t{mail}@@
7115a53f50b9Schristos@tab @t{/mail/home/}@i{NAME}
7116a53f50b9Schristos@tab @t{mail}@@ -> @t{/mail/home}
7117a53f50b9Schristos
7118a53f50b9Schristos@item @t{/}
7119a53f50b9Schristos@tab @t{mail/home/}@i{NAME}
7120a53f50b9Schristos
7121a53f50b9Schristos@item @t{mail/}
7122a53f50b9Schristos@tab @t{home/}@i{NAME}
7123a53f50b9Schristos
7124a53f50b9Schristos@item @t{home}@@
7125a53f50b9Schristos@tab @i{NAME}
7126a53f50b9Schristos@tab @t{home}@@ -> @t{/users/ezk/.mailspool}
7127a53f50b9Schristos
7128a53f50b9Schristos@item @t{/}
7129a53f50b9Schristos@tab @t{users/ezk/.mailspool/}@i{NAME}
7130a53f50b9Schristos
7131a53f50b9Schristos@item @t{users/}
7132a53f50b9Schristos@tab @t{ezk/.mailspool/}@i{NAME}
7133a53f50b9Schristos
7134a53f50b9Schristos@item @t{ezk/}
7135a53f50b9Schristos@tab @t{.mailspool/}@i{NAME}
7136a53f50b9Schristos
7137a53f50b9Schristos@item @t{.mailspool/}
7138a53f50b9Schristos@tab @i{NAME}
7139a53f50b9Schristos
7140a53f50b9Schristos@item @i{NAME}
7141a53f50b9Schristos
7142a53f50b9Schristos@end multitable
7143a53f50b9Schristos
7144a53f50b9Schristos@c ================================================================
7145a53f50b9Schristos@node Background to Mail Delivery, Using Hlfsd, Introduction to Hlfsd, Hlfsd
7146a53f50b9Schristos@comment  node-name,  next,  previous,  up
7147a53f50b9Schristos@section Background to Mail Delivery
7148a53f50b9Schristos@cindex Background to Mail Delivery
7149a53f50b9Schristos@cindex Hlfsd; background
7150a53f50b9Schristos
7151a53f50b9SchristosThis section provides an in-depth discussion of why available methods
7152a53f50b9Schristosfor delivering mail to home directories are not as good as the one used
7153a53f50b9Schristosby @i{Hlfsd}.
7154a53f50b9Schristos
7155a53f50b9Schristos@menu
7156a53f50b9Schristos* Single-Host Mail Spool Directory::
7157a53f50b9Schristos* Centralized Mail Spool Directory::
7158a53f50b9Schristos* Distributed Mail Spool Service::
7159a53f50b9Schristos* Why Deliver Into the Home Directory?::
7160a53f50b9Schristos@end menu
7161a53f50b9Schristos
7162a53f50b9Schristos@c ----------------------------------------------------------------
7163a53f50b9Schristos@node Single-Host Mail Spool Directory, Centralized Mail Spool Directory, Background to Mail Delivery, Background to Mail Delivery
7164a53f50b9Schristos@comment  node-name,  next,  previous,  up
7165a53f50b9Schristos@subsection Single-Host Mail Spool Directory
7166a53f50b9Schristos@cindex Single-Host Mail Spool Directory
7167a53f50b9Schristos
7168a53f50b9SchristosThe most common method for mail delivery is for mail to be appended to a
7169a53f50b9Schristosmailbox file in a standard spool directory on the designated ``mail
7170a53f50b9Schristoshome'' machine of the user. The greatest advantage of this method is
7171a53f50b9Schristosthat it is the default method most vendors provide with their systems,
7172a53f50b9Schristosthus very little (if any) configuration is required on the SA's part.
7173a53f50b9SchristosAll they need to set up are mail aliases directing mail to the host on
7174a53f50b9Schristoswhich the user's mailbox file is assigned.  (Otherwise, mail is
7175a53f50b9Schristosdelivered locally, and users find mailboxes on many machines.)
7176a53f50b9Schristos
7177a53f50b9SchristosAs users become more sophisticated, and aided by windowing systems, they
7178a53f50b9Schristosfind themselves logging in on multiple hosts at once, performing several
7179a53f50b9Schristostasks concurrently.  They ask to be able to read their mail on any host
7180a53f50b9Schristoson the network, not just the one designated as their ``mail home''.
7181a53f50b9Schristos
7182a53f50b9Schristos@c ----------------------------------------------------------------
7183a53f50b9Schristos@node Centralized Mail Spool Directory, Distributed Mail Spool Service, Single-Host Mail Spool Directory, Background to Mail Delivery
7184a53f50b9Schristos@comment  node-name,  next,  previous,  up
7185a53f50b9Schristos@subsection Centralized Mail Spool Directory
7186a53f50b9Schristos@cindex Centralized Mail Spool Directory
7187a53f50b9Schristos
7188a53f50b9SchristosA popular method for providing mail readability from any host is to have
7189a53f50b9Schristosall mail delivered to a mail spool directory on a designated
7190a53f50b9Schristos``mail-server'' which is exported via NFS to all of the hosts on the
7191a53f50b9Schristosnetwork.  Configuring such a system is relatively easy.  On most
7192a53f50b9Schristossystems, the bulk of the work is a one-time addition to one or two
7193a53f50b9Schristosconfiguration files in @file{/etc}.  The file-server's spool directory
7194a53f50b9Schristosis then hard-mounted across every machine on the local network.  In
7195a53f50b9Schristossmall environments with only a handful of hosts this can be an
7196a53f50b9Schristosacceptable solution.  In our department, with a couple of hundred active
7197a53f50b9Schristoshosts and thousands of mail messages processed daily, this was deemed
7198a53f50b9Schristoscompletely unacceptable, as it introduced several types of problems:
7199a53f50b9Schristos
7200a53f50b9Schristos@table @b
7201a53f50b9Schristos
7202a53f50b9Schristos@item Scalability and Performance
7203a53f50b9Schristos
7204a53f50b9SchristosAs more and more machines get added to the network, more mail traffic
7205a53f50b9Schristoshas to go over NFS to and from the mail-server. Users like to run
7206a53f50b9Schristosmail-watchers, and read their mail often. The stress on the shared
7207a53f50b9Schristosinfrastructure increases with every user and host added; loads on the
7208a53f50b9Schristosmail server would most certainly be high since all mail delivery goes
7209a53f50b9Schristosthrough that one machine.@footnote{ Delivery via NFS-mounted filesystems
7210a53f50b9Schristosmay require usage of @samp{rpc.lockd} and @samp{rpc.statd} to provide
7211a53f50b9Schristosdistributed file-locking, both of which are widely regarded as unstable
7212a53f50b9Schristosand unreliable.  Furthermore, this will degrade performance, as local
7213a53f50b9Schristosprocesses as well as remote @samp{nfsd} processes are kept busy.}  This
7214a53f50b9Schristosleads to lower reliability and performance.  To reduce the number of
7215a53f50b9Schristosconcurrent connections between clients and the server host, some SAs
7216a53f50b9Schristoshave resorted to automounting the mail-spool directory.  But this
7217a53f50b9Schristossolution only makes things worse: since users often run mail watchers,
7218a53f50b9Schristosand many popular applications such as @samp{trn}, @samp{emacs},
7219a53f50b9Schristos@samp{csh} or @samp{ksh} check periodically for new mail, the
7220a53f50b9Schristosautomounted directory would be effectively permanently mounted.  If it
7221a53f50b9Schristosgets unmounted automatically by the automounter program, it is most
7222a53f50b9Schristoslikely to get mounted shortly afterwards, consuming more I/O resources
7223a53f50b9Schristosby the constant cycle of mount and umount calls.
7224a53f50b9Schristos
7225a53f50b9Schristos@item Reliability
7226a53f50b9Schristos
7227a53f50b9SchristosThe mail-server host and its network connectivity must be very reliable.
7228a53f50b9SchristosWorse, since the spool directory has to be hard-mounted,@footnote{No SA
7229a53f50b9Schristosin their right minds would soft-mount read/write partitions --- the
7230a53f50b9Schristoschances for data loss are too great.} many processes which access the
7231a53f50b9Schristosspool directory (various shells, @samp{login}, @samp{emacs}, etc.)
7232a53f50b9Schristoswould be hung as long as connectivity to the mail-server is severed. To
7233a53f50b9Schristosimprove reliability, SAs may choose to backup the mail-server's spool
7234a53f50b9Schristospartition several times a day.  This may make things worse since reading
7235a53f50b9Schristosor delivering mail while backups are in progress may cause backups to be
7236a53f50b9Schristosinconsistent; more backups consume more backup-media resources, and
7237a53f50b9Schristosincrease the load on the mail-server host.
7238a53f50b9Schristos
7239a53f50b9Schristos@end table
7240a53f50b9Schristos
7241a53f50b9Schristos@c ----------------------------------------------------------------
7242a53f50b9Schristos@node Distributed Mail Spool Service, Why Deliver Into the Home Directory?, Centralized Mail Spool Directory, Background to Mail Delivery
7243a53f50b9Schristos@comment  node-name,  next,  previous,  up
7244a53f50b9Schristos@subsection Distributed Mail Spool Service
7245a53f50b9Schristos@cindex Distributed Mail Spool Service
7246a53f50b9Schristos
7247a53f50b9SchristosDespite the existence of a few systems that support delivery to users'
7248a53f50b9Schristoshome directories, mail delivery to home directories hasn't caught on.
7249a53f50b9SchristosWe believe the main reason is that there are too many programs that
7250a53f50b9Schristos``know'' where mailbox files reside.  Besides the obvious (the delivery
7251a53f50b9Schristosprogram @file{/bin/mail} and mail readers like @file{/usr/ucb/Mail},
7252a53f50b9Schristos@samp{mush}, @samp{mm}, etc.), other programs that know mailbox location
7253a53f50b9Schristosare login, from, almost every shell, @samp{xbiff}, @samp{xmailbox}, and
7254a53f50b9Schristoseven some programs not directly related to mail, such as @samp{emacs}
7255a53f50b9Schristosand @samp{trn}.  Although some of these programs can be configured to
7256a53f50b9Schristoslook in different directories with the use of environment variables and
7257a53f50b9Schristosother resources, many of them cannot.  The overall porting work is
7258a53f50b9Schristossignificant.
7259a53f50b9Schristos
7260a53f50b9SchristosOther methods that have yet to catch on require the use of a special
7261a53f50b9Schristosmail-reading server, such as IMAP or POP.  The main disadvantage of
7262a53f50b9Schristosthese systems is that UAs need to be modified to use these services ---
7263a53f50b9Schristosa long and involved task.  That is why they are not popular at this
7264a53f50b9Schristostime.
7265a53f50b9Schristos
7266a53f50b9SchristosSeveral other ideas have been proposed and even used in various
7267a53f50b9Schristosenvironments.  None of them is robust.  They are mostly very
7268a53f50b9Schristosspecialized, inflexible, and do not extend to the general case.  Some of
7269a53f50b9Schristosthe ideas are plain bad, potentially leading to lost or corrupt mail:
7270a53f50b9Schristos
7271a53f50b9Schristos@table @b
7272a53f50b9Schristos
7273a53f50b9Schristos@item automounters
7274a53f50b9Schristos
7275a53f50b9SchristosUsing an automounter such as @i{Amd} to provide a set of symbolic links
7276a53f50b9Schristosfrom the normal spool directory to user home directories is not
7277a53f50b9Schristossufficient.  UAs rename, unlink, and recreate the mailbox as a regular
7278a53f50b9Schristosfile, therefore it must be a real file, not a symbolic link.
7279a53f50b9SchristosFurthermore, it must reside in a real directory which is writable by the
7280a53f50b9SchristosUAs and MTAs.  This method may also require populating
7281a53f50b9Schristos@file{/var/spool/mail} with symbolic links and making sure they are
7282a53f50b9Schristosupdated.  Making @i{Amd} manage that directory directly fails, since
7283a53f50b9Schristosmany various lock files need to be managed as well.  Also, @i{Amd} does
7284a53f50b9Schristosnot provide all of the NFS operations which are required to write mail
7285a53f50b9Schristossuch as write, create, remove, and unlink.
7286a53f50b9Schristos
7287a53f50b9Schristos@item @code{$MAIL}
7288a53f50b9Schristos
7289a53f50b9SchristosSetting this variable to an automounted directory pointing to the user's
7290a53f50b9Schristosmail spool host only solves the problem for those programs which know
7291a53f50b9Schristosand use @code{$MAIL}.  Many programs don't, therefore this solution is partial
7292a53f50b9Schristosand of limited flexibility.  Also, it requires the SAs or the users to
7293a53f50b9Schristosset it themselves --- an added level of inconvenience and possible
7294a53f50b9Schristosfailures.
7295a53f50b9Schristos
7296a53f50b9Schristos@item @t{/bin/mail}
7297a53f50b9Schristos
7298a53f50b9SchristosUsing a different mail delivery agent could be the solution.  One such
7299a53f50b9Schristosexample is @samp{hdmail}.  However, @samp{hdmail} still requires
7300a53f50b9Schristosmodifying all UAs, the MTA's configuration, installing new daemons, and
7301a53f50b9Schristoschanging login scripts.  This makes the system less upgradable or
7302a53f50b9Schristoscompatible with others, and adds one more complicated system for SAs to
7303a53f50b9Schristosdeal with.  It is not a complete solution because it still requires each
7304a53f50b9Schristosuser have their @code{$MAIL} variable setup correctly, and that every program
7305a53f50b9Schristosuse this variable.
7306a53f50b9Schristos
7307a53f50b9Schristos@end table
7308a53f50b9Schristos
7309a53f50b9Schristos@c ----------------------------------------------------------------
7310a53f50b9Schristos@node Why Deliver Into the Home Directory?, , Distributed Mail Spool Service, Background to Mail Delivery
7311a53f50b9Schristos@comment  node-name,  next,  previous,  up
7312a53f50b9Schristos@subsection Why Deliver Into the Home Directory?
7313a53f50b9Schristos@cindex Why Deliver Into the Home Directory?
7314a53f50b9Schristos@cindex Hlfsd; Why Deliver Into the Home Directory?
7315a53f50b9Schristos
7316a53f50b9SchristosThere are several major reasons why SAs might want to deliver mail
7317a53f50b9Schristosdirectly into the users' home directories:
7318a53f50b9Schristos
7319a53f50b9Schristos@table @b
7320a53f50b9Schristos
7321a53f50b9Schristos@item Location
7322a53f50b9Schristos
7323a53f50b9SchristosMany mail readers need to move mail from the spool directory to the
7324a53f50b9Schristosuser's home directory.  It speeds up this operation if the two are on
7325a53f50b9Schristosthe same filesystem.  If for some reason the user's home directory is
7326a53f50b9Schristosinaccessible, it isn't that useful to be able to read mail, since there
7327a53f50b9Schristosis no place to move it to.  In some cases, trying to move mail to a
7328a53f50b9Schristosnon-existent or hung filesystem may result in mail loss.
7329a53f50b9Schristos
7330a53f50b9Schristos@item Distribution
7331a53f50b9Schristos
7332a53f50b9SchristosHaving all mail spool directories spread among the many more filesystems
7333a53f50b9Schristosminimizes the chances that complete environments will grind to a halt
7334a53f50b9Schristoswhen a single server is down.  It does increase the chance that there
7335a53f50b9Schristoswill be someone who is not able to read their mail when a machine is
7336a53f50b9Schristosdown, but that is usually preferred to having no one be able to read
7337a53f50b9Schristostheir mail because a centralized mail server is down.  The problem of
7338a53f50b9Schristoslosing some mail due to the (presumably) higher chances that a user's
7339a53f50b9Schristosmachine is down is minimized in HLFS.
7340a53f50b9Schristos
7341a53f50b9Schristos@item Security
7342a53f50b9Schristos
7343a53f50b9SchristosDelivering mail to users' home directories has another advantage ---
7344a53f50b9Schristosenhanced security and privacy.  Since a shared system mail spool
7345a53f50b9Schristosdirectory has to be world-readable and searchable, any user can see
7346a53f50b9Schristoswhether other users have mail, when they last received new mail, or when
7347a53f50b9Schristosthey last read their mail.  Programs such as @samp{finger} display this
7348a53f50b9Schristosinformation, which some consider an infringement of privacy.  While it
7349a53f50b9Schristosis possible to disable this feature of @samp{finger} so that remote
7350a53f50b9Schristosusers cannot see a mailbox file's status, this doesn't prevent local
7351a53f50b9Schristosusers from getting the information.  Furthermore, there are more
7352a53f50b9Schristosprograms which make use of this information.  In shared environments,
7353a53f50b9Schristosdisabling such programs has to be done on a system-wide basis, but with
7354a53f50b9Schristosmail delivered to users' home directories, users less concerned with
7355a53f50b9Schristosprivacy who do want to let others know when they last received or read
7356a53f50b9Schristosmail can easily do so using file protection bits.
7357a53f50b9Schristos
7358a53f50b9Schristos@c Lastly, on systems that do not export their NFS filesystem with
7359a53f50b9Schristos@c @t{anon=0}, superusers are less likely to snoop around others' mail, as
7360a53f50b9Schristos@c they become ``nobodies'' across NFS.
7361a53f50b9Schristos
7362a53f50b9Schristos@end table
7363a53f50b9Schristos
7364a53f50b9SchristosIn summary, delivering mail to home directories provides users the
7365a53f50b9Schristosfunctionality sought, and also avoids most of the problems just
7366a53f50b9Schristosdiscussed.
7367a53f50b9Schristos
7368a53f50b9Schristos@c ================================================================
7369a53f50b9Schristos@node Using Hlfsd, , Background to Mail Delivery, Hlfsd
7370a53f50b9Schristos@comment  node-name,  next,  previous,  up
7371a53f50b9Schristos@section Using Hlfsd
7372a53f50b9Schristos@cindex Using Hlfsd
7373a53f50b9Schristos@cindex Hlfsd; using
7374a53f50b9Schristos
7375a53f50b9Schristos@menu
7376a53f50b9Schristos* Controlling Hlfsd::
7377a53f50b9Schristos* Hlfsd Options::
7378a53f50b9Schristos* Hlfsd Files::
7379a53f50b9Schristos@end menu
7380a53f50b9Schristos
7381a53f50b9Schristos@c ----------------------------------------------------------------
7382a53f50b9Schristos@node Controlling Hlfsd, Hlfsd Options, Using Hlfsd, Using Hlfsd
7383a53f50b9Schristos@comment  node-name,  next,  previous,  up
7384a53f50b9Schristos@subsection Controlling Hlfsd
7385a53f50b9Schristos@cindex Controlling Hlfsd
7386a53f50b9Schristos@cindex Hlfsd; controlling
7387a53f50b9Schristos@pindex ctl-hlfsd
7388a53f50b9Schristos
7389a53f50b9SchristosMuch the same way @i{Amd} is controlled by @file{ctl-amd}, so does
7390a53f50b9Schristos@i{Hlfsd} get controlled by the @file{ctl-hlfsd} script:
7391a53f50b9Schristos
7392a53f50b9Schristos@table @t
7393a53f50b9Schristos
7394a53f50b9Schristos@item ctl-hlfsd start
7395a53f50b9SchristosStart a new @i{Hlfsd}.
7396a53f50b9Schristos
7397a53f50b9Schristos@item ctl-hlfsd stop
7398a53f50b9SchristosStop a running @i{Hlfsd}.
7399a53f50b9Schristos
7400a53f50b9Schristos@item ctl-hlfsd restart
7401a53f50b9SchristosStop a running @i{Hlfsd}, wait for 10 seconds, and then start a new
7402a53f50b9Schristosone.  It is hoped that within 10 seconds, the previously running
7403a53f50b9Schristos@i{Hlfsd} terminate properly; otherwise, starting a second one could
7404a53f50b9Schristoscause system lockup.
7405a53f50b9Schristos
7406a53f50b9Schristos@end table
7407a53f50b9Schristos
7408a53f50b9SchristosFor example, on our systems, we start @i{Hlfsd} within @file{ctl-hlfsd}
7409a53f50b9Schristosas follows on Solaris 2 systems:
7410a53f50b9Schristos
7411a53f50b9Schristos@example
7412a53f50b9Schristoshlfsd -a /var/alt_mail -x all -l /var/log/hlfsd /mail/home .mailspool
7413a53f50b9Schristos@end example
7414a53f50b9Schristos
7415a53f50b9SchristosThe directory @file{/var/alt_mail} is a directory in the root partition
7416a53f50b9Schristoswhere alternate mail will be delivered into, when it cannot be delivered
7417a53f50b9Schristosinto the user's home directory.
7418a53f50b9Schristos
7419a53f50b9SchristosNormal mail gets delivered into @file{/var/mail}, but on our systems,
7420a53f50b9Schristosthat is a symbolic link to @file{/mail/home}.  @file{/mail} is managed
7421a53f50b9Schristosby @i{Hlfsd}, which creates a dynamic symlink named @samp{home},
7422a53f50b9Schristospointing to the subdirectory @file{.mailspool} @emph{within} the
7423a53f50b9Schristosaccessing user's home directory.  This results in mail which normally
7424a53f50b9Schristosshould go to @file{/var/mail/@code{$USER}}, to go to
7425a53f50b9Schristos@file{@code{$HOME}/.mailspool/@code{$USER}}.
7426a53f50b9Schristos
7427a53f50b9Schristos@i{Hlfsd} does not create the @file{/var/mail} symlink.  This needs to
7428a53f50b9Schristosbe created (manually) once on each host, by the system administrators,
7429a53f50b9Schristosas follows:
7430a53f50b9Schristos
7431a53f50b9Schristos@example
7432a53f50b9Schristosmv /var/mail /var/alt_mail
7433a53f50b9Schristosln -s /mail/home /var/mail
7434a53f50b9Schristos@end example
7435a53f50b9Schristos
7436a53f50b9Schristos@i{Hlfsd} also responds to the following signals:
7437a53f50b9Schristos
7438a53f50b9SchristosA @samp{SIGHUP} signal sent to @i{Hlfsd} will force it to reload the
7439a53f50b9Schristospassword map immediately.
7440a53f50b9Schristos
7441a53f50b9SchristosA @samp{SIGUSR1} signal sent to @i{Hlfsd} will cause it to dump its
7442a53f50b9Schristosinternal password map to the file @file{/usr/tmp/hlfsd.dump.XXXXXX},
7443a53f50b9Schristoswhere @samp{XXXXXX} will be replaced by a random string generated by
7444a53f50b9Schristos@b{mktemp}(3) or (the more secure) @b{mkstemp}(3).
7445a53f50b9Schristos
7446a53f50b9Schristos@c ----------------------------------------------------------------
7447a53f50b9Schristos@node Hlfsd Options, Hlfsd Files, Controlling Hlfsd, Using Hlfsd
7448a53f50b9Schristos@comment  node-name,  next,  previous,  up
7449a53f50b9Schristos@subsection Hlfsd Options
7450a53f50b9Schristos@cindex Hlfsd Options
7451a53f50b9Schristos@cindex Hlfsd; Options
7452a53f50b9Schristos
7453a53f50b9Schristos@table @t
7454a53f50b9Schristos
7455a53f50b9Schristos@item -a @var{alt_dir}
7456a53f50b9SchristosAlternate directory.  The name of the directory to which the symbolic
7457a53f50b9Schristoslink returned by @i{Hlfsd} will point, if it cannot access the home
7458a53f50b9Schristosdirectory of the user.  This defaults to @file{/var/hlfs}.  This
7459a53f50b9Schristosdirectory will be created if it doesn't exist.  It is expected that
7460a53f50b9Schristoseither users will read these files, or the system administrators will
7461a53f50b9Schristosrun a script to resend this ``lost mail'' to its owner.
7462a53f50b9Schristos
7463a53f50b9Schristos@item -c @var{cache-interval}
7464a53f50b9SchristosCaching interval.  @i{Hlfsd} will cache the validity of home directories
7465a53f50b9Schristosfor this interval, in seconds.  Entries which have been verified within
7466a53f50b9Schristosthe last @var{cache-interval} seconds will not be verified again, since
7467a53f50b9Schristosthe operation could be expensive, and the entries are most likely still
7468a53f50b9Schristosvalid.  After the interval has expired, @i{Hlfsd} will re-verify the
7469a53f50b9Schristosvalidity of the user's home directory, and reset the cache time-counter.
7470a53f50b9SchristosThe default value for @var{cache-interval} is 300 seconds (5 minutes).
7471a53f50b9Schristos
7472a53f50b9Schristos@item -f
7473a53f50b9SchristosForce fast startup.  This option tells @i{Hlfsd} to skip startup-time
7474a53f50b9Schristosconsistency checks such as existence of mount directory, alternate spool
7475a53f50b9Schristosdirectory, symlink to be hidden under the mount directory, their
7476a53f50b9Schristospermissions and validity.
7477a53f50b9Schristos
7478a53f50b9Schristos@item -g @var{group}
7479a53f50b9SchristosSet the special group HLFS_GID to @var{group}.  Programs such as
7480a53f50b9Schristos@file{/usr/ucb/from} or @file{/usr/sbin/in.comsat}, which access the
7481a53f50b9Schristosmailboxes of other users, must be setgid @samp{HLFS_GID} to work properly.  The
7482a53f50b9Schristosdefault group is @samp{hlfs}.  If no group is provided, and there is no
7483a53f50b9Schristosgroup @samp{hlfs}, this feature is disabled.
7484a53f50b9Schristos
7485a53f50b9Schristos@item -h
7486a53f50b9SchristosHelp.  Print a brief help message, and exit.
7487a53f50b9Schristos
7488a53f50b9Schristos@item -i @var{reload-interval}
7489a53f50b9SchristosMap-reloading interval.  Each @var{reload-interval} seconds, @i{Hlfsd}
7490a53f50b9Schristoswill reload the password map.  @i{Hlfsd} needs the password map for the
7491a53f50b9SchristosUIDs and home directory pathnames.  @i{Hlfsd} schedules a @samp{SIGALRM} to
7492a53f50b9Schristosreload the password maps.  A @samp{SIGHUP} sent to @i{Hlfsd} will force it to
7493a53f50b9Schristosreload the maps immediately.  The default value for
7494a53f50b9Schristos@var{reload-interval} is 900 seconds (15 minutes.)
7495a53f50b9Schristos
7496a53f50b9Schristos@item -l @var{logfile}
7497a53f50b9SchristosSpecify a log file to which @i{Hlfsd} will record events.  If
7498a53f50b9Schristos@var{logfile} is the string @samp{syslog} then the log messages will be
7499a53f50b9Schristossent to the system log daemon by @b{syslog}(3), using the @samp{LOG_DAEMON}
7500a53f50b9Schristosfacility.  This is also the default.
7501a53f50b9Schristos
7502a53f50b9Schristos@item -n
7503a53f50b9SchristosNo verify.  @i{Hlfsd} will not verify the validity of the symbolic link
7504a53f50b9Schristosit will be returning, or that the user's home directory contains
7505a53f50b9Schristossufficient disk-space for spooling.  This can speed up @i{Hlfsd} at the
7506a53f50b9Schristoscost of possibly returning symbolic links to home directories which are
7507a53f50b9Schristosnot currently accessible or are full.  By default, @i{Hlfsd} validates
7508a53f50b9Schristosthe symbolic-link in the background.  The @code{-n} option overrides the
7509a53f50b9Schristosmeaning of the @code{-c} option, since no caching is necessary.
7510a53f50b9Schristos
7511a53f50b9Schristos@item -o @var{mount-options}
7512a53f50b9SchristosMount options which @i{Hlfsd} will use to mount itself on top of
7513a53f50b9Schristos@var{dirname}.  By default, @var{mount-options} is set to @samp{ro}.  If
7514a53f50b9Schristosthe system supports symbolic-link caching, default options are set
7515a53f50b9Schristosto @samp{ro,nocache}.
7516a53f50b9Schristos
7517a53f50b9Schristos@item -p
7518a53f50b9SchristosPrint PID.  Outputs the process-id of @i{Hlfsd} to standard output where
7519a53f50b9Schristosit can be saved into a file.
7520a53f50b9Schristos
7521a53f50b9Schristos@item -v
7522a53f50b9SchristosVersion.  Displays version information to standard error.
7523a53f50b9Schristos
7524a53f50b9Schristos@item -x @var{log-options}
7525a53f50b9SchristosSpecify run-time logging options.  The options are a comma separated
7526a53f50b9Schristoslist chosen from: @samp{fatal}, @samp{error}, @samp{user}, @samp{warn}, @samp{info}, @samp{map}, @samp{stats}, @samp{all}.
7527a53f50b9Schristos
7528a53f50b9Schristos@item -C
7529a53f50b9SchristosForce @i{Hlfsd} to run on systems that cannot turn off the NFS
7530a53f50b9Schristosattribute-cache.  Use of this option on those systems is discouraged, as
7531a53f50b9Schristosit may result in loss or misdelivery of mail.  The option is ignored on
7532a53f50b9Schristossystems that can turn off the attribute-cache.
7533a53f50b9Schristos
7534a53f50b9Schristos@item -D @var{log-options}
7535a53f50b9SchristosSelect from a variety of debugging options.  Prefixing an option with
7536a53f50b9Schristosthe string @samp{no} reverses the effect of that option.  Options are
7537a53f50b9Schristoscumulative.  The most useful option is @samp{all}.  Since this option is
7538a53f50b9Schristosonly used for debugging other options are not documented here.  A fuller
7539a53f50b9Schristosdescription is available in the program source.
7540a53f50b9Schristos
7541a53f50b9Schristos@item -P @var{password-file}
7542a53f50b9SchristosRead the user-name, user-id, and home directory information from the
7543a53f50b9Schristosfile @var{password-file}.  Normally, @i{Hlfsd} will use @b{getpwent}(3)
7544a53f50b9Schristosto read the password database.  This option allows you to override the
7545a53f50b9Schristosdefault database, and is useful if you want to map users' mail files to
7546a53f50b9Schristosa directory other than their home directory.  Only the username, uid,
7547a53f50b9Schristosand home-directory fields of the file @var{password-file} are read and
7548a53f50b9Schristoschecked.  All other fields are ignored.  The file @var{password-file}
7549a53f50b9Schristosmust otherwise be compliant with Unix Version 7 colon-delimited format
7550a53f50b9Schristos@b{passwd}(4).
7551a53f50b9Schristos
7552a53f50b9Schristos@end table
7553a53f50b9Schristos
7554a53f50b9Schristos@c ----------------------------------------------------------------
7555a53f50b9Schristos@node Hlfsd Files, , Hlfsd Options, Using Hlfsd
7556a53f50b9Schristos@comment  node-name,  next,  previous,  up
7557a53f50b9Schristos@subsection Hlfsd Files
7558a53f50b9Schristos@cindex Hlfsd Files
7559a53f50b9Schristos@cindex Hlfsd; Files
7560a53f50b9Schristos
7561a53f50b9SchristosThe following files are used by @i{Hlfsd}:
7562a53f50b9Schristos
7563a53f50b9Schristos@table @file
7564a53f50b9Schristos
7565a53f50b9Schristos@item /hlfs
7566a53f50b9Schristosdirectory under which @i{Hlfsd} mounts itself and manages the symbolic
7567a53f50b9Schristoslink @file{home}.
7568a53f50b9Schristos
7569a53f50b9Schristos@item .hlfsdir
7570a53f50b9Schristosdefault sub-directory in the user's home directory, to which the
7571a53f50b9Schristos@file{home} symbolic link returned by @i{Hlfsd} points.
7572a53f50b9Schristos
7573a53f50b9Schristos@item /var/hlfs
7574a53f50b9Schristosdirectory to which @file{home} symbolic link returned by @i{Hlfsd}
7575a53f50b9Schristospoints if it is unable to verify the that user's home directory is
7576a53f50b9Schristosaccessible.
7577a53f50b9Schristos
7578a53f50b9Schristos@item /usr/tmp/hlfsd.dump.XXXXXX
7579a53f50b9Schristosfile to which @i{Hlfsd} will dump its internal password map when it
7580a53f50b9Schristosreceives the @samp{SIGUSR1} signal. @samp{XXXXXX} will be replaced by
7581a53f50b9Schristosa random string generated by @b{mktemp}(3) or (the more secure)
7582a53f50b9Schristos@b{mkstemp}(3).
7583a53f50b9Schristos
7584a53f50b9Schristos@end table
7585a53f50b9Schristos
7586a53f50b9SchristosFor discussion on other files used by @i{Hlfsd}, see @xref{lostaltmail}, and
7587a53f50b9Schristos@ref{lostaltmail.conf-sample}.
7588a53f50b9Schristos
7589a53f50b9Schristos@c ################################################################
7590a53f50b9Schristos@node Assorted Tools, Examples, Hlfsd, Top
7591a53f50b9Schristos@comment  node-name,  next,  previous,  up
7592a53f50b9Schristos@chapter Assorted Tools
7593a53f50b9Schristos@cindex  Assorted Tools
7594a53f50b9Schristos
7595a53f50b9SchristosThe following are additional utilities and scripts included with
7596a53f50b9Schristosam-utils, and get installed.
7597a53f50b9Schristos
7598a53f50b9Schristos@menu
7599a53f50b9Schristos* am-eject::
7600a53f50b9Schristos* amd.conf-sample::
7601a53f50b9Schristos* amd2ldif::
7602a53f50b9Schristos* amd2sun::
7603a53f50b9Schristos* automount2amd::
7604a53f50b9Schristos* ctl-amd::
7605a53f50b9Schristos* ctl-hlfsd::
7606a53f50b9Schristos* fix-amd-map::
7607a53f50b9Schristos* fixmount::
7608a53f50b9Schristos* fixrmtab::
7609a53f50b9Schristos* lostaltmail::
7610a53f50b9Schristos* lostaltmail.conf-sample::
7611a53f50b9Schristos* mk-amd-map::
7612a53f50b9Schristos* pawd::
7613a53f50b9Schristos* redhat-ctl-amd::
7614a53f50b9Schristos* wait4amd::
7615a53f50b9Schristos* wait4amd2die::
7616a53f50b9Schristos* wire-test::
7617a53f50b9Schristos@end menu
7618a53f50b9Schristos
7619a53f50b9Schristos@c ----------------------------------------------------------------
7620a53f50b9Schristos@node am-eject, amd.conf-sample, Assorted Tools, Assorted Tools
7621a53f50b9Schristos@comment  node-name,  next,  previous,  up
7622a53f50b9Schristos@section am-eject
7623a53f50b9Schristos@pindex am-eject
7624a53f50b9Schristos
7625a53f50b9SchristosA shell script unmounts a floppy or CD-ROM that is automounted, and
7626a53f50b9Schristosthen attempts to eject the removable device.
7627a53f50b9Schristos
7628a53f50b9Schristos@c ----------------------------------------------------------------
7629a53f50b9Schristos@node amd.conf-sample, amd2ldif, am-eject, Assorted Tools
7630a53f50b9Schristos@comment  node-name,  next,  previous,  up
7631a53f50b9Schristos@section amd.conf-sample
7632a53f50b9Schristos@pindex amd.conf-sample
7633a53f50b9Schristos
7634a53f50b9SchristosA sample @i{Amd} configuration file. @xref{Amd Configuration File}.
7635a53f50b9Schristos
7636a53f50b9Schristos@c ----------------------------------------------------------------
7637a53f50b9Schristos@node amd2ldif, amd2sun, amd.conf-sample, Assorted Tools
7638a53f50b9Schristos@comment  node-name,  next,  previous,  up
7639a53f50b9Schristos@section amd2ldif
7640a53f50b9Schristos@pindex amd2ldif
7641a53f50b9Schristos
7642a53f50b9SchristosA script to convert @i{Amd} maps to LDAP input files.  Use it as follows:
7643a53f50b9Schristos
7644a53f50b9Schristos@example
7645a53f50b9Schristosamd2ldif @i{mapname} @i{base} < @i{amd.mapfile} > @i{mapfile.ldif}
7646a53f50b9Schristos@end example
7647a53f50b9Schristos
7648a53f50b9Schristos@c ----------------------------------------------------------------
7649a53f50b9Schristos@node amd2sun, automount2amd, amd2ldif, Assorted Tools
7650a53f50b9Schristos@comment  node-name,  next,  previous,  up
7651a53f50b9Schristos@section amd2sun
7652a53f50b9Schristos@pindex amd2sun
7653a53f50b9Schristos
7654a53f50b9SchristosA script to convert @i{Amd} maps to Sun Automounter maps.  Use it as
7655a53f50b9Schristosfollows
7656a53f50b9Schristos
7657a53f50b9Schristos@example
7658a53f50b9Schristosamd2sun < @i{amd.mapfile} > @i{auto_mapfile}
7659a53f50b9Schristos@end example
7660a53f50b9Schristos
7661a53f50b9Schristos@c ----------------------------------------------------------------
7662a53f50b9Schristos@node automount2amd, ctl-amd, amd2sun, Assorted Tools
7663a53f50b9Schristos@comment  node-name,  next,  previous,  up
7664a53f50b9Schristos@section automount2amd
7665a53f50b9Schristos@pindex automount2amd
7666a53f50b9Schristos
7667a53f50b9SchristosA script to convert old Sun Automounter maps to @i{Amd} maps.
7668a53f50b9Schristos
7669a53f50b9SchristosSay you have the Sun automount file @i{auto.foo}, with these two lines:
7670a53f50b9Schristos@example
7671a53f50b9Schristoshome                  earth:/home
7672a53f50b9Schristosmoon  -ro,intr        server:/proj/images
7673a53f50b9Schristos@end example
7674a53f50b9SchristosRunning
7675a53f50b9Schristos@example
7676a53f50b9Schristosautomount2amd auto.foo > amd.foo
7677a53f50b9Schristos@end example
7678a53f50b9Schristos
7679a53f50b9Schristoswill produce the @i{Amd} map @i{amd.foo} with this content:
7680a53f50b9Schristos
7681a53f50b9Schristos@example
7682a53f50b9Schristos# generated by automount2amd on Sat Aug 14 17:59:32 US/Eastern 1999
7683a53f50b9Schristos
7684a53f50b9Schristos/defaults \\
7685a53f50b9Schristos  type:=nfs;opts:=rw,grpid,nosuid,utimeout=600
7686a53f50b9Schristos
7687a53f50b9Schristoshome \
7688a53f50b9Schristos  host==earth;type:=link;fs:=/home \\
7689a53f50b9Schristos  rhost:=earth;rfs:=/home
7690a53f50b9Schristos
7691a53f50b9Schristosmoon \
7692a53f50b9Schristos  -addopts:=ro,intr \\
7693a53f50b9Schristos  host==server;type:=link;fs:=/proj/images \\
7694a53f50b9Schristos  rhost:=server;rfs:=/proj/images
7695a53f50b9Schristos@end example
7696a53f50b9Schristos
7697a53f50b9SchristosThis perl script will use the following @i{/default} entry
7698a53f50b9Schristos@example
7699a53f50b9Schristostype:=nfs;opts:=rw,grpid,nosuid,utimeout=600
7700a53f50b9Schristos@end example
7701a53f50b9SchristosIf you wish to override that, define the @b{$DEFAULTS} environment
7702a53f50b9Schristosvariable, or modify the script.
7703a53f50b9Schristos
7704a53f50b9SchristosIf you wish to generate Amd maps using the @i{hostd} (@pxref{hostd
7705a53f50b9SchristosSelector Variable}) @i{Amd} map syntax, then define the environment
7706a53f50b9Schristosvariable @b{$DOMAIN} or modify the script.
7707a53f50b9Schristos
7708a53f50b9SchristosNote that automount2amd does not understand the syntax in newer Sun
7709a53f50b9SchristosAutomount maps, those used with autofs.
7710a53f50b9Schristos
7711a53f50b9Schristos@c ----------------------------------------------------------------
7712a53f50b9Schristos@node ctl-amd, ctl-hlfsd, automount2amd, Assorted Tools
7713a53f50b9Schristos@comment  node-name,  next,  previous,  up
7714a53f50b9Schristos@section ctl-amd
7715a53f50b9Schristos@pindex ctl-amd
7716a53f50b9Schristos
7717a53f50b9SchristosA script to start, stop, or restart @i{Amd}.  Use it as follows:
7718a53f50b9Schristos
7719a53f50b9Schristos@table @t
7720a53f50b9Schristos@item ctl-amd start
7721a53f50b9SchristosStart a new @i{Amd} process.
7722a53f50b9Schristos@item ctl-amd stop
7723a53f50b9SchristosStop the running @i{Amd}.
7724a53f50b9Schristos@item ctl-amd restart
7725a53f50b9SchristosStop the running @i{Amd} (if any), safely wait for it to terminate, and
7726a53f50b9Schristosthen start a new process --- only if the previous one died cleanly.
7727a53f50b9Schristos@end table
7728a53f50b9Schristos
7729a53f50b9Schristos@xref{Run-time Administration}, for more details.
7730a53f50b9Schristos
7731a53f50b9Schristos@c ----------------------------------------------------------------
7732*4da6d876Schristos@node ctl-hlfsd, fix-amd-map, ctl-amd, Assorted Tools
7733a53f50b9Schristos@comment  node-name,  next,  previous,  up
7734a53f50b9Schristos@section ctl-hlfsd
7735a53f50b9Schristos@pindex ctl-hlfsd
7736a53f50b9Schristos
7737a53f50b9SchristosA script for controlling @i{Hlfsd}, much the same way @file{ctl-amd}
7738a53f50b9Schristoscontrols @i{Amd}.  Use it as follows:
7739a53f50b9Schristos
7740a53f50b9Schristos@table @t
7741a53f50b9Schristos@item ctl-hlfsd start
7742a53f50b9SchristosStart a new @i{Hlfsd} process.
7743a53f50b9Schristos@item ctl-hlfsd stop
7744a53f50b9SchristosStop the running @i{Hlfsd}.
7745a53f50b9Schristos@item ctl-hlfsd restart
7746a53f50b9SchristosStop the running @i{Hlfsd} (if any), wait for 10 seconds for it to
7747a53f50b9Schristosterminate, and then start a new process --- only if the previous one
7748a53f50b9Schristosdied cleanly.
7749a53f50b9Schristos@end table
7750a53f50b9Schristos
7751a53f50b9Schristos@xref{Hlfsd}, for more details.
7752a53f50b9Schristos
7753a53f50b9Schristos@c ----------------------------------------------------------------
7754*4da6d876Schristos@node fix-amd-map, fixmount, ctl-hlfsd, Assorted Tools
7755a53f50b9Schristos@comment  node-name,  next,  previous,  up
7756a53f50b9Schristos@section fix-amd-map
7757a53f50b9Schristos@pindex fix-amd-map
7758a53f50b9Schristos
7759a53f50b9SchristosAm-utils changed some of the syntax and default values of some
7760a53f50b9Schristosvariables.  For example, the default value for @samp{$@{os@}} for
7761a53f50b9SchristosSolaris 2.x (aka SunOS 5.x) systems used to be @samp{sos5}, it is now
7762a53f50b9Schristosmore automatically generated from @file{config.guess} and its value is
7763a53f50b9Schristos@samp{sunos5}.
7764a53f50b9Schristos
7765a53f50b9SchristosThis script converts older @i{Amd} maps to new ones.  Use it as follows:
7766a53f50b9Schristos
7767a53f50b9Schristos@example
7768a53f50b9Schristosfix-amd-map < @i{old.map} > @i{new.map}
7769a53f50b9Schristos@end example
7770a53f50b9Schristos
7771a53f50b9Schristos@c ----------------------------------------------------------------
7772a53f50b9Schristos@node fixmount, fixrmtab, fix-amd-map, Assorted Tools
7773a53f50b9Schristos@comment  node-name,  next,  previous,  up
7774a53f50b9Schristos@section fixmount
7775a53f50b9Schristos@pindex fixmount
7776a53f50b9Schristos
7777a53f50b9Schristos@samp{fixmount} is a variant of @b{showmount}(8) that can delete bogus
7778a53f50b9Schristosmount entries in remote @b{mountd}(8) daemons.  This is useful to
7779a53f50b9Schristoscleanup otherwise ever-accumulating ``junk''.  Use it for example:
7780a53f50b9Schristos
7781a53f50b9Schristos@example
7782a53f50b9Schristosfixmount -r @i{host}
7783a53f50b9Schristos@end example
7784a53f50b9Schristos
7785a53f50b9SchristosSee the online manual page for @samp{fixmount} for more details of its
7786a53f50b9Schristosusage.
7787a53f50b9Schristos
7788a53f50b9Schristos@c ----------------------------------------------------------------
7789a53f50b9Schristos@node fixrmtab, lostaltmail, fixmount, Assorted Tools
7790a53f50b9Schristos@comment  node-name,  next,  previous,  up
7791a53f50b9Schristos@section fixrmtab
7792a53f50b9Schristos@pindex fixrmtab
7793a53f50b9Schristos
7794a53f50b9SchristosA script to invalidate @file{/etc/rmtab} entries for hosts named.  Also
7795a53f50b9Schristosrestart mountd for changes to take effect.  Use it for example:
7796a53f50b9Schristos
7797a53f50b9Schristos@example
7798a53f50b9Schristosfixrmtab @i{host1} @i{host2} @i{...}
7799a53f50b9Schristos@end example
7800a53f50b9Schristos
7801a53f50b9Schristos@c ----------------------------------------------------------------
7802a53f50b9Schristos@node lostaltmail, lostaltmail.conf-sample, fixrmtab, Assorted Tools
7803a53f50b9Schristos@comment  node-name,  next,  previous,  up
7804a53f50b9Schristos@section lostaltmail
7805a53f50b9Schristos@pindex lostaltmail
7806a53f50b9Schristos
7807a53f50b9SchristosA script used with @i{Hlfsd} to resend any ``lost'' mail.  @i{Hlfsd}
7808a53f50b9Schristosredirects mail which cannot be written into the user's home directory to
7809a53f50b9Schristosan alternate directory.  This is useful to continue delivering mail,
7810a53f50b9Schristoseven if the user's file system was unavailable, full, or over quota.
7811a53f50b9SchristosBut, the mail which gets delivered to  the alternate directory needs to
7812a53f50b9Schristosbe resent to its respective users.  This is what the @samp{lostaltmail}
7813a53f50b9Schristosscript does.
7814a53f50b9Schristos
7815a53f50b9SchristosUse it as follows:
7816a53f50b9Schristos
7817a53f50b9Schristos@example
7818a53f50b9Schristoslostaltmail
7819a53f50b9Schristos@end example
7820a53f50b9Schristos
7821a53f50b9SchristosThis script needs a configuration file @samp{lostaltmail.conf} set up
7822a53f50b9Schristoswith the right parameters to properly work.  @xref{Hlfsd}, for more
7823a53f50b9Schristosdetails.
7824a53f50b9Schristos
7825a53f50b9Schristos@c ----------------------------------------------------------------
7826a53f50b9Schristos@node lostaltmail.conf-sample, mk-amd-map, lostaltmail, Assorted Tools
7827a53f50b9Schristos@comment  node-name,  next,  previous,  up
7828a53f50b9Schristos@section lostaltmail.conf-sample
7829a53f50b9Schristos@pindex lostaltmail.conf-sample
7830a53f50b9Schristos@cindex lostaltmail; configuration file
7831a53f50b9Schristos
7832a53f50b9SchristosThis is a text file with configuration parameters needed for the
7833a53f50b9Schristos@samp{lostaltmail} script.  The script includes comments explaining each
7834a53f50b9Schristosof the configuration variables.  See it for more information.  Also
7835a53f50b9Schristos@pxref{Hlfsd} for general information.
7836a53f50b9Schristos
7837a53f50b9Schristos@c ----------------------------------------------------------------
7838a53f50b9Schristos@node mk-amd-map, pawd, lostaltmail.conf-sample, Assorted Tools
7839a53f50b9Schristos@comment  node-name,  next,  previous,  up
7840a53f50b9Schristos@section mk-amd-map
7841a53f50b9Schristos@pindex mk-amd-map
7842a53f50b9Schristos
7843a53f50b9SchristosThis program converts a normal @i{Amd} map file into an ndbm database
7844a53f50b9Schristoswith the same prefix as the named file.  Use it as follows:
7845a53f50b9Schristos
7846a53f50b9Schristos@example
7847a53f50b9Schristosmk-amd-map @i{mapname}
7848a53f50b9Schristos@end example
7849a53f50b9Schristos
7850a53f50b9Schristos@c ----------------------------------------------------------------
7851a53f50b9Schristos@node pawd, redhat-ctl-amd, mk-amd-map, Assorted Tools
7852a53f50b9Schristos@comment  node-name,  next,  previous,  up
7853a53f50b9Schristos@section pawd
7854a53f50b9Schristos@pindex pawd
7855a53f50b9Schristos
7856a53f50b9Schristos@i{Pawd} is used to print the current working directory, adjusted to
7857a53f50b9Schristosreflect proper paths that can be reused to go through the automounter
7858a53f50b9Schristosfor the shortest possible path.  In particular, the path printed back
7859a53f50b9Schristosdoes not include any of @i{Amd}'s local mount points.  Using them is
7860a53f50b9Schristosunsafe, because @i{Amd} may unmount managed file systems from the mount
7861a53f50b9Schristospoints, and thus including them in paths may not always find the files
7862a53f50b9Schristoswithin.
7863a53f50b9Schristos
7864a53f50b9SchristosWithout any arguments, @i{Pawd} will print the automounter adjusted
7865a53f50b9Schristoscurrent working directory.  With any number of arguments, it will print
7866a53f50b9Schristosthe adjusted path of each one of the arguments.
7867a53f50b9Schristos
7868a53f50b9Schristos@c ----------------------------------------------------------------
7869a53f50b9Schristos@node redhat-ctl-amd, wait4amd, pawd, Assorted Tools
7870a53f50b9Schristos@comment  node-name,  next,  previous,  up
7871a53f50b9Schristos@section redhat-ctl-amd
7872a53f50b9Schristos@pindex redhat-ctl-amd
7873a53f50b9Schristos
7874a53f50b9SchristosThis script is similar to @i{ctl-amd} (@pxref{ctl-amd}) but is intended
7875a53f50b9Schristosfor Red Hat Linux systems.  You can safely copy @i{redhat-ctl-amd} onto
7876a53f50b9Schristos@file{/etc/rc.d/init.d/amd}.  The script supplied by @i{Am-utils} is
7877a53f50b9Schristosusually better than the one provided by Red Hat, because the Red Hat
7878a53f50b9Schristosscript does not correctly kill @i{Amd} processes: it is too quick to
7879a53f50b9Schristoskill the wrong processes, leaving stale or hung mount points behind.
7880a53f50b9Schristos
7881a53f50b9Schristos@c ----------------------------------------------------------------
7882a53f50b9Schristos@node wait4amd, wait4amd2die, redhat-ctl-amd, Assorted Tools
7883a53f50b9Schristos@comment  node-name,  next,  previous,  up
7884a53f50b9Schristos@section wait4amd
7885a53f50b9Schristos@pindex wait4amd
7886a53f50b9Schristos
7887a53f50b9SchristosA script to wait for @i{Amd} to start on a particular host before
7888a53f50b9Schristosperforming an arbitrary command.  The command is executed repeatedly,
7889a53f50b9Schristoswith 1 second intervals in between.  You may interrupt the script using
7890a53f50b9Schristos@samp{^C} (or whatever keyboard sequence your terminal's @samp{intr} function
7891a53f50b9Schristosis bound to).
7892a53f50b9Schristos
7893a53f50b9SchristosExamples:
7894a53f50b9Schristos
7895a53f50b9Schristos@table @t
7896a53f50b9Schristos@item wait4amd saturn amq -p -h saturn
7897a53f50b9SchristosWhen @i{Amd} is up on host @samp{saturn}, get the process ID of that
7898a53f50b9Schristosrunning @i{Amd}.
7899a53f50b9Schristos@item wait4amd pluto rlogin pluto
7900a53f50b9SchristosRemote login to host @samp{pluto} when @i{Amd} is up on that host.  It
7901a53f50b9Schristosis generally necessary to wait for @i{Amd} to properly start and
7902a53f50b9Schristosinitialize on a remote host before logging in to it, because otherwise
7903a53f50b9Schristosuser home directories may not be accessible across the network.
7904a53f50b9Schristos@item wait4amd pluto
7905a53f50b9SchristosA short-hand version of the previous command, since the most useful
7906a53f50b9Schristosreason for this script is to login to a remote host.  I use it very
7907a53f50b9Schristosoften when testing out new versions of @i{Amd}, and need to reboot hung
7908a53f50b9Schristoshosts.
7909a53f50b9Schristos@end table
7910a53f50b9Schristos
7911a53f50b9Schristos@c ----------------------------------------------------------------
7912a53f50b9Schristos@node wait4amd2die, wire-test, wait4amd, Assorted Tools
7913a53f50b9Schristos@comment  node-name,  next,  previous,  up
7914a53f50b9Schristos@section wait4amd2die
7915a53f50b9Schristos@pindex wait4amd2die
7916a53f50b9Schristos
7917a53f50b9SchristosThis script is used internally by @samp{ctl-amd} when used to restart
7918a53f50b9Schristos@i{Amd}.  It waits for @i{Amd} to terminate.  If it detected that
7919a53f50b9Schristos@i{Amd} terminated cleanly, this script will return an exist status of
7920a53f50b9Schristoszero.  Otherwise, it will return a non-zero exit status.
7921a53f50b9Schristos
7922a53f50b9SchristosThe script tests for @i{Amd}'s existence once every 5 seconds, six
7923a53f50b9Schristostimes, for a total of 30 seconds.  It will return a zero exist status as
7924a53f50b9Schristossoon as it detects that @i{Amd} dies.
7925a53f50b9Schristos
7926a53f50b9Schristos@c ----------------------------------------------------------------
7927a53f50b9Schristos@node wire-test, , wait4amd2die, Assorted Tools
7928a53f50b9Schristos@comment  node-name,  next,  previous,  up
7929a53f50b9Schristos@section wire-test
7930a53f50b9Schristos@pindex wire-test
7931a53f50b9Schristos
7932a53f50b9SchristosA simple program to test if some of the most basic networking functions
7933a53f50b9Schristosin am-util's library @file{libamu} work.  It also tests the combination
7934a53f50b9Schristosof NFS protocol and version number that are supported from the current
7935a53f50b9Schristoshost, to a remote one.
7936a53f50b9Schristos
7937a53f50b9SchristosFor example, in this test a machine which only supports NFS Version 2 is
7938a53f50b9Schristoscontacting a remote host that can support the same version, but using
7939a53f50b9Schristosboth UDP and TCP.  If no host name is specified, @samp{wire-test} will
7940a53f50b9Schristostry @file{localhost}.
7941a53f50b9Schristos
7942a53f50b9Schristos@example
7943a53f50b9Schristos$ wire-test moisil
7944a53f50b9SchristosNetwork name is "mcl-lab-net.cs.columbia.edu"
7945a53f50b9SchristosNetwork number is "128.59.13"
7946a53f50b9SchristosNetwork name is "old-net.cs.columbia.edu"
7947a53f50b9SchristosNetwork number is "128.59.16"
7948a53f50b9SchristosMy IP address is 0x7f000001.
7949a53f50b9SchristosNFS Version and protocol tests to host "moisil"...
7950a53f50b9Schristos        testing vers=2, proto="udp" -> found version 2.
7951a53f50b9Schristos        testing vers=3, proto="udp" -> failed!
7952a53f50b9Schristos        testing vers=2, proto="tcp" -> found version 2.
7953a53f50b9Schristos        testing vers=3, proto="tcp" -> failed!
7954a53f50b9Schristos@end example
7955a53f50b9Schristos
7956a53f50b9Schristos@c ################################################################
7957a53f50b9Schristos@node Examples, Internals, Assorted Tools, Top
7958a53f50b9Schristos@comment  node-name,  next,  previous,  up
7959a53f50b9Schristos@chapter Examples
7960a53f50b9Schristos
7961a53f50b9Schristos@menu
7962a53f50b9Schristos* User Filesystems::
7963a53f50b9Schristos* Home Directories::
7964a53f50b9Schristos* Architecture Sharing::
7965a53f50b9Schristos* Wildcard Names::
7966a53f50b9Schristos* rwho servers::
7967a53f50b9Schristos* /vol::
7968a53f50b9Schristos* /defaults with selectors::
7969a53f50b9Schristos* /tftpboot in a chroot-ed environment::
7970a53f50b9Schristos
7971a53f50b9Schristos@end menu
7972a53f50b9Schristos
7973a53f50b9Schristos@node User Filesystems, Home Directories, Examples, Examples
7974a53f50b9Schristos@comment  node-name,  next,  previous,  up
7975a53f50b9Schristos@section User Filesystems
7976a53f50b9Schristos@cindex User filesystems
7977a53f50b9Schristos@cindex Mounting user filesystems
7978a53f50b9Schristos
7979a53f50b9SchristosWith more than one fileserver, the directories most frequently
7980a53f50b9Schristoscross-mounted are those containing user home directories.  A common
7981a53f50b9Schristosconvention used at Imperial College is to mount the user disks under
7982a53f50b9Schristos@t{/home/}@i{machine}.
7983a53f50b9Schristos
7984a53f50b9SchristosTypically, the @samp{/etc/fstab} file contained a long list of entries
7985a53f50b9Schristossuch as:
7986a53f50b9Schristos
7987a53f50b9Schristos@example
7988a53f50b9Schristos@i{machine}:/home/@i{machine} /home/@i{machine} nfs ...
7989a53f50b9Schristos@end example
7990a53f50b9Schristos
7991a53f50b9Schristosfor each fileserver on the network.
7992a53f50b9Schristos
7993a53f50b9SchristosThere are numerous problems with this system.  The mount list can become
7994a53f50b9Schristosquite large and some of the machines may be down when a system is
7995a53f50b9Schristosbooted.  When a new fileserver is installed, @samp{/etc/fstab} must be
7996a53f50b9Schristosupdated on every machine, the mount directory created and the filesystem
7997a53f50b9Schristosmounted.
7998a53f50b9Schristos
7999a53f50b9SchristosIn many environments most people use the same few workstations, but
8000a53f50b9Schristosit is convenient to go to a colleague's machine and access your own
8001a53f50b9Schristosfiles.  When a server goes down, it can cause a process on a client
8002a53f50b9Schristosmachine to hang.  By minimizing the mounted filesystems to only include
8003a53f50b9Schristosthose actively being used, there is less chance that a filesystem will
8004a53f50b9Schristosbe mounted when a server goes down.
8005a53f50b9Schristos
8006a53f50b9SchristosThe following is a short extract from a map taken from a research fileserver
8007a53f50b9Schristosat Imperial College.
8008a53f50b9Schristos
8009a53f50b9SchristosNote the entry for @samp{localhost} which is used for users such as
8010a53f50b9Schristosthe operator (@samp{opr}) who have a home directory on most machine as
8011a53f50b9Schristos@samp{/home/localhost/opr}.
8012a53f50b9Schristos
8013a53f50b9Schristos@example
8014a53f50b9Schristos/defaults       opts:=rw,intr,grpid,nosuid
8015a53f50b9Schristoscharm           host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \
8016a53f50b9Schristos                host==$@{key@};type:=ufs;dev:=/dev/xd0g
8017a53f50b9Schristos#
8018a53f50b9Schristos...
8019a53f50b9Schristos
8020a53f50b9Schristos#
8021a53f50b9Schristoslocalhost       type:=link;fs:=$@{host@}
8022a53f50b9Schristos...
8023a53f50b9Schristos#
8024a53f50b9Schristos# dylan has two user disks so have a
8025a53f50b9Schristos# top directory in which to mount them.
8026a53f50b9Schristos#
8027a53f50b9Schristosdylan           type:=auto;fs:=$@{map@};pref:=$@{key@}/
8028a53f50b9Schristos#
8029a53f50b9Schristosdylan/dk2       host!=dylan;type:=nfs;rhost:=dylan;rfs:=/home/$@{key@} \
8030a53f50b9Schristos                host==dylan;type:=ufs;dev:=/dev/dsk/2s0
8031a53f50b9Schristos#
8032a53f50b9Schristosdylan/dk5       host!=dylan;type:=nfs;rhost:=dylan;rfs:=/home/$@{key@} \
8033a53f50b9Schristos                host==dylan;type:=ufs;dev:=/dev/dsk/5s0
8034a53f50b9Schristos...
8035a53f50b9Schristos#
8036a53f50b9Schristostoytown         host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \
8037a53f50b9Schristos                host==$@{key@};type:=ufs;dev:=/dev/xy1g
8038a53f50b9Schristos...
8039a53f50b9Schristos#
8040a53f50b9Schristoszebedee         host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \
8041a53f50b9Schristos                host==$@{key@};type:=ufs;dev:=/dev/dsk/1s0
8042a53f50b9Schristos#
8043a53f50b9Schristos# Just for access...
8044a53f50b9Schristos#
8045a53f50b9Schristosgould           type:=auto;fs:=$@{map@};pref:=$@{key@}/
8046a53f50b9Schristosgould/staff     host!=gould;type:=nfs;rhost:=gould;rfs:=/home/$@{key@}
8047a53f50b9Schristos#
8048a53f50b9Schristosgummo           host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@}
8049a53f50b9Schristos...
8050a53f50b9Schristos@end example
8051a53f50b9Schristos
8052a53f50b9SchristosThis map is shared by most of the machines listed so on those
8053a53f50b9Schristossystems any of the user disks is accessible via a consistent name.
8054a53f50b9Schristos@i{Amd} is started with the following command
8055a53f50b9Schristos
8056a53f50b9Schristos@example
8057a53f50b9Schristosamd /home amd.home
8058a53f50b9Schristos@end example
8059a53f50b9Schristos
8060a53f50b9SchristosNote that when mounting a remote filesystem, the @dfn{automounted}
8061a53f50b9Schristosmount point is referenced, so that the filesystem will be mounted if
8062a53f50b9Schristosit is not yet (at the time the remote @samp{mountd} obtains the file handle).
8063a53f50b9Schristos
8064a53f50b9Schristos@node Home Directories, Architecture Sharing, User Filesystems, Examples
8065a53f50b9Schristos@comment  node-name,  next,  previous,  up
8066a53f50b9Schristos@section Home Directories
8067a53f50b9Schristos@cindex Home directories
8068a53f50b9Schristos@cindex Example of mounting home directories
8069a53f50b9Schristos@cindex Mount home directories
8070a53f50b9Schristos
8071a53f50b9SchristosOne convention for home directories is to locate them in @samp{/homes}
8072a53f50b9Schristosso user @samp{jsp}'s home directory is @samp{/homes/jsp}.  With more
8073a53f50b9Schristosthan a single fileserver it is convenient to spread user files across
8074a53f50b9Schristosseveral machines.  All that is required is a mount-map which converts
8075a53f50b9Schristoslogin names to an automounted directory.
8076a53f50b9Schristos
8077a53f50b9SchristosSuch a map might be started by the command:
8078a53f50b9Schristos
8079a53f50b9Schristos@example
8080a53f50b9Schristosamd /homes amd.homes
8081a53f50b9Schristos@end example
8082a53f50b9Schristos
8083a53f50b9Schristoswhere the map @samp{amd.homes} contained the entries:
8084a53f50b9Schristos
8085a53f50b9Schristos@example
8086a53f50b9Schristos/defaults   type:=link   # All the entries are of type:=link
8087a53f50b9Schristosjsp         fs:=/home/charm/jsp
8088a53f50b9Schristosnjw         fs:=/home/dylan/dk5/njw
8089a53f50b9Schristos...
8090a53f50b9Schristosphjk        fs:=/home/toytown/ai/phjk
8091a53f50b9Schristossjv         fs:=/home/ganymede/sjv
8092a53f50b9Schristos@end example
8093a53f50b9Schristos
8094a53f50b9SchristosWhenever a login name is accessed in @samp{/homes} a symbolic link
8095a53f50b9Schristosappears pointing to the real location of that user's home directory.  In
8096a53f50b9Schristosthis example, @samp{/homes/jsp} would appear to be a symbolic link
8097a53f50b9Schristospointing to @samp{/home/charm/jsp}.  Of course, @samp{/home} would also
8098a53f50b9Schristosbe an automount point.
8099a53f50b9Schristos
8100a53f50b9SchristosThis system causes an extra level of symbolic links to be used.
8101a53f50b9SchristosAlthough that turns out to be relatively inexpensive, an alternative is
8102a53f50b9Schristosto directly mount the required filesystems in the @samp{/homes}
8103a53f50b9Schristosmap.  The required map is simple, but long, and its creation is best automated.
8104a53f50b9SchristosThe entry for @samp{jsp} could be:
8105a53f50b9Schristos
8106a53f50b9Schristos@example
8107a53f50b9Schristosjsp   -sublink:=$@{key@};rfs:=/home/charm \
8108a53f50b9Schristos               host==charm;type:=ufs;dev:=/dev/xd0g \
8109a53f50b9Schristos               host!=charm;type:=nfs;rhost:=charm
8110a53f50b9Schristos@end example
8111a53f50b9Schristos
8112a53f50b9SchristosThis map can become quite big if it contains a large number of entries.
8113a53f50b9SchristosBy combining two other features of @i{Amd} it can be greatly simplified.
8114a53f50b9Schristos
8115a53f50b9SchristosFirst the UFS partitions should be mounted under the control of
8116a53f50b9Schristos@samp{/etc/fstab}, taking care that they are mounted in the same place
8117a53f50b9Schristosthat @i{Amd} would have automounted them.  In most cases this would be
8118a53f50b9Schristossomething like @samp{/a/@dfn{host}/home/@dfn{host}} and
8119a53f50b9Schristos@samp{/etc/fstab} on host @samp{charm} would have a line:@refill
8120a53f50b9Schristos
8121a53f50b9Schristos@example
8122a53f50b9Schristos/dev/xy0g /a/charm/home/charm 4.2 rw,nosuid,grpid 1 5
8123a53f50b9Schristos@end example
8124a53f50b9Schristos
8125a53f50b9SchristosThe map can then be changed to:
8126a53f50b9Schristos
8127a53f50b9Schristos@example
8128a53f50b9Schristos/defaults    type:=nfs;sublink:=$@{key@};opts:=rw,intr,nosuid,grpid
8129a53f50b9Schristosjsp          rhost:=charm;rfs:=/home/charm
8130a53f50b9Schristosnjw          rhost:=dylan;rfs:=/home/dylan/dk5
8131a53f50b9Schristos...
8132a53f50b9Schristosphjk         rhost:=toytown;rfs:=/home/toytown;sublink:=ai/$@{key@}
8133a53f50b9Schristossjv          rhost:=ganymede;rfs:=/home/ganymede
8134a53f50b9Schristos@end example
8135a53f50b9Schristos
8136a53f50b9SchristosThis map operates as usual on a remote machine (@i{ie} @code{$@{host@}}
8137a53f50b9Schristosnot equal to @code{$@{rhost@}}).  On the machine where the filesystem is
8138a53f50b9Schristosstored (@i{ie} @code{$@{host@}} equal to @code{$@{rhost@}}), @i{Amd}
8139a53f50b9Schristoswill construct a local filesystem mount point which corresponds to the
8140a53f50b9Schristosname of the locally mounted UFS partition.  If @i{Amd} is started with
8141a53f50b9Schristosthe @code{-r} option then instead of attempting an NFS mount, @i{Amd} will
8142a53f50b9Schristossimply inherit the UFS mount (@pxref{Inheritance Filesystem}).  If
8143a53f50b9Schristos@code{-r} is not used then a loopback NFS mount will be made.  This type of
8144a53f50b9Schristosmount is known to cause a deadlock on many systems.
8145a53f50b9Schristos
8146a53f50b9Schristos@node Architecture Sharing, Wildcard Names, Home Directories, Examples
8147a53f50b9Schristos@comment  node-name,  next,  previous,  up
8148a53f50b9Schristos@section Architecture Sharing
8149a53f50b9Schristos@cindex Architecture sharing
8150a53f50b9Schristos@cindex Sharing a fileserver between architectures
8151a53f50b9Schristos@cindex Architecture dependent volumes
8152a53f50b9Schristos
8153a53f50b9Schristos@c %At the moment some of the research machines have sets of software
8154a53f50b9Schristos@c %mounted in @samp{/vol}.  This contains subdirectories for \TeX,
8155a53f50b9Schristos@c %system sources, local sources, prolog libraries and so on.
8156a53f50b9SchristosOften a filesystem will be shared by machines of different architectures.
8157a53f50b9SchristosSeparate trees can be maintained for the executable images for each
8158a53f50b9Schristosarchitecture, but it may be more convenient to have a shared tree,
8159a53f50b9Schristoswith distinct subdirectories.
8160a53f50b9Schristos
8161a53f50b9SchristosA shared tree might have the following structure on the fileserver (called
8162a53f50b9Schristos@samp{fserver} in the example):
8163a53f50b9Schristos
8164a53f50b9Schristos@example
8165a53f50b9Schristoslocal/tex
8166a53f50b9Schristoslocal/tex/fonts
8167a53f50b9Schristoslocal/tex/lib
8168a53f50b9Schristoslocal/tex/bin
8169a53f50b9Schristoslocal/tex/bin/sun3
8170a53f50b9Schristoslocal/tex/bin/sun4
8171a53f50b9Schristoslocal/tex/bin/hp9000
8172a53f50b9Schristos...
8173a53f50b9Schristos@end example
8174a53f50b9Schristos
8175a53f50b9SchristosIn this example, the subdirectories of @samp{local/tex/bin} should be
8176a53f50b9Schristoshidden when accessed via the automount point (conventionally @samp{/vol}).
8177a53f50b9SchristosA mount-map for @samp{/vol} to achieve this would look like:
8178a53f50b9Schristos
8179a53f50b9Schristos@example
8180a53f50b9Schristos/defaults   sublink:=$@{/key@};rhost:=fserver;type:=link
8181a53f50b9Schristostex         type:=auto;fs:=$@{map@};pref:=$@{key@}/
8182a53f50b9Schristostex/fonts   host!=fserver;type:=nfs;rfs:=/vol/tex \
8183a53f50b9Schristos            host==fserver;fs:=/usr/local/tex
8184a53f50b9Schristostex/lib     host!=fserver;type:=nfs;rfs:=/vol/tex \
8185a53f50b9Schristos            host==fserver;fs:=/usr/local/tex
8186a53f50b9Schristostex/bin     -sublink:=$@{/key@}/$@{arch@} \
8187a53f50b9Schristos            host!=fserver;type:=nfs;rfs:=/vol/tex \
8188a53f50b9Schristos            host:=fserver;fs:=/usr/local/tex
8189a53f50b9Schristos@end example
8190a53f50b9Schristos
8191a53f50b9SchristosWhen @samp{/vol/tex/bin} is referenced, the current machine architecture
8192a53f50b9Schristosis automatically appended to the path by the @code{$@{sublink@}}
8193a53f50b9Schristosvariable.  This means that users can have @samp{/vol/tex/bin} in their
8194a53f50b9Schristos@samp{PATH} without concern for architecture dependencies.
8195a53f50b9Schristos
8196a53f50b9Schristos@node Wildcard Names, rwho servers, Architecture Sharing, Examples
8197a53f50b9Schristos@comment  node-name,  next,  previous,  up
8198a53f50b9Schristos@section Wildcard Names & Replicated Servers
8199a53f50b9Schristos
8200a53f50b9SchristosBy using the wildcard facility, @i{Amd} can @dfn{overlay} an existing
8201a53f50b9Schristosdirectory with additional entries.
8202a53f50b9SchristosThe system files are usually mounted under @samp{/usr}.  If instead,
8203a53f50b9Schristos@i{Amd} is mounted on @samp{/usr}, additional
8204a53f50b9Schristosnames can be overlayed to augment or replace names in the ``master'' @samp{/usr}.
8205a53f50b9SchristosA map to do this would have the form:
8206a53f50b9Schristos
8207a53f50b9Schristos@example
8208a53f50b9Schristoslocal  type:=auto;fs:=local-map
8209a53f50b9Schristosshare  type:=auto;fs:=share-map
8210a53f50b9Schristos*      -type:=nfs;rfs:=/export/exec/$@{arch@};sublink:="$@{key@}" \
8211a53f50b9Schristos        rhost:=fserv1  rhost:=fserv2  rhost:=fserv3
8212a53f50b9Schristos@end example
8213a53f50b9Schristos
8214a53f50b9SchristosNote that the assignment to @code{$@{sublink@}} is surrounded by double
8215a53f50b9Schristosquotes to prevent the incoming key from causing the map to be
8216a53f50b9Schristosmisinterpreted.  This map has the effect of directing any access to
8217a53f50b9Schristos@samp{/usr/local} or @samp{/usr/share} to another automount point.
8218a53f50b9Schristos
8219a53f50b9SchristosIn this example, it is assumed that the @samp{/usr} files are replicated
8220a53f50b9Schristoson three fileservers: @samp{fserv1}, @samp{fserv2} and @samp{fserv3}.
8221a53f50b9SchristosFor any references other than to @samp{local} and @samp{share} one of
8222a53f50b9Schristosthe servers is used and a symbolic link to
8223a53f50b9Schristos@t{$@{autodir@}/$@{rhost@}/export/exec/$@{arch@}/@i{whatever}} is
8224a53f50b9Schristosreturned once an appropriate filesystem has been mounted.@refill
8225a53f50b9Schristos
8226a53f50b9Schristos@node rwho servers, /vol, Wildcard Names, Examples
8227a53f50b9Schristos@comment  node-name,  next,  previous,  up
8228a53f50b9Schristos@section @samp{rwho} servers
8229a53f50b9Schristos@cindex rwho servers
8230a53f50b9Schristos@cindex Architecture specific mounts
8231a53f50b9Schristos@cindex Example of architecture specific mounts
8232a53f50b9Schristos
8233a53f50b9SchristosThe @samp{/usr/spool/rwho} directory is a good candidate for automounting.
8234a53f50b9SchristosFor efficiency reasons it is best to capture the rwho data on a small
8235a53f50b9Schristosnumber of machines and then mount that information onto a large number
8236a53f50b9Schristosof clients.  The data written into the rwho files is byte order dependent
8237a53f50b9Schristosso only servers with the correct byte ordering can be used by a client:
8238a53f50b9Schristos
8239a53f50b9Schristos@example
8240a53f50b9Schristos/defaults         type:=nfs
8241a53f50b9Schristosusr/spool/rwho    -byte==little;rfs:=/usr/spool/rwho \
8242a53f50b9Schristos                      rhost:=vaxA  rhost:=vaxB \
8243a53f50b9Schristos                  || -rfs:=/usr/spool/rwho \
8244a53f50b9Schristos                      rhost:=sun4  rhost:=hp300
8245a53f50b9Schristos@end example
8246a53f50b9Schristos
8247a53f50b9Schristos@node /vol, /defaults with selectors, rwho servers, Examples
8248a53f50b9Schristos@comment  node-name,  next,  previous,  up
8249a53f50b9Schristos@section @samp{/vol}
8250a53f50b9Schristos@cindex /vol
8251a53f50b9Schristos@cindex Catch-all mount point
8252a53f50b9Schristos@cindex Generic volume name
8253a53f50b9Schristos
8254a53f50b9Schristos@samp{/vol} is used as a catch-all for volumes which do not have other
8255a53f50b9Schristosconventional names.
8256a53f50b9Schristos
8257a53f50b9SchristosBelow is part of the @samp{/vol} map for the domain @samp{doc.ic.ac.uk}.
8258a53f50b9SchristosThe @samp{r+d} tree is used for new or experimental software that needs
8259a53f50b9Schristosto be available everywhere without installing it on all the fileservers.
8260a53f50b9SchristosUsers wishing to try out the new software then simply include
8261a53f50b9Schristos@samp{/vol/r+d/@{bin,ucb@}} in their path.@refill
8262a53f50b9Schristos
8263a53f50b9SchristosThe main tree resides on one host @samp{gould.doc.ic.ac.uk}, which has
8264a53f50b9Schristosdifferent @samp{bin}, @samp{etc}, @samp{lib} and @samp{ucb}
8265a53f50b9Schristossub-directories for each machine architecture.  For example,
8266a53f50b9Schristos@samp{/vol/r+d/bin} for a Sun-4 would be stored in the sub-directory
8267a53f50b9Schristos@samp{bin/sun4} of the filesystem @samp{/usr/r+d}.  When it was accessed
8268a53f50b9Schristosa symbolic link pointing to @samp{/a/gould/usr/r+d/bin/sun4} would be
8269a53f50b9Schristosreturned.@refill
8270a53f50b9Schristos
8271a53f50b9Schristos@example
8272a53f50b9Schristos/defaults    type:=nfs;opts:=rw,grpid,nosuid,intr,soft
8273a53f50b9Schristoswp           -opts:=rw,grpid,nosuid;rhost:=charm \
8274a53f50b9Schristos             host==charm;type:=link;fs:=/usr/local/wp \
8275a53f50b9Schristos             host!=charm;type:=nfs;rfs:=/vol/wp
8276a53f50b9Schristos...
8277a53f50b9Schristos#
8278a53f50b9Schristossrc          -opts:=rw,grpid,nosuid;rhost:=charm \
8279a53f50b9Schristos             host==charm;type:=link;fs:=/usr/src \
8280a53f50b9Schristos             host!=charm;type:=nfs;rfs:=/vol/src
8281a53f50b9Schristos#
8282a53f50b9Schristosr+d          type:=auto;fs:=$@{map@};pref:=r+d/
8283a53f50b9Schristos# per architecture bin,etc,lib&ucb...
8284a53f50b9Schristosr+d/bin      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
8285a53f50b9Schristosr+d/etc      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
8286a53f50b9Schristosr+d/include  rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}
8287a53f50b9Schristosr+d/lib      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
8288a53f50b9Schristosr+d/man      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}
8289a53f50b9Schristosr+d/src      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}
8290a53f50b9Schristosr+d/ucb      rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@}
8291a53f50b9Schristos# hades pictures
8292a53f50b9Schristospictures     -opts:=rw,grpid,nosuid;rhost:=thpfs \
8293a53f50b9Schristos             host==thpfs;type:=link;fs:=/nbsd/pictures \
8294a53f50b9Schristos             host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=pictures
8295a53f50b9Schristos# hades tools
8296a53f50b9Schristoshades        -opts:=rw,grpid,nosuid;rhost:=thpfs \
8297a53f50b9Schristos             host==thpfs;type:=link;fs:=/nbsd/hades \
8298a53f50b9Schristos             host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=hades
8299a53f50b9Schristos# bsd tools for hp.
8300a53f50b9Schristosbsd          -opts:=rw,grpid,nosuid;arch==hp9000;rhost:=thpfs \
8301a53f50b9Schristos             host==thpfs;type:=link;fs:=/nbsd/bsd \
8302a53f50b9Schristos             host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=bsd
8303a53f50b9Schristos@end example
8304a53f50b9Schristos
8305a53f50b9Schristos@node /defaults with selectors, /tftpboot in a chroot-ed environment, /vol, Examples
8306a53f50b9Schristos@comment  node-name,  next,  previous,  up
8307a53f50b9Schristos@section @samp{/defaults} with selectors
8308a53f50b9Schristos@cindex /defaults with selectors
8309a53f50b9Schristos@cindex selectors on default
8310a53f50b9Schristos
8311a53f50b9SchristosIt is sometimes useful to have different defaults for a given map.  To
8312a53f50b9Schristosachieve this, the @samp{/defaults} entry must be able to process normal
8313a53f50b9Schristosselectors.  This feature is turned on by setting
8314a53f50b9Schristos@samp{selectors_in_defaults = yes} in the @file{amd.conf} file.
8315a53f50b9Schristos@xref{selectors_in_defaults Parameter}.
8316a53f50b9Schristos
8317a53f50b9SchristosIn this example, I set different default NFS mount options for hosts
8318a53f50b9Schristoswhich are running over a slower network link.  By setting a smaller size
8319a53f50b9Schristosfor the NFS read and write buffer sizes, you can greatly improve remote
8320a53f50b9Schristosfile service performance.
8321a53f50b9Schristos
8322a53f50b9Schristos@example
8323a53f50b9Schristos/defaults \
8324a53f50b9Schristos  wire==slip-net;opts:=rw,intr,rsize=1024,wsize=1024,timeo=20,retrans=10 \
8325a53f50b9Schristos  wire!=slip-net;opts:=rw,intr
8326a53f50b9Schristos@end example
8327a53f50b9Schristos
8328a53f50b9Schristos@node /tftpboot in a chroot-ed environment, , /defaults with selectors, Examples
8329a53f50b9Schristos@comment  node-name,  next,  previous,  up
8330a53f50b9Schristos@section @samp{/tftpboot} in a chroot-ed environment
8331a53f50b9Schristos@cindex /tftpboot in a chroot-ed environment
8332a53f50b9Schristos@cindex chroot; /tftpboot example
8333a53f50b9Schristos
8334a53f50b9SchristosIn this complex example, we attempt to run an @i{Amd} process
8335a53f50b9Schristos@emph{inside} a chroot-ed environment.  @samp{tftpd} (Trivial FTP) is
8336a53f50b9Schristosused to trivially retrieve files used to boot X-Terminals, Network
8337a53f50b9SchristosPrinters, Network routers, diskless workstations, and other such
8338a53f50b9Schristosdevices.  For security reasons, @samp{tftpd} (and also @samp{ftpd})
8339a53f50b9Schristosprocesses are run using the @b{chroot}(2) system call.  This provides an
8340a53f50b9Schristosenvironment for these processes, where access to any files outside the
8341a53f50b9Schristosdirectory where the chroot-ed process runs is denied.
8342a53f50b9Schristos
8343a53f50b9SchristosFor example, if you start @samp{tftpd} on your system with
8344a53f50b9Schristos
8345a53f50b9Schristos@example
8346a53f50b9Schristoschroot /tftpboot /usr/sbin/tftpd
8347a53f50b9Schristos@end example
8348a53f50b9Schristos
8349a53f50b9Schristos@noindent
8350a53f50b9Schristosthen the @samp{tftpd} process will not be able to access any files
8351a53f50b9Schristosoutside @file{/tftpboot}.  This ensures that no one can retrieve files
8352a53f50b9Schristossuch as @file{/etc/passwd} and run password crackers on it.
8353a53f50b9Schristos
8354a53f50b9SchristosSince the TFTP service works by broadcast, it is necessary to have at
8355a53f50b9Schristosleast one TFTP server running on each subnet.  If you have lots of files
8356a53f50b9Schristosthat you need to make available for @samp{tftp}, and many subnets, it
8357a53f50b9Schristoscould take significant amounts of disk space on each host serving them.
8358a53f50b9Schristos
8359a53f50b9SchristosA solution we implemented at Columbia University was to have every host
8360a53f50b9Schristosrun @samp{tftpd}, but have those servers retrieve the boot files from
8361a53f50b9Schristostwo replicated servers.  Those replicated servers have special
8362a53f50b9Schristospartitions dedicated to the many network boot files.
8363a53f50b9Schristos
8364a53f50b9SchristosWe start @i{Amd} as follows:
8365a53f50b9Schristos
8366a53f50b9Schristos@example
8367a53f50b9Schristosamd /tftpboot/.amd amd.tftpboot
8368a53f50b9Schristos@end example
8369a53f50b9Schristos
8370a53f50b9SchristosThat is, @i{Amd} is serving the directory @file{/tftpboot/.amd}.  The
8371a53f50b9Schristos@samp{tftp} server runs inside @file{/tftpboot} and is chroot-ed in that
8372a53f50b9Schristosdirectory too.  The @file{amd.tftpboot} map looks like:
8373a53f50b9Schristos
8374a53f50b9Schristos@example
8375a53f50b9Schristos#
8376a53f50b9Schristos# Amd /tftpboot directory -> host map
8377a53f50b9Schristos#
8378a53f50b9Schristos
8379a53f50b9Schristos/defaults  opts:=nosuid,ro,intr,soft;fs:=/tftpboot/import;type:=nfs
8380a53f50b9Schristos
8381a53f50b9Schristostp         host==lol;rfs:=/n/lol/import/tftpboot;type:=lofs \
8382a53f50b9Schristos           host==ober;rfs:=/n/ober/misc/win/tftpboot;type:=lofs \
8383a53f50b9Schristos           rhost:=ober;rfs:=/n/ober/misc/win/tftpboot \
8384a53f50b9Schristos           rhost:=lol;rfs:=/n/lol/import/tftpboot
8385a53f50b9Schristos@end example
8386a53f50b9Schristos
8387a53f50b9SchristosTo help understand this example, I list a few of the file entries that
8388a53f50b9Schristosare created inside @file{/tftpboot}:
8389a53f50b9Schristos
8390a53f50b9Schristos@example
8391a53f50b9Schristos$ ls -la /tftpboot
8392a53f50b9Schristosdr-xr-xr-x   2 root   512 Aug 30 23:11 .amd
8393a53f50b9Schristosdrwxrwsr-x  12 root   512 Aug 30 08:00 import
8394a53f50b9Schristoslrwxrwxrwx   1 root    33 Feb 27  1997 adminpr.cfg -> ./.amd/tp/hplj/adminpr.cfg
8395a53f50b9Schristoslrwxrwxrwx   1 root    22 Dec  5  1996 tekxp -> ./.amd/tp/xterms/tekxp
8396a53f50b9Schristoslrwxrwxrwx   1 root     1 Dec  5  1996 tftpboot -> .
8397a53f50b9Schristos@end example
8398a53f50b9Schristos
8399a53f50b9SchristosHere is an explanation of each of the entries listed above:
8400a53f50b9Schristos
8401a53f50b9Schristos@table @code
8402a53f50b9Schristos
8403a53f50b9Schristos@item .amd
8404a53f50b9SchristosThis is the @i{Amd} mount point.  Note that you do not need to run a
8405a53f50b9Schristosseparate @i{Amd} process for the TFTP service.  The @b{chroot}(2) system
8406a53f50b9Schristoscall only protects against file access, but the same process can still
8407a53f50b9Schristosserve files and directories inside and outside the chroot-ed
8408a53f50b9Schristosenvironment, because @i{Amd} itself was not run in chroot-ed mode.
8409a53f50b9Schristos
8410a53f50b9Schristos@item import
8411a53f50b9SchristosThis is the mount point where @i{Amd} will mount the directories
8412a53f50b9Schristoscontaining the boot files.  The map is designed so that remote
8413a53f50b9Schristosdirectories will be NFS mounted (even if they are already mounted
8414a53f50b9Schristoselsewhere), and local directories are loopback mounted (since they are
8415a53f50b9Schristosnot accessible outside the chroot-ed @file{/tftpboot} directory).
8416a53f50b9Schristos
8417a53f50b9Schristos@item adminpr.cfg
8418a53f50b9Schristos@itemx tekxp
8419a53f50b9SchristosTwo manually created symbolic links to directories @emph{inside} the
8420a53f50b9Schristos@i{Amd}-managed directory.  The crossing of the component @file{tp} will
8421a53f50b9Schristoscause @i{Amd} to automount one of the remote replicas.  Once crossed,
8422a53f50b9Schristosaccess to files inside proceeds as usual.  The @samp{adminpr.cfg} is a
8423a53f50b9Schristosconfiguration file for an HP Laser-Jet 4si printer, and the @samp{tekxp}
8424a53f50b9Schristosis a directory for Tektronix X-Terminal boot files.
8425a53f50b9Schristos
8426a53f50b9Schristos@item tftpboot
8427a53f50b9SchristosThis innocent looking symlink is important.  Usually, when devices boot
8428a53f50b9Schristosvia the TFTP service, they perform the @samp{get file} command to
8429a53f50b9Schristosretrieve @var{file}.  However, some devices assume that @samp{tftpd}
8430a53f50b9Schristosdoes not run in a chroot-ed environment, but rather ``unprotected'', and
8431a53f50b9Schristosthus use a full pathname for files to retrieve, as in @samp{get
8432a53f50b9Schristos/tftpboot/file}.  This symlink effectively strips out the leading
8433a53f50b9Schristos@file{/tftpboot/}.
8434a53f50b9Schristos
8435a53f50b9Schristos@end table
8436a53f50b9Schristos
8437a53f50b9Schristos@c ################################################################
8438a53f50b9Schristos@node Internals, Acknowledgments & Trademarks, Examples, Top
8439a53f50b9Schristos@comment  node-name,  next,  previous,  up
8440a53f50b9Schristos@chapter Internals
8441a53f50b9Schristos
8442a53f50b9SchristosNote that there are more error and logging messages possible than are
8443a53f50b9Schristoslisted here.  Most of them are self-explanatory.  Refer to the program
8444a53f50b9Schristossources for more details on the rest.
8445a53f50b9Schristos
8446a53f50b9Schristos@menu
8447a53f50b9Schristos* Log Messages::
8448a53f50b9Schristos@end menu
8449a53f50b9Schristos
8450a53f50b9Schristos@node Log Messages, , Internals, Internals
8451a53f50b9Schristos@comment  node-name,  next,  previous,  up
8452a53f50b9Schristos@section Log Messages
8453a53f50b9Schristos
8454a53f50b9SchristosIn the following sections a brief explanation is given of some of the
8455a53f50b9Schristoslog messages made by @i{Amd}.  Where the message is in @samp{typewriter}
8456a53f50b9Schristosfont, it corresponds exactly to the message produced by @i{Amd}.  Words
8457a53f50b9Schristosin @dfn{italic} are replaced by an appropriate string.  Variables,
8458a53f50b9Schristos@code{$@{@i{var}@}}, indicate that the value of the appropriate variable is
8459a53f50b9Schristosoutput.
8460a53f50b9Schristos
8461a53f50b9SchristosLog messages are either sent directly to a file,
8462a53f50b9Schristosor logged via the @b{syslog}(3) mechanism.  @xref{log_file Parameter}.
8463a53f50b9SchristosIn either case, entries in the file are of the form:
8464a53f50b9Schristos@example
8465a53f50b9Schristos@i{date-string}  @i{hostname} @t{amd[}@i{pid}@t{]}  @i{message}
8466a53f50b9Schristos@end example
8467a53f50b9Schristos
8468a53f50b9Schristos@menu
8469a53f50b9Schristos* Fatal errors::
8470a53f50b9Schristos* Info messages::
8471a53f50b9Schristos@end menu
8472a53f50b9Schristos
8473a53f50b9Schristos@node Fatal errors, Info messages, Log Messages, Log Messages
8474a53f50b9Schristos@comment  node-name,  next,  previous,  up
8475a53f50b9Schristos@subsection Fatal errors
8476a53f50b9Schristos
8477a53f50b9Schristos@i{Amd} attempts to deal with unusual events.  Whenever it is not
8478a53f50b9Schristospossible to deal with such an error, @i{Amd} will log an appropriate
8479a53f50b9Schristosmessage and, if it cannot possibly continue, will either exit or abort.
8480a53f50b9SchristosThese messages are selected by @samp{-x fatal} on the command line.
8481a53f50b9SchristosWhen @b{syslog}(3) is being used, they are logged with level
8482a53f50b9Schristos@samp{LOG_FATAL}.  Even if @i{Amd} continues to operate it is likely to
8483a53f50b9Schristosremain in a precarious state and should be restarted at the earliest
8484a53f50b9Schristosopportunity.
8485a53f50b9Schristos
8486a53f50b9Schristos@table @t
8487a53f50b9Schristos
8488a53f50b9Schristos@item Attempting to inherit not-a-filesystem
8489a53f50b9SchristosThe prototype mount point created during a filesystem restart did not
8490a53f50b9Schristoscontain a reference to the restarted filesystem.  This error ``should
8491a53f50b9Schristosnever happen''.
8492a53f50b9Schristos
8493a53f50b9Schristos@item Can't bind to domain "@i{NIS-domain}"
8494a53f50b9SchristosA specific NIS domain was requested on the command line, but no server
8495a53f50b9Schristosfor that domain is available on the local net.
8496a53f50b9Schristos
8497a53f50b9Schristos@item Can't determine IP address of this host (@i{hostname})
8498a53f50b9SchristosWhen @i{Amd} starts it determines its own IP address.  If this lookup
8499a53f50b9Schristosfails then @i{Amd} cannot continue.  The hostname it looks up is that
8500a53f50b9Schristosobtained returned by @b{gethostname}(2) system call.
8501a53f50b9Schristos
8502a53f50b9Schristos@item Can't find root file handle for @i{automount point}
8503a53f50b9Schristos@i{Amd} creates its own file handles for the automount points.  When it
8504a53f50b9Schristosmounts itself as a server, it must pass these file handles to the local
8505a53f50b9Schristoskernel.  If the filehandle is not obtainable the mount point is ignored.
8506a53f50b9SchristosThis error ``should never happen''.
8507a53f50b9Schristos
8508a53f50b9Schristos@item Must be root to mount filesystems (euid = @i{euid})
8509a53f50b9SchristosTo prevent embarrassment, @i{Amd} makes sure it has appropriate system
8510a53f50b9Schristosprivileges.  This amounts to having an euid of 0.  The check is made
8511a53f50b9Schristosafter argument processing complete to give non-root users a chance to
8512a53f50b9Schristosaccess the @code{-v} option.
8513a53f50b9Schristos
8514a53f50b9Schristos@item No work to do - quitting
8515a53f50b9SchristosNo automount points were given on the command line and so there is no
8516a53f50b9Schristoswork to do.
8517a53f50b9Schristos
8518a53f50b9Schristos@item Out of memory
8519a53f50b9SchristosWhile attempting to malloc some memory, the memory space available to
8520a53f50b9Schristos@i{Amd} was exhausted.  This is an unrecoverable error.
8521a53f50b9Schristos
8522a53f50b9Schristos@item Out of memory in realloc
8523a53f50b9SchristosWhile attempting to realloc some memory, the memory space available to
8524a53f50b9Schristos@i{Amd} was exhausted.  This is an unrecoverable error.
8525a53f50b9Schristos
8526a53f50b9Schristos@item cannot create rpc/udp service
8527a53f50b9SchristosEither the NFS or AMQ endpoint could not be created.
8528a53f50b9Schristos
8529a53f50b9Schristos@item gethostname: @i{description}
8530a53f50b9SchristosThe @b{gethostname}(2) system call failed during startup.
8531a53f50b9Schristos
8532a53f50b9Schristos@item host name is not set
8533a53f50b9SchristosThe @b{gethostname}(2) system call returned a zero length host name.
8534a53f50b9SchristosThis can happen if @i{Amd} is started in single user mode just after
8535a53f50b9Schristosbooting the system.
8536a53f50b9Schristos
8537a53f50b9Schristos@item ifs_match called!
8538a53f50b9SchristosAn internal error occurred while restarting a pre-mounted filesystem.
8539a53f50b9SchristosThis error ``should never happen''.
8540a53f50b9Schristos
8541a53f50b9Schristos@item mount_afs: @i{description}
8542a53f50b9SchristosAn error occurred while @i{Amd} was mounting itself.
8543a53f50b9Schristos
8544a53f50b9Schristos@item run_rpc failed
8545a53f50b9SchristosSomehow the main NFS server loop failed.  This error ``should never
8546a53f50b9Schristoshappen''.
8547a53f50b9Schristos
8548a53f50b9Schristos@item unable to free rpc arguments in amqprog_1
8549a53f50b9SchristosThe incoming arguments to the AMQ server could not be free'ed.
8550a53f50b9Schristos
8551a53f50b9Schristos@item unable to free rpc arguments in nfs_program_1
8552a53f50b9SchristosThe incoming arguments to the NFS server could not be free'ed.
8553a53f50b9Schristos
8554a53f50b9Schristos@item unable to register (AMQ_PROGRAM, AMQ_VERSION, udp)
8555a53f50b9SchristosThe AMQ server could not be registered with the local portmapper or the
8556a53f50b9Schristosinternal RPC dispatcher.
8557a53f50b9Schristos
8558a53f50b9Schristos@item unable to register (NFS_PROGRAM, NFS_VERSION, 0)
8559a53f50b9SchristosThe NFS server could not be registered with the internal RPC dispatcher.
8560a53f50b9Schristos
8561a53f50b9Schristos@end table
8562a53f50b9Schristos
8563a53f50b9SchristosXXX: This section needs to be updated
8564a53f50b9Schristos
8565a53f50b9Schristos@node Info messages, , Fatal errors, Log Messages
8566a53f50b9Schristos@comment  node-name,  next,  previous,  up
8567a53f50b9Schristos@subsection Info messages
8568a53f50b9Schristos
8569a53f50b9Schristos@i{Amd} generates information messages to record state changes.  These
8570a53f50b9Schristosmessages are selected by @samp{-x info} on the command line.  When
8571a53f50b9Schristos@b{syslog}(3) is being used, they are logged with level @samp{LOG_INFO}.
8572a53f50b9Schristos
8573a53f50b9SchristosThe messages listed below can be generated and are in a format suitable
8574a53f50b9Schristosfor simple statistical analysis.  @dfn{mount-info} is the string
8575a53f50b9Schristosthat is displayed by @dfn{Amq} in its mount information column and
8576a53f50b9Schristosplaced in the system mount table.
8577a53f50b9Schristos
8578a53f50b9Schristos@table @t
8579a53f50b9Schristos
8580a53f50b9Schristos@item "@t{$@{@i{path}@}}" forcibly timed out
8581a53f50b9SchristosAn automount point has been timed out by the @i{Amq} command.
8582a53f50b9Schristos
8583a53f50b9Schristos@item "@t{$@{@i{path}@}}" has timed out
8584a53f50b9SchristosNo access to the automount point has been made within the timeout
8585a53f50b9Schristosperiod.
8586a53f50b9Schristos
8587a53f50b9Schristos@item Filehandle denied for "$@{@i{rhost}@}:$@{@i{rfs}@}"
8588a53f50b9SchristosThe mount daemon refused to return a file handle for the requested filesystem.
8589a53f50b9Schristos
8590a53f50b9Schristos@item Filehandle error for "$@{@i{rhost}@}:$@{@i{rfs}@}": @i{description}
8591a53f50b9SchristosThe mount daemon gave some other error for the requested filesystem.
8592a53f50b9Schristos
8593a53f50b9Schristos@item Finishing with status @i{exit-status}
8594a53f50b9Schristos@i{Amd} is about to exit with the given exit status.
8595a53f50b9Schristos
8596a53f50b9Schristos@item Re-synchronizing cache for map @t{$@{@i{map}@}}
8597a53f50b9SchristosThe named map has been modified and the internal cache is being re-synchronized.
8598a53f50b9Schristos
8599a53f50b9Schristos@item file server @t{$@{@i{rhost}@}} is down - timeout of "@t{$@{@i{path}@}}" ignored
8600a53f50b9SchristosAn automount point has timed out, but the corresponding file server is
8601a53f50b9Schristosknown to be down.  This message is only produced once for each mount
8602a53f50b9Schristospoint for which the server is down.
8603a53f50b9Schristos
8604a53f50b9Schristos@item file server @t{$@{@i{rhost}@}} type nfs is down
8605a53f50b9SchristosAn NFS file server that was previously up is now down.
8606a53f50b9Schristos
8607a53f50b9Schristos@item file server @t{$@{@i{rhost}@}} type nfs is up
8608a53f50b9SchristosAn NFS file server that was previously down is now up.
8609a53f50b9Schristos
8610a53f50b9Schristos@item file server @t{$@{@i{rhost}@}} type nfs starts down
8611a53f50b9SchristosA new NFS file server has been referenced and is known to be down.
8612a53f50b9Schristos
8613a53f50b9Schristos@item file server @t{$@{@i{rhost}@}} type nfs starts up
8614a53f50b9SchristosA new NFS file server has been referenced and is known to be up.
8615a53f50b9Schristos
8616a53f50b9Schristos@item mount of "@t{$@{@i{path}@}}" on @t{$@{@i{fs}@}} timed out
8617a53f50b9SchristosAttempts to mount a filesystem for the given automount point have failed
8618a53f50b9Schristosto complete within 30 seconds.
8619a53f50b9Schristos
8620a53f50b9Schristos@item @i{mount-info} mounted fstype @t{$@{@i{type}@}} on @t{$@{@i{fs}@}}
8621a53f50b9SchristosA new file system has been mounted.
8622a53f50b9Schristos
8623a53f50b9Schristos@item @i{mount-info} restarted fstype @t{$@{@i{type}@}} on @t{$@{@i{fs}@}}
8624a53f50b9Schristos@i{Amd} is using a pre-mounted filesystem to satisfy a mount request.
8625a53f50b9Schristos
8626a53f50b9Schristos@item @i{mount-info} unmounted fstype @t{$@{@i{type}@}} from @t{$@{@i{fs}@}}
8627a53f50b9SchristosA file system has been unmounted.
8628a53f50b9Schristos
8629a53f50b9Schristos@item @i{mount-info} unmounted fstype @t{$@{@i{type}@}} from @t{$@{@i{fs}@}} link @t{$@{@i{fs}@}}/@t{$@{@i{sublink}@}}
8630a53f50b9SchristosA file system of which only a sub-directory was in use has been unmounted.
8631a53f50b9Schristos
8632a53f50b9Schristos@item restarting @i{mount-info} on @t{$@{@i{fs}@}}
8633a53f50b9SchristosA pre-mounted file system has been noted.
8634a53f50b9Schristos
8635a53f50b9Schristos@end table
8636a53f50b9Schristos
8637a53f50b9SchristosXXX: This section needs to be updated
8638a53f50b9Schristos
8639a53f50b9Schristos@c ################################################################
8640a53f50b9Schristos@node Acknowledgments & Trademarks, Index, Internals, Top
8641a53f50b9Schristos@comment  node-name,  next,  previous,  up
8642a53f50b9Schristos@unnumbered Acknowledgments & Trademarks
8643a53f50b9Schristos
8644a53f50b9SchristosMany thanks to the Am-Utils Users
8645a53f50b9Schristosmailing list through the months developing am-utils.  These members
8646a53f50b9Schristoshave contributed to the discussions, ideas, code and documentation,
8647a53f50b9Schristosand subjected their systems to alpha quality code.  Special thanks go
8648a53f50b9Schristosto those @uref{http://www.am-utils.org/docs/am-utils/AUTHORS.txt,authors} who have
8649a53f50b9Schristossubmitted patches, and especially to the maintainers:
8650a53f50b9Schristos
8651a53f50b9Schristos@itemize @bullet
8652a53f50b9Schristos@item @uref{http://www.cs.sunysb.edu/~ezk,Erez Zadok}
8653a53f50b9Schristos@item @email{ionut AT badula.org,Ion Badulescu}
8654a53f50b9Schristos@item @email{ro AT techfak.uni-bielefeld.de,Rainer Orth}
8655a53f50b9Schristos@item @email{nick.williams AT morganstanley.com,Nick Williams}
8656a53f50b9Schristos@end itemize
8657a53f50b9Schristos
8658a53f50b9SchristosThanks to the Formal Methods Group at Imperial College for suffering
8659a53f50b9Schristospatiently while @i{Amd} was being developed on their machines.
8660a53f50b9Schristos
8661a53f50b9SchristosThanks to the many people who have helped with the development of
8662a53f50b9Schristos@i{Amd}, especially Piete Brooks at the Cambridge University Computing
8663a53f50b9SchristosLab for many hours of testing, experimentation and discussion.
8664a53f50b9Schristos
8665a53f50b9SchristosThanks to the older @email{amd-workers AT majordomo.glue.umd.edu,Amd
8666a53f50b9SchristosWorkers} mailing list (now defunct) members for many suggestions and
8667a53f50b9Schristosbug reports to @i{Amd}.
8668a53f50b9Schristos
8669a53f50b9Schristos@itemize @bullet
8670a53f50b9Schristos@item
8671a53f50b9Schristos@b{DEC}, @b{VAX} and @b{Ultrix} are registered trademarks of Digital
8672a53f50b9SchristosEquipment Corporation.
8673a53f50b9Schristos@item
8674a53f50b9Schristos@b{AIX} and @b{IBM} are registered trademarks of International Business
8675a53f50b9SchristosMachines Corporation.
8676a53f50b9Schristos@item
8677a53f50b9Schristos@b{Sun}, @b{NFS} and @b{SunOS} are registered trademarks of Sun
8678a53f50b9SchristosMicrosystems, Inc.
8679a53f50b9Schristos@item
8680a53f50b9Schristos@b{UNIX} is a registered trademark in the USA and other countries,
8681a53f50b9Schristosexclusively licensed through X/Open Company, Ltd.
8682a53f50b9Schristos@item
8683a53f50b9SchristosAll other registered trademarks are owned by their respective owners.
8684a53f50b9Schristos@end itemize
8685a53f50b9Schristos
8686a53f50b9Schristos@c ################################################################
8687a53f50b9Schristos@node Index, , Acknowledgments & Trademarks, Top
8688a53f50b9Schristos@comment  node-name,  next,  previous,  up
8689a53f50b9Schristos@unnumbered Index
8690a53f50b9Schristos
8691a53f50b9Schristos@printindex cp
8692a53f50b9Schristos
8693a53f50b9Schristos@contents
8694a53f50b9Schristos@bye
8695a53f50b9Schristos
8696a53f50b9Schristos@c ====================================================================
8697a53f50b9Schristos@c ISPELL LOCAL WORDS:
8698a53f50b9Schristos@c LocalWords:  setfilename amdref overfullrule settitle titlepage titlefont nz
8699a53f50b9Schristos@c LocalWords:  authorfont vskip ifinfo iftex cindex unnumberedsec dfn xref vol
8700a53f50b9Schristos@c LocalWords:  locationN pxref jpo nott concentrix Sjoerd sjoerd cwi Eitan vuw
8701a53f50b9Schristos@c LocalWords:  Mizrotsky eitan shumuji dgux fpx scp hcx metcalf masala hlh OTS
8702a53f50b9Schristos@c LocalWords:  Presnell srp cgl Trost trost ogi pyrOSx OSx tubsibr riscix iX
8703a53f50b9Schristos@c LocalWords:  Piete pb Lindblad cjl ai umax utek xinu Mitchum D'Souza dsouza
8704a53f50b9Schristos@c LocalWords:  mrc apu alliant aviion AViiON fps macII multimax tahoe vax emph
8705a53f50b9Schristos@c LocalWords:  mapdefault valA valB valC YPTSDIR ETCDIR substr MAKEDBM YPDBDIR
8706a53f50b9Schristos@c LocalWords:  NOPUSH njw dylan dk dylan njw anydir domN achilles mjh pref sel
8707a53f50b9Schristos@c LocalWords:  gdef loc loc loc ldots autodir remopts rwho rwho styx styx yoyo
8708a53f50b9Schristos@c LocalWords:  noindent gould rvdmount rvdunmount fserver mtmp unioned logfile
8709a53f50b9Schristos@c LocalWords:  dmn esac phjk toytown toytown toytown toytown phjk RdDir RdLnk
8710a53f50b9Schristos@c LocalWords:  volname attrs netif dougal inaddr hwaddr ec mountmaps passno xy
8711a53f50b9Schristos@c LocalWords:  freq dumpset hfs brian florence localinfo fstabs automaps defn
8712a53f50b9Schristos@c LocalWords:  localname fsck'd opr gummo sjv ganymede sjv fserv fserv fserv
8713a53f50b9Schristos@c LocalWords:  vaxA vaxB wp thpfs nbsd asis ifs amqprog free'ed printindex gov
8714a53f50b9Schristos@c LocalWords:  LocalWords syncodeindex Distrib bsdnet lanl AutoMounter acis ic
8715a53f50b9Schristos@c LocalWords:  ac uk aix bsd Mullender nl il DG lcs hpux irix ucsf NeXT cse cl
8716a53f50b9Schristos@c LocalWords:  mt FX hp ibm mips utils def def Domainname eg hostd getwd tmp
8717a53f50b9Schristos@c LocalWords:  subsubsection rw grpid intr noconn nocto nodevs nosuid retrans
8718a53f50b9Schristos@c LocalWords:  rsize tcp timeo nounmount utimeout DDEBUG nodaemon fd hostnames
8719a53f50b9Schristos@c LocalWords:  pid Amd's pendry vangogh nfsx backoff stats nomap nostats CRIT
8720a53f50b9Schristos@c LocalWords:  noinfo clustername RVD dsk dsk amq hostports osver statfs str
8721a53f50b9Schristos@c LocalWords:  ou counter's amdmaps proj src tftpboot sh mv cd sbin ypcat inet
8722a53f50b9Schristos@c LocalWords:  Getattr getattr localhost fhandles netmask fstype noquota addr
8723a53f50b9Schristos@c LocalWords:  exportfs Dumpsets dumpsets pindex ldif fixmount fixrmtab euid
8724a53f50b9Schristos@c LocalWords:  lostaltmail realloc netnumber itemx primnetnum primnetname ARG
8725a53f50b9Schristos@c LocalWords:  subsnetname subsnetnum netgrp netgroup multitable Shlib dec osf
8726a53f50b9Schristos@c LocalWords:  hppa pc bsdi freebsd netbsd openbsd ncr sysv rs acdirmax fsid
8727a53f50b9Schristos@c LocalWords:  acdirmin acregmax acregmin actimeo dumbtimr nfsv noac noauto sd
8728a53f50b9Schristos@c LocalWords:  nocache nodev noint nosub pgthresh posix rdonly suid symttl mfs
8729a53f50b9Schristos@c LocalWords:  AMFS umapfs myftpdir unionfs es mapname mapfile mapfile slocal
8730a53f50b9Schristos@c LocalWords:  mailspool saturn saturn notknown lol ober dr xr xr drwxrwsr cfg
8731a53f50b9Schristos@c LocalWords:  lrwxrwxrwx adminpr hplj adminpr cfg tekxp xterms tekxp Dupuy tp
8732a53f50b9Schristos@c LocalWords:  linkname hlfsddump dirname rmtab pluto rlogin direntry pg vr dn
8733a53f50b9Schristos@c LocalWords:  maxmem hlfsdir xmailbox showmount cn amdmap amdmapName resvport
8734a53f50b9Schristos@c LocalWords:  objectClass amdmapKey amdmapValue ln powerpc amdmapTimestamp ez
8735a53f50b9Schristos@c LocalWords:  moisil FSinfo Libtool Unmounting sublink fileservers NullProc
8736a53f50b9Schristos@c LocalWords:  gethostname mount's unmounts linkx remounts unmounting UAs SA's
8737a53f50b9Schristos@c LocalWords:  mountpoint mountpoints unescaped UIDs util's overlayed uref EFS
8738a53f50b9Schristos@c LocalWords:  serv maxgroups nfsl cachedir copt cfsadmin efs addopts fg ROMs
8739a53f50b9Schristos@c LocalWords:  nointr extatt setchapternewpage columnfractions alphaev gnulibc
8740a53f50b9Schristos@c LocalWords:  freebsdelf gnuoldld ifhtml defperm nodefperm norrip RRIP rrip
8741a53f50b9Schristos@c LocalWords:  noversion attr XXXXXX netgrpd rh mkstemp uid gid noexec mntfs
8742a53f50b9Schristos@c LocalWords:  nomnttab optionstr hrtime xdrtrace getpwd proplist redhat ctl
8743a53f50b9Schristos@c LocalWords:  texinfo texi ib sp cartouche ified xlatecookie dircategory sc
8744a53f50b9Schristos@c LocalWords:  AddInfo suse Novell softlookup ENOENT USB fullybrowsable LDAPv
8745a53f50b9Schristos@c LocalWords:  amy ie xfffffe zebedee andrew diskfull hdmail searchable si
8746a53f50b9Schristos@c LocalWords:  Orth ESTALE
8747