LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   VNCServer wierd happenings?? (http://www.linuxquestions.org/questions/linux-networking-3/vncserver-wierd-happenings-11865/)

FunkFlex 01-15-2002 11:22 PM

VNCServer wierd happenings??
 
Trying to get VNC Server up and running on one of my Linux box. Due to lack of monitors and space in my room (and plugpoints) it needs to sit elsewhere.

Using RH7.2
Now the problem is when using the built in VNCServer it starts up OK but no display number is assigned (or is it?) hence when trying to connect to it returns an error.

Next I tried editing the /etc/sysconfig/vncserver file as appropriately and rebooted machine.. works fine display 1 assigned.. connected..OK
Then I rebooted again only to come across an error:
Display :1 is already in use
There is already afile in /tmp/.X.....blah blah
Starting VNC Server.. FAILED

Obviously the previous display is still hanging around..

I've also tried not using the built in VNC Server startup and started it in rc.local same error occurs..
Display :<number> is already in use.
blah blah..

Is there any solution to this??

dkochan 01-29-2002 10:56 PM

Go to this file: /tmp/.X11-unix/X1

It will solve your problem

FunkFlex 01-30-2002 07:35 AM

Yes I've been there and fixed the problem now..

Obviously the vncserver wasn't killing the displays properly on stop/shutdown so I put in this line in the vncserver init script:
rm -f /tmp/.X11-unix/X*.*

Thanks for replying anyway

jrmann1999 01-31-2002 05:19 PM

decent temp solution, but you might just notice, did your shutdown script have

vncserver -kill :#

where # is the number of the display that was active? perhaps it might have had a variable there?

FunkFlex 01-31-2002 07:50 PM

yes it does, but for some reason it won't work,
here is the original 'stop' section from ../init.d/vncserver

Code:

echo -n $"Shutting down $prog: "
for display in ${VNCSERVERS}
do
 echo -n "${display}"
 unset BASH_ENV ENV
 initlog $INITLOG_ARGS -c \
  "su ${display##*:} -c \"vncserver -kill :${display%%:*} > /dev/null 2>&1\""
done

I know that for every display listed in file "VNCSERVERS" (located in /etc/sysconfig) it starts/kills it in the vncserver init script. Is there something wrong in the init script (RH7.2)

I have to add this line in order to remove the X0 and X1 thats left behind.
rm -f /tmp/.X11-unix/X*.*


All times are GMT -5. The time now is 11:42 PM.