removed signal handling, cause it was not very useful, and then made WithPidFile...
[gitmo/MooseX-Daemonize.git] / lib / MooseX / Daemonize / WithPidFile.pm
index b5aa510..7bc0de8 100644 (file)
@@ -6,6 +6,8 @@ use MooseX::Daemonize::Pid::File;
 
 our $VERSION = 0.01;
 
+with 'MooseX::Daemonize::Core';
+
 requires 'init_pidfile';
 
 has pidfile => (
@@ -18,6 +20,14 @@ has pidfile => (
     builder   => 'init_pidfile',
 );
 
+after 'daemonize' => sub {
+    # NOTE:
+    # make sure that we do not have 
+    # any bad PID values stashed around
+    # - SL
+    (shift)->pidfile->clear_pid
+};
+
 1;
 
 __END__