CLASS="SECTION" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" >

6.1. init system

The file /etc/inittab contains the background programs that used to keep the system running. One of these programs is one getty process per serial port.

Figure 6-3. getty is started by init, based upon an entry in /etc/inittab

co:2345:respawn:/sbin/getty ttyS0 CON9600 vt102

Each field in inittab is separated by a colon and contains:

co

Arbitrary entry for inittab. As long as this entry doesn't appear anywhere else in inittab, you're okay. We named this entry co because it's for the console.

Red Hat Linux 7.3 has a program called kudzu which configures the system when it is booted. kudzu treats an inittab entry of co specially, setting it for the attached monitor and keyboard or the serial console. Hardcoding the value of co prevents this behaviour.

2345

Run levels where this entry gets started. Run levels 2, 3, 4 and 5 can be used for an operational system, getty should not be used in other run levels. The serial console still works in run level 1 (or single user mode) even without a getty.

respawn

Re-run the program if it dies. We want this to happen so that a new login prompt will appear when you log out of the console.

/sbin/getty ttyS0 CON9600 vt102

The command to run. In this case, we're telling getty to connect to /dev/ttyS0 using the settings for CON9600 which exists in /etc/gettydefs. This entry represents a terminal running at 9600bps. Initially assume that the terminal is a later-model VT100.

After changing /etc/inittab restart init with

telinit q

An alternative is to send the hangup signal to init with the command kill -HUP 1. This is not recommended: if you make a typing mistake and actually kill init then your system will suddenly halt.

NoteComments in inittab and Red Hat's kudzu
 

kudzu uses the # line comment to activate and deactivate the gettys for the attached monitor and keyboard and for the serial port. To prevent a genuine comment from becoming confused with a line saved by kudzu use ## at the start of a line of genuine comments.