The UNIX and Linux Forums  

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


SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
killing the process arthi UNIX for Dummies Questions & Answers 3 06-03-2008 05:57 AM
Killing of a process and send a mail if the process doesnot come up within 2 minutes Prince89 Shell Programming and Scripting 1 02-15-2008 04:10 PM
Killing specific process benefactr Shell Programming and Scripting 6 10-25-2007 09:23 AM
killing a process bbhayana UNIX for Dummies Questions & Answers 6 06-02-2007 04:58 AM
killing a process pid jo calamine UNIX for Advanced & Expert Users 16 12-04-2006 04:43 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 12-02-2007
Registered User
 

Join Date: May 2007
Posts: 16
Reg process of killing

Dear All,

I have one doubt - when u use netstat -na | grep 8080 to know the status of 8080 ports.when it is listed someone is accessing the 8080 ports
like this
*.8080 *.* 0 0 64000 0 LISTEN
172.19.69.39.8080 172.19.50.20.1929 65535 0 64260 0 ESTABLISHED

Please can anyone say how to kill the process of that particular ip who is accessing 8080 ports.

Appreciate if anyone helps me.

Regards,
Shanmuga
Reply With Quote
Forum Sponsor
  #2  
Old 12-03-2007
Smiling Dragon's Avatar
Disorganised User
 
Join Date: Nov 2007
Location: New Zealand
Posts: 734
netstat won't show you which processes have those connections open but lsof does.
The commandline you'll probably want is
Code:
for pid in `lsof -i:8080 | grep '(ESTABLISHED)' | awk '{ print $2 }'` ; do kill $pid
Test it first though - wouldn't want to accidentally send a SIGTERM to the listening daemon

lsof -i:8080 on it's own should be very informative too

[edit]Oh, you want to target a given IP... I missed that bit on the first run through.
For a particular IP, replace the '(ESTABLISHED)' bit with '->172.19.50.20' (for example)
Reply With Quote
  #3  
Old 12-03-2007
Registered User
 

Join Date: May 2007
Posts: 16
can i get lsof manual entry and patch
Reply With Quote
  #4  
Old 12-03-2007
Registered User
 

Join Date: Dec 2007
Location: Paris
Posts: 489
lsof isn't part of Solaris. You need to download it from freeware repositories or recompile it from the source.

Alternatively, you can use pfiles to figure out which process is using this port, eg:

Code:
pfiles `ptree | awk '{print $1}'` | egrep '^[0-9]|port:' | grep -v "AF_INET6"
Reply With Quote
  #5  
Old 12-04-2007
Smiling Dragon's Avatar
Disorganised User
 
Join Date: Nov 2007
Location: New Zealand
Posts: 734
Quote:
Originally Posted by jlliagre View Post
Alternatively, you can use pfiles to figure out which process is using this port
pfiles can sometimes be a little hard on the system, I've seen it impact performance considerably. Might be better on later versions of solaris but it was pretty nasty on 8.
Reply With Quote
  #6  
Old 12-05-2007
Registered User
 

Join Date: Dec 2007
Location: Paris
Posts: 489
I believe pfiles is suspending the target process for a short period of time. Isn't lsof doing the same ?
Reply With Quote
  #7  
Old 12-05-2007
Smiling Dragon's Avatar
Disorganised User
 
Join Date: Nov 2007
Location: New Zealand
Posts: 734
Quote:
Originally Posted by jlliagre View Post
I believe pfiles is suspending the target process for a short period of time. Isn't lsof doing the same ?
If you get the solaris optimized version of it, it seems to be ok - purely anecdotal evidence from my using it of course so take with a grain of salt.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:26 AM.


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

Content Relevant URLs by vBSEO 3.2.0