Systemd is a widely used Linux software suite that also provides an init (also known as “initialization“), the first process that loads when you boot your Linux system.
It’s a powerful program that offers a multitude of features and functionality out of the box, which also makes it bloatware. Those who dislike it prefer to use other Linux systems running on different inits.
Interestingly, popular Linux distributions such as Debian, Ubuntu, RedHat, Fedora, AlmaLinux, Arch, Manjaro, and openSUSE use systemd by default.
If you're not into any specific Linux distribution with a particular init running, you might not worry about what your system is running on until you need to execute a specific command, such as
systemctl, which should only be run on a systemd-based Linux distribution.
In this article, I’ll guide you through different ways to find out what your system is running on.
Table of Contents
How to Check If Your Linux System is Running on Systemd
Initially, the original Linux init, known as "init" itself, was the first one. Later, when various init variants entered the market, each of them was linked to the original init through symbolic links.
To provide an overview, execute the following command, which will list the first process, namely your init.
- ps 1
Observing the above output, you'll notice that the first process is
/sbin/init, which confuses many Linux users, leading them to believe that their Linux system is running on init, which is not true.
So, let's determine the init your Linux system is running on by using the first command.
Method 1: Find Your Linux System Running on the Systemd using the stat command
Open your terminal and execute the following command to determine which init system you are using.
- stat /sbin/init
If your Linux system runs on systemd, it will print
/lib/systemd/systemd. Otherwise, for other init systems, it will print their names, such as
/sbin/init (for SysVinit) or
/usr/bin/openrc-init (for OpenRC init).
Method 2: Find Your Linux System Running on the Systemd using the readlink command
The readlink command works identically to the previous one, except instead of printing multiple items in the output, it will only print the output of the symbolic link being pointed to, making the output clean and simple for users to understand.
So to determine if you are using Systemd or not, simply run the following command:
- readlink /sbin/init
The above output states that the current system is running on systemd.
There are several additional ways to identify your running init system; for instance, the ps command itself can be utilized. Just execute any of the following commands, and it will display the init system you are currently using.
- ps -p 1
- ps --no-headers -o comm 1
The working of this command is quite simple; it will look for the process with PID 1, which is the init process, and retrieve the name of the command. The output will typically indicate which init system is in use.
Aside from this, you can also use the ls command to identify your init system. For example, by running the following command, it will print the pointed-init system.
- ls -l /sbin/init