As an excellent engineer or architect, we must have a very good understanding and mastery of Linux systems. Here is an introduction to ordering a lot of people confused Linux self-booting.
At present, there are 3 kinds of initialization system of Linux, according to the time of occurrence is init, upstart and SYSTEMD.
Introduction to 3 Systems 1. Init
Init is Sysvinit, which is the result of System V and is extended to other UNIX systems. Common init commands and/ETC/INIT.D belong to it.
The benefits of Init come from the service serial start, which guarantees the sequence of script execution, as well as the convenience of debugging and troubleshooting. But because of the long system boot time caused by serial booting, this drawback becomes a big problem after Linux is applied to the mobile side. Also init needs to write a complex startup script, you can find a file in the INIT.D to see
2. Upstart
Upstart speeds up execution through parallel booting, but concurrently initiates for interdependent services. It also supports dynamic start and unload when hardware is hot-swappable.
3.Systemd
The concurrency of SYSTEMD is more aggressive because it also starts at the same time for interdependent services. And its on-demand boot is better than upstart.
Upstart replaced the once brilliant init, and SYSTEMD will replace upstart
Two core issues
In fact, the two issues that we care about most are how to determine which initialization system is used by a Linux system, and how to determine which system the service is initialized by or which system it should choose to initialize.
1. Judging the initialization system
The initialization process is the first process that kernel starts, and its PID is always 1, so we use Stat/proc/1/exe to view
or the existence of the 3 directories according to/USR/LIB/SYSTEMD/USR/SHARE/UPSTART/ETC/INIT.D to determine
Note Because Systemd and upstart are backwards compatible, multiple initialization systems may be installed in one system
2. Determine which system the server is initialized on
In fact, Init will turn the boot service over to upstart, and upstart to SYSTEMD.
Linux system boot from: Init upstart SYSTEMD