Centos6
service 注册在系统中的标准化程序
常用方法:
- service 服务名 start
- service 服务名 stop
- service 服务名 restart
- service 服务名 reload
- service 服务名 status
查看服务的方法 /etc/init.d/服务名
通过chkconfig命令设置自启动
查看服务 chkconfig --list | grep XXX
如:chkconfig --level 5 服务名 on
运行级别:
- 0:停机
- 1:单用户模式
- 2:多用户无网络
- 3:多用户有网络
- 4:保留
- 5:图形界面
- 6:重启
Centos7
注册在系统中的标准化程序
常用方法:
- systemctl start 服务名
- systemctl restart 服务名
- systemctl stop 服务名
- systemctl reload 服务名
- systemctl status 服务名
查看服务的方法 /usr/lib/systemd/system
查看服务的命令:
- systemctl list-unit-files
- systemctl --type sevice
通过systemctl命令设置自动启动
- 自启动 systemctl enable service_name
- 不自启动 systemctl disable service_name
posted on
浙公网安备 33010602011771号