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! :slight_smile: Add to your normal webmin startup routines and enjoy. :wink: 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