|
Next: Run levels Up: init Previous: init comes first Configuring init to start getty : the /etc/inittab fileWhen it starts up, init reads the /etc/inittab configuration file. While the system is running, it will re-read it, if sent the HUP signal; this feature makes it unnecessary to boot the system to make changes to the init configuration take effect. The /etc/inittab file is a bit complicated. We'll start with the simple case of configuring getty lines. Lines in /etc/inittab consist of four colon-delimited fields: id:runlevels:action:processThe fields are described below. In addition, /etc/inittab can contain empty lines, and lines that begin with a number sign (` # '); these are both ignored.
To start a getty on the first virtual terminal (/dev/tty1 ), in all the normal multi-user run levels (2-5), one would write the following line: 1:2345:respawn:/sbin/getty 9600 tty1The first field says that this is the line for /dev/tty1 . The second field says that it applies to run levels 2, 3, 4, and 5. The third field means that the command should be run again, after it exits (so that one can log in, log out, and then log in again). The last field is the command that runs getty on the first virtual terminal. If you wanted to add terminals or dial-in modem lines to a system, you'd add more lines to /etc/inittab , one for each terminal or dial-in line. For more details, see the manual pages init (8), inittab (5), and getty (8). If a command fails when it starts, and init is configured to restart it, it will use a lot of system resources: init starts it, it fails, init starts it, it fails, init starts it, it fails, and so on, ad infinitum. To prevent this, init will keep track of how often it restarts a command, and if the frequency grows to high, it will delay for five minutes before restarting again.
Next Up Previous Contents Index Next: Run levels Up: init Previous: init comes first Lars Wirzenius Sat Nov 15 02:32:11 EET 1997 |
|||||||||||||||||
With any suggestions or questions please feel free to contact us |