Since the function that interests me is not an option with mod_fastcgi, and I cannot find a piece of code to wrap in Time :: Out to kill the process. I thought I would share my hacked decision.
I was looking for one linux command for this, but killall did not work (it would not specifically find the perl command that launched this server instance), and pkill also (could not indicate the age of the kill process).
So, I wrote a short perl script that runs as root to kill jobs with the correct name and age of the dancer mod_fastcgi server instances:
#!/usr/bin/perl -w use Proc::ProcessTable; $t = new Proc::ProcessTable( 'cache_ttys' => 1 ); foreach $p ( @{$t->table} ){ if ($p->cmndline =~ /perl.*dispatch.fcgi/) { my $run_time_min = $p->time/(1000000*60); if ($run_time_min >= 15) {
source share