Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux技術

解決 vncserver 找不到 .pid 檔案而無法停止的問題

CentOS 6.5 修改 IP 之後,VNC 連線失敗,提示「The connection was refused by host computer」。

解決 vncserver 找不到 .pid 檔案而無法停止的問題

這時想刪掉舊的服務,卻又跳出另一個錯誤:

Can't find file /root/.vnc/192.168.1.33:1.pid
You'll have to kill the Xvnc process manually

]# vncserver -kill :1
Can't find file /root/.vnc/192.168.1.33:1.pid
You'll have to kill the Xvnc process manually

原因不難理解:IP 變了,vncserver 依舊拿舊 IP 去拼 .pid 檔名,自然找不到檔案,也就無法正常停止。解法與「連線被拒絕」相同——重新初始化一次即可:

# vncserver
New '192.168.1.33:8 (root)' desktop is 192.168.1.33:8
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/192.168.1.33:8.log

雖然這裡顯示的仍是原來的 IP,但無妨,客戶端已經可以正常連線了。

Copyright © Linux教程網 All Rights Reserved