确保 X 服务器尚未运行?

cea*_*cea 7 xorg gdm

突然间,我能够启动 X 服务器,但在 CentOS 上出现许多警告,然后我尝试通过进入 /usr/bin 来确保它已关闭,gdm stop但有一个错误日志指出:

[2148293.861] _XSERVTransSocketINETCreateListener: ...SocketCreateListener() failed
[2148293.861] _XSERVTransMakeAllCOTSServerListeners: server already running
[2148293.861]
Fatal server error:
[2148293.862] Cannot establish any listening sockets - Make sure an X server isn't already running
[2148293.862] (EE)
Please consult the CentOS support
         at http://wiki.centos.org/Documentation
 for help.
[2148293.862] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[2148293.862] (EE)
[2148293.862] Server terminated with error (1). Closing log file.
Run Code Online (Sandbox Code Playgroud)

随着gdm stop我得到:

** (gdm-binary:25390): WARNING **: Couldn't connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or director
Run Code Online (Sandbox Code Playgroud)

Tim*_*Tim 5

要回答上述问题,您可以通过发出以下命令来确定 Xserver 是否正在运行:

ps -C Xorg
Run Code Online (Sandbox Code Playgroud)