In this article, you will learn about the short description of the init process, the runlevels of init, and the init command in a Linux system.
What is Init Process?
In layman’s terms, when you press the power button, your system will first look for the bootloader (basically, your Linux grub), and then it will try to launch the kernel.
But the kernel itself cannot launch all of the processes, so it will start the first (or parent) process, known as init (sort for “initialization“), with PID “1” (process identifiers are assigned in sequential order).
/etc/inittab” script is used by the “init” process. It has entries for processes that do basic things when the system starts up and shuts down, like showing the user a login screen with gettys, mounting and unmounting file systems, and managing daemons.
As a result, it should be kept running until the system terminates. If the kernel is unable to start it, the system will reach a stage called “Kernel Panic“.
Run Levels is a system software configuration (by init) that defines a set of processes to start when the system boots. The processes spawned by the init for each of these run levels are defined in the file “
Run Levels are numbered from zero to six and define the state of the machine after boot, as listed below.
|Halt||Halt the system.|
|Single-User Mode||Get the system into single user mode.|
|Multi-User Mode||Get the system into multiuser mode without networking.|
|Multi-User Mode with Networking||Get the system into multiuser mode with networking.|
|X11||Get the system into multiuser mode with networking and X windows.|
|Reboot||Reboot the system.|
The majority of Linux systems is based on runlevel 3 or 5. Although, users can modify these runlevels or create new ones based on their requirements.
The 0, 1, and 6 are reserved runlevels used for halting, getting into single user mode, and rebooting the system.
Init Command in Linux
In most Linux systems, the init command is used to send control commands to the init daemons that run as background processes.
$ init [OPTION]
The following is a list of all known options, along with their descriptions.
|Shutdown the system.|
|Reboot the system.|
|Start runlevelX.target unit.|
|Enter rescue mode.|
|Reload the init daemon configuration.|
|Re-execute the init daemon.|
There are numerous items that should be included, but the goal of this article is not to provide a detailed description of the init process or command; rather, it is to walk you through them.
If you are more interested in knowing the init process, then check this article, as this method of booting the system is deprecated with systemd, so there is no future plan to have a major update in this article.
If you are interested in learning about them from our site or want this article to be more concise, then do let me know in the comment section.