'WSL Redis encountered System has not been booted with systemd as init system (PID 1). Can't operate [closed]

I'm trying to follow the Redis installation process that was discuss in this article of digital ocean, for in WSL(Windows Sub-System for Linux). The Ubuntu version installed is Ubuntu 18.04.

Everything in redis installation is fine but when I tried to run this sudo systemctl start redis I got this message.

System has not been booted with systemd as init system (PID 1). Can't operate.

Any Idea on what should I do with that?



Solution 1:[1]

Instead of using

sudo systemctl start redis

use:

sudo /etc/init.d/redis start

as of right now we do not have systemd in WSL

Or sometime it might be redis-server, like:

>> sudo /etc/init.d/redis-server start
Starting redis-server: redis-server.

Just do a ls, like: ls /etc/init.d

Solution 2:[2]

I had this problem running WSL 2

the solution was the command

 $ sudo dockerd

if after that you still have a problem with permission, run the command:

 $ sudo usermod -aG docker your-user

Solution 3:[3]

I was trying to start Docker within ubuntu and WSL.

This worked for me,

sudo service docker start

Solution 4:[4]

If you are using Docker, you may try an image that has Ubuntu with System D already active with this command:

docker run -d --name redis --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro jrei/systemd-ubuntu:18.04

Then you just need to run:

docker exec -it redis /bin/bash

and there you can just install Redis, start it, restart it or whatever you need.

Solution 5:[5]

Total newbie here - after trying most of the above suggestions, the command that worked for me was sudo service apache2 --full-restart and the web server started up.

Maybe the error came up because I have been following lots of setup instructions without a reboot/restart. I'm working on Ubuntu 20.04 in WSL2 using Apache2 Debian.

Solution 6:[6]

For WSL2, I had to install cgroupfs-mount, than start the daemon, as described here:

sudo apt-get install cgroupfs-mount
sudo cgroupfs-mount
sudo service docker start

Solution 7:[7]

This worked for me (using WSL)

sudo /etc/init.d/redis start

(for any other service, check the init.d folder for filenames)

Solution 8:[8]

use this command for run every service just write name service for example :

for xrdp :

sudo /etc/init.d/xrdp start

for redis :

sudo /etc/init.d/redis start

(for any other service, check the init.d folder for filenames)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Maifee Ul Asad
Solution 2 Felipe Augusto
Solution 3 Sangeetha
Solution 4 Carlos Saltos
Solution 5
Solution 6 amy8374
Solution 7 assayag.org
Solution 8 mamal