CentOS7使用systemctl命令管理系统服务。
- 启动服务 -> systemctl start 服务名
- 停止服务 -> systemctl stop 服务名
- 重启服务 -> systemctl restart 服务名
- 重新加载配置 -> systemctl reload 服务名
- 查看服务状态 -> systemctl status 服务名
- 启用开机自启 -> systemctl enable 服务名
- 禁止开机自启 -> systemctl disable 服务名
- 查看开机自启 -> systemctl is-enabled 服务名
- 查看各服务开机自启情况 -> systemctl list-unit-files --type=service