Revision history for MooseX-Daemonize
+0.14 Thursday April 19, 2012
+ - using signal numbers directly is
+ not portable; use the names instead
+ since perl's kill() supports them
+
0.13 Wed. July 6, 2011
- adding docs related to closing all
filehandles and the issues that can
use Moose::Role;
use MooseX::Types::Path::Class;
-our $VERSION = '0.13';
+our $VERSION = '0.14';
with 'MooseX::Daemonize::WithPidFile',
'MooseX::Getopt';
# 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;
}
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 ("