X port in use

Philip Andrew pwa0202 "at" mail.com
Wed, 06 Jun 2001 12:12:03 +0000

Hi --

I have several Sun Sparc systems running Solaris 8, and multiple users 
who run VNC servers on those systems.  Each user is assigned a unique 
display number for their exclusive use, using an NIS map (I have a 
program that automatically looks up their display number, and starts up 
a server on that display).

Generally, this works great.  However, occasionally I've had situations 
where 'vncserver' thought there was a VNC server already running on that 
display.  Tracing through the Perl code, I found that there were 3 
situations in which this occurs:

   1. The previous server exited without deleting the socket file
      called '/tmp/.X11-unix/X<disp#>'
   2. 'bind' to port 60xx fails.
   3. 'bind' to port 59xx fails.

#1 is easy to fix -- it can happen if the server either (a) dies a 
violent death, or (b) when the server is started, the permissions on 
'/tmp/.X11-unix' are 777, and somehow get reset to 775 by the time the 
server exits (yes, this is a strange one).  However, I have no idea how 
to diagnose, let alone remedy, #2/#3 -- I have a case right now where 
one of my users is trying to start a server on display :25, but there 
seems to be something running on port 6025 (or at least, 'bind' fails 
when trying to bind to that port).  In the past, "port-in-use" problems 
have gone away when I've rebooted a system -- but I can't go rebooting 
systems just to fix this!

I've searched the list archives and found no mention of this issue, so I 
don't know if anyone else has encountered this.  But I only run into 
this problem when using VNC -- I've previously had the problem with 
display numbers :14, :15, and :18 (oh, and not always on the same system).

Any help in fixing this would be appreciated -- either in determining 
what (if anything) is using port 6025, or in releasing port 6025 (if 
it's a stale port or something) ...


To unsubscribe, send a message with the line: unsubscribe vnc-list
to majordomo "at" uk.research.att.com
See also: http://www.uk.research.att.com/vnc/intouch.html