$ENV{MX_DAEMON_STDOUT} = catfile($CWD, 'Out.txt');
$ENV{MX_DAEMON_STDERR} = catfile($CWD, 'Err.txt');
+unlink $PIDFILE; # clean up anythinf leftover by last run
+
{
package MyFooDaemon;
use Moose;
},
terminate => sub {
my ($kernel, $heap) = @_[KERNEL, HEAP];
+ $self->pidfile->remove if $self->pidfile->pid == $$;
}
},
heap => [ 0 ]