System has not been booted with systemd as init system (PID 1). Can’t operate
原因:您的linux系统没有使用systemd
在命令穿那个口输入
ps -p 1 -o comm=
输出结果
systemd/sysv
根据对应的系统使用操作命令去进行操作.
服务操作命令:
Systemd command | Sysvinit commmand |
---|---|
systemctl start service_name | service service_name start |
systemctl stop service_name | service service_name stop |
systemctl restart service_name | service service_name restart |
systemctl status service_name | service service_name status |
systemctl enable service_name | service service_name enable |
systemctl disable service_name | service service_name disable |