这里以nginx为例:
| 任务 | 旧指令 | 新指令 |
|---|---|---|
| 自动启动 | chkconfig nginx on | systemctl enable nginx.service |
| 不自动启动 | chkconfig nginx off | systemctl disable nginx.service |
| 检查服务状态 | service nginx status | systemctl status nginx.service |
| 显示所有服务 | chkconfig --list | systemctl list-units --type=service |
| 启动服务 | service nginx start | systemctl start nginx.service |
| 停止服务 | service nginx stop | systemctl stop nginx.service |
| 重启服务 | service nginx restart | systemctl restart nginx.service |