What is an init system?

Back in Fedora 15, Fedora introduced a piece of core software called systemd. systemd is a collection of tools for a range of different tasks. Its primary purpose is initializing, managing and tracking system services and daemons in Fedora, both during startup and while the system is running. In previous versions of Fedora, these jobs were handled by SysVinit (System V init, or just init).

To understand the primary purpose of systemd — initializing the Fedora operating system — first we need to understand what an init system actually does.

Booting and initializing

Your computer’s startup or boot process begins with the BIOS (Basic Input / Output System) software on the motherboard. After completing hardware initialization and checks, the BIOS starts up the bootloader (GRUB in Fedora’s case). The bootloader accesses the Master Boot Record (MBR) on your storage device, usually a hard drive. It uses the data there to locate and start the Linux kernel.

The init system is the first process started on Fedora after the kernel starts. In fact, the init system always gets the Process ID (PID) of 1 on a system. This process is always executed by the Linux kernel after the early stages of bootup are completed by the BIOS and bootloader (GRUB).

Daemons and other processes

The init system then must start all the necessary daemons, background processes and services required to make the operating system work. Examples of such processes include starting up a boot screen, various parts of the networking stack, and hardware in your machine.

Often these processes continue to run in the background after they start, and are called daemons. These daemons manage many parts of your system, such as logging information, watching for devices you insert or remove, and managing user login.

To see all the processes and daemons that the systemd init system is managing on your Fedora system, use the command

systemctl

in the terminal to list them.

After initialization, the init system stays running, for as long as your system is running, and it manages the processes already started, and allows others to be started, stopped and restarted while the OS is running.

Controlling with systemd

The init system can also be used to start other services and daemons too. For example, let’s say you want your machine to start a webserver on boot. You can tell systemd to start the httpd daemon during boot:

sudo systemctl enable httpd

If you want the webserver to start right away, that’s easy as well:

sudo systemctl start httpd

Once you have started the service, you can check the status of the service with

systemctl status httpd

These are only simple examples of how to control specific services with systemd. Managing your Fedora system with systemd is not difficult, though. The Fedora community wiki has a handy systemd page to help you quickly learn the commands most often used with systemd. There’s also a SysVinit to systemd cheatsheet to help you translate, in case you’re used to the old SysVinit commands already.

Introducing the systemd series

This is the beginning of a series of articles delving into systemd usage. The series will assume that you’ve read the systemd overview page. Once you’ve done that, this series will show you other interesting ways to use systemd, and explain how it works. Get ready for a fun ride as you learn more about managing Fedora!

Fedora Project community

5 Comments

  1. Eduardo Silva

    There’s a typo in the last two commands, should be

    httpd

    not

    http

  2. Jose Gonzalez

    I thought BIOS looked at MRB for bootloader then the bootloader(GRUB) looked at it’s config for the kernel.

  3. mate

    BIOS looks in to MBR and loads a small program which knows where GRUB is located then this small program loads GRUB and eventually GRUB loads a kernel.

Comments are Closed

The opinions expressed on this website are those of each author, not of the author's employer or of Red Hat. Fedora Magazine aspires to publish all content under a Creative Commons license but may not be able to do so in all cases. You are responsible for ensuring that you have the necessary permission to reuse any work on this site. The Fedora logo is a trademark of Red Hat, Inc. Terms and Conditions