Windows 可以通过 net 管理服务。
Linux 可以通过 service 或 systemctl 两种方式管理服务。
如下:
Windows | Linux(service ) | Linux (systemctl) | |
---|---|---|---|
启动服务 | net start 服务名 | service 服务名 start | systemctl start 服务名 |
停止服务 | net stop 服务名 | service 服务名 stop | systemctl stop 服务名 |
查看服务状态 | service 服务名 status | systemctl status 服务名 | |
重启服务 | service 服务名 restart | systemctl restart 服务名 | |
设置开机自启动 | chkconfig 服务名 on | systemctl enable 服务名 | |
设置开机不启动 | chkconfig 服务名 off | systemctl disable 服务名 |