AMD.CONF(5)

πŸ“¦ version 6.2.0, in fedora 43, fedora 44

πŸŽ€ amd.conf β€” the Amd configuration file πŸŽ€

hey bestie!! you clicked into AMD.CONF(5) and honestly? iconic choice πŸ’– this is the whole vibe of amd.conf, and i'm gonna walk you through every last bit of it. grab a snack πŸ“

✨ NAME ✨

amd.conf β€” Amd configuration file 🌸

✨ SYNOPSIS ✨

amd.conf

✨ DESCRIPTION ✨

the amd.conf file is the configuration file for Amd, as part of the am-utils suite 🫢

amd.conf contains runtime configuration information for the Amd automounter program ✨ no cap.


πŸ“„ FILE FORMAT πŸ“„

okay so the file is made of sections and parameters, that's the whole structure πŸ’…

a section begins with the name of the section in square brackets and just keeps going until the next section starts, or until you hit the end of the file. sections contain parameters shaped like name = value.

the file is line-based β€” meaning every newline-terminated line is either a comment, a section name, or a parameter. there is no line-continuation syntax, so don't try it πŸ™ˆ

section names, parameter names and their values are all case sensitive, fr fr.

only the first equals sign in a parameter matters. whitespace before or after that first equals sign gets discarded. leading, trailing and internal whitespace in section and parameter names is irrelevant. leading and trailing whitespace in a parameter value is discarded. internal whitespace inside a parameter value is not allowed β€” unless the whole parameter value is wrapped in double quotes, like name = "some value" ✨

any line starting with a pound sign (#) is ignored, and so are lines that are nothing but whitespace 🌸

the values after the equals sign are all either:

  • a string β€” no quotes needed if the string doesn't include spaces, or
  • a boolean, which you can give as yes/no.

case is significant in all values, bestie. and some items, like cache timeouts, are numeric πŸ”’


πŸ—‚οΈ SECTIONS πŸ—‚οΈ

πŸ‘‘ The [global] section

parameters in here either apply to Amd as a whole, or to every regular map section that follows it. there should be only one global section defined in one configuration file πŸ‘‘

it is highly recommended that this section be specified first in the configuration file. if it isn't, then the regular map sections that come before it will not use the global values defined later. so like, put it first. periodt πŸ’…

πŸ—ΊοΈ Regular [/map] sections

parameters in regular (non-global) sections apply to a single map entry. for example, if the map section [/homes] is defined, then all parameters following it get applied to the /homes Amd-managed mount point πŸ¦‹


πŸŽ›οΈ PARAMETERS πŸŽ›οΈ

🌈 Parameters common to all sections

these parameters can go either in the global section or in a map-specific section. entries in a map-specific section override the default value, or whatever was defined in the global section πŸ’– and if a common parameter is only specified in the global section, it applies to all the regular map sections that follow it.

  • browsable_dirs (string, default=no) β€” if "yes", then Amd's top-level mount points will be browsable to readdir(3) calls πŸ‘€ meaning you could run, for example, ls(1) and see what keys are available to mount in that directory. but not all entries get made visible to readdir(3): the "/default" entry, wildcard entries, and those with a "/" in them are not included. if you specify "full" to this option, all but "/default" will be visible. note that if you run a command which will attempt to stat(2) the entries β€” like what often happens with "ls -l" or "ls -F," β€” Amd will attempt to mount every entry in that map 😭 this is often called a ``mount storm.''
  • map_defaults (string, default to empty) β€” this option sets a string to be used as the map's /defaults entry, overriding any /defaults specified in the map. this lets local users override map defaults without modifying maps globally πŸ™Œ
  • map_options (string, default no options) β€” this option is the same as specifying map options on the command line to Amd, such as "cache:=all" ✨
  • map_type (string, default search all map types) β€” if specified, Amd will initialize the map only for the type given. this is useful to avoid the default map search type used by Amd, which takes longer and can have undesired side-effects such as initializing NIS even if it's not used πŸ’€ possible values are:
    • exec β€” executable maps
    • file β€” plain files
    • hesiod β€” Hesiod name service from MIT
    • ldap β€” Lightweight Directory Access Protocol
    • ndbm β€” (New) dbm style hash files
    • nis β€” Network Information Services (version 2)
    • nisplus β€” Network Information Services Plus (version 3)
    • passwd β€” local password files
    • union β€” union maps
  • mount_type (string, default=nfs) β€” all Amd mount types default to NFS. that is, Amd is an NFS server on the map mount points, for the local host it is running on. if "autofs" is specified, Amd will be an autofs server for those mount points 🌈
  • autofs_use_lofs (string, default=yes) β€” when set to "yes" and using Autofs, Amd will use lofs-type (loopback) mounts for type:=link mounts. this has the advantage of mounting in place, and users get to see the same pathname that they chdir'ed into πŸ‘‘ if this option is set to "no," then Amd will use symlinks instead: that code is more tested, but it negates autofs's big advantage of in-place mounts πŸ™ˆ
  • search_path (string, default no search path) β€” this provides a (colon-delimited) search path for file maps. using a search path, sites can allow for local map customizations and overrides, and can distributed maps in several locations as needed πŸ—ΊοΈ
  • selectors_in_defaults (boolean, default=no) β€” if "yes," then the /defaults entry of maps will search for and process any selectors before setting defaults for all other keys in that map. useful when you want to set different options for a whole map based on some parameters. for example, you may want to better the NFS performance over slow slip-based networks as follows:
/defaults \
    wire==slip-net;opts:=intr,rsize=1024,wsize=1024 \
    wire!=slip-net;opts:=intr,rsize=8192,wsize=8192
deprecated form: selectors_on_default ⚠️
  • sun_map_syntax (boolean, default=no) β€” if "yes," then Amd will parse the map according to the Sun Automount syntax β˜€οΈ

πŸ”₯ Parameters applicable to the global section only

  • arch (string, default to compiled in value) β€” same as the -A option to Amd. lets you override the value of the arch Amd variable πŸ’…
  • auto_attrcache (numeric, default=0) β€” specify in seconds (or units of 0.1 seconds, depending on the OS), what is the (kernel-side) NFS attribute cache timeout for Amd's own automount points. a value of 0 is supposed to turn off attribute caching, meaning that Amd will be consulted via a kernel-RPC each time someone stat()'s the mount point (which could be abused as a denial-of-service attack) 😱 warning: some OSs are incapable of turning off the NFS attribute cache reliably. on such systems, Amd may not work reliably under heavy load. see the README.attrcache document in the Am-utils distribution for more details πŸ“–
  • auto_dir (string, default=/a) β€” same as the -a option to Amd. this sets the private directory where Amd will create sub-directories for its real mount points πŸ—‚οΈ
  • cache_duration (numeric, default=300) β€” same as the -c option to Amd. sets the duration in seconds that looked-up or mounted map entries remain in the cache ⏳
  • cluster (string, default no cluster) β€” same as the -C option to Amd. specifies the alternate HP-UX cluster to use πŸ–₯️
  • debug_mtab_file (string, default=/tmp/mnttab) β€” path to mtab file that is used by Amd to store a list of mounted file systems during debug-mtab mode. this option only applies to systems that store mtab information on disk πŸ’Ύ
  • debug_options (string, default no debug options) β€” same as the -D option to Amd. specify any debugging options for Amd. it works only if am-utils was configured for debugging using the --enable-debug option. the "mem" option, as well as all other options, can be turned on via --enable-debug=mem. otherwise debugging options are ignored πŸ™ˆ options are comma delimited, and can be preceded by the string "no" to negate their meaning. you can get the list of supported debugging options by running Amd -H. possible values are:
    • all β€” all options (excludes hrtime and mtab)
    • defaults β€” "sensible" default options (all--excluding hrtime, mtab, and xdrtrace)
    • test β€” full debug options plus mtab,nodaemon,nofork,noamq
    • amq β€” register for amq
    • daemon β€” enter daemon mode
    • fork β€” fork server
    • full β€” program trace
    • hrtime β€” print high resolution time stamps (only if syslog(3) is not used)
    • info β€” info service specific debugging (hesiod, nis, etc.)
    • mem β€” trace memory allocations
    • mtab β€” use local "/tmp/mtab" file
    • readdir β€” show browsable_dirs progress
    • str β€” debug string munging
    • trace β€” trace protocol and NFS mount arguments
    • xdrtrace β€” trace XDR routines
  • dismount_interval (numeric, default=120) β€” same as the -w option to Amd. specify in seconds, the time between attempts to dismount file systems that have exceeded their cached times ⏰
  • domain_strip (boolean, default=yes) β€” if "yes," then the domain name part referred to by ${rhost} is stripped off. this is useful to keep logs and smaller. if "no," then the domain name part is left changed. this is useful when using multiple domains with the same maps (as you may have hosts whose domain-stripped name is identical) 🌐
  • exec_map_timeout (numeric, default=10) β€” the timeout in seconds that Amd will wait for an executable map program before an answer is returned from that program (or script). this value should be set to as small as possible while still allowing normal replies to be returned before the timer expires, because during the time that the executable map program is queried, Amd is essentially waiting and is thus not responding to any other queries 😭
  • forced_unmounts (boolean, default=no) β€” if set to "yes," and the client OS supports forced or lazy unmounts, then Amd will attempt to use them if it gets any of three serious error conditions when trying to unmount an existing mount point or mount on top of one: EIO, ESTALE, or EBUSY πŸ’€

This could be useful to recover from serious conditions such as hardware failure of mounted disks, or NFS servers which are down permanently, were migrated, or changed their IP address. Only type:=toplvl mounts hung with EBUSY are forcibly unmounted using this option, which is useful to recover from a hung Amd πŸ’…


  • full_os (string, default to compiled in value) β€” the full name of the operating system, plus its version πŸ’– lets you override the compiled-in full name and version. Iconic when the compiled-in name is just… not it. For example, the full operating system name on linux comes up as linux'', but you can override it to linux-2.2.5.''
  • fully_qualified_hosts (string, default=no) β€” if it's "yes," then Amd does its RPC authentication using fully-qualified host names ✨ this is necessary for some systems, and especially when you're doing cross-domain mounting. For this function to work, the Amd variable ${hostd} is used, which requires that ${domain} not be null 🫢
  • hesiod_base (string, default=automount) β€” specify the base name for hesiod maps 🌸
  • karch (string, default to karch of the system) β€” same as the -k option to Amd. Lets you override the kernel-architecture of your system πŸ‘‘ lowkey so useful on Sun (Sparc) machines, where you can build one Amd binary, and run it on multiple machines, yet you want each one to get the correct karch variable set (for example, sun4c, sun4m, sun4u, etc.). Note that if not specified, Amd will use uname(3) to figure out the kernel architecture of the machine πŸ’€
  • ldap_base (string, default not set) β€” specify the base name for LDAP 🌈 this often includes LDAP-specific values such as country and organization.
  • ldap_cache_maxmem (numeric, default=131072) β€” the maximum memory Amd should use to cache LDAP entries πŸŽ€
  • ldap_cache_seconds (numeric, default=0) β€” the number of seconds to keep entries in the cache ⭐
  • ldap_hostports (string, default not set) β€” specify the LDAP host and port values πŸ¦‹
  • ldap_proto_version (numeric, default=2) β€” specify the version of the LDAP protocol to use πŸ’œ
  • local_domain (string, default no sub-domain) β€” same as the -d option to Amd. Specify the local domain name 🌸 if this option isn't given, the domain name is determined from the hostname, by removing the first component of the fully-qualified host name.
  • localhost_address (string, default to localhost or 127.0.0.1) β€” the name or IP address Amd should use when connecting the sockets for the local NFS server and the RPC server πŸ’– this defaults to 127.0.0.1 or whatever the host reports as its local address. Super handy on hosts with multiple addresses where you want to force Amd to connect to a specific address ✨
  • log_file (string, default=/dev/stderr) β€” same as the -l option to Amd. Specify a file name to log Amd events to 🫢 if the string /dev/stderr is specified, Amd will send its events to the standard error file descriptor. If the string syslog is given, Amd will record its events with the system logger syslogd(8) 😭 the default syslog facility used is LOG_DAEMON. If you wish to change it, append its name to the log file name, delimited by a single colon. For example, if logfile is the string syslog:local7 then Amd will log messages via syslog(3) using the LOG_LOCAL7 facility (if it exists on the system) πŸ”₯
  • log_options (string, default=defaults) β€” same as the -x option to Amd. Specify any logging options for Amd πŸŽ€ options are comma delimited, and can be preceded by the string "no" to negate their meaning. The debug logging option is only available if am-utils was configured with --enable-debug. You can get the list of supported debugging and logging options by running amd -H πŸ‘‘ possible values are:
    • all β€” all messages
    • defaults β€” default messages (fatal,error,user,warning,info)
    • debug β€” debug messages
    • error β€” non-fatal system errors (cannot be turned off)
    • fatal β€” fatal errors (cannot be turned off)
    • info β€” information
    • map β€” map errors
    • stats β€” additional statistical information
    • user β€” non-fatal user errors
    • warn β€” warnings
    • warning β€” warnings
  • map_reload_interval (numeric, default=3600) β€” the number of seconds Amd waits before it checks whether any maps have changed at their source (NIS servers, LDAP servers, files, etc.) πŸ¦‹ Amd will reload only those maps that have changed πŸ’…
  • nfs_allow_any_interface (string, default=no) β€” normally Amd accepts local NFS packets only from 127.0.0.1. If this parameter is set to "yes" then Amd will accept local NFS packets from any local interface 😳 this is useful on hosts that may have multiple interfaces where the system is forced to send all outgoing packets (even those bound to the same host) via an address other than 127.0.0.1.
  • nfs_allow_insecure_port (string, default=no) β€” normally Amd refuses requests coming from unprivileged ports (i.e. ports >= 1024 on Unix systems), so that only privileged users and the kernel can send NFS requests to it 🫢 however, some kernels (certain versions of Darwin, MacOS X, and Linux) have bugs that cause them to use unprivileged ports in certain situations, which causes Amd to stop dead in its tracks πŸ’€ this parameter lets Amd operate normally even on such systems, at the expense of a slight decrease in the security of its operations. If you see messages like "ignoring request from foo:1234, port not reserved" in your Amd log, try enabling this parameter and give it another go ✨
  • nfs_proto (string, default to trying version tcp then udp) β€” by default, Amd tries TCP and then UDP. This option forces the overall NFS protocol used to TCP or UDP πŸ”₯ it overrides what's in the Amd maps, and is useful when Amd is compiled with NFSv3 support that may not be stable. With this option you can turn off the complete usage of NFSv3 dynamically (without having to recompile Amd) until such time as NFSv3 support is desired again πŸ‘‘
  • nfs_retransmit_counter (numeric, default=11) β€” same as the retransmit part of the -t timeout.retransmit option to Amd. Specifies the number of NFS retransmissions that the kernel will use to communicate with Amd 🌸
  • nfs_retransmit_counter_udp (numeric, default=11) β€” same as the nfs_retransmit_counter option, but for all UDP mounts only πŸ’œ
  • nfs_retransmit_counter_tcp (numeric, default=11) β€” same as the nfs_retransmit_counter option, but for all TCP mounts only πŸŽ€
  • nfs_retransmit_counter_toplvl (numeric, default=11) β€” same as the nfs_retransmit_counter option, but only for Amd's top-level UDP mounts ⭐
  • nfs_retry_interval (numeric, default=8) β€” same as the timeout part of the -t timeout.retransmit option to Amd. Specifies the NFS timeout interval, in tenths of seconds, between NFS/RPC retries (for UDP and TCP) 🫢 this is the value that the kernel will use to communicate with Amd.

Amd relies on the kernel RPC retransmit mechanism to trigger mount retries. The values of the nfs_retransmit_counter and the nfs_retry_interval parameters change the overall retry interval 😭 too long an interval gives poor interactive response; too short an interval causes excessive retries.

  • nfs_retry_interval_udp (numeric, default=8) β€” same as the nfs_retry_interval option, but for all UDP mounts only πŸ¦‹
  • nfs_retry_interval_tcp (numeric, default=8) β€” same as the nfs_retry_interval option, but for all TCP mounts only πŸ’–
  • nfs_retry_interval_toplvl (numeric, default=8) β€” same as the nfs_retry_interval option, but only for Amd's top-level UDP mounts ✨
  • nfs_vers (numeric, default to trying version 3 then 2) β€” by default, Amd tries version 3 and then version 2. This option forces the overall NFS protocol used to version 3 or 2 πŸ”₯ it overrides what's in the Amd maps, and is useful when Amd is compiled with NFSv3 support that may not be stable. With this option you can turn off the complete usage of NFSv3 dynamically (without having to recompile Amd) until such time as NFSv3 support is desired again πŸ‘‘
  • nis_domain (string, default to local NIS domain name) β€” same as the -y option to Amd. Specify an alternative NIS domain from which to fetch the NIS maps 🌈 the default is the system domain name. This option is ignored if NIS support is not available πŸ™ˆ
  • normalize_hostnames (boolean, default=no) β€” same as the -n option to Amd. If "yes," then the name referred to by ${rhost} is normalized relative to the host database before being used πŸ’… the effect is to translate aliases into ``official'' names.
  • normalize_slashes (boolean, default=yes) β€” if "yes," then Amd will condense all multiple ``/'' (slash) characters into one and remove all trailing slashes πŸŽ€ if "no," then Amd will not touch strings that may contain repeated or trailing slashes. The latter is sometimes useful with SMB mounts, which often require multiple slash characters in pathnames πŸ¦‹
  • os (string, default to compiled in value) β€” same as the -O option to Amd. Lets you override the compiled-in name of the operating system πŸ‘‘ useful when the built-in name isn't desired for backward compatibility reasons. For example, if the built in name is sunos5'', you can override it to sos5'', and use older maps which were written with the latter in mind πŸ’œ
  • osver (string, default to compiled in value) β€” same as the -o option to Amd. Overrides the compiled-in version number of the operating system ⭐ useful when the built in version isn't desired for backward compatibility reasons. For example, if the build in version is 2.5.1'', you can override it to 5.5.1'', and use older maps that were written with the latter in mind 🌸
  • pid_file (string, default=/dev/stdout) β€” bestie, this is where you tell Amd to stash the process ID of the running daemon. Don't specify it and Amd just prints its process id onto the standard output, easy peasy. It's super useful for killing Amd after it's been running. Fun lil fact: you can also grab the PID of a running Amd with amq -p. Heads up tho β€” this file only gets used if the print_pid option is on. πŸŽ€
  • plock (boolean, default=yes) β€” same energy as the -S option to Amd. Set it to "yes" and Amd locks its own running executable pages into memory. The way this works: on systems that support the plock(3) or mlockall(2) call, Amd can lock its process into memory, which means there's less chance the operating system will schedule, page out, and swap the Amd process as needed. Performance go brrr, but at a cost β€” it reserves the memory the Amd process uses, so that memory is unavailable for other processes. Trade-offs, we love them. ✨
  • portmap_program (numeric, default=300019) β€” pick an alternate Port-mapper RPC program number instead of the official one. Obsessed with this one for running multiple Amd processes at once β€” like, you can run another Amd in "test" mode without affecting the primary Amd process in any way. πŸ¦‹ For safety reasons the alternate program numbers you can specify must be in the range 300019-300029, inclusive. Amq has an option -P for specifying an alternate program number of an Amd to contact, so amq can fully control any number of Amd processes running on the same host. Iconic.
  • preferred_amq_port (numeric, default=0) β€” set an alternate Port-mapper RPC port number for Amd's Amq service. Used for both UDP and TCP, no cap. Setting this to 0 (or just not defining it) makes Amd pick an arbitrary port number. Setting the Amq RPC service port to a specific number is so useful in firewalled or NAT'ed environments, where you literally need to know which port Amd will listen on. πŸ”₯
  • print_pid (boolean, default=no) β€” same as the -p option to Amd. If "yes", Amd prints its process ID upon starting. Simple. Clean. πŸ’…
  • print_version (boolean, default=no) β€” same as the -v option to Amd, except the version prints and Amd continues to run. If "yes", Amd prints its version information string, which includes some configuration and compilation values. πŸ“
  • restart_mounts (boolean, default=no) β€” same as the -r option to Amd. If "yes", Amd scans the mount table to figure out which file systems are currently mounted, and whenever one of those would have been auto-mounted, Amd inherits it. πŸ‘‘
  • show_statfs_entries (boolean, default=no) β€” if "yes", then all maps which are browsable will also show the number of entries (keys) they have when "df" runs. (This is accomplished by returning non-zero values to the statfs(2) system call.) Ngl, kind of a flex. 🌈
  • truncate_log (boolean, default=no) β€” if "yes", then the log file (if it is a regular file) will be truncated upon startup. Fresh start energy. 🧚
  • unmount_on_exit (boolean, default=no) β€” if "yes", then Amd will attempt to unmount all file systems which it knows about. Normally Amd leaves all (esp. NFS) mounted file systems intact. Careful tho β€” Amd does not know about file systems mounted before it starts up, unless the restart_mounts option or -r flag are used. πŸ’€
  • use_tcpwrappers (boolean, default=yes) β€” if "yes", then Amd will use the tcpd/librwap tcpwrappers library (if available) to control access to Amd via the /etc/hosts.allow and /etc/hosts.deny files. Gatekeeping, but make it config files. πŸšͺ
  • vendor (string, default to compiled in value) β€” the name of the vendor of the operating system. Overrides the compiled-in vendor name. Useful when the compiled-in name is not desired β€” for example, most Intel based systems set the vendor name to unknown'', but you can set it to redhat.'' Fr fr, rename yourself. πŸ™ˆ

πŸ’– Parameters applicable to regular map sections πŸ’–

  • map_name (string, must be specified) β€” name of the map where the keys are located. Required, no skipping. ⭐
  • tag (string, default no tag) β€” each map entry in the configuration file can be tagged. If no tag is specified, that map section will always be processed by Amd. If it is specified, then Amd will process the map if the -T option was given to Amd, and the value given to that command-line option matches that in the map section. Matchy matchy. πŸŽ€

🌸 EXAMPLES 🌸

Here is a real Amd configuration file I use daily.

# GLOBAL OPTIONS SECTION
[ global ]
normalize_hostnames =    no
print_pid =              no
restart_mounts =         yes
auto_dir =               /n
log_file =               /var/log/amd
log_options =            all
#debug_options =         all
plock =                  no
selectors_in_defaults =  yes
# config.guess picks up "sunos5" and I don't want to edit my maps yet
os =                     sos5
# if you print_version after setting up "os," it will show it.
print_version =          no
map_type =               file
search_path =            /etc/amdmaps:/usr/lib/amd:/usr/local/AMD/lib
browsable_dirs =         yes

# DEFINE AN AMD MOUNT POINT
[ /u ]
map_name =               amd.u

[ /proj ]
map_name =               amd.proj

[ /src ]
map_name =               amd.src

[ /misc ]
map_name =               amd.misc

[ /import ]
map_name =               amd.import

[ /tftpboot/.amd ]
tag =                    tftpboot
map_name =               amd.tftpboot

✨ SEE ALSO ✨


πŸ‘‘ AUTHORS πŸ‘‘

Erez Zadok <ezk@cs.sunysb.edu>, Computer Science Department, Stony Brook University, Stony Brook, New York, USA.

Other authors and contributors to am-utils are listed in the AUTHORS file distributed with am-utils. 🫢


And that's the whole page, bestie β€” this version's from 7 August 1997, page AMD.CONF(5). Go forth and automount, you absolute main character. πŸ’œπŸ¦‹

πŸ“¦ where this page comes from