From: Stevan Little Date: Mon, 3 Dec 2007 02:22:09 +0000 (+0000) Subject: withpidfile should write its pidfile :) X-Git-Tag: 0_06~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1ddf8f0c69173810a2e8d9e8dff9d43e97768c0f;p=gitmo%2FMooseX-Daemonize.git withpidfile should write its pidfile :) --- diff --git a/lib/MooseX/Daemonize/WithPidFile.pm b/lib/MooseX/Daemonize/WithPidFile.pm index 7bc0de8..1e17a13 100644 --- a/lib/MooseX/Daemonize/WithPidFile.pm +++ b/lib/MooseX/Daemonize/WithPidFile.pm @@ -21,11 +21,13 @@ has pidfile => ( ); after 'daemonize' => sub { + my $self = shift; # NOTE: # make sure that we do not have # any bad PID values stashed around # - SL - (shift)->pidfile->clear_pid + $self->pidfile->clear_pid; + $self->pidfile->write if $self->is_daemon; }; 1; diff --git a/t/30.with_pid_file.t b/t/30.with_pid_file.t index 61414a7..e26d142 100644 --- a/t/30.with_pid_file.t +++ b/t/30.with_pid_file.t @@ -41,8 +41,6 @@ $ENV{MX_DAEMON_STDERR} = catfile($CWD, 'Err.txt'); $self->daemonize; return unless $self->is_daemon; - $self->pidfile->write; - # make it easy to find with ps $0 = 'test-app'; $SIG{INT} = sub {