The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > 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 08: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 07:10 PM
Killing specific process benefactr Shell Programming and Scripting 6 10-25-2007 12:23 PM
killing a process bbhayana UNIX for Dummies Questions & Answers 6 06-02-2007 07:58 AM
killing a process pid jo calamine UNIX for Advanced & Expert Users 16 12-04-2006 07:43 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-03-2007
shanshine shanshine is offline
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
  #2 (permalink)  
Old 12-03-2007
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 922
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)
  #3 (permalink)  
Old 12-04-2007
shanshine shanshine is offline
Registered User
  
 

Join Date: May 2007
Posts: 16
can i get lsof manual entry and patch
  #4 (permalink)  
Old 12-04-2007
jlliagre jlliagre is offline Forum Advisor  
ɹǝsn sıɹɐlosuǝdo
  
 

Join Date: Dec 2007
Location: Paris
Posts: 1,396
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"
  #5 (permalink)  
Old 12-04-2007
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 922
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.
  #6 (permalink)  
Old 12-05-2007
jlliagre jlliagre is offline Forum Advisor  
ɹǝsn sıɹɐlosuǝdo
  
 

Join Date: Dec 2007
Location: Paris
Posts: 1,396
I believe pfiles is suspending the target process for a short period of time. Isn't lsof doing the same ?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:05 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0