Hung Port

Thread Tools Search this Thread
Operating Systems HP-UX Hung Port
# 1  
Old 10-23-2001
Hung Port

Here's a difficult one for you.

I am on HPUX 11.0. I have a hung port, it is stuck in FIN_WAIT_2. Short of rebooting, how can I terminate the connection the system thinks still exists? I found a script online that uses adb but have not been able to get it to work. I am still open to using adb but have not been able to figure it out on my own, mostly becuase my background is Sun and HPUX is slightly different.Smilie Smilie
# 2  
Old 10-23-2001
The usual reason for asking this question is that you want to restart a server but can't because you get a message "can't bind to port". There are adb scripts to close a FIN_WAIT_2 socket, I don't understand why you're having trouble with it. HP also has a program called ndd which can close a connection. But you shouldn't have to do this. Instead you address the real problem which is that the server has a bug that should be fixed.

There are two ways to ignore FIN_WAIT_2 sockets under unix. First, a program like inetd can do the bind at boot-up time and pass off new connections to the server as they arrive. Second, the server can simply set the SO_REUSEADDR option to indicate that it would prefer to ignore them.

You must have a server that does not want to run under inetd and it doesn't set SO_REUSEADDR. Ask whoever wrote the server to fix that. It takes one line of code to set SO_REUSEADDR and then you will have no more problem.
# 3  
Old 10-23-2001
Thanks for the insight. I will see if I can get the program changed, which I am sure will take some time. In the mean time I will keep working the the adb script and check out ndd. If anyone has tips on adb troubleshooting, let me know.
# 4  
Old 10-25-2001
I think ndd is for tuning only. You can use it to change timeout thresholds and things like that, but you can't use it to clear a port that has been left open to my knowledge. Anyone know how if this IS possible?
# 5  
Old 10-25-2001
Wha't up Doeboy, Long time no see Smilie

I think you are right. I thought there might be tuning parm to set the TTL on the connection, but all settings I could see are global so this would not help me. I think adb is the only way out. Guess I will keep searching for a working script and keep trying to tweak the one I have (which was created on HPUX 8 by the way, I have tried to update it for 11 but must be missing something in the adb command).
# 6  
Old 10-26-2001
Remember that we are talking HP-UX here. HP's man page for ndd mentions "ndd -h unsupported". If you run:
ndd -h unsupported | grep disco
you will see:

tcp_discon - Terminate a TCP connection
tcp_discon_by_addr - Terminate a TCP connection

I have never had a TCP connection that I want to terminate, so I have never tried them. But I know several people who claim that they do work. Why are you saying that ndd can't do this? Did you guys try these and find that they don't work?
# 7  
Old 09-08-2006
Hung Port


I used the below script to clear the FIN_WAIT socket connections. ( HP unix )

for i in $(ndd -get /dev/tcp tcp_status | grep | grep TCP_FIN_WAIT | awk '{print $1}' )
ndd -set /dev/tcp tcp_discon 0x${i}
if [ $? -eq 0 ]
echo "Cleared $i"
echo "Unable to clear $i"
done = the destination server IP.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to check if the process is Hung?

I wish to monitor if my Tomcat process if Running, Hung, or Shutdown. I cannot use any third party monitoring tools so i decided to use one of these to test if the tomcat server is responding or not . 1. nslookup 2. telnet 3. ps The reason I do not use wget / curl is because it will... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies

3. Solaris

Hung ILOM - e2900

While trying to perform a firmware upgrade on this ilom, the system refused to allow uploading of more than ~900k or so... We tried multiple approaches using FTP and all failed. I decided to start this morning by firing up Apache on another box and trying the same process via HTTP but when I went... (8 Replies)
Discussion started by: DustinT
8 Replies

4. HP-UX

ssh session getting hung (smilar to hpux telnet session is getting hung after about 15 minutes)

Our network administrators implemented some sort of check to kill idle sessions and now burden is on us to run some sort of keep alive. Client based keep alive doesn't do a very good job. I have same issue with ssh. Does solution 2 provided above apply for ssh sessions also? (1 Reply)
Discussion started by: yoda9691
1 Replies

5. Programming

Subroutine Hung

Hi friends I am Administrator for a system works with uinx OS but, many times I get messages from server console inform me about Subroutine is Hanging so what can I do to reset this Subroutine? Note: always when I got that I restart the server but I think that is not professional solution. (3 Replies)
Discussion started by: bintaleb
3 Replies

6. Shell Programming and Scripting

Monitoring for a hung process

A coworker has a shell script that runs from a scheduler at the 3am. The shell script runs sqlplus passing in a sql statement, which generate a file. This is done 21 times for 21 different sql statements. Recently, one of the sqlplus processes got hung. Is there a way to monitor how long the... (2 Replies)
Discussion started by: prismtx
2 Replies

7. HP-UX

Server hung

So my server was hung when I came in this morning. It was responding to pings, but the console and telnet sessions would not respond. There was no disk activity. The display said FA1F which I discovered that the "A" represents a high CPU load. I tired several things to get it going but was forced... (6 Replies)
Discussion started by: biznatch
6 Replies

8. Solaris

SUN is hung/dead

What do you do if the system will not respond to commands? I'm using SUN Fire v210. We had a power hit, so i think it caused a problem. The monitor does not come up anymore. So i plugged in on a laptop via serial port, rebooted. The system seems to start to boot, but comes up to message "SC... (11 Replies)
Discussion started by: ireeneek
11 Replies

9. UNIX for Dummies Questions & Answers

SCSI bus is hung

Anyone have any ideas what could be causing me to get the error "The SCSI bus is hung. Perhaps an external device is turned off"? This is occuring when I try to boot off of my external CDROM. I have tried this CDROM on 3 different systems, tried different SCSI cables, and different terminators... (2 Replies)
Discussion started by: saucierm
2 Replies

10. IP Networking

system hung

I installed sco unix v 5.0.5 in the hp server lc 2000 HD size 27gb & ram 256 , used micro focus cobol for unix , aplication system bank , the problem is the system hung 2 or 3 times a day will you pls. give me the solution. thanks talib alsaadi :( (2 Replies)
Discussion started by: talib alsaadi
2 Replies
Login or Register to Ask a Question