Before going through the booting process, make sure that you know something about systemd. If you are not sure, you may refer here and then come back.
While a system is booted up by starting the RHEL 7 kernel and initial ram disk, systemd initializes the system, starting all the system services. There involves a structure for the boot process.
There are many files that depend on the boot process structure, starting with default.target file.
1. default.target: ls -l /usr/lib/systemd/system/default.target will show you that this file is actually a symlink to another file graphical.target.
lrwxrwxrwx. 1 root root 16 Mar 24 2014 /usr/lib/systemd/system/default.target -> graphical.target
This means executing default.target file automatically invokes graphical.target file.
2. graphical.target: Now, take a look at this file by vi /usr/lib/systemd/system/graphical.target
You can see the three lines as shown below:
As per this file, systemd starts everything in the multi-user.target before starting this. “Wants” tells systemd to start the display-manager.service service after multi-user.target.
3. multi-user.target: It starts every service that are expected to run in RHEL multi user mode.
vi /usr/lib/systemd/system/multi-user.target gives you a line as shown below:
which means systemd should start everything in basic.target prior starting services in multi-user.target. All the services included here, actually has symlinks associated, which point to the location of the service.
4. basic.target: Starts the basic services like firewalld and microcode services.
vi /usr/lib/systemd/system/basic.target will give you a line as shown below:
Which means sysinit.target should be started first before proceeding with basic.target.
5. sysinit.target: As per this file, systemd starts system initialization services. This includes swap devices enabling and file systems mounting.
local-fs.target needs to be started before sysinit.target since
vi /usr/lib/systemd/system/sysinit.target shows you:
6. local-fs-pre.target: This is set to run after local-fs-pre.target target based on the line below:
No services has been associated with local-fs-pre.target, however units in local-fs.target.wants directory import the network configuration from the initramfs, run a file system check (fsck) on the root file system when necessary, and remount the root file system based on the contents of the /etc/fstab file.
This is the structure of boot process by built by systemd. But keep in mind that this is not the way how systemd actually works 😀 .
Yes, you read it true. systemd actually runs in the opposite order of how the process is built 🙂 .
Which simply means that the order of booting up is as follows: