Cenetos系统服务器检查/设置服务运行情况的命令
Centos系统如何启动/关闭某项服务?如何设置服务自动启动?本文将主要列举CentOS系统服务器中常用的服务相关命令。服务(service)启动相关命令(以httpd服务为例)
因系统命令不同,命令也不同;一般Centos5.x/6.x使用旧命令、Centos7.x/8.x使用新命令:
任务旧命令新命令使某服务开机自动启动Chkconfig --level 3 httpd onsystemctl enable httpd.service使某服务开机不自动启动chkconfig --level 3 httpd offsystemctl disable httpd.service检查服务状态service httpd statussystemctl status httpd.service (服务详细信息)
systemctl is-active httpd.service(仅显示是否Active)显示所有已启动的服务chkconfig --listsystemctl list-unit-files
systemctl list-units --type=service启动某服务service httpd startsystemctl start httpd.service停止某服务service httpd stopsystemctl stop httpd.service重启某服务service httpd restartsystemctl restart httpd.service
页:
[1]