r28840@alice-3: perigrin | 2007-09-11 04:45:00 -0500
more patches from dec
Revision history for MooseX-Daemonize
0.02 ???
+ - Fixed bug where sometimes the pidfile is writeable but pidbase is not -- reported by dec
+ - Fixed bug where the pidfile wasn't being updated properly -- reported by dec
+ - Added is_daemon attribute
+ - Added another fork to make sure we short circuit out of the daemonize process properly
- Switch to File::Pid
- Add the GetOpt prereq
- Adjust the kill timings
coerce => 1,
predicate => 'has_pidfile',
default => sub {
- die 'Cannot write to ' . $_[0]->pidbase unless -w $_[0]->pidbase;
my $file = $_[0]->pidbase . '/' . $_[0]->progname . '.pid';
+ die "Cannot write to $file" unless (-e $file ? -w $file : -w $_[0]->pidbase);
File::Pid->new( { file => $file } );
},
handles => {
If true, the process won't background. Useful for debugging. This option can be set via Getopt's -f.
+=item is_daemon Bool
+
+If true, the process is the backgrounded process. This is useful for example in an after 'start' => sub { } block
+
=back
=head1 METHODS
#!perl
-
-if (!require Test::Perl::Critic) {
+use Test::More;
+eval "require Test::Perl::Critic";
+if (! $@) {
Test::More::plan(
skip_all => "Test::Perl::Critic required for testing PBP compliance"
);