The English meaning of/etc/inittab under CentOS: ThisfiledescribeshowtheINITprocessshouldsetupthesysteminacertainrun-level.Theinittabfiledescribeswhichprocessesarestart
The English description of/etc/inittab in CentOS:
This file describes how the INIT process shocould set up the system in a certain run-level.The inittab file describes which processes are started at bootup and during normal operation.
In general, it is to control some programs and levels during Linux startup.
Run-level:
# Default runlevel. The runlevels used by RHS are:
#0-halt (Do NOT set initdefault to this)
#1-Single user mode
#2-Multiuser, without NFS (The same as 3, if you do not have networking)
#3-Full multiuser mode
#4-unused
#5-X11
#6-reboot (Do NOT set initdefault to this)
The above translation is:
#0-stop (never set initdefault to 0)
#1-single-user mode
#2-multi-user, no NFS (no network)
#3-full multi-user mode (the standard running level is actually the text mode)
#4-useless
#5-X11 (xwindow)
#6-restart
All valid statements in the inittab file follow the following format:
Id: runlevels: action: process
Id: It is the identification name, which can be any name, within four characters. Note that the identification name cannot be repeated and it is unique.
Runlevels: This row applies to the running levels (the six levels shown above). In addition, the sysinit, boot, and bootwait processes ignore this setting value. This option can be selected multiple times. for example, if you want to run 1, 2, or 3 levels, you can write it as 123.
Action: Indicates the method in which init should run the process field command when entering the corresponding runlevels. the common field values and explanations are in the appendix.
Respawn: indicates that init should monitor this process, even after which it should be restarted.
Wait: init should run the process once and wait until it is finished before proceeding to the next step.
Once: init needs to run this process once.
Boot: Run as the system starts, so the runlevel value is invalid.
Bootwait: Run as the system starts, and init should wait until it ends.
Off: it makes no sense.
Initdefault: the default running level after the system is started. as processes at the corresponding running level are activated, the process Field specified by the system is meaningless. If this record does not exist in the inittab file, you can query the running level on the console when the system starts.
Sysinit: the command to be run when the system starts. For example, this command will clear/tmp. you can view the/etc/rc. d/rc. sysinit script to understand the operations it has run.
Powerwait: allows init to shut down the system when the power supply is disconnected. Of course, the premise is that u p s and monitoring u p s and notifying init that the power supply has been cut off. This option is not listed by default in RH linux.
Powerfail: same as powerwait, but init does not wait until the running process ends. This option is not listed by default in RH linux.
Powerokwait: the operation that init performs when the power monitoring software reports "power recovery.
Powerfailnow: if the ups power supply is about to run out, the init operation is different from powerwait/powerfail.
Ctrlaltdel: allows init to restart the system when you press the C t r l + A l t + D e l key combination on the console keyboard. Note: If the system is deployed in A public place, the system administrator can configure the C t r l + A l t + D e l combination key as another action, such as ignore. I set it to print out a swear word ^ o ^. kbrequest: the action taken when the specified keyboard combination key is pressed, which is not complete yet.
Ondemand: A process marked with an ondemand runlevel will be executed whenever the specified ondemand runlevel is called. however, no runlevel change will occur (ondemand runlevels are 'A', 'B', and 'C ')
Process: The program to be executed
Example:
Id: 3: initdefault: # indicates that the command line mode is started.
X: 5: once:/etc/X11/preofdm-nodaemon # indicates that after the startup, the preofdm-nodaemon command is executed in xwindow mode.
Practical experience:
If you want to directly go to "command line mode" when starting the instance, you can edit it./Etc/inittabFile, setId: 3: initdefault:
If you want to directly enter "window mode", set itId: 5: initdefault: