温馨提示×

如何查看centos compton日志

小樊
43
2026-09-21 13:02:51
栏目: 智能运维

在 CentOS 上查看 Compton(窗口合成器)日志,取决于你是如何启动它的。下面按常见情况说明。


一、确认 Compton 是否在运行

ps -ef | grep compton

或

pgrep -a compton

二、如果是手动命令行启动

如果你是在终端直接运行:

compton

或

compton -b

1️⃣ 前台运行(推荐调试)

compton --log-level debug

日志会直接输出到当前终端。

2️⃣ 后台运行

compton -b --log-level debug --log-file /tmp/compton.log

然后查看日志:

cat /tmp/compton.log

三、如果是 systemd 启动(用户级)

很多桌面环境用 systemd 管理 Compton:

systemctl --user status compton

查看日志:

journalctl --user -u compton -f

四、如果是通过桌面环境自动启动

(如 .xinitrc、.xprofile、autostart)

查看启动配置

cat ~/.xinitrc
cat ~/.xprofile
ls ~/.config/autostart/

如果是 autostart:

cat ~/.config/autostart/compton.desktop

建议修改为带日志的启动方式:

Exec=compton --log-level debug --log-file /tmp/compton.log

五、常见问题排查(日志里常看到的)

  • Failed to load backend
  • GLX error
  • Another compositor is running
  • Configuration file error

六、补充说明

  • CentOS 7 常见的是 compton
  • CentOS 8 / Stream 可能已迁移到 picom(compton 分支)
which picom

如果是 picom:

picom --log-level debug
journalctl --user -u picom

如果你愿意,可以告诉我:

  • CentOS 版本
  • 桌面环境(GNOME / KDE / XFCE)
  • Compton 启动方式

我可以给你更精确的命令。

0 踩