The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Operating Systems > HP-UX
.
google unix.com



HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
rcp gets hung for long time panchpan AIX 0 01-09-2008 09:02 PM
Server hung biznatch HP-UX 6 01-20-2006 04:49 PM
SUN is hung/dead ireeneek SUN Solaris 11 12-12-2003 06:05 PM
SCSI bus is hung saucierm UNIX for Dummies Questions & Answers 2 10-23-2003 11:11 PM
system hung talib alsaadi IP Networking 2 09-04-2002 11:40 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-23-2001
TioTony's Avatar
TioTony TioTony is offline Forum Advisor  
Bit Pusher
 

Join Date: Oct 2001
Location: Southern California
Posts: 332
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.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-23-2001
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,042
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.
Reply With Quote
  #3 (permalink)  
Old 10-23-2001
TioTony's Avatar
TioTony TioTony is offline Forum Advisor  
Bit Pusher
 

Join Date: Oct 2001
Location: Southern California
Posts: 332
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.
Reply With Quote
  #4 (permalink)  
Old 10-25-2001
doeboy's Avatar
Registered User
 

Join Date: Oct 2001
Location: Here
Posts: 137
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?
Reply With Quote
  #5 (permalink)  
Old 10-25-2001
TioTony's Avatar
TioTony TioTony is offline Forum Advisor  
Bit Pusher
 

Join Date: Oct 2001
Location: Southern California
Posts: 332
Wha't up Doeboy, Long time no see

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).
Reply With Quote
  #6 (permalink)  
Old 10-26-2001
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,042
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?
Reply With Quote
  #7 (permalink)  
Old 09-08-2006
Registered User
 

Join Date: Jun 2006
Posts: 1
Hung Port

Hi,

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

for i in $(ndd -get /dev/tcp tcp_status | grep xxx.xxx.xxx.xxx | grep TCP_FIN_WAIT | awk '{print $1}' )
do
ndd -set /dev/tcp tcp_discon 0x${i}
if [ $? -eq 0 ]
then
echo "Cleared $i"
else
echo "Unable to clear $i"
fi
done


xxx.xxx.xxx.xxx = the destination server IP.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Bookmarks

Tags
None

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:




All times are GMT -4. The time now is 04:07 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66