解决vncserver报错:PID file /root/.vnc/localhost.localdomain:1.pid not readable

启动vnc报错 :Job for vncserver@:1.service failed because a configured resource limit was exceeded. 
执行# systemctl status vncserver@:1.service

发现一条信息:

 localhost.localdomain systemd[1]: PID file /root/.vnc/localhost.localdomain:1.pid not readable (yet?) after start.
检查 /root/.vnc/,发现没有localhost.localdomain:1.pid

解决方法:

原来目录/tmp/下有一个/.X11-unix目录会占用这个pid序号资源。
把这个目录改名/.X11-unix.bak后,再次执行
#vncserver,系统正常生成了1.pid。
执行:

systemctl start vncserver@\:1.service

成功。

步骤:

1.  #  mv /tmp/.X11-unix /tmp/.X11-unix.bak

2.  #  vncserver

3.  # systemctl start vncserver@\:1.service

  重启一下机器即可

如果提示Too many open files  可以忽视

注意:非正常关机启动后,会报

PID 4286 read from file /root/.vnc/localhost.localdomain:1.pid does not exist or is a zombie

或者 PID file /root/.vnc/localhost.localdomain:2.pid not readable (yet?) after start.

解决方法:cd /tmp/.X11-unix

Rm -rf  *

你可能感兴趣的:(linux)