Apache-Watchdog-RunAway

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


ported to mod_perl2

open the safehang.log file only when it's used for the first time, so
if someone loads the module before setting
$Apache::Watchdog::RunAway::LOG_FILE the user value will take an
effect

added a basic test suite

untaint proc id used in stop_monitor (now runs under -T)



=item 0.3 - Wed Feb 20 14:09:32 SGT 2002

rewrite debug and error handling code, so one can actually benefit
from debug levels



RunAway.pm  view on Meta::CPAN



# returns the PID if lockfile exists or 0
################
sub get_proc_pid {

    my $fh = Symbol::gensym();
    open $fh, $Apache::Watchdog::RunAway::LOCK_FILE
        or die "Cannot open $Apache::Watchdog::RunAway::LOCK_FILE: $!";
    chomp (my $pid = <$fh>);
    # untaint
    $pid = $pid =~ /^(\d+)$/ ? $1 : 0;
    close $fh;

    return $pid;
}


# create the lockfile and put the PID inside
##############
sub lock {



( run in 0.481 second using v1.01-cache-2.11-cpan-4e96b696675 )