Author |
Message |
CypherJF I gargle nitroglycerin
Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Thu Jan 31, 2008 9:16 pm Post subject: UNIX script |
|
|
|
|
Does anyone know the best way of having CentOS parse the current process list for a specific process name and determine if the CPU usage has been above a specific threshold for X amount of time? If it does, kill it and re-execute the process?
Thoughts would be appreciated. _________________ Performance is often the art of cheating carefully. - James Gosling |
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Fri Feb 01, 2008 8:33 am Post subject: |
|
|
|
|
I seem to recall an /etc/limits or limit.conf that does that as part of the OS. You can set various thresholds and it'll kill processes if they exceed them.
I had to do that to prevent my friend from hacking in and fork bombing to crash my server. You'd be surprised how much better your security gets when you've got someone telling you how they exploited it. _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me |
|
Back to top |
|
|
phong Seasoned Helper
Gender: Joined: Jul 19 2005 Posts: 154 Offline
|
Posted: Sat Feb 16, 2008 7:57 pm Post subject: |
|
|
|
|
/etc/security/limits.conf |
|
Back to top |
|
|
|