Operating System - Tru64 Unix
1751917 Members
5291 Online
108783 Solutions
New Discussion юеВ

/etc/services reserved ports issue

 
Brendan Murphy_5
Frequent Advisor

/etc/services reserved ports issue

I'm having a problem with an network based application that on occassion during startup with start using port 2224, even though I have an entry reserving it for a second application in /etc/services. The second application has a dependency on the first being active first & port 2224 being free. Can anyone tell me why this might be happening & how I might resolve it. Does having an entry in /etc/services actually reserve the port, or is it just a nice lookup table.
7 REPLIES 7
Steven Schweda
Honored Contributor

Re: /etc/services reserved ports issue

> Does having an entry in /etc/services
> actually reserve the port, or is it just a
> nice lookup table.

No and yes, respectively. On ports, it's
pretty much first come, first served.

Why does the problem application "on
occassion" use the port which you wish you
could reserve for some other application?

If you change the sequence of the two
programs' start-ups, you should be able to
move the failure to the other program.
Brendan Murphy_5
Frequent Advisor

Re: /etc/services reserved ports issue

Hi Stephen,
Thanks for your reply. Unfortunately, the first application MUST be up an running before the second application. The second application needs to use port 2224, however the first application sometimes selects port 2224 for some of its network processes. I have no idea what it uses port 2224 for, but once selected then the second dependent application will not start.

Regards,

Brendan
Steven Schweda
Honored Contributor

Re: /etc/services reserved ports issue

You could write a short program which grabs
the critical port. Then, at start-up, (1)
run the critical-port-grabber, (2) start the
must-be-first application, (3) whack the
critical-port-grabber, and (4) start the
must-use-critical-port program.

This assumes that the must-be-first
application can select a different port if it
finds its first choice occupied (and that
it won't just be waiting for its chance to
pounce).

This also assumes that it wouldn't be easier
to repair the must-be-first application,

Many problems have some goofy solution (like
this) which will work, but is too embarassing
to document thoroughly.
Brendan Murphy_5
Frequent Advisor

Re: /etc/services reserved ports issue

Hi Steven,
Thanks for your help. I'm not in a postition to play around with the apps, their both 3rd party products. The solution you've just suggested is what I had been considering ... it just seems a painful way to solve what looks like a simple problem. I suppose the more direct solution is to ask the 3rd party to get heir act together;-)

Thanks again, you've been very helpful.
Al Licause
Trusted Contributor

Re: /etc/services reserved ports issue

Is this a standalone tru64 system or a cluster ?

If the later, you could assign the port in /etc/clua_services and use the static qualifier to reserve the port.

Brendan Murphy_5
Frequent Advisor

Re: /etc/services reserved ports issue

Standalone sadly ... but good idea all the same.
Brendan Murphy_5
Frequent Advisor

Re: /etc/services reserved ports issue

The solution to my problem is as steven describes, to write a startup script that temporarily opens port 2224 until the fisrt app has started, then close port 2224 & allow the second app to use port 2224. Not very pretty, but needs must & all that:-(

Brendan