Linux常用服务类相关命令

2020-10-18  本文已影响0人  笨比乔治

Linux常用服务类相关命令
CentOS 6

常用基本命令-进程类
注册在系统中的标准化程序
service 服务名 start
service 服务名 stop
service 服务名 restart
service 服务名 reload
service 服务名 status
通过chkconfig 命令设置自启动程序
chkcongfig --list #可以查看所有对应服务自启动状态开关
chkcongfig --level 3 服务名 off #on自启动、off不自启动
运行级别runlevel(centos6),常用级别3和5

0 停机、1 单用户root状态、2 多用户状态、3 有网多用户状态、4. 保留、5 图形模式、6、重启

CentOS 7

注册在系统中的标准化程序
systemctl start 服务名
systemctl restart 服务名
systemctl stop 服务名 #示例:停防火墙 systemctl stop firewalld
systemctl reload 服务名
systemctl status 服务名
查看服务的命令
systemctl list-unit-files #示例:systemctl list-unit-files |grep firewalld
systemctl --type service
设置自启动/不自启动
systemctl enable 服务名
systemctl disable 服务名

上一篇 下一篇

猜你喜欢

热点阅读