在 CentOS 上,cpustat 通常是通过 sysstat 工具包提供的(或者某些第三方工具),一般有两种常见“运行方式”,停止方法也不同:
cpustat 命令在前台运行比如你直接执行了:
cpustat
# 或
cpustat 1
停止方法:
Ctrl + C有些环境会把 cpustat 放到:
cronsystemd 服务ps -ef | grep cpustat
或
pgrep -a cpustat
假设 PID 是 1234:
kill 1234
如果杀不掉:
kill -9 1234
systemctl status cpustat
systemctl stop cpustat
crontab -l
找到类似:
* * * * * /usr/bin/cpustat >> /var/log/cpustat.log
删除或注释掉即可。
mpstatsariostatcpustat 命令多来自 pcp(Performance Co-Pilot)如果你是用 pcp-cpustat,停止方式:
pmie_stop
# 或
systemctl stop pmcd
如果你能告诉我:
我可以给你更精确的停止方法。