Command to release a port in AIX


 
Thread Tools Search this Thread
Operating Systems AIX Command to release a port in AIX
# 1  
Old 04-22-2008
Command to release a port in AIX

Hi All,

I wanna know the command to release a particualr port in AIX machine without rebooting it.

Code:
# netstat -a | grep 7100
tcp4       0      0  loopback.7100      *.*                    LISTEN
#

In the above example, how to release the port 7100

Thanks in advance.

-Hemanshu

Last edited by Yogesh Sawant; 04-23-2008 at 01:42 AM.. Reason: added code tags
# 2  
Old 04-22-2008
need a command for AIX 4.3.3. The rmsock works only for AIX 5L. Please let me know if there is any command to release a port in AIX 4.3.3
# 3  
Old 04-22-2008
There would be a process that is listening on that port. Stopping that would be the first order of business.

It might also be that inetd is listening on that port and will fire up a process as specified in /etc/inetd.conf (does the name stay the same in AIX?).
In that case, find what process it is (usually from /etc/services - again confirm the name for AIX), then hash out the line referring to that process from /etc/inetd.conf. Send SIGHUP to inetd. That should do it.

If there isn't a process listening at all - or rather, there was a process, but it was killed or stopped uncleanly and didn't release the port, then just give it a few minutes. Connections to the port will drop once they timeout.
# 4  
Old 05-06-2008
This is a customized application running on AIX, using this port and this is specified in /etc/services. When ever the application starts it looks into /etc/services uses the specified port to come into service, unfortunately due to some bug, the application hangs and few of its processes goes into exiting state:

# ps -eaf | grep -i exiting
root 10996 53590 1 10:46:01 pts/1 0:00 grep -i exiting
- 12472 - - - <exiting>
- 22580 - - - <exiting>
- 23476 - - - <exiting>
#

After this the port get stuck and when I restart the application, it fails to start saying that the port is in use. So I have to edit the /etc/services file and change the port to another one.

Since the application get hang then and there, now on the system there are lots of port which are stuck.

Also ports are not getting cleared up by itself, even after the timeout. It remains in LISTEN mode for ever, unless the system is rebooted.


I beleive if there is a way to clear up the exitung processes without rebooting the system, then it will clear up the system.

Is there anyway to kill the exiting processes ???
# 5  
Old 05-06-2008
blowtorch is correct (by the way: yes, the filenames are correct for AIX too, regardless of the version). The problem is not a problem of the port, but a problem of the application. You will probably be able to remedy the problem by applying a healthy dose of "kill -9" onto the processes of your application.

Do something like the following:

Code:
ps -fe | grep exiting | while read junk PID junk ; do
     kill -9 $PID
done

I hope this helps.

bakunin
# 6  
Old 05-06-2008
Here is some more details of the application. This application uses OpenSSH, to ftp files. When there are sftp failures, the sftp processes are becoming defunct. All the sftp are actually threads fork by the application. On investigation it is notice that some of the sftp processes which are defunct and the ssh process which is used by the application itself is going to exiting state. This doesnt happens immediately, after sftp failure, defunct processes are getting generated and also sometimes it gets cleared by itself, once it gets timed out. But after a long period say a 2 or 3 weeks, with many sftp failures in past, the processes goes to exiting state.

We are not able to kill -9 the exiting processes, it is not accepting any signals. Till now only way to clear them is to reboot the AIX box.

We are working on the remedy, but unable to understand how the processes are going to exiting state.

Has someone faced this issue where processes goes to exiting state, if yes how do we handle this situation ???
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to release port on AIX?

Hello all, I need your help with any command to release a port on AIX. Thanks for all. (5 Replies)
Discussion started by: Mcipamo
5 Replies

2. UNIX for Advanced & Expert Users

Help with AIX port limit

Hi guys, I have a problem need to solve urgently, please help me, any suggestion will be great. When my workmates installed a control-m agent in an AIX 6.1 OS, they got an error below: Port exceeded maximum allowed value. No available port found in the specified range up to 65535. ... (2 Replies)
Discussion started by: Lucas_0418
2 Replies

3. 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

4. AIX

Blocking/starting a Port in AIX 6.1

Hello Team, We are having weblogic which running on AIX 6.1 Lpar machine. We not enabled any firewall(IPSEC) in AIX level. Our weblogic is running on cluster.Whenever we stop/restart the cluster we would like to stop/start the port(by using command) which used by the weblogic. Please... (2 Replies)
Discussion started by: gowthamakanthan
2 Replies

5. AIX

How to find what process is using a port in AIX 5L and above.

There have been a lot of threads about how to find processes that are using a specific port on an AIX server. After long hours of research and reading countless "you can't do that" responses, I finally found the answer. YES IT CAN BE DONE! YES ITS EASY. NO, I DON'T KNOW WHY NO ONE GETS THIS... (2 Replies)
Discussion started by: troym72
2 Replies

6. AIX

Who's using my port in AIX

Hello Gurus, I was trying to find who's using my port and got below answer from a IBM website. But the problem with the below answer is I need a root to run the rmsock, is there any other alternative to find out who is using my port with out a root access?? 1. netstat -Aan | grep <port... (1 Reply)
Discussion started by: tenderfoot
1 Replies

7. AIX

Serial port in AIX

Hi, How can i configure my modem in AIX thru serial port (sa0-->tty0) I have two port serial card configured as sa0 I created tty1 which port is tty0 and which port is tty1 how can i know?? (1 Reply)
Discussion started by: pchangba
1 Replies

8. UNIX for Dummies Questions & Answers

release a port

I'm trying to release a port 7601 I do a netstat -an which is returns *.7601 *.* 0 0 49152 0 LISTEN I assume 49152 is the process running the port. Is this correct? If so, how would I safely terminate the process? thanks (2 Replies)
Discussion started by: orahi001
2 Replies

9. AIX

How to open a port in AIX

Hi Guys, i am trying to open a port in AIX. but i am not able to get the command for this. AIX is not having the iptables file present. So please any body can tell me how to open a port in AIX... Thanks sanju (2 Replies)
Discussion started by: sanju_d1231
2 Replies

10. Shell Programming and Scripting

Release a port

Hi all, Its a gr8 pleasure being a member of this forum. Could anyone help me out re: How u release a port in Unix. Thanks in advance..! aces4u (2 Replies)
Discussion started by: aces4u
2 Replies
Login or Register to Ask a Question