The UNIX and Linux Forums  

Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 10:02 PM
Server hung biznatch HP-UX 6 01-20-2006 05:49 PM
SUN is hung/dead ireeneek SUN Solaris 11 12-12-2003 07: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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
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.
  #2 (permalink)  
Old 10-23-2001
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,116
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 (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.
  #4 (permalink)  
Old 10-25-2001
doeboy's Avatar
doeboy doeboy is offline
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?
  #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).
  #6 (permalink)  
Old 10-26-2001
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,116
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 (permalink)  
Old 09-08-2006
jmreddyks jmreddyks is offline
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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:27 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
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