1837157 Members
2828 Online
110112 Solutions
New Discussion

Ports in use

 
Jeffrey F. Goldsmith
Super Advisor

Ports in use

This past weekend I updated my server (L2000 w/HP-UX 11.0) with several patches. Today my users are not able to use openlink due to internal rpc call failed (address already in use). This services is setup to use port 5000. I checked /etc/service and port 5000 is not listed as being used.
How can I check my system to see if port 5000 is being used?
I am attaching a file with the error.

Thanks for the help.
7 REPLIES 7
Raj D.
Honored Contributor

Re: Ports in use

Jeffrey,

Use lsof utility to find out whats happening with the ports ,

Use it with swinstall and use the command from /usr/local/bin

- To check manpage # man lsof

Here it is :
http://hpux.connect.org.uk/hppd/cgi-bin/search?package=on&description=on&term=lsof

hth,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
A. Clay Stephenson
Acclaimed Contributor

Re: Ports in use

Looking in /etc/services is a waste of time; the presence or absence of any entry there is meaningless. As noted, use lsof or netstat to see which process has the port in use.

If you refer to this link, you will see that your application isn't playing by the rules as it is using an already registered port for some other nefarious use.

http://www.iana.org/assignments/port-numbers
If it ain't broke, I can fix that.
Jeffrey F. Goldsmith
Super Advisor

Re: Ports in use

I looked for the lsof software and could not find a version for HP-UX 11.0 which is on my server. Can someone send me a link to where I can find it?

When I tried netstat I was given a lot of information but nothing that shows that port 5000 is in use.

Any other ideas?
Jeffrey F. Goldsmith
Super Advisor

Re: Ports in use

One thing that I may not have mentioned is that there has not been a problem with this software until I installed the patches this past weekend. I am attaching a copy of the patches.

I am to the point of removing the patches to see if that corrects the problem.
A. Clay Stephenson
Acclaimed Contributor

Re: Ports in use

You can get lsof from any of the HP-UX Porting Centre's but you are going to have to download the src and build it for 11.0.

http://hpux.its.tudelft.nl/hppd/hpux/Sysadmin/lsof-4.77/

It's an easy build.

In any event:

netstat -an | grep '.5000'
should get you there.

If it ain't broke, I can fix that.
Ivan Krastev
Honored Contributor

Re: Ports in use

rick jones
Honored Contributor

Re: Ports in use

To expand a bit on why /etc/services isn't helpful...

The entries in /etc/services are there simply to provide a mapping between a port number and a service name. It does not represent any sort of "hard reservation" mechanism.

Netstat -an | grep 5000 will tell you what sort of endpoints exist on the system bound to port 5000, but alas it will not tell you which processes have them. For that you will indeed need to get a version of lsof onto your system. You could try the porting archive at http://hpux.connect.org.uk/ (or one of its mirrors) or you could use a web search to find the "home" of the lsof source code and then compile it on your system. It is conceivable that the lsof source could compile with the "bundled" compiler rather than an add-on compiler, if you don't already have an add-on compiler on the system.

And given that 11.0 is now past its EOL date (IIRC) you may want to start looking into an upgrade to a newer version of HP-UX.
there is no rest for the wicked yet the virtuous have no pillows