From 14d249d3f03d65f57e09c2b7489c0bbc589221f6 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 13bbd8954..ad3cf8d20 100755 --- a/sbin/spectre.pl +++ b/sbin/spectre.pl @@ -105,10 +105,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";