3.6 KiB
How to Find Systemd or Any Other init System in Linux
Here’s how you can determine if you are running systems or any other init system in your Linux distribution.
The first process, which starts when you boot up your Linux distribution, is called init (short for initialization). It has the process identifier 1 (i.e. pid=1). All the processes and applications in your Unix-based system are direct descendants of this init process.
Based on functionality and features, different types of init processes are present. For example, systemd, Runit, OpenRC, sysVinit, etc. Among those, the systemd is the most popular and modern one, which is used and adopted by all the modern Linux distributions, including Ubuntu and Fedora.
There are ongoing debates about Systemd and its performance compared to the traditional Unix-based init systems. But that’s a topic for another article.
let’s find out how you can determine whether you are running a systemd or any other init system in your Linux distribution.
Systemd or what init system?
Unfortunately, there’s no direct command to find it out. You can trace it back from the init process id=1, which is basically a symbolic link to /sbin/init
i.e. pid=1.
Use [strings][2]
command to print the text embedded in the binary file /sbin/init
& search for init with the following command.
strings /sbin/init | grep init
Example 1: In this below output where it’s a sysVinit system running Debian (via Peppermint OS). As you can see, it clearly shows the init process name.
strings /sbin/init | grep init
If you find systemd in the same above system, there won’t be any entries. Hence you can conclude that you are running sysvinit and not systemd.
Example 2: If you run the above command in a systemd system, you can easily see the systemd and its version at the first line of the output.
strings /sbin/init | grep systemd
Example 3: You can also try to print the process tree using pstree
command, which should show you the first process name. It should be either systemd or init, as shown in the below example.
pstree
That’s it. This is how you can easily find out whether your distro uses systemd or something else.
via: https://www.debugpoint.com/systemd-or-init/