Suggestion re: fcgiclear.pl and other cron'ed jobs

1 post / 0 new
#1 Tue, 11/13/2007 - 03:52
TonyShadwick

Suggestion re: fcgiclear.pl and other cron'ed jobs

I have a thought for you:

Before: [code:1]

!/usr/bin/perl Delete any orphan php*-cgi processes

package virtual_server; $main::no_acl_check++; require './virtual-server-lib.pl'; &cleanup_php_cgi_processes(); [/code:1]

After: [code:1]

!/usr/bin/env perl Delete any orphan php*-cgi processes

use strict; use Proc::«»Daemon;

package virtual_server; $main::no_acl_check++; require './virtual-server-lib.pl';

Proc::Daemon::Init;

while(1){ &cleanup_php_cgi_processes(); sleep(1); # However often you want to cleanup_php_cgi_processes() } [/code:1]

Look ma, no cron! :) Add to your normal webmin startup routines and enjoy. ;) Extra credit would be to create a pid file in /var/run to start and stop this as you see fit. This way you're not shoving things into root's crontab by default. Again, just a thought. :)<br><br>Post edited by: TonyShadwick, at: 2007/11/13 03:54