Only check pidfile if it exists.

This commit is contained in:
Chris 2014-02-03 19:50:55 +00:00
parent 9330b05af8
commit c317f9575a

View File

@ -163,8 +163,11 @@ sub detach {
sub running { sub running {
my $self = shift; my $self = shift;
my $pid = eval { read_pid($self -> {"pidfile"}) }; my $pid;
print $@ if($@); if(-f $self -> {"pidfile"}) {
eval { $pid = read_pid($self -> {"pidfile"}) };
print $@ if($@);
}
return 0 if(!$pid); return 0 if(!$pid);
my $signalled = kill 0,$pid; my $signalled = kill 0,$pid;