Библиотека сайта rus-linux.net
When it starts up, init reads the
configuration file. While the system is running, it will
re-read it, if sent the HUP signal (kill -HUP 1);
this feature makes it unnecessary to boot the system to make
changes to the init configuration take
/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
/etc/inittabcan contain empty lines, and lines that begin with a number sign (`
#'); these are both ignored.
This identifies the line in the file. For getty lines, it specifies the terminal it runs on (the characters after
/dev/ttyin the device file name). For other lines, it doesn't matter (except for length restrictions), but it should be unique.
The run levels the line should be considered for. The run levels are given as single digits, without delimiters. (Run levels are described in the next section.)
What action should be taken by the line, e.g.,
respawnto run the command in the next field again, when it exits, or
onceto run it just once.
The command to run.
/dev/tty1), in all the normal multi-user run levels (2-5), one would write the following line:
1:2345:respawn:/sbin/getty 9600 tty1
/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.
Different versions of getty are run differently. Consult your manual page, and make sure it is the correct manual page.
If you wanted to add terminals or dial-in modem lines to a
system, you'd add more lines to
one for each terminal or dial-in line. For more details, see the
manual pages init,
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