> ## Content Index
> Fetch the complete content index at: https://itsfoss.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Check if Your Linux System Uses systemd
- URL: https://itsfoss.com/check-if-systemd/
- Published: 2024-01-03T04:57:10.000Z
- Updated: 2024-01-03T10:15:17.000Z
- Description: Wondering which init service your Linux system uses? Here's how to find it out.
- Author: Sagar Sharma
- Tags: Tutorial

Every mainstream Linux distro including Ubuntu, Fedora, openSUSE, and Arch uses systemd by default. 

But there are [many non-systemd distros](https://itsfoss.com/systemd-free-distros/) like Void Linux that uses lightweight runit for better performance or Devuan that uses sysvinit on principal basis.

The problem comes when you are trying to follow some tutorial or documentation and it has commands specific to systemd or some other init service.

And this is where you have to check if your Linux system uses systemd or something else.

One way would to be check the process with PID 1 (after all, an init system is the first process to run on a Linux system).

```
ps 1
```

But its output could be misleading as often it shows `/sbin/init` which is just a soft link to actual init process.

If you [follow that symbolic link](https://linuxhandbook.com/follow-symbolic-link/?ref=itsfoss.com), you can get the init system information. There are two ways of doing that:

- Using the stat command
- Using the readlink command

So let's start with the first one.

📋

These methods were tested with 6 init systems: Systemd, OpenRC, SysVnint, Busybox, runit, and s6.

## Method 1: Check if systemd is in use with the stat command 

Here's how you can use the stat command to find out what init system you are using:

```
stat /sbin/init
```

If you are using a systemd-powered distro, then it will show you the following output:

![Use the stat command to find if you are using systemd or not](https://itsfoss.com/content/images/2023/12/Use-the-stat-command-to-find-if-you-are-using-systemd-or-not.png)

But if you are using anything else than systemd, it will show the init name unless you are using SysVnit which will only show you `init` instead of `sysvnit`:

![Check if you are using SysVnit in Linux or not](https://itsfoss.com/content/images/2023/12/Check-if-you-are-using-SysVnit-in-Linux-or-not.png)

SysVnit only displays "init" instead of sysvnit

## Method 2: Check the init system using the readlink command 

Unlike the previous method, when you use the readlink command, it will only print the name of the init system. 

So if you want to know if you are using Systemd or not, simply use the following command:

```
readlink /sbin/init
```

![Use the readlink command to find if you are using systemd or some other init system in Linux](https://itsfoss.com/content/images/2023/12/Use-the-readlink-command-to-find-if-you-are-using-systemd-or-not-something-else.png)

If you are using the [OpenRC init service](https://wiki.gentoo.org/wiki/OpenRC/openrc-init?ref=itsfoss.com), then it will show the following output:

![how to check if you are using openRC init system](https://itsfoss.com/content/images/2023/12/find-if-you-are-using-openrc-as-init-system.png)

But if you are using SysVnit, then, it will show you the following output:

![How to find out if you are using SysVnit as init system in Linux](https://itsfoss.com/content/images/2023/12/How-to-find-out-if-you-are-using-SysVnit-as-init-system-in-Linux.png)

## Tiny 'script' I wrote for you

Another way is to check if the `/run/systemd/system` directory exists or not.

Well, the easiest way to find out is to [use an if-else bash command](https://itsfoss.com/bash-if-else/) in your terminal which will check if you are running a systemd-powered distro or not:

```
if [ -d /run/systemd/system ]; then echo "System is running systemd"; else echo "System is not running systemd"; fi

```

![A simple if else statement to know if you are using systemd distro or not](https://itsfoss.com/content/images/2023/12/A-simple-if-else-statement-to-know-if-you-are-using-systemd-distro-or-not.png)

## More on systemd

Once you know you are using the systemd-powered distro, here's how you can [manage services using the systemctl command](https://linuxhandbook.com/systemctl-commands/?ref=itsfoss.com):

[Using systemctl Command \[15 Examples\]The systemctl command is a must know for Linux systems with systemd init system. Here are some practical examples.![](https://linuxhandbook.com/content/images/size/w256h256/2021/08/Linux-Handbook-New-Logo.png)Linux HandbookSagar Sharma![](https://linuxhandbook.com/content/images/2023/11/systemctl-command-examples.png)](https://linuxhandbook.com/systemctl-commands/?ref=itsfoss.com)

Want to [create a systemd service](https://linuxhandbook.com/create-systemd-services/?ref=itsfoss.com) from scratch? You can do that too:

[How to create a systemd service in LinuxLearn the steps for creating systemd services in Linux with the practical example demonstrated in this tutorial.![](https://linuxhandbook.com/content/images/size/w256h256/2021/08/Linux-Handbook-New-Logo.png)Linux HandbookPratham Patel![](https://linuxhandbook.com/content/images/2022/09/create-systemd-service-in-linux.png)](https://linuxhandbook.com/create-systemd-services/?ref=itsfoss.com)

I hope you will find this guide helpful.