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


WSL(Windows Subsystem for Linux,适用于Linux的Windows子系统)下通过systemctl命令启动某些服务将造成System has not been booted with systemd as init system (PID 1). Can't operate.这样的错误;

以启动Nginx为例:

systemctl start nginx
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
wsl启动服务错误

解决方法

尝试使用以下方法启动服务:

service nginx start