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