1836458 Members
2605 Online
110101 Solutions
New Discussion

Re: Service is in use

 
SOLVED
Go to solution
Volker Borowski
Honored Contributor

Service is in use

Hi networkers,

my application process on HP-UX 10.20 died. I have no zombie or process left.
The tcp-socket is still blocked, so I can not restart the application. But I do not want to reboot the server.

Is it possible to release the service WITHOUT rebooting the machine ?

Thanks
Volker
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor
Solution

Re: Service is in use

Hi:

I'm afraid you're stuck with a reboot.

While 'netstat -an' will show you the ports in use, you will need 'lsof' to determine what process is bound to the port.

A good description of what has (probably) happened is contained in this thread:

http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0xdc968d77ef20d411b66300108302854d!1,00.html

...JRF...
Vincenzo Restuccia
Honored Contributor

Re: Service is in use

Volker Borowski
Honored Contributor

Re: Service is in use

Thanks, although this was what I was afraid of....

Since I do not have the process anymore, there is no way to kill it at all, even if an lsof will show me its PID.
But it is good to know, that in the other case, you have the option with lsof (never heard of this before).

This seems to be a quite difficult problem.
Any idea, why there are no tools to clean this up from the network side ?
Like IPCS / IPCRM for shared memory ?
There should be a way to kick those entrys out of the communication tables...

Volker
James R. Ferguson
Acclaimed Contributor

Re: Service is in use

Hi Volker:

With 11.x and 'ndd' there is a workaround. See this thread, for instance:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0xa6c353921f1ad5118fef0090279cd0f9,00.html

...JRF...
Steven Sim Kok Leong
Honored Contributor

Re: Service is in use

Hi,

The unorthodox method of using tcp_discon or tcp_discon_by_addr allows terminating of connections in the connections table without the need for a reboot. However, my advice is to use it only as a last resort.

To use the ndd -set /dev/tcp tcp_discon, you need the pointer to the TCP instance data. You can retrieve this via the ndd command tcp_status.

So, the scenario to find the TCP instance data and then use tcp_discon to remove the instance is as follows:

# ndd -get /dev/tcp tcp_status
TCP dest snxt suna swnd cwnd rnxt rack rwnd rto mss [lport,fport] state

0183b8b4 015.043.233.086 533cb8ce 533cb8ce 00008000 00003000 533bc583 533bc583 00000000 02812 04096 [c00a,cea9] TCP_CLOSE_WAIT

So, if you wanted to remove this connection:
# ndd -set /dev/tcp tcp_discon 0x0183b8b4

If you want to use the tcp_discon_by_addr, you use a 24 byte string that contains the hex representation of the quadruple.

For example, if the connection that I want to delete is:

Local IP: 192.1.2.3 (0xc0010203)
Local Port: 1024 (0x0400)
Remote IP : 192.4.5.6 (0xc0040506)
Remote Port: 2049 (0x0801)

The "hex" string you pass to tcp_discon_by_addr is:

# ndd -set /dev/tcp tcp_discon_by_addr "c00102030400c00405060801"

NOTE: the preceding 0x that typically indicates a Hex number is NOT part of the string passed.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Philip Chan_1
Respected Contributor

Re: Service is in use

Hi,

I guess that the reason why these dead connections can't be reset is because network I/Os are all handled by the kernel, therefore you cannot get rid of these connections simply by restarting their parental process (restarting the kernel = reboot !!!). Chances are that one could still instruct the kernel to do something (see Steven's message on this).

Also, if you can wait long enough, these dead connections may eventually go away according to the tcp_keepalive settings.

Rgds,
Philip