Logo

dev-resources.site

for different kinds of informations.

Systemd vs sysVinit - Initializing the system

Published at
12/20/2023
Categories
linux
systems
operatingsystem
booting
Author
akshay_khoje
Author
12 person written this
akshay_khoje
open
Systemd vs sysVinit - Initializing the system

Motivation behind this post - my first post here. In this post I'll try to explain the system initializer in linux and the difference between sysVinit and systemd.

ESSENTIAL BACKGROUND

What is the init process?

To answer this, we need to look a little bit at the booting process.

Boot sequence

The boot process is everything that happens from the time you press the power button until you are presented with a login screen. It generally follows this sequence:



1. BIOS/UEFI locates and executes the bootloader (or UEFI can load a kernel directly).
2. Bootloader(e.g. GRUB2 loads the desired kernel into memory).
3. Kernel starts the init process (pid = 1).
4. init process manages overall system initialization : systemd( or sysVinit, upstart, etc).
5. Then the display manager takes over the control (the login screen).



Enter fullscreen mode Exit fullscreen mode

This post focuses on point #4 of the boot sequence.

The init process essentially means loading all the services and daemons required by the user after login, to be loaded into the RAM and get the system up and ready.

Now, various system initializers are available - systemd, sysVinit, upstart, openRC, etc. In modern systems - systemd is the default system initializer, however some distros like MXLinux still prefer sysVinit (an older guy in the game).

What does systemd do?

The systemd is an init and service manager. It is the first user-level process that runs until the PC is shutdown. It's process ID id 1.

pid of systemd is 1

It does the following tasks:

  1. Once kernel starts the init process, systemd handles all the later stages of the boot process.
  2. It configures the environment by loading all the services and daemons needed to login the user.
  3. It allows managing services, devices, sockets, mount points, swap areas, etc.

Few notes about systemd:

  • Starts all services parallely.
  • Can start daemons without restarting the running service.
  • It is the universal parent of all processes.

What is sysVinit?

sysVinit was initially created for UNIX systems, it later got adapted in Linux. Till RHEL5, RedHat used this as its default system initializer. Thereafter, they switched to systemd.

Few notes about sysVinit:

  • It loaded services in kind of a synchronous fashion as against parallel in systemd.
  • A next service can be loaded only after the current one being loaded is timed out.

One final question beginners might have is...

What is systemctl and how is it related to systemd?

systemctl is a command line utility to manage services, get the status of services.
systemd on the other hand is a daemon which keeps running in the background until the machine is shut down. systemctl is simply an interface to access the services provided by systemd.

Finally, if you found this topic interesting, I had highly recommend you to check out this reddit discussion.

If you find any mistakes, feel free to comment. Also, if you want to add any points, the comment section is all yours.

operatingsystem Article's
30 articles in total
Favicon
Understanding Process Management in Operating Systems
Favicon
Introduction to Operating Systems
Favicon
A Deep Dive into Operating Systems
Favicon
Understanding the Core Components of an Operating System and How They Work
Favicon
Unveiling the Magic Behind Your Computer: A Deep Dive into Operating Systems
Favicon
Understanding How Your OS Handles Print Requests to the Console 🖥️
Favicon
A revolutionary operating system
Favicon
40+ Linux Commands You Need to Know: The Ultimate Guide for Ubuntu Users
Favicon
Understanding Operating Systems: The Backbone of Modern Computing
Favicon
Demystifying OS Concepts (Part 2): Other Synchronization Primitives
Favicon
Demystifying OS Concepts: Introducing OSViz
Favicon
Mastering Package Management in Fedora Linux: Beginner's Guide
Favicon
Systemd: Managing Services and Processes In Fedora Linux
Favicon
Unlocking the Mysteries of the Clipboard: Your Computer's Unsung Hero
Favicon
Resolving Memory Fragmentation for Linkedlist Heap Allocator
Favicon
CPU Scheduling Algorithms in OS
Favicon
Securing Virtual Memory in Operating Systems
Favicon
Exploring Operating Systems and Distributions: A Comprehensive Overview
Favicon
Exploring Operating Systems and Distributions: A Comprehensive Overview
Favicon
Operating System Security in a Hybrid Cloud Environment
Favicon
Systemd vs sysVinit - Initializing the system
Favicon
Design and Implementation Challenges in Mobile Device Operating Systems: Overcoming Complexities
Favicon
Which is More Secure: Linux or Windows?
Favicon
Understanding Virtual Memory and Paging
Favicon
Exploring Different Mobile Operating Systems
Favicon
Demystifying the Inner Workings of Operating Systems
Favicon
Deadlock in Operating System
Favicon
What Is An Operating System (OS)? Demystifying The Core Concepts
Favicon
Cache : Direct Mapping ,Assosiate Mapping & Set Assosiate Mapping
Favicon
Process Management in Operating Systems

Featured ones: