tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY: Reserving ephemeral (>1024) ports - is it possible?
@ 2001-02-21 19:04 tackenhu
  0 siblings, 0 replies; only message in thread
From: tackenhu @ 2001-02-21 19:04 UTC (permalink / raw)
  To: tru64-unix-managers




I received 2 responses on this query (thanks to Elizabeth and Ernest) -
both concurred that naming these ports in the /etc/services file should
prevent them from being dynamically allocated as the next available port by
processes (although I would bet that any process that specifically requests
this port will be able to allocate it if no other process is using it).

I have yet to test this, but it certainly makes sense.

Thanks,

Tom






tackenhu@fnal.gov@ornl.gov on 02/16/2001 03:17:40 PM

Sent by:  tru64-unix-managers-owner@ornl.gov


To:   tru64-unix-managers@ornl.gov
cc:

Subject:  Reserving ephemeral (>1024) ports - is it possible?



I have some non-OS server side processes that listen on ephemeral ports
(unprivileged ports above 1024 - lets say port 4000).  I would like to be
able to reserve this port so that no other process will grab the port when
it goes to create a new network connection.  The problem I am currently
experiencing is that I might have to bounce my process on port 4000 (for
instance, in order to upgrade the application software), but when I go to
start up the process again, some other process has grabbed port 4000 (and I
get a message about "port in use".  The other process grabbing the port is
a process that dynamically allocates port to handle client connections, so
it just grabs the next available port when it gets a connection request.

So, is there anyway to say to the OS don't assign port 4000 unless it is
specifically requested?  Would putting a custom entry in the /etc/services
file (like  "myservice 4000/tcp") cause the operating system to not
allocate this port when a process is being assigned a random port for use?
Is there some other mechanism to do this?

I know I can kill the process using the port to recover it, but that is an
after the fact correction (that potentially violently ends a client
connection) rather than a prevention.

Thanks,

Tom Ackenhusen
tackenhu@fnal.gov
Fermi National Accelerator Laboratory

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-02-21 19:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-21 19:04 SUMMARY: Reserving ephemeral (>1024) ports - is it possible? tackenhu

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