我在家庭实验室的 centos 7 主机上设置了一个 Tiger-VNC 服务器,最近停电了。我尝试像往常一样连接到 vnc 服务器,但收到“连接被拒绝”错误消息。我通过 ssh 连接到服务器并尝试重新启动守护进程并收到这些错误。提前致谢! :)
[root@centos-desktop ~]# systemctl status vncserver@:1
● vncserver@:1.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@:1.service; enabled; vendor preset: disabled)
Active: failed (Result: resources) since Sun 2018-06-17 18:01:36 EDT; 1min 51s ago
Process: 1324 ExecStart=/usr/sbin/runuser -l sam -c /usr/bin/vncserver %i -geometry 1366x768 (code=exited, status=0/SUCCESS)
Process: 1315 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
Jun 17 18:01:33 centos-desktop.mylab.local systemd[1]: Starting Remote desktop service (VNC)...
Jun 17 18:01:36 centos-desktop.mylab.local systemd[1]: PID file /home/sam/.vnc/centos-desktop.mylab.local:1.pid not readable (yet?) after start.
Jun 17 18:01:36 centos-desktop.mylab.local systemd[1]: Failed to start Remote desktop service (VNC).
Jun 17 18:01:36 centos-desktop.mylab.local systemd[1]: Unit vncserver@:1.service entered failed state.
Jun 17 18:01:36 centos-desktop.mylab.local systemd[1]: vncserver@:1.service failed.
[root@centos-desktop ~]# systemctl start vncserver@:1
Job for vncserver@:1.service failed because a configured resource limit was exceeded. See "systemctl status vncserver@:1.service" and "journalctl -xe" for details.
答案1
我在这里找到了解决方案:
vncserver -kill :1