Welcome to WebmasterWorld Guest from 23.20.162.200

Forum Moderators: bakedjake

Message Too Old, No Replies

script to kill long processes not working

     
3:34 am on Oct 30, 2012 (gmt 0)

New User

10+ Year Member

joined:May 26, 2005
posts: 35
votes: 0


We have the problem of a few php files that occaisionally just wont die , for whatever reason.

We have tried everything to isolate the issue, but with no success.

We came across the following perl script which we are running as a cron, but sometimes it still doesn't kill the pid's.



ps -lef | grep "nobody" | grep httpd | perl -ane '($h,$m,$s) = split /:/,$F[13]; kill + 9, $F[3] if ($m > 2);'




Our server runs on centos 5.7 "nobody" is how we define apache process users.

Bascially, the script should be killing anything that is > 2 minutes old.

Help please?
3:44 am on Oct 30, 2012 (gmt 0)

New User

10+ Year Member

joined:May 26, 2005
posts: 35
votes: 0


...am wondering - should it somehow be kill -9 instead?
9:46 am on Oct 30, 2012 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:11082
votes: 106


i'm not sure what a "kill + 9," does but you should try either "kill -9" or perhaps "kill -s 9" or "kill -s SIGKILL"
(not sure what works on centos)
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members