Connection to VNC server fails. While restarting the service from the server, we get the following error:
[myuser@xxxxxx tmp]# service vncserver restart
Shutting down VNC server: 3:myuser [FAILED]
Starting VNC server: 3:myuser
Warning: xxx.xxx.xxx:3 is taken because of /tmp/.X3-lock
Remove this file if there is no X server xxx.xxx.xxx.xxx:3
A VNC server is already running as :3 [FAILED]
This error is because of a lock file. To resolve this we have to remove the lock file and socket.
rm -rf /tmp/.X3-lock
rm -rf /tmp/.X11-unix/X3
Then restart the VNC service.
service vncserver restart