Online Book Reader

Home Category

UNIX System Administration Handbook - Evi Nemeth [70]

By Root 2828 0
and the terminal type (among other things).

Unfortunately, terminal configuration is one area where there is little agreement among vendors. Table 7.6 lists the files used by each system.

Table 7.6 Terminal configuration files

a. Solaris configuration files are in /etc/saf and should be managed with sacadm.

The /etc/ttys and /etc/ttytab files

Systems based on 4.3BSD or later have both the port and terminal type information merged into a single file, sometimes called ttytab and sometimes called ttys (FreeBSD). The format is:

device program termtype {on|off} [secure]

Fields are separated by whitespace. program is the monitor process that init should start if the port is turned on. getty, the usual entry in this field, takes an argument that indicates the speed and configuration parameters of the serial port.

termtype is the terminal type; it names an entry in termcap or terminfo (see page 109). When you log in, the TERM environment variable is set to the value of this field.

The keywords “on” and “off” enable or disable logins on the port (that is, they specify whether or not program should be executed). If the “secure” keyword is present, root may log in on this terminal. Many sites do not allow root logins from public terminal rooms or dial-ins.

Here are some sample entries from an /etc/ttys file:

console none unknown off secure

ttyd0 "/usr/libexec/getty std.9600" dialup off secure

ttyd1 "/usr/libexec/getty std.9600" dialup off secure

ttyd2 "/usr/libexec/getty std.9600" dialup off secure

The argument to getty refers to an entry in the inittab, gettytab, or gettydefs file, depending on the system.

init reads the ttys or ttytab file only once. If you change the configuration file, you must explicitly tell init to reread the file by sending it a hangup signal. init is always process number 1, so the command

# kill -1 1

executed as root will usually work. Don’t mistype and leave out the dash!

The /etc/ttytype file


On some systems, terminal type information is separated from /etc/ttys and kept in a file called /etc/ttytype. The format of an entry in ttytype is:

termtype device

device is the short name of the device file representing the port, and termtype is as described above for the new-style /etc/ttys. Here is a sample ttytype file:

wyse console

dialup ttyi0

dialup ttyi1

vt320 ttyi2

h19 ttyi3

dialout ttyi4

The /etc/gettytab file


The gettytab file associates symbolic names (such as std.9600, used in the examples above) with port configuration information such as speed, parity, and desired login prompt. Here is a sample:

# The default entry, used to set defaults for other entries, and in cases

# where getty is called with no specific entry name.

default:\

:ap:lm=\r\n%h login\72 :sp#9600:

# Fixed-speed entries

2|std.9600|9600-baud:\

:sp#9600:

h|std.38400|38400-baud:\

:sp#38400:

The format is the same as that of /etc/printcap and /etc/termcap. The lines with names separated by a vertical bar (|) list the names by which each configuration is known. The other fields in an entry set the options to be used with the serial port.

Most systems come with preset gettytab entries appropriate for a variety of terminals. See page 712 for a description of the general file format; refer to your manuals for information about specific variables.

The /etc/inittab file


The Solaris, HP-UX, and Red Hat versions of init support various “run levels” that determine which system resources are enabled. There are eight run levels: 0 to 6, plus “s” for single-user operation. When you leave single-user mode, init prompts you to enter a run level unless an initdefault field exists in /etc/inittab as described below. init then scans the inittab file for all lines that match the specified run level.

Run levels are usually set up so that you have one level where only the console is enabled and another level that enables all terminals. You can define the run levels in whatever way is appropriate for your system; however, we recommend that you not stray too far

Return Main Page Previous Page Next Page

®Online Book Reader