I pretty successfully get VNC working as service on my Centos 7 with multiple instances for different users.
But I found one problem. I need the display of specific user always on the same port, but when the service fail to start VNC, it automatically try next display number.
I found that this happen, when PC shut down without proper ending of VNC. Then there is left opened socket in /tmp/.X11-unix/X# (where # is number of the display). Even that I have
Code: Select all
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
So my 2 questions are:
1. Is there a way, how to properly remove orphan socket of VNC, when PC shut down without proper VNC turn off?
(except rm /tmp/.x11-unix/X%i)
2. Even if there will be this problem and VNC try to start, is possible to fail immediately without increasing automatically display number?
Thank you very much