![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| When kill doesnt work, how to kill a process ? | VijayHegde | UNIX for Advanced & Expert Users | 3 | 05-12-2006 05:24 PM |
| Automatic Kill -help | lancemendioro | UNIX for Dummies Questions & Answers | 5 | 07-03-2005 11:29 AM |
| Script to kill process | Lestat | Shell Programming and Scripting | 5 | 06-15-2005 01:09 PM |
| Script to kill all child process for a given PID | sanjay92 | UNIX for Dummies Questions & Answers | 4 | 03-21-2002 03:28 PM |
| Script to kill stranded/orphan process by users. | rjohnson | Shell Programming and Scripting | 4 | 03-07-2002 10:37 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
[REQ] Automatic script kill process
HI,
I'm using CentOS 5.1 x86_64, CPanel .. a lot of my users used too much resource, i want to write a script to kill all of them. Eg: LFD always notify me: Time: Sun Apr 27 07:40:08 2008 Account: xxxx (my user) Resource: Virtual Memory Size Exceeded: 110 > 100 (MB) Executable: /usr/bin/php Command Line: php /home/xxxx/public_html/import.php PID: 20897 Killed: No or . Time: Sat Apr 26 18:40:50 2008 Account: xxxx (my user) Resource: Process Time Exceeded: 7305 > 1800 (seconds) Executable: /usr/bin/php Command Line: /usr/bin/php /home/xxxx/public_html/index.php PID: 27308 Killed: No Now, can you help me ?? |
|
||||
|
Sorry, i'm not good at English.
I found out the option of csf (ConfigServer Security & Firewall) to kill all process over 180 seconds and over 100Mb RAM resource. And now, i want you help me write a script kill all mySQL process over 15 seconds anyone can help me ? I'm using CentOS 5.1 and Cpanel |
|
||||
|
killall mysql
Well, if you want to kill everything from a specific daemon then i guess you could use this
PID=`ps -ef |grep mysql |grep -v grep | awk '{print $2}'` for i in $PID; do echo "killing MySQL process with PID = $i"; kill -9 $i; done bare in mind that this will also kill the MySQL daemon...Therefore better used as a stop script. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|