Operating System - HP-UX
1752826 Members
4254 Online
108789 Solutions
New Discussion юеВ

Re: How to release a locked port number

 
kvsheejith
Advisor

How to release a locked port number

I am using hp unix 11.0. If i restart some of my applications it's port number is getting locked, For example i have UGS application and it's port number is 28000, if i am restarting my UGS application hpux will not able to release the port for re-use.

How do i release one locked port number in HPunix?
7 REPLIES 7
Robert-Jan Goossens
Honored Contributor

Re: How to release a locked port number

Hi,

Try to locate the process with lsof keeping this port locked.

http://mirrors.develooper.com/hpux/lsof-4.80-11.00.sd.bz

# lsof -i tcp:28000

Regards,
Robert-Jan
rick jones
Honored Contributor

Re: How to release a locked port number

"Locked" probably isn't quite the correct term.

Unless the application sets SO_REUSEADDR() before calling bind() with the well-known port number, not only will any previous instance of the application with a socket bound to that port need to be closed, but also (IIRC) all the TCP endpoints in TIME_WAIT etc will have to clear-out.

And since you mention 11.0, "insert usual suggestion to upgrade to a supported OS revision here" :)
there is no rest for the wicked yet the virtuous have no pillows
Kapil Jha
Honored Contributor

Re: How to release a locked port number

well port is used only if some process is accessing it.
Probably you may stop the service and then try
lsof to find which process is using this port.
Kill that process and restart the process.
Should help.
Anyways 11.00 is out of support, you should upgrade you OS.

BR,
Kapil+
I am in this small bowl, I wane see the real world......
kvsheejith
Advisor

Re: How to release a locked port number



I am able fix that problem.

Thanks lot.
Sunny123_1
Esteemed Contributor

Re: How to release a locked port number

Hi



whats is that??? If you are now able to fix that problem then you should explain here what is the solution you got so in future it can help others if same problem occurs.

Regards
Sunny
kvsheejith
Advisor

Re: How to release a locked port number


First i made my application down and

In /vat/tmp/ one lock file will be there which ends with my application name that i have deleted

Then started my application and it started with out any issues

My application is UGS software.

Thanks
Sheejith
Horia Chirculescu
Honored Contributor

Re: How to release a locked port number

The existence of some lock file for any application does not mean that the port that it is used by that server application is locked!

Best regards
Horia.
Best regards from Romania,
Horia.