oio11: (Default)
[personal profile] oio11
Linux System Administrators Guide:
PrevChapter 9. initNext

9.2. Configuring init to start getty: the /etc/inittab file

When 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 (kill -HUP 1); 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:process
The fields are described below. In addition, /etc/inittab can contain empty lines, and lines that begin with a number sign (`#'); these are both ignored.
id
This identifies the line in the file. For getty lines, it specifies the terminal it runs on (the characters after /dev/tty in the device file name). For other lines, it doesn't matter (except for length restrictions), but it should be unique.
runlevels
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.)
action
What action should be taken by the line, e.g., respawn to run the command in the next field again, when it exits, or once to run it just once.
process
The command to run.
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 tty1
The 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.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 /etc/inittab, one for each terminal or dial-in line. For more details, see the manual pages init, inittab, and getty.
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.

PrevHomeNext
init comes firstUp


http://tldp.org/LDP/sag/html/config-init.html
(will be screened)
(will be screened if not validated)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org

October 2025

S M T W T F S
   1234
567891011
12131415161718
19202122 232425
262728293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 3rd, 2026 11:16 pm
Powered by Dreamwidth Studios