Only check pidfile if it exists.
This commit is contained in:
parent
9330b05af8
commit
c317f9575a
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user