Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Error: port already open
@ 1999-10-28  4:00 Uncle Jeff
  1999-10-28  4:00 ` Serguei Patchkovskii
  0 siblings, 1 reply; 6+ messages in thread
From: Uncle Jeff @ 1999-10-28  4:00 UTC (permalink / raw)


(posting to comp.unix.osf.osf1)

Hi all.

I'm told that this group focuses on Digital UNIX queries. If I'm wrong,
I'd appreciate somebody setting me straight :*>.

We have an Digital UNIX system, V4.0F, and we have a problem. We have
an assortment of applications (Progress database servers, amongs other
stuff) that get automatically shut down each night and restarted in the
morning. Each one of these is assigned to use a particular port in
/etc/services file. So, it's our understanding that each port should be
reserved by the OS for only that application.

Why, then, do we find that intermittantly one or more of the servers
fails to start, with the error in the log file (for example):

The port 2122 is already in use. (785)

We don't think it's an error caused by Progress itself (??). So assuming
that, can anyone suggest any other reasons this might be happening? How
can we tell what process is tying up the port at that time, and why
would the OS allow it to?

Thanks in advance.

--
 ( >- ------------------------------------- -< )
 /~\           THKS :?) Uncle Jeff           /~\
|  \)      jeffhowie@NOJUNKmy-deja.com      (/  |
 \_|_ Linux, the choice of a GNU generation _|_/


Sent via Deja.com http://www.deja.com/
Before you buy.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Error: port already open
  1999-10-28  4:00 Error: port already open Uncle Jeff
@ 1999-10-28  4:00 ` Serguei Patchkovskii
  1999-10-29  4:00   ` Uncle Jeff
  0 siblings, 1 reply; 6+ messages in thread
From: Serguei Patchkovskii @ 1999-10-28  4:00 UTC (permalink / raw)


Uncle Jeff (jeffhowie@my-deja.com) wrote:
: /etc/services file. So, it's our understanding that each port should be
: reserved by the OS for only that application.

No, this understanding is wrong. Placing a port name in /etc/services
has no effect apart from giving that port a convenient symbolic name, 
which every individual program is free to use (or ignore). The only way
to actually reserve a port number is to bind() to it - in which case
it will not be available for other processes.

/Serge.P

--
home page: http://www.cobalt.chem.ucalgary.ca/ps/



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Error: port already open
  1999-10-28  4:00 ` Serguei Patchkovskii
@ 1999-10-29  4:00   ` Uncle Jeff
  1999-11-08  5:00     ` /WB/
  0 siblings, 1 reply; 6+ messages in thread
From: Uncle Jeff @ 1999-10-29  4:00 UTC (permalink / raw)


In article <7vae9u$djg$1@nserve1.acs.ucalgary.ca>,
  patchkov@acs1.acs.ucalgary.ca (Serguei Patchkovskii) wrote:
> No, this understanding is wrong. Placing a port name in /etc/services
> has no effect apart from giving that port a convenient symbolic name,
> which every individual program is free to use (or ignore). The only
> way
> to actually reserve a port number is to bind() to it - in which case
> it will not be available for other processes.

Interesting. :*|

The bind-lock would only be active while the process is running, though,
correct? If I understand then, we'd need to have a 'sleeper' process
bind the port while the server is down, and then kill that process
before restarting the server.
--
 ( >- ------------------------------------- -< )
 /~\           THKS :?) Uncle Jeff           /~\
|  \)      jeffhowie@NOJUNKmy-deja.com      (/  |
 \_|_ Linux, the choice of a GNU generation _|_/


Sent via Deja.com http://www.deja.com/
Before you buy.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Error: port already open
  1999-10-29  4:00   ` Uncle Jeff
@ 1999-11-08  5:00     ` /WB/
  1999-11-08  5:00       ` Uncle Jeff
  0 siblings, 1 reply; 6+ messages in thread
From: /WB/ @ 1999-11-08  5:00 UTC (permalink / raw)


How long is the servers down before you restart them. It sounds more
like the the port is in TIME_WAIT, depending on the server bind mode (ie
the SO_REUSEADDR flag for the socket) the server will not be able to
re-bind to the port before the port becomes totally free again...

/WB/

Uncle Jeff wrote:
> 
> In article <7vae9u$djg$1@nserve1.acs.ucalgary.ca>,
>   patchkov@acs1.acs.ucalgary.ca (Serguei Patchkovskii) wrote:
> > No, this understanding is wrong. Placing a port name in /etc/services
> > has no effect apart from giving that port a convenient symbolic name,
> > which every individual program is free to use (or ignore). The only
> > way
> > to actually reserve a port number is to bind() to it - in which case
> > it will not be available for other processes.
> 
> Interesting. :*|
> 
> The bind-lock would only be active while the process is running, though,
> correct? If I understand then, we'd need to have a 'sleeper' process
> bind the port while the server is down, and then kill that process
> before restarting the server.
> --
>  ( >- ------------------------------------- -< )
>  /~\           THKS :?) Uncle Jeff           /~\
> |  \)      jeffhowie@NOJUNKmy-deja.com      (/  |
>  \_|_ Linux, the choice of a GNU generation _|_/
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Error: port already open
  1999-11-08  5:00     ` /WB/
@ 1999-11-08  5:00       ` Uncle Jeff
  1999-11-09  5:00         ` /WB/
  0 siblings, 1 reply; 6+ messages in thread
From: Uncle Jeff @ 1999-11-08  5:00 UTC (permalink / raw)


In article <3826150A.3639817D@slashwb.org>,
  WB@slashwb.org wrote:
> How long is the servers down before you restart them. It sounds more
> like the the port is in TIME_WAIT, depending on the server bind mode
> (ie
> the SO_REUSEADDR flag for the socket) the server will not be able to
> re-bind to the port before the port becomes totally free again...
> Uncle Jeff wrote:

They're down for 6 hours. Does this mean you're saying that the port
_should_ get bound by the entry in the /eetc/services?
--
 ( >- ------------------------------------- -< )
 /~\           THKS :?) Uncle Jeff           /~\
|  \)      jeffhowie@NOJUNKmy-deja.com      (/  |
 \_|_ Linux, the choice of a GNU generation _|_/


Sent via Deja.com http://www.deja.com/
Before you buy.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Error: port already open
  1999-11-08  5:00       ` Uncle Jeff
@ 1999-11-09  5:00         ` /WB/
  0 siblings, 0 replies; 6+ messages in thread
From: /WB/ @ 1999-11-09  5:00 UTC (permalink / raw)


No, /etc/services is just a name for the port, nothing more. But what
can happen is that if the server is shut down withou cleanly closing the
socket, the socket can go into TIME_WAIT which will prevent a new bind
without specifying the SO_REUSEADDR. Six hours should be long enough
though...
Try doing a netstat -an >/tmp/sockets.list just before starting the
servers, check if the failed servers correspond to open sockets...

/WB/

Uncle Jeff wrote:
> 
> In article <3826150A.3639817D@slashwb.org>,
>   WB@slashwb.org wrote:
> > How long is the servers down before you restart them. It sounds more
> > like the the port is in TIME_WAIT, depending on the server bind mode
> > (ie
> > the SO_REUSEADDR flag for the socket) the server will not be able to
> > re-bind to the port before the port becomes totally free again...
> > Uncle Jeff wrote:
> 
> They're down for 6 hours. Does this mean you're saying that the port
> _should_ get bound by the entry in the /eetc/services?
> --
>  ( >- ------------------------------------- -< )
>  /~\           THKS :?) Uncle Jeff           /~\
> |  \)      jeffhowie@NOJUNKmy-deja.com      (/  |
>  \_|_ Linux, the choice of a GNU generation _|_/
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1999-11-09  5:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-10-28  4:00 Error: port already open Uncle Jeff
1999-10-28  4:00 ` Serguei Patchkovskii
1999-10-29  4:00   ` Uncle Jeff
1999-11-08  5:00     ` /WB/
1999-11-08  5:00       ` Uncle Jeff
1999-11-09  5:00         ` /WB/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox