Make sendmail executable location be configurable
[girocco.git] / toolbox / kill-stale-daemons.pl
blob030b10649353609f076c368c151f5ab86bbe7295
1 #!/usr/bin/perl
3 use strict;
4 use warnings;
5 use lib @basedir@;
7 use Girocco::Config;
8 use Proc::ProcessTable;
10 use Data::Dumper;
12 my $week_ago = time-60*60*24*7;
13 my $t = new Proc::ProcessTable;
15 my $reporoot = $Girocco::Config::reporoot;
16 foreach my $p ( @{$t->table} ) {
17 if ($p->start() < $week_ago &&
18 ($p->cmndline() =~ /git-daemon --inetd --verbose --enable=upload-archive --base-path=\Q$reporoot\E --export-all/o ||
19 $p->cmndline() =~ /git upload-pack --strict --timeout=0 \./)) {
20 print Dumper $p if $ENV{'PERL_DEBUG'};
21 kill 9, $p->pid;