homepage Welcome to WebmasterWorld Guest from 54.196.57.4
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Website
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
script to kill long processes not working
starchild




msg:4513612
 3:34 am on Oct 30, 2012 (gmt 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?

 

starchild




msg:4513615
 3:44 am on Oct 30, 2012 (gmt 0)

...am wondering - should it somehow be kill -9 instead?

phranque




msg:4513698
 9:46 am on Oct 30, 2012 (gmt 0)

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)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved