系统尚未使用 systemd 作为初始化系统(PID 1)启动.无法操作 [英] System has not been booted with systemd as init system (PID 1). Can't operate
问题描述
我正在尝试按照此 文章 数字海洋,WSL.安装的 Ubuntu 版本为 Ubuntu 18.04.
I'm trying to follow the Redis installation process as discuss in this article of digital ocean, in WSL. The Ubuntu version installed is Ubuntu 18.04.
redis 安装中的一切都很好,但是当我尝试运行这个 sudo systemctl start redis
时,我收到了这条消息.
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?
推荐答案
改为使用:sudo service redis-server start
我遇到了同样的问题,在 WSL 上的 Ubuntu 中停止/启动其他服务.这有效,而 systemctl 没有.
I had the same problem, stopping/starting other services from within Ubuntu on WSL. This worked, where systemctl did not.
人们可能会想,你怎么知道服务名称是‘redis-server’?"您可以使用 service --status-all
And one could reasonably wonder, "how would you know that the service name was 'redis-server'?" You can see them using service --status-all
这篇关于系统尚未使用 systemd 作为初始化系统(PID 1)启动.无法操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!