Merge pull request #27 from karenetheridge/topic/init_config_perlbrew

Better init file generation - Thanks =)
This commit is contained in:
SymKat 2012-09-03 12:10:56 -07:00
commit c3115593a1
2 changed files with 8 additions and 4 deletions

View file

@ -8,5 +8,6 @@ license 'perl';
# Specific dependencies
requires 'File::Spec' => '0';
requires 'POSIX' => '0';
requires 'Cwd' => '0';
WriteAll;

View file

@ -4,6 +4,7 @@ use strict;
use warnings;
use POSIX qw(_exit setsid setuid setgid getuid getgid);
use File::Spec;
use Cwd 'abs_path';
require 5.008001; # Supporting 5.8.1+
our $VERSION = '0.000009'; # 0.0.9
@ -379,7 +380,7 @@ sub dump_init_script {
REQUIRED_STOP => $self->lsb_stop ? $self->lsb_stop : "",
SHORT_DESCRIPTION => $self->lsb_sdesc ? $self->lsb_sdesc : "",
DESCRIPTION => $self->lsb_desc ? $self->lsb_desc : "",
SCRIPT => $self->path ? $self->path : $0,
SCRIPT => $self->path ? $self->path : abs_path($0),
INIT_SOURCE_FILE => $init_source_file,
}
));
@ -576,8 +577,7 @@ If provided, chdir to this directory before execution.
The path of the script you are using Daemon::Control in. This will be used in
the LSB file genration to point it to the location of the script. If this is
not provided $0 will be used, which is likely to work only if you use the full
path to execute it when asking for the init script.
not provided, the absolute path of $0 will be used.
=head2 init_config
@ -587,6 +587,9 @@ a PERL5LIB and such things.
$daemon->init_config( "/etc/default/my_program" );
If you are using perlbrew, you probably want to set your init_config to
C<$ENV{PERLBREW_ROOT} . '/etc/bashrc'>.
=head2 redirect_before_fork
By default this is set true. STDOUT will be redirected to stdout_file,
@ -770,4 +773,4 @@ This library is free software and may be distributed under the same terms as per
=head2 AVAILABILITY
The most current version of Daemon::Control can be found at L<https://github.com/symkat/Daemon-Control>
The most current version of Daemon::Control can be found at L<https://github.com/symkat/Daemon-Control>