Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

Killing a process to free up port

SOLVED
Go to solution
Sanjay Duhan
Occasional Contributor

Killing a process to free up port

Hi,

I have an application which uses some specific port. A lot of time this app dies and when the port is free some other application binds to this port.
Now I want to know which process is using this port so that I can kill.
Well I want to free up this port.

Iam havinh HP-UX 11 server.

Thanx
Sanjay Duhan
3 REPLIES
Steve Steel
Honored Contributor

Re: Killing a process to free up port

Hi

netstat -a


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
John Payne_2
Honored Contributor

Re: Killing a process to free up port

There is a product called lsof that can help you with this as well. It is found at any of the porting centers...

Hope it helps

John
Spoon!!!!
Andreas Kruth
Occasional Advisor
Solution

Re: Killing a process to free up port

Hello,

as you know the used port try "lsof" which is able to display the associated processes in most cases (for each process that allocates a file descriptor)

example:

# lsof -i:23
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
inetd 17768 root 5u inet 0x2b2f940 0t0 TCP *:telnet (LISTEN)

You can see Port 23 is in use by a TCP SErvice "telnet" and the responsible process is inetd with PID 17768.

"lsof" is available at the HP Porting Center:
http://hpux.cs.utah.edu/
There search for "lsof".

Regards,

Andreas