码迷,mamicode.com
首页 > 其他好文 > 详细

CentOS7 服务检查命令

时间:2020-04-09 15:24:32      阅读:474      评论:0      收藏:0      [点我收藏+]

标签:bsp   mct   postfix   ble   重载   firewalld   重启   利用   har   

列出所有服务:systemctl list-unit-files

列出运行中的服务:systemctl list-units

列出所有失败的服务:systemctl --failed

检查单个服务是否启用:systemctl is-enabled mysqld.service

查看单个服务的状态:systemctl status firewalld.service

启动、重启、、停止、重载某个服务

# systemctl start httpd.service
# systemctl restart httpd.service
# systemctl stop httpd.service
# systemctl reload httpd.service
# systemctl status httpd.service

激活/禁止自动重启

# systemctl enable httpd.service
# systemctl disable httpd.service

使用Systemctl控制并管理挂载点:

# systemctl list-unit-files --type=socket

# systemctl start cups.socket
# systemctl restart cups.socket
# systemctl stop cups.socket
# systemctl reload cups.socket
# systemctl status cups.socket

# systemctl is-active cups.socket
# systemctl enable cups.socket
# systemctl disable cups.socket

# systemctl mask cups.socket

 

使用Systemctl管理服务的CPU利用率

# systemctl show -p CPUShares httpd.service

# systemctl set-property httpd.service CPUShares=2000
# systemctl show -p CPUShares httpd.service

# systemctl show httpd

启动防火墙——systemctl start firewalld.service

 

停止防火墙——systemctl stop firewalld.service

查看firewalld防火墙状态——firewall-cmd --state

禁止防火墙开机启动——systemctl disable firewalld.service

列出正在运行的服务状态——systemctl

启动一个服务——systemctl start postfix.service

关闭一个服务——systemctl stop postfix.service

重启一个服务:——systemctl restart postfix.service

显示一个服务的状态——systemctl status postfix.service

在开机时启用一个服务——systemctl enable postfix.service

在开机时禁用一个服务——systemctl disable postfix.service

查看服务是否开机启动——systemctl is-enabled postfix.service

查看已启动的服务列表——systemctl list-unit-files|grep enabled

 

CentOS7 服务检查命令

标签:bsp   mct   postfix   ble   重载   firewalld   重启   利用   har   

原文地址:https://www.cnblogs.com/ZeroSunny/p/12667080.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!