![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
There is a process which is consuming too much time.. how to find that process and kill it.
|
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
use ps -ef|grep program_name to get the pid of process.
then use kill command. syntax is kill pid1 pid2 .... |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
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. |
|||
| Google The UNIX and Linux Forums |