Operating System - HP-UX
1822545 Members
2723 Online
109642 Solutions
New Discussion юеВ

How can I disconnect a port without a process? Or how can i find the PID?

 
Leif Schall
New Member

How can I disconnect a port without a process? Or how can i find the PID?

Hi all,

I have some problems with a dead port on a HP-UX 11.11 server. Sometimes it is necessary to kill a Tipco process (tibcoadmi). After this an Apache Tomcat (which listens on port 8080) will be shutdown. Afterwards this port 8080 is still in use.

netstat -na |egrep "Addr|8080"
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp 0 0 *.8080 *.* LISTEN

No results with:
lsof -R |grep 8080
ndd -get /dev/tcp tcp_status |grep 1f90
Has no result. Or after ndd -set /dev/tcp tcp_discon 0x... I get the same result from netstat:
netstat -na |egrep "Addr|8080"
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp 0 0 *.8080 *.* LISTEN

My workaround at the moment is a reboot.

Has anybody an idea how to disconnect or kill the connection on port 8080?
6 REPLIES 6
harry d brown jr
Honored Contributor

Re: How can I disconnect a port without a process? Or how can i find the PID?

try this to stop port number translation to names:

lsof -P|grep 8080

is port 8080 defined in /etc/services?

live free or die
harry
Live Free or Die
RAC_1
Honored Contributor

Re: How can I disconnect a port without a process? Or how can i find the PID?

lsof -i tcp:8080

Anil
There is no substitute to HARDWORK
Petr Simik_1
Valued Contributor

Re: How can I disconnect a port without a process? Or how can i find the PID?

I think lsof should give you info which process is hanged on which port.
By your inf I suppose that Tipco process is using 8080.
Ports are defined in inetd try restart inetd
Sridhar Bhaskarla
Honored Contributor

Re: How can I disconnect a port without a process? Or how can i find the PID?

Hi,

8080 is used by httpd. I would suggest you do a 'ps -ef|grep http' and then see if there are any httpds running. Also ensure 8080 is not brokered by inetd. Look for entries in /etc/inetd.conf.

Make sure your 'lsof' works for other known ports. Get a working copy (the one at porting site doesn't seem to work). Search the forums and you will find many threads with sources to lsof.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Leif Schall
New Member

Re: How can I disconnect a port without a process? Or how can i find the PID?

Hi!

I think the question "Or how can I find the PID?" is wrong! Please forget this!

Answer to your questions:
With other ports lsof is running fine. So I hope that my problem is not the usage of lsof.
The port is not configured in /etc/services und so it is not started by the inetd.

I try to describe again:
I kill the process which listens on 8080.
lsof |grep 8080
tibcoadmi 8563 tibcobw 85u inet 0x4cf1d680 0t0 TCP *:8080 (LISTEN)
ps -ef |grep 8563
tibcobw 8563 8416 14 08:42:40 pts/td 3:28 tibcoadmin_AC9_TEST --innerProcess
kill 8563
ps -ef |grep 8563 (No result!)
The process is killed and is not a zombie.
netstat -na |egrep "8080|Add"
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp 0 0 *.8080 *.* LISTEN

So the process is killed but the Port 8080 is still in use.

Thank you
Leif
Bharat Katkar
Honored Contributor

Re: How can I disconnect a port without a process? Or how can i find the PID?

Hi Leif,
You need to identfy the service which is listening on the port 8080 ( You mentioned it as Apache Tomcat ) and then identfy the script which is running or starting this service.
You need to stop this service from running (look for the script in /sbin/init.d) and parrallely if there are any configuration files associated with this services in /etc/rc.config.d then you have update it to stop it during system startup.

I hope once the service is stopped you may not see its entry in netstat -na output.
If still does then try rebooting your server (last option).

Hope that helps.
Regards,
You need to know a lot to actually know how little you know