From: Chris Prather Date: Sun, 8 Jul 2007 23:37:11 +0000 (+0000) Subject: add basedir attribute X-Git-Tag: 0.01~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=24a6a660ca5395d9250344164f7330e1e7709fef;p=gitmo%2FMooseX-Daemonize.git add basedir attribute --- diff --git a/lib/MooseX/Daemonize.pm b/lib/MooseX/Daemonize.pm index 6bdcadc..c02346f 100644 --- a/lib/MooseX/Daemonize.pm +++ b/lib/MooseX/Daemonize.pm @@ -22,6 +22,13 @@ has progname => ( }, ); +has basedir => ( + isa => 'Str', + is => 'ro', + lazy => 1, + default => sub { return '/' }, +); + has pidbase => ( isa => 'Str', is => 'ro', @@ -81,6 +88,9 @@ sub start { if (0); ## use critic + # Change to basedir + chdir $self->basedir; + $self->save_pid; $self->setup_signals; return $$;