The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > AIX
Google UNIX.COM
Home Forums Register Rules & FAQ Members List Arcade Search Today's Posts Mark Forums Read


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


Other UNIX.COM Threads 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
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-22-2008
Registered User
 

Join Date: Apr 2008
Posts: 4
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
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,309
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
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: 916
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
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
Google UNIX.COM
Reply



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB 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 -7. The time now is 06:40 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

Search Engine Optimization by vBSEO 3.1.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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102