Centos 6
1. 常用命令
1 | service 服务名 start | stop | restart | reload | status |
2. 设置自启动
查看服务是否自启
1
chkconfig --list | grep 服务名
设置自启动 ( on – 开启, off – 关闭)
1
chkconfig --level 5 服务名 on
Centos 7
1. 常用命令
1 | sysremctl start | stop | restart | reload | status 服务名 |
2. 查看服务
方法:
/usr/lib/systemd/system
命令:
list-unit-files``` 1
2
```systemmctl --type service
3.设置服务自启动 (enable : 启动, disable: 关闭)
1 | systemctl enable 服务名 |