Previous: , Up: mgetty   [Contents]


2.9 Runtime configuration for mgetty: mgetty.config

Mgetty works quite well with the compiled-in defaults (it has been the only way to configure it for a long time), but that’s quite unflexible, and especially if you use different modem types, it’s extremely unhandy. The built-in defaults can be modified by command line options, but that’s not perfect either, because it makes /etc/inittab entries very long and difficult to read.

If compiled with config file support (define MGETTY_CONFIG in policy.h), mgetty can use a configuration file, quite similar to those which "Taylor UUCP" uses, which make dynamic setup far easier.

The config file is usually located in /usr/local/etc/mgetty+sendfax/ and named mgetty.config. Its format is very simple. Each line contains one keyword, and possibly arguments for it, separated by whitespace. Empty lines, and comment lines (lines starting with ‘#’) are allowed.

The config file is grouped into port-specific sections, separated by port <tty-name> lines. Everything before the first port line specifies global defaults, everything between two port statements specifies configuration items valid only for exactly this device. Let me show you an example:

# global defaults:
# fax station id is always the same
fax-id ++49-89-1234
# per port stuff
port tty1a
# This modem can't fax
modem-type data

port tty2a
# more verbose logging for this modem
debug 9

The data part of each line, following the keyword, can be a string (in most cases), a chat sequence (a series of strings, separated by whitespace, that specify the "modem talk" to do. It starts with "expect" string, then "send", then "expect" again, and so on), an integer (interpreted as decimal, octal or hexadecimal, depending on the leading character [1-9/0/0x]), or boolean (‘y(es)’ or ‘t(rue)’ vs. ‘n(o)’ or ‘f(alse)’). If no argument is specified, this will be considered “value not set” (if allowed) or “error” (if value is mandatory), except for boolean values. In that case, it’s interpreted as ‘true’.

Many of those configuration items can be overriden from the command line. In that case, command line options take precedence over configuration file settings (and those take precedence over built-in defaults). In many cases, the built-in defaults can be set in policy.h.

The available configuration items are (command line options, if available, given in brackets):


Previous: , Up: mgetty   [Contents]