更新时间:2023-03-23 17:00:31浏览次数:1+次
service是用于不同的unix和linux中启动和停止服务等的通用命令。service对于基本服务管理已经足够了。但如果要更多的控制选项,还是使用不同系统各自的命令。
根据“低级”服务管理器,service在不同的二进制文件上重定向。
centos7,重定向到systemctl。
centos6,重定向到/etc/init.d脚本。
较旧的ubuntu版本,重定向到upstart。
service 服务名 start / stop/ restart (不支持开机自启的操作)
启用开机自启:systemctl enable 服务名
禁止开机自启:systemctl disable 服务名