The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > AIX
Google UNIX.COM


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
required command to know the port no. Amit_kolurwar SUN Solaris 1 04-23-2008 12:05 AM
Command to know port no manoj.solaris SUN Solaris 6 08-03-2007 07:49 PM
mailing with attachments in mail command in HP-UX Release 11i rosh0623 UNIX for Advanced & Expert Users 1 08-30-2005 12:30 PM
How to set baude rate of Serial port using setserial or other command zaheer031 UNIX for Advanced & Expert Users 1 09-29-2004 08:20 AM
Release a port aces4u Shell Programming and Scripting 2 08-22-2003 03:47 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-22-2008
Registered User
 

Join Date: Apr 2008
Posts: 4
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-22-2008 at 09:42 PM. Reason: added code tags
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-22-2008
Registered User
 

Join Date: Apr 2008
Posts: 4
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
Reply With Quote
  #3 (permalink)  
Old 04-22-2008
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,322
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.
Reply With Quote
  #4 (permalink)  
Old 05-05-2008
Registered User
 

Join Date: Apr 2008
Posts: 4
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 ???
Reply With Quote
  #5 (permalink)  
Old 05-06-2008
Bughunter Extraordinaire
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,021
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
Reply With Quote
  #6 (permalink)  
Old 05-06-2008
Registered User
 

Join Date: Apr 2008
Posts: 4
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 ???
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:29 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0