From dc14b0628067e954e80c734af34cb7174642e332 Mon Sep 17 00:00:00 2001 From: Scott Walters Date: Fri, 28 May 2010 08:38:38 -0400 Subject: [PATCH] stale PID file detection -- previous patch cleanup and supress uninit warning --- sbin/spectre.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sbin/spectre.pl b/sbin/spectre.pl index 141eff668..a81abab1d 100755 --- a/sbin/spectre.pl +++ b/sbin/spectre.pl @@ -114,10 +114,9 @@ elsif ($daemon) { die "Spectre is already running.\n"; } elsif (-e $pidFileName){ - # oh, ffs ... die "pidFile $pidFileName already exists\n"; open my $pidFile, '<', $pidFileName or die "$pidFileName: $!"; (my $pid) = readline $pidFile; - chomp $pid; + chomp $pid if defined $pid; if(defined $pid and $pid =~ m/^(\d+)$/) { if(kill 0, $1) { die "$0: already running as PID $1";