The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to Kill a Process bennichan SUN Solaris 5 03-23-2008 11:14 PM
kill(0,-9) don't kill the process umen High Level Programming 9 06-19-2007 03:09 AM
how to start a process and make it sleep for 5 mins and then kill that process shrao Shell Programming and Scripting 6 03-27-2007 09:54 AM
Process KILL rkrgarlapati Shell Programming and Scripting 2 09-22-2006 02:07 AM
When kill doesnt work, how to kill a process ? VijayHegde UNIX for Advanced & Expert Users 3 05-12-2006 01:24 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 04-03-2006
Registered User
 

Join Date: Apr 2006
Location: Bangalore
Posts: 1
Post How ti kill a process which is consuming so much time

There is a process which is consuming too much time.. how to find that process and kill it.
Reply With Quote
Forum Sponsor
  #2  
Old 04-04-2006
Registered User
 

Join Date: Dec 2005
Location: Pune
Posts: 78
use ps -ef|grep program_name to get the pid of process.
then use kill command.

syntax is
kill pid1 pid2 ....
Reply With Quote
  #3  
Old 04-04-2006
Registered User
 

Join Date: Feb 2006
Posts: 25
for i in `ps -eaf | grep "programname" | tr -s " " | cut -f2 -d " "`
do
kill -9 ${i}
done


ps -eaf | grep "programname" | tr -s " " | cut -f2 -d " " --- This should return all process ids.
Reply With Quote
  #4  
Old 04-04-2006
Registered User
 

Join Date: Mar 2006
Posts: 106
here...

First, make sure that process does consume too much of CPU by using “top” command. Second, make sure (as far as it is possible) that process is independent; it means that it has no parent process that will relaunch it again by “pstree” command or by following the parent process from “ps –ef” or “ps –aux” (depending on UNIX clone).
As you decided to kill process try first not to use “-9” because much of junk will remain in memory and it may make “zombie” from other processes that may depend on this one. Better use SIGSTOP signal. In Linux SIGSTOP is number 19 so “kill -19 PID”, you can check what it is in your system by “kill –l” command , it will print the complete list of signals your UNIX can handle. With SIGSTOP, the process will stop gracefully as system has requested it to be stopped. You can use “-9” in a case the process is broken, its structures are corrupted and it does not response to the signals. “-9” option will remove process brutally with no concerns of data it possibly may have in memory or child processes it may have. Take “UNIX Essentials and UNIX Core” DVD if you have questions like that.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:27 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