close tcp port


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers close tcp port
# 1  
Old 09-24-2008
close tcp port

Hello, I have a service running (ODBC) and every now and then it will hang and I will have to stop and restart the service. The problem is when I stop the service, it indeed stops the service, but netstat reports a tcp port still open with the fin_wait_2 status. Then I must close the client application to allow the service to restart or wait 5 minutes. How do I make it close automatically and not wait for 5 minutes? I thought maybe if I defined the service in /etc/inted.conf as nowait it might help but either that is not how it's done or that just doesn't work that way.

I added this: (copied from another service in the file and adapted it)

tfodbc stream tcp nowait root /usr/local/tsobdc/tfodbc.sh start

It did not break the service, it still works fine. There is also /etc/services. can I add anything to that to define this program as a service and have it so that when it stops running it closes its ports? This is AIX 4.3

Thanks
# 2  
Old 09-24-2008
Well the closest I have come is decreasing the time AIX takes to close sockets in the FIN_WAIT_2 state. setting tcp_keepintvl to 30 seconds with
Code:
no -o tcp_keepintvl=30

is the best I can do for now I guess. According to IBM you cannot set it lower than 30 seconds. But that may be and probably is for the best. IBM seems to know what they're doing Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

30 tcp connections Established for a while and after a few minutes are close

Good morning, I need your help please After Restarting Aps or connection, these are connections tcp 0 0 10.80.1.26.57597 10.81.248.79.53008 ESTABLISHED tcp 0 47 10.80.1.26.57607 10.81.248.79.53008 ESTABLISHED tcp 0 0 ... (4 Replies)
Discussion started by: alexcol
4 Replies

2. IP Networking

Tcp ip port open but no such process (merged: Release A Port)

i want to kill a tcp connection by killing its pid with netstat -an i got the tcp ip connection on port 5914 but when i type ps -a or ps-e there is not such process running on port 5914 is it possible that because i do not log on with proper user account i can not see that process running? (30 Replies)
Discussion started by: alinamadchian
30 Replies

3. AIX

How to close a unix port

I have an issue with port 7331 on our Unix box that is hung, It is stuck in a listen status: ukh-o2-jcaps1:/tstjcaps6/apptest2> netstat -a|grep 7331 tcp4 1019 0 ukh-o2-jcaps1.7331 10.230.6.7.59010 CLOSE_WAIT tcp4 1019 0 ukh-o2-jcaps1.7331 10.230.6.7.59215 ... (7 Replies)
Discussion started by: mrn6430
7 Replies

4. Solaris

many tcp connection in close-wait

Hi, I use solaris Unix . I find there is some problem in application and it generate many "close-wait" tcp connect and stay in the server . it is generate by process id 7740 root@XX # netstat -an | grep CLOSE_WAIT | wc -l 285 root@XX # netstat -an | grep CLOSE_WAIT 10.158.35.4.34805 ... (2 Replies)
Discussion started by: abcdef
2 Replies

5. Programming

TCP trashing data on application close

I am using c to send data to a socket with the following commands: socket = socket(AF_INET, SOCK_STREAM, ptrp->p_proto); ioctl(socket, FIONBIO, (char *)&on); connect(socket) send(socket,data) shutdown(socket, SHUT_WR); recv(socket) //ready last of data waiting on the port //note this is... (3 Replies)
Discussion started by: metrix
3 Replies

6. Programming

Getting TCP Port status through C API

Does anyone know if there is a C API call to get the status of a TCP port? As opposed to running netstat and parsing the results. At the moment I have to attempt to bind() and pick up on the address in use error which isn't very elegant Thanks ---------- Post updated at 10:42 AM ----------... (0 Replies)
Discussion started by: janra
0 Replies

7. Shell Programming and Scripting

TCP port assignment

I have multiple processes running the same program on my linux machine. For each process I want to be able to use a unique (available) TCP port. I have thought of using netstat to check which ports are available for use however, the time-window between checking and selecting might expose some race... (1 Reply)
Discussion started by: timmylita
1 Replies

8. Programming

close existing tcp connection in C

Hello. I would like to know how to close an existing tcp socket. I have read some stuff and learned how to create a socket and then close it but have not found anything about how to close an existing tcp socket created by another application. The situation is this: I have an ODBC server running and... (6 Replies)
Discussion started by: raidzero
6 Replies

9. UNIX for Dummies Questions & Answers

restrict tcp-port access

Hi Is there any way to restrict the TCP-IP port usage. I want to restrict TCP-IP port 1500/1550 to the oracle osuser. Tanks in advance. Remi (2 Replies)
Discussion started by: remivisser
2 Replies

10. IP Networking

tcp problem with port

I am trying to connect via DBACCESS and Informix server to a server on a different computer. When I execute the connect command from dbaccess I get the following message, Exec format error cannot bind a name to the port. As far as I know the port is not being used by another client. How... (1 Reply)
Discussion started by: lopez
1 Replies
Login or Register to Ask a Question