![如何查看 Gnome 启动的 Xwayland 服务器的日志?](https://linux22.com/image/130122/%E5%A6%82%E4%BD%95%E6%9F%A5%E7%9C%8B%20Gnome%20%E5%90%AF%E5%8A%A8%E7%9A%84%20Xwayland%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9A%84%E6%97%A5%E5%BF%97%EF%BC%9F.png)
我正在使用 Fedora Workstation 27。具体来说,gnome-session-3.26.1-1.fc27.x86_64
.
我知道 Xwayland 仅服务 X11 应用程序,而原生 Wayland 应用程序直接由gnome-shell
.我特别想查找来自 Xwayland 服务器的日志消息。
该目录~/.local/share/xorg/
是空的。我尝试过该杂志:
# journalctl -b /usr/bin/Xwayland
-- Logs begin at Fri 2017-04-21 15:22:01 BST, end at Fri 2018-03-23 23:45:13 GMT. --
-- No entries --
# journalctl -b | grep -i 'wayland.*]: '
#
它没有显示任何内容,尽管第二种方法可以很好地搜索“gnome-session”。
看起来 Xwayland 是通过与 gnome-shell 完全相同的套接字连接到日志的。如果您使用 来查看打开文件的完整列表lsof
,Xwayland 没有打开任何日志文件。
$ lsof -p 20554 | grep " [0-2][ur]"
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1002/gvfs
Output information may be incomplete.
Xwayland 20554 alan 0r CHR 1,3 0t0 12290 /dev/null
Xwayland 20554 alan 1u unix 0x0000000000e7d1ab 0t0 1945828 type=STREAM
Xwayland 20554 alan 2u unix 0x00000000a0ce92a9 0t0 1945829 type=STREAM
$ lsof -p 20518 | grep " [0-2][ur]"
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1002/gvfs
Output information may be incomplete.
gnome-she 20518 alan 0r CHR 1,3 0t0 12290 /dev/null
gnome-she 20518 alan 1u unix 0x0000000000e7d1ab 0t0 1945828 type=STREAM
gnome-she 20518 alan 2u unix 0x00000000a0ce92a9 0t0 1945829 type=STREAM
$ lsof -p 20554
Xwayland 20554 alan 0r CHR 1,3 0t0 12290 /dev/null
Xwayland 20554 alan 1u unix 0x0000000000e7d1ab 0t0 1945828 type=STREAM
Xwayland 20554 alan 2u unix 0x00000000a0ce92a9 0t0 1945829 type=STREAM
Xwayland 20554 alan 3u unix 0x0000000028595a37 0t0 1939422 type=STREAM
Xwayland 20554 alan 4u unix 0x000000004eb7173c 0t0 1939418 @/tmp/.X11-unix/X0 type=STREAM
Xwayland 20554 alan 5u unix 0x00000000db8a25b3 0t0 1939419 /tmp/.X11-unix/X0 type=STREAM
Xwayland 20554 alan 6u unix 0x0000000015c66fa0 0t0 1939441 @/tmp/.X11-unix/X0 type=STREAM
Xwayland 20554 alan 7u a_inode 0,13 0 11496 [eventpoll]
Xwayland 20554 alan 8u unix 0x00000000c130aa15 0t0 1944439 @/tmp/.X11-unix/X0 type=STREAM
Xwayland 20554 alan 9u CHR 226,0 0t0 692 /dev/dri/card0
Xwayland 20554 alan 10u CHR 226,0 0t0 692 /dev/dri/card0
Xwayland 20554 alan 11u unix 0x00000000313e2f4a 0t0 1945251 @/tmp/.X11-unix/X0 type=STREAM
Xwayland 20554 alan 12u unix 0x000000002c480fb6 0t0 1948769 @/tmp/.X11-unix/X0 type=STREAM
Xwayland 20554 alan 13u unix 0x00000000fe0b74af 0t0 1946332 @/tmp/.X11-unix/X0 type=STREAM
Xwayland 20554 alan 14u unix 0x000000008b10aa34 0t0 1946568 @/tmp/.X11-unix/X0 type=STREAM
Xwayland 20554 alan 15u unix 0x0000000009a83fdb 0t0 1948183 @/tmp/.X11-unix/X0 type=STREAM
Xwayland 20554 alan 16u unix 0x00000000eca69878 0t0 1948185 @/tmp/.X11-unix/X0 type=STREAM
Xwayland 20554 alan 17u unix 0x000000003a75c3bb 0t0 1955186 @/tmp/.X11-unix/X0 type=STREAM
Xwayland 20554 alan 18u unix 0x0000000072d53ca4 0t0 1957059 @/tmp/.X11-unix/X0 type=STREAM
Xwayland 20554 alan 19u unix 0x000000001efe4b9c 0t0 1948302 @/tmp/.X11-unix/X0 type=STREAM
Xwayland 20554 alan 20u unix 0x00000000777a260e 0t0 1946959 @/tmp/.X11-unix/X0 type=STREAM
Xwayland 20554 alan 21u unix 0x00000000925c7157 0t0 1948306 @/tmp/.X11-unix/X0 type=STREAM
Xwayland 20554 alan 22u unix 0x00000000ae315ead 0t0 1955996 @/tmp/.X11-unix/X0 type=STREAM
Xwayland 20554 alan 23u unix 0x000000002edc3509 0t0 1948309 @/tmp/.X11-unix/X0 type=STREAM
答案1
gnome-shell
Xwayland
确实从日志连接开始。这些消息在日志中显示,前缀为org.gnome.Shell.desktop[3494]:
,其中 3494 是该消息的 PIDgnome shell过程。
看 'systemd 日志中的“org.gnome.Shell.desktop[1711]:”是什么意思?'。
这可能会令人困惑,因为以gnome-shell
相同的方式记录并且可能会非常嘈杂;而 Xwayland 却非常安静。我看到 Xwayland 没有记录任何启动消息。我只看到记录有关错误的消息。
您可以尝试使用以下技巧来查找 Xwayland 消息
$ journalctl --since=-1month | grep ': [(]..[)] ' | grep -v gdm-x-session
或者
$ journalctl --since=-1month \
| grep -E '[(]([^0-9^a-z]){2}[)]' \
| grep -v gdm-x-session
Mar 18 21:15:45 alan-laptop org.gnome.Shell.desktop[1133]: (EE) failed to read Wayland events: Connection reset by peer
Mar 18 21:48:01 alan-laptop org.gnome.Shell.desktop[3012]: (EE) failed to read Wayland events: Broken pipe
Mar 18 21:50:06 alan-laptop org.gnome.Shell.desktop[2124]: (EE) failed to read Wayland events: Connection reset by peer
Mar 19 11:03:43 alan-laptop org.gnome.Shell.desktop[29640]: (EE) failed to read Wayland events: Broken pipe