对比centos7的systemctl和其余service+chkconfig

syetemctl就是service和chkconfig这两个命令的整合,在CentOS 7就开始被使用了。
systemctl 是系统服务管理器命令,它实际上将 service 和 chkconfig 这两个命令组合到一块儿。centos

(一)对比centos7

任务 旧指令(centos六、5) 新指令(centos7)
显示全部已启动的服务 chkconfig --list systemctl list-units --type=service
--all查看全部服务:
systemctl list-units --type=service --all
使某服务自动启动 chkconfig --level 3 httpd on systemctl enable httpd.service
使某服务不自动启动 chkconfig --level 3 httpd off systemctl disable httpd.service
     
检查服务状态 service httpd status systemctl status httpd.service (服务详细信息) systemctl is-active httpd.service (仅显示是否 Active)
启动某服务 service httpd start systemctl start httpd.service
中止某服务 service httpd stop systemctl stop httpd.service
重启某服务 service httpd restart systemctl restart httpd.service

(二)扩展spa

centos7中rest

yum install -y A   #安装ci

systemctl   status   A   # 管理it

systemctl   start   A table

systemctl   stop  A 扩展

systemctl   restart  A service

systemctl   enable  A yum

systemctl   disable  A 

systemctl   list-units   --type=service   #  查看全部开机自动启动的服务

相关文章
相关标签/搜索