X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FDaemonize.pm;h=07a0d9affa0463ebae75502a464172c90f6caa6f;hb=8057fbc4bb13a7aa225ea915523f58b8c2e96de8;hp=5c627bac6eb8670831adf583d419d09a02b964ef;hpb=05b96f4d04d93f2344602f7b3ef43da01c0a2794;p=gitmo%2FMooseX-Daemonize.git diff --git a/lib/MooseX/Daemonize.pm b/lib/MooseX/Daemonize.pm index 5c627ba..07a0d9a 100644 --- a/lib/MooseX/Daemonize.pm +++ b/lib/MooseX/Daemonize.pm @@ -3,7 +3,7 @@ use strict; # because Kwalitee is pedantic use Moose::Role; use MooseX::Types::Path::Class; -our $VERSION = '0.13'; +our $VERSION = '0.14'; with 'MooseX::Daemonize::WithPidFile', 'MooseX::Getopt'; @@ -257,7 +257,7 @@ $_kill = sub { # Try SIGINT ... 2s ... SIGTERM ... 2s ... SIGKILL ... 3s ... UNDEAD! my $terminating_signal; - for ( [ 2, $timeout ], [15, $timeout], [9, $timeout * 1.5] ) { + for ( [ 'INT', $timeout ], ['TERM', $timeout], ['KILL', $timeout * 1.5] ) { my ($signal, $timeout) = @$_; $timeout = int $timeout; @@ -276,9 +276,9 @@ $_kill = sub { } if($terminating_signal) { - if($terminating_signal == 9) { - # clean up the pidfile ourselves iff we used -9 and it worked - warn "Had to resort to 'kill -9' and it worked, wiping pidfile"; + if($terminating_signal eq 'KILL') { + # clean up the pidfile ourselves iff we used KILL and it worked + warn "Had to resort to 'kill -KILL' and it worked, wiping pidfile"; eval { $self->pidfile->remove }; if ($@) { warn "Could not remove pidfile ("