X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FDaemonize.pm;h=a59f794c0fc38365d668068a24cd16dae57d8c46;hb=e7a196e7340f91f13006a6af6873d105dbc187d4;hp=2a12ce8cde94cd85b665f6522df4cfcf792ad097;hpb=cbff8e5216c7e752ed8f2e64e0f200e1d3c9c718;p=gitmo%2FMooseX-Daemonize.git diff --git a/lib/MooseX/Daemonize.pm b/lib/MooseX/Daemonize.pm index 2a12ce8..a59f794 100644 --- a/lib/MooseX/Daemonize.pm +++ b/lib/MooseX/Daemonize.pm @@ -50,8 +50,8 @@ has pidfile => ( 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 => { @@ -226,6 +226,10 @@ The file we store our PID in, defaults to /var/run/$progname/ 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