* Fixed an issue with the inital PID being invalid.
    * Added directory accessor to support chdir before exec.
    * Minor documentation changes
This commit is contained in:
SymKat 2012-02-19 01:21:33 -05:00
parent 5774fa1504
commit ccda8486d0
4 changed files with 25 additions and 7 deletions

View file

@ -1,3 +1,8 @@
0.0.5 2012-18-12 SymKat <symkat@symkat.com>
* Fixed an issue with the inital PID being invalid.
* Added directory accessor to support chdir before exec.
* Minor documentation changes
0.0.4 2012-18-12 SymKat <symkat@symkat.com>
* First release to cpan.
* Refactoring and review by Matt S. Trout

2
MANIFEST.SKIP Normal file
View file

@ -0,0 +1,2 @@
README.md
.git

View file

@ -49,9 +49,9 @@ You can also make an LSB compatable init script:
/home/symkat/etc/init.d/program get_init_file > /etc/init.d/program
# CONSTRUCTURE
# CONSTRUCTOR
The constucture takes the following arguments.
The constuctor takes the following arguments.
## name
@ -97,6 +97,10 @@ as root. This takes the numerical GID ( grep group /etc/groups )
$daemon->gid( 1001 );
## directory
If provided, chdir to this directory before execution.
## path
The path of the script you are using Daemon::Control in. This will be used in
@ -270,7 +274,7 @@ SymKat _<symkat@symkat.com>_ ( Blog: [http://symkat.com/](http://symkat.com/) )
## CONTRIBUTORS
Matt S. Trout (mst) _<mst@mst@shadowcat.co.uk>_
Matt S. Trout (mst) _<mst@shadowcat.co.uk>_
# COPYRIGHT

View file

@ -5,11 +5,11 @@ use warnings;
use POSIX qw(_exit setsid setuid setgid getuid getgid);
use File::Spec;
our $VERSION = '0.000004'; # 0.0.4
our $VERSION = '0.000005'; # 0.0.5
$VERSION = eval $VERSION;
my @accessors = qw(
pid color_map name program program_args
pid color_map name program program_args directory
uid path gid scan_name stdout_file stderr_file pid_file fork data
lsb_start lsb_stop lsb_sdesc lsb_desc redirect_before_fork
);
@ -113,6 +113,9 @@ sub _fork {
sub _launch_program {
my ($self) = @_;
chdir( $self->directory ) if $self->directory;
if ( ref $self->program eq 'CODE' ) {
$self->program->( $self, @{$self->program_args || []} );
} else {
@ -397,9 +400,9 @@ You can also make an LSB compatable init script:
/home/symkat/etc/init.d/program get_init_file > /etc/init.d/program
=head1 CONSTRUCTURE
=head1 CONSTRUCTOR
The constucture takes the following arguments.
The constuctor takes the following arguments.
=head2 name
@ -445,6 +448,10 @@ as root. This takes the numerical GID ( grep group /etc/groups )
$daemon->gid( 1001 );
=head2 directory
If provided, chdir to this directory before execution.
=head2 path
The path of the script you are using Daemon::Control in. This will be used in