System Initialization Once the root file system has been mounted, the init command runs as the last step of the startup process it attempts to read the /etc/inittab file and it attempts to locate an initdefault entry in the /etc/inittab file.
If the initdefault entry exist, the init command user the specified run level as the initial system run level.
If the initdefault file does not exist, the init command places the system in the maintenance level by default.
The init command rereads the /etc/inittab file every 60 seconds; if the file has changed then the new commands in the /etc/inittab file are executed.
The /etc/inittab file In the inittab file there are four fields separated by semi column
Identifier: Runlevel: Action: Command
Identifier -: A character that uniquely identifies an object
Runlevel -: Run level at which this entry can be processed Each process is started by the init command is assigned one or more run Levels
Run levels are represented by 0-9
Action -: Tells the init command how to treat the process specified in the process field There are some standard in the action field. They are:
Respwan: If the process does not exist, start the process do not wait for its
Termination – Continue scanning the /etc/inittab file and restarts the process when it dies.
Wait : When the init command enters the run level that matches the entry’s run level, start the process and wait for its termination.
Once : When the init command enters a run level that matches the entry’s run level, start the process and do not wait for termination. When it dies do not start the process.
Boot : During the system boot process the entry, which when the init command reads the /etc/inittab file during system startup, Start the process and do not wait for its termination and do not start when it dies.
Bootwait: Process the entry the first time that the init command goes from single- user to milti-user state after the system is booted. Same like boot.
powerfail : when server receives the power fail signal, execute the process.
Initdefauly: An entry with this action is only scanned when the init command is initially invoked.
Sysinit : Entries of this type are executed before the init command tries to access the console before login.
Command: A shell command to execute.There are following command to change the inittab file
mkitab : adds records to the /etc/inittab file
lsitab : List records in the /etc/inittab file
chitab : Changes records in the /etc/inittab file
rmitab : Removes records from the /etc/inittab file.
Order of the /etc/inittab entries
The base process entries in the /etc/inittab file is ordered as follows:
1. initdefault
2. sysinit
3. Powerfailure Detection (powerfail)
4. Multiuser check (rc)
5. /etc/firstboot (fbcheck)
6. System Resource Controller (srcmstr)
7. Start TCP/IP daemons (rctcpip)
8. Start NFS daemons (rcnfs)
9. cron
10.pb cleanup (piobe)
11.getty for the console (cons)