用window10下WSL应用Ubuntu20.04,当我应用命令sudo systemctl status mariadb的时候报错:

glc@LAPTOP-LEMON:~$ sudo systemctl status mariadb
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

问题起因:
如果是个别的Linux操作系统,可能是因为Linux中没有应用systemd,想用systemd命令来治理Linux上的服务,因而会报错,很可能是应用的是经典的SysV init(sysvinit)零碎。
但我这个是window10下WSL的Ubuntu,就会使SysV init而不是systemd。

解决办法:
更换命令,用SysV init的命令代替systemd的