App-Milter-Limit

 view release on metacpan or  search on metacpan

lib/App/Milter/Limit/PidFile.pm  view on Meta::CPAN

    my $class = shift;

    my $conf = App::Milter::Limit::Config->global;

    App::Milter::Limit::Util::make_path($$conf{state_dir});

    $Pid = Proc::PID::File->new;

    $Pid->file(dir => $$conf{state_dir});

    if ($Pid->alive) {
        $Pid = undef;
        return 1;
    }

    $Pid->touch;

    # chown the file so we can unlink it
    chown $$conf{user}, $$conf{group}, $Pid->{path};

    return 0;



( run in 0.660 second using v1.01-cache-2.11-cpan-df04353d9ac )