xref: /freebsd-12.1/contrib/amd/scripts/amd.conf.5 (revision 0cbc7cc2)
1.\"
2.\" Copyright (c) 1997-2003 Erez Zadok
3.\" Copyright (c) 1990 Jan-Simon Pendry
4.\" Copyright (c) 1990 Imperial College of Science, Technology & Medicine
5.\" Copyright (c) 1990 The Regents of the University of California.
6.\" All rights reserved.
7.\"
8.\" This code is derived from software contributed to Berkeley by
9.\" Jan-Simon Pendry at Imperial College, London.
10.\"
11.\" Redistribution and use in source and binary forms, with or without
12.\" modification, are permitted provided that the following conditions
13.\" are met:
14.\" 1. Redistributions of source code must retain the above copyright
15.\"    notice, this list of conditions and the following disclaimer.
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\"    notice, this list of conditions and the following disclaimer in the
18.\"    documentation and/or other materials provided with the distribution.
19.\" 3. All advertising materials mentioning features or use of this software
20.\"    must display the following acknowledgment:
21.\"      This product includes software developed by the University of
22.\"      California, Berkeley and its contributors.
23.\" 4. Neither the name of the University nor the names of its contributors
24.\"    may be used to endorse or promote products derived from this software
25.\"    without specific prior written permission.
26.\"
27.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37.\" SUCH DAMAGE.
38.\"
39.\"	%W% (Berkeley) %G%
40.\"
41.\" $Id: amd.conf.5,v 1.7.2.8 2003/03/16 01:47:00 ezk Exp $
42.\" $FreeBSD$
43.\"
44.Dd April 7, 1997
45.Dt AMD.CONF 5
46.Os
47.Sh NAME
48.Nm amd.conf
49.Nd amd configuration file
50.Sh SYNOPSIS
51.Nm
52.Sh DESCRIPTION
53The
54.Nm
55file is the configuration file for amd, as part of the am-utils suite.
56.Pp
57.Nm
58contains runtime configuration information for the
59.Xr amd 8
60automounter program.
61.Sh FILE FORMAT
62The file consists of sections and parameters.  A section begins with the
63name of the section in square brackets and continues until the next section
64begins or the end of the file is reached.  Sections contain parameters of
65the form
66.Sq name = value .
67.Pp
68The file is line-based - that is, each newline-terminated line represents
69either a comment, a section name or a parameter.  No line-continuation
70syntax is available.
71.Pp
72Section, parameter names and their values are case sensitive.
73.Pp
74Only the first equals sign in a parameter is significant.  Whitespace before
75or after the first equals sign is discarded.  Leading, trailing and
76internal whitespace in section and parameter names is irrelevant.  Leading
77and trailing whitespace in a parameter value is discarded.  Internal
78whitespace within a parameter value is not allowed, unless the whole
79parameter value is quoted with double quotes as in
80.Sq name = Qq some\ value .
81.Pp
82Any line beginning with a pound sign (#) is ignored, as are lines containing
83only whitespace.
84.Pp
85The values following the equals sign in parameters are all either a string
86(no quotes needed if string does not include spaces) or a boolean, which may
87be given as yes/no.  Case is significant in all values.  Some items such as
88cache timeouts are numeric.
89.Sh SECTIONS
90.Ss "The [global] section"
91Parameters in this section either apply to
92.Nm amd
93as a whole, or to all other regular map sections which follow.  There
94should be only one global section defined in one configuration file.
95.Pp
96It is highly recommended that this section be specified first in the
97configuration file.  If it is not, then regular map sections which precede
98it will not use global values defined later.
99.Ss "Regular [/map] sections"
100Parameters in regular (non-global) sections apply to a single map entry.
101For example, if the map section
102.Bq Pa /homes
103is defined, then all parameters following it will be applied to the
104.Pa /homes
105amd-managed mount point.
106.Sh PARAMETERS
107.Ss "Parameters common to all sections"
108These parameters can be specified either in the global or a map specific
109section.  Entries specified in a map-specific section override the default
110value or one defined in the global section.   If such a common parameter is
111specified only in the global section, it is applicable to all regular map
112sections that follow.
113.Bl -tag -width 4n
114.It Ic browsable_dirs Xo
115(string, default=no)
116.Xc
117If
118.Qq yes ,
119then amd's top-level mount points will be browsable to
120.Xr readdir 3
121calls.  This means you could run for example
122.Xr ls 1
123and see what keys are available to mount in that directory.  Not all entries
124are made visible to readdir(3): the "/default" entry, wildcard
125entries, and those with a "/" in them are not included.  If you specify
126"full" to this option, all but "/default" will be visible.
127Note that if you run a command which will attempt to
128.BR stat (2)
129the entries, such as often done by "ls -l" or "ls -F", amd will attempt to
130mount
131.I every
132entry in that map.  This is often called a ``mount storm''.
133
134.TP
135.BR map_options " (string, default no options)"
136This option is the same as specifying map options on the command line to
137amd, such as "cache:=all".
138
139.TP
140.BR map_type " (string, default search all map types)"
141If specified, amd will initialize the map only for the type given.  This is
142useful to avoid the default map search type used by amd which takes longer
143and can have undesired side-effects such as initializing NIS even if not
144used.  Possible values are
145
146.nf
147\fBfile\fR      plain files
148\fBhesiod\fR    Hesiod name service from MIT
149\fBldap\fR      Lightweight Directory Access Protocol
150\fBndbm\fR      (New) dbm style hash files
151\fBnis\fR       Network Information Services (version 2)
152\fBnisplus\fR   Network Information Services Plus (version 3)
153\fBpasswd\fR    local password files
154\fBunion\fR     union maps
155.fi
156
157.TP
158.BR mount_type " (string, default=nfs)"
159All amd mount types must be NFS.  That is, amd is an NFS server on the
160map mount points, for the local host it is running on.  If "autofs" is
161specified, amd will log an error and convert it to NFS.
162
163.TP
164.BR search_path " (string, default no search path)"
165This provides a (colon-delimited) search path for file maps.  Using a search
166path, sites can allow for local map customizations and overrides, and can
167distributed maps in several locations as needed.
168
169.\" **************************************************************************
170.SS Parameters applicable to the global section only
171
172.TP
173.BR arch " (string, default to compiled in value)"
174Allows you to override the value of the
175.Va arch
176.Nm amd
177variable.
178.It Ic auto_dir Xo
179(string, default=/a)
180.Xc
181Same as the
182.Fl a
183option to
184.Nm amd .
185This sets the private directory where amd will create sub-directories for its
186real mount points.
187.It Ic cache_duration Xo
188(numeric, default=300)
189.Xc
190Same as the
191.Fl c
192option to
193.Nm amd .
194Sets the duration in seconds that looked up map entries remain in the cache.
195.It Ic cluster Xo
196(string, default no cluster)
197.Xc
198Same as the
199.Fl C
200option to
201.Nm amd .
202Specifies the alternate
203.Tn HP-UX
204cluster to use.
205.It Ic debug_options Xo
206(string, default no debug options)
207.Xc
208Same as the
209.Fl D
210option to
211.Nm amd .
212Specify any debugging options for
213.Nm amd .
214Works only if am-utils was configured for debugging using the
215.Fl -enable-debug
216option.
217The
218.Qq mem
219option alone can be turned on via
220.Fl -enable-debug Ns = Ns Ic mem .
221Otherwise debugging options are ignored.  Options are comma delimited, and can
222be preceded by the string
223.Qq no
224to negate their meaning.  You can get the list of supported debugging options
225by running
226.Nm amd Fl v .
227Possible values are:
228.Pp
229.Bl -tag -width "daemon" -compact
230.It Ic all
231all options
232.It Ic amq
233register for
234.Xr amq 8
235.It Ic daemon
236enter daemon mode
237.It Ic fork
238fork server
239.It Ic full
240program trace
241.It Ic info
242info service specific debugging
243(hesiod, nis, etc.)
244.It mem
245trace memory allocations
246.It Ic mtab
247use local
248.Pa ./mtab
249file
250.It Ic str
251debug string munging
252.It Ic test
253full debug but no daemon
254.It Ic trace
255protocol trace
256.El
257.It Ic dismount_interval Xo
258(numeric, default=120)
259.Xc
260Same as the
261.Fl w
262option to
263.Nm amd .
264Specify, in seconds, the time between attempts to dismount file systems that
265have exceeded their cached times.
266.It Ic fully_qualified_hosts Xo
267(string, default=no)
268.Xc
269If
270.Qq yes ,
271.Nm Amd
272will perform RPC authentication using fully-qualified host names.  This is
273necessary for some systems, and especially when performing cross-domain
274mounting.  For this function to work, the
275.Nm amd
276variable
277.Va ${hostd}
278is used, requiring that
279.Va ${domain}
280not be null.
281.It Ic hesiod_base Xo
282(string, default=automount)
283.Xc
284Specify the base name for hesiod maps.
285.It Ic karch Xo
286(string, default to karch of the system)
287.Xc
288Same as the
289.Fl k
290option to
291.Nm amd .
292Allows you to override the kernel-architecture of your system.  Useful for
293example on Sun
294(Sparc)
295machines, where you can build one
296.Nm amd
297binary and run it on multiple machines, yet you want each one to get the
298correct
299.Va karch
300variable set
301(for example, sun4c, sun4m, sun4u, etc.)
302Note that if not
303specified,
304.Nm amd
305will use
306.Xr uname 3
307to figure out the kernel architecture of the machine.
308.It Ic ldap_base Xo
309(string, default not set)
310.Xc
311Specify the base name for LDAP.
312.It Ic ldap_cache_maxmem Xo
313(numeric, default=131072)
314.Xc
315Specify the maximum memory amd should use to cache LDAP entries.
316.It Ic ldap_cache_seconds Xo
317(numeric, default=0)
318.Xc
319Specify the number of seconds to keep entries in the cache.
320.It Ic ldap_hostports Xo
321(string, default not set)
322.Xc
323Specify LDAP-specific values such as country and organization.
324.It Ic local_domain Xo
325(string, default no sub-domain)
326.Xc
327Same as the
328.Fl d
329option to
330.Nm amd .
331Specify the local domain name.  If this option is not given the domain name is
332determined from the hostname by removing the first component of the
333fully-qualified host name.
334.It Ic log_file Xo
335(string, default=/dev/stderr)
336.Xc
337Same as the
338.Fl l
339option to
340.Nm amd .
341Specify a file name to log
342.Nm amd
343events to.  If the string
344.Pa /dev/stderr
345is specified,
346.Nm amd
347will send its events to the standard error file descriptor.  IF the string
348.Pa syslog
349is given,
350.Nm amd
351will record its events with the system logger
352.Xr syslogd 8 .
353The default syslog facility used is
354.Ev LOG_DAEMON .
355If you wish to change it, append its name to the log file name, delimited by a
356single colon.  For example, if
357.Pa logfile
358is the string
359.Qq syslog:local7
360then
361.Nm amd
362will log messages via
363.Xr syslog 3
364using the
365.Ev LOG_LOCAL7
366facility
367(if it exists on the system).
368.It Ic log_options Xo
369(string, default no logging options)
370.Xc
371Same as the
372.Fl x
373option to
374.Nm amd .
375Specify any logging options for
376.Nm amd .
377Options are comma delimited, and can be preceded by the string
378.Dq no
379to negate their meaning.  The
380.Dq debug
381logging option is only available if am-utils was configured with
382.Fl -enable-debug .
383You can get the list of supported debugging options by running
384.Nm amd Fl v .
385Possible values are:
386.Pp
387.Bl -tag -width "warning" -compact
388.It Ic all
389all messages
390.It Ic debug
391debug messages
392.It Ic error
393non-fatal system errors
394.It Ic fatal
395fatal errors
396.It Ic info
397information
398.It Ic map
399map errors
400.It Ic stats
401additional statistical information
402.It Ic user
403non-fatal user errors
404.It Ic warn
405warnings
406.It Ic warning
407warnings
408.El
409.It Ic nfs_retransmit_counter Xo
410(numeric, default=110)
411.Xc
412Same as the
413.Ic counter
414part of the
415.Fl t Ar interval.counter
416option to
417.Nm amd .
418Specifies the retransmit counter's value in tenths of seconds.
419.It Ic nfs_retry_interval Xo
420(numeric, default=8)
421.Xc
422Same as the
423.B \-x
424option to amd.  Specify any logging options for amd.  Options are comma
425delimited, and can be preceded by the string "no" to negate their meaning.
426The "debug" logging option is only available if am-utils was configured with
427--enable-debug.  You can get the list of supported debugging and logging
428options by running amd \-H.  Possible values are:
429
430.nf
431\fBall\fR       all messages
432\fBdebug\fR     debug messages
433\fBerror\fR     non-fatal system errors
434\fBfatal\fR     fatal errors
435\fBinfo\fR      information
436\fBmap\fR       map errors
437\fBstats\fR     additional statistical information
438\fBuser\fR      non-fatal user errors
439\fBwarn\fR      warnings
440\fBwarning\fR   warnings
441.fi
442
443.TP
444.BR nfs_vers " (numeric, default to trying version 3 then 2)"
445By default, amd tries version 3 and then version 2.  This option forces the
446overall NFS protocol used to version 3 or 2.  It overrides what is in the
447amd maps, and is useful when amd is compiled with NFSv3 support that may not
448be stable.  With this option you can turn off the complete usage of NFSv3
449dynamically (without having to recompile amd) until such time as NFSv3
450support is desired again.
451
452.TP
453.BR nfs_retransmit_counter " (numeric, default=11)"
454Same as the
455.I retransmit
456part of the
457.BI \-t " timeout.retransmit"
458option to amd.
459Specifies the number of NFS retransmissions that the kernel will use to
460communicate with amd.
461
462.TP
463.BR nfs_retry_interval " (numeric, default=8)"
464Same as the
465.I timeout
466part of the
467.BI \-t " timeout.retransmit"
468option to amd.  Specifies the NFS timeout interval, in
469.I tenths
470of seconds, between NFS/RPC retries (for UDP only).
471This is the value that the kernel will use to
472communicate with amd.
473
474Amd relies on the kernel RPC retransmit mechanism to trigger mount retries.
475The values of the
476.B nfs_retransmit_counter
477and the
478.B nfs_retry_interval
479parameters change the overall retry interval.  Too long an interval gives
480poor interactive response; too short an interval causes excessive retries.
481
482.TP
483.BR nfs_proto " (string, default to trying version tcp then udp)"
484By default, amd tries TCP and then UDP.  This option forces the overall NFS
485protocol used to TCP or UDP.  It overrides what is in the amd maps, and is
486useful when amd is compiled with NFSv3 support that may not be stable.  With
487this option you can turn off the complete usage of NFSv3 dynamically
488(without having to recompile amd) until such time as NFSv3 support is
489desired again.
490
491.TP
492.BR nis_domain " (string, default to local NIS domain name)"
493Same as the
494.B \-y
495option to amd.  Specify an alternative NIS domain from which to fetch the
496NIS maps.  The default is the system domain name.  This option is ignored if
497NIS support is not available.
498
499.TP
500.BR normalize_hostnames " (boolean, default=no)"
501Same as the
502.B \-n
503option to amd.  If "yes", then the name refereed to by ${rhost} is
504normalized relative to the host database before being used.  The effect is
505to translate aliases into ``official'' names.
506
507.TP
508.BR os " (string, default to compiled in value)"
509Same as the
510.B \-O
511option to amd.  Allows you to override the compiled-in name of the operating
512system.  Useful when the built-in name is not desired for backward
513compatibility reasons.  For example, if the build in name is
514.Dq sunos5 ,
515you can override it to
516.Dq sos5 ,
517and use older maps which were written with the latter in mind.
518.It Ic osver Xo
519(string, default to compiled in value)
520.Xc
521Same as the
522.Fl o
523option to
524.Nm amd .
525Override the compiled-in version number of the operating
526system.  Useful when the built in version is not desired for backward
527compatibility reasons.  For example, if the build in version is
528.Dq 2.5.1 ,
529you can override it to
530.Dq 5.5.1 ,
531and use older maps that were written with the latter in mind.
532.It Ic pid_file Xo
533(string, default=/dev/stdout)
534.Xc
535Specify a file to store the process ID of the running daemon into.  If not
536specified,
537.Nm amd
538will print its process id only the standard output.  Useful for killing
539.Nm amd
540after it had run.  Note that the PID of a running
541.Nm amd
542can also be retrieved via
543.Nm amq Fl p .
544This file is used only if the
545.Ar print_pid
546option is on.
547.It Ic plock Xo
548(boolean, default=yes)
549.Xc
550Same as the
551.Fl S
552option to
553.Nm amd .
554If
555.Dq yes ,
556lock the running executable pages of
557.Nm amd
558into memory.  To improve
559.Nm amd Ns 's
560performance, systems that support the
561.Xr plock 3
562call can lock the
563.Nm amd
564process into memory.  This way there is less chance it that the operating
565system will schedule, page out, and swap the
566.Nm amd
567process as needed.  This improves
568.Nm amd Ns 's
569performance, at the cost of reserving the memory used by the
570.Nm amd
571process
572(making it unavailable for other processes).
573.It Ic portmap_program Xo
574(numeric, default=300019)
575.Xc
576Specify an alternate Port-mapper RPC program number, other than the official
577number.  This is useful when running multiple
578.Nm amd
579processes.  For example, you can run another
580.Nm amd
581in
582.Dq test
583mode, without affecting the primary
584.Nm amd
585process in any way.  For safety reasons, the alternate program numbers that
586can be specified must be in the range 300019-300029, inclusive.
587.Nm amq
588has an option
589.Fl P
590which can be used to specify an alternate program number of an
591.Nm amd
592to contact.  In this way,
593.Nm amq
594can fully control any number of
595.Nm amd
596processes running on the same host.
597.It Ic print_pid Xo
598(boolean, default=no)
599.Xc
600Same as the
601.Fl p
602option to
603.Nm amd .
604If
605.Dq yes ,
606.Nm amd
607will print its process ID upon starting.
608.It Ic print_version Xo
609(boolean, default=no)
610.Xc
611Same as the
612.Fl v
613option to
614.Nm amd ,
615but the version prints and
616.Nm amd
617continues to run.  If
618.Dq yes ,
619.Nm amd
620will print its version information string, which includes some configuration
621and compilation values.
622.It Ic restart_mounts Xo
623(boolean, default=no)
624.Xc
625Same as the
626.Fl r
627option to
628.Nm amd .
629If
630.Dq yes ,
631.Nm amd
632will scan the mount table to determine which file systems are currently
633mounted.  Whenever one of these would have been auto-mounted,
634.Nm amd
635inherits it.
636.It Ic selectors_on_default Xo
637(boolean, default=no)
638.Xc
639If
640.Dq yes ,
641then the
642.Pa /default
643entry of maps will be looked for and process any selectors before setting
644defaults for all other keys in that map.  Useful when you want to set
645different options for a complete map based on some parameters.  For example,
646you may want to better the
647.Tn NFS
648performance over slow slip-based networks as
649follows:
650.Pp
651.Bd -literal
652/defaults \\
653    wire==slip-net;opts:=intr,rsize=1024,wsize=1024 \\
654    wire!=slip-net;opts:=intr,rsize=8192,wsize=8192
655.Ed
656.It Ic show_statfs_entries Xo
657(boolean, default=no)
658.Xc
659If
660.Dq yes ,
661then all maps which are browsable will also show the number of entries
662(keys)
663they have when
664.Qq df
665runs.
666(This is accomplished by returning non-zero values to the
667.Xr statfs 2
668system call.)
669.It Ic unmount_on_exit Xo
670(boolean, default=no)
671.Xc
672If
673.Dq yes ,
674then
675.Nm amd
676will attempt to unmount all file systems which it knows about.  Normally
677.Nm amd
678leaves all
679(esp.\&)
680.Tn NFS
681mounted file systems intact.  Note that
682.Nm amd
683does not know about file systems mounted before it starts up, unless the
684.Ar restart_mounts
685option or
686.Fl r
687flag are used.
688.El
689.Ss "Parameters applicable to regular map sections"
690.Bl -tag -width 4n
691.It Ic map_name Xo
692(string, must be specified)
693.Xc
694Name of the map where the keys are located.
695.It Ic tag Xo
696(string, default no tag)
697.Xc
698Each map entry in the configuration file can be tagged.  If no tag is
699specified, that map section will always be processed by
700.Nm amd .
701If it is specified, then
702.Nm amd
703will process the map if the
704.Fl T
705option was given to
706.Nm amd ,
707and the value given to that command-line option matches that in the map
708section.
709.El
710.Sh EXAMPLES
711Here is a real
712.Nm amd
713configuration I use daily.
714.Bd -literal
715# GLOBAL OPTIONS SECTION
716[ global ]
717normalize_hostnames =    no
718print_pid =              no
719restart_mounts =         yes
720auto_dir =               /n
721log_file =               /var/log/amd
722log_options =            all
723#debug_options =         all
724plock =                  no
725selectors_on_default =   yes
726# config.guess picks up "sunos5" and I don't want to edit my maps yet
727os =                     sos5
728# if you print_version after setting up "os", it will show it.
729print_version =          no
730map_type =               file
731search_path =            /etc/amdmaps:/usr/lib/amd:/usr/local/AMD/lib
732browsable_dirs =         yes
733
734# DEFINE AN AMD MOUNT POINT
735[ /u ]
736map_name =               amd.u
737
738[ /proj ]
739map_name =               amd.proj
740
741[ /src ]
742map_name =               amd.src
743
744[ /misc ]
745map_name =               amd.misc
746
747[ /import ]
748map_name =               amd.import
749
750[ /tftpboot/.amd ]
751tag =                    tftpboot
752map_name =               amd.tftpboot
753.Ed
754.Sh SEE ALSO
755.Xr amd 8 ,
756.Xr amq 8
757.Sh AUTHORS
758.An Erez Zadok Aq [email protected] ,
759Department of Computer Science, Columbia University, New York, USA.
760.Pp
761.An Jan-Simon Pendry Aq [email protected] ,
762Department of Computing, Imperial College, London, UK.
763.Pp
764Other authors and contributers to am-utils are listed in the
765.Pa AUTHORS
766file distributed with am-utils.
767.Sh HISTORY
768The
769.Nm amd
770utility first appeared in
771.Bx 4.4 .
772