systemd – Booting Process

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:

graphical.target

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:

multi-user-vi

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.

multi-user.target

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:

basic.target

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:

sysinit.target

6. local-fs-pre.target: This is set to run after local-fs-pre.target target based on the line below:

local-fs.target

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:

  1. local-fs-pre.target
  2. local-fs.target
  3. sysinit.target
  4. basic.target
  5. multi-user.target
  6. graphical.target
  7. default.target

LET US KNOW YOUR RATINGS ON THIS BLOG HERE. ALSO FEEL FREE TO CONTACT ME.

Advertisements

One thought on “systemd – Booting Process

  1. Thanks for the sensible critique. Me & my neighbor were just preparing to do a little research about this. We got a grab a book from our area library but I think I learned more from this post. I’m very glad to see such wonderful info being shared freely out there.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s