When you run Systemd commands, you may receive error "System has not been booted with systemd as init system (PID 1). Can't operate." In this post, MiniTool Partition Wizard tells you why you will get this error and how to solve it.

System Has Not Been Booted With Systemd as Init System

Many people report that they have received error “System has not been booted with systemd as init system (PID 1). Can’t operate.” This error usually occurs when they run a systemd command under Linux systems.

The reason why this error occurs is that the Linux system is not using systemd as the init system. As we all know, the boot process of the Linux system is as follows:

  • Power on PC and it will activate the BIOS.
  • The BIOS will read MBR to find the boot loader.
  • The boot loader will load the system kernel, which will manage the computer’s hardware resources and act as an interface between software and hardware.
  • The kernel will then activate an init process (its process ID is 1) which is the first process of the system. It is responsible for spawning all other user processes. The init process is very unique and can complete tasks that other processes cannot.
What Is Linux Boot Process? [A Detailed Introduction]
What Is Linux Boot Process? [A Detailed Introduction]

This post details every stage of the Linux boot process. Knowing it can help you solve many PC boot problems.

Read More

Then, what is an init system? The Init system can define, manage and control the behavior of the init process. And it is responsible for organizing and running many independent or related initialization tasks, so that the computer system can enter a certain user-subscribed operating mode smoothly.

Linux systems have many init systems, such as System III, System V, Upstart, etc. But since 2015, most Linux distributions have adopted the systemd to replace those traditional init systems. In addition, the systemd is backward compatible with System V.

However, in the following two cases, systemd will not be enabled by default:

  1. You are using Linux systems in WSL (Windows Subsystem for Linux).
  2. You have skipped the init process (/sbin/init).
Guide to Install Windows Subsystem for Linux (WSL) in Win 10
Guide to Install Windows Subsystem for Linux (WSL) in Win 10

You can run Linux on your Windows 10 computer simply by installing Windows Subsystem for Linux (WSL). This post shows you how to set it up.

Read More

How to Solve This Issue

To solve the “System has not been booted with systemd as init system” error, I gathered 3 ways. If you are facing the same issue, you can try them one by one.

Way 1. Use Equivalent Sysvinit Command

If you run Linux systems via WSL, the Linux system will use System V init system, instead of systemd. In this case, you can’t run systemd commands, but you can run equivalent Sysvinit commands.

Tip: Command “ps -p 1 -o comm=” will help you know what init system you are using.

This table may help you.

Systemd commandSysvinit command
systemctl start service_nameservice service_name start
systemctl stop service_nameservice service_name stop
systemctl restart service_nameservice service_name restart
systemctl status service_nameservice service_name status
systemctl enable service_namechkconfig service_name on
systemctl disable service_namechkconfig service_name off
5 Windows Explorer Alternatives Worth Trying!
5 Windows Explorer Alternatives Worth Trying!

This post introduces the 5 best Windows Explorer alternatives, offering much more features than Windows File Explorer.

Read More

Way 2. Add /sbin/init in the Command

Modern Linux systems allow users to skip the init process. For example, if you execute command “init=/bin/bash” in bootloader environment, the system will start a single-user root shell environment and no user password is required.

In this environment, all commands are executed with the default path /bin/bash. In this case, you should use /sbin/init to replace /bin/bash.

Way 3. Enable SystemD Using Scripts

To always enable systemd on WSL2, you can apply the scripts from diddledani. Click the link and it will show you how to complete that job step by step. Some people report that it works for them.

[Solved] How to Fix GRUB Load Errors and Recover Data?

  • linkedin
  • reddit