@@ -1,3 +1,8 @@
+0.001006 2014-06-24 SymKat <symkat@symkat.com>
+ * Allow custom reload/stop signals (hemmop)
+ * Documentation cleanup (ilmari, rwstauner)
+ * Module name POD format fixed (RT 93280)
+
0.001005 2014-02-19 SymKat <symkat@symkat.com>
* Constructor now accepts a list as well as a hashref
* New method added: run_command, allows multiple instances of D::C
@@ -4,12 +4,12 @@ author:
- '=over 4'
build_requires:
ExtUtils::MakeMaker: 6.59
- Test::More: 0.88
+ Test::More: '0.88'
configure_requires:
ExtUtils::MakeMaker: 6.59
distribution_type: module
dynamic_config: 1
-generated_by: 'Module::Install version 1.06'
+generated_by: 'Module::Install version 1.08'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -21,11 +21,11 @@ no_index:
- t
requires:
Cwd: 0
- File::Path: 2.08
+ File::Path: '2.08'
File::Spec: 0
POSIX: 0
perl: 5.8.1
resources:
license: http://dev.perl.org/licenses/
repository: git://github.com/symkat/Daemon-Control.git
-version: 0.001005
+version: '0.001006'
@@ -4,7 +4,7 @@ package Module::Install::Base;
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.08';
}
# Suspend handler for "redefined" warnings
@@ -8,7 +8,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.08';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.08';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.08';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.08';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.08';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.08';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
@@ -31,7 +31,7 @@ BEGIN {
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
- $VERSION = '1.06';
+ $VERSION = '1.08';
# Storage for the pseudo-singleton
$MAIN = undef;
@@ -8,7 +8,7 @@ use File::Path qw( make_path );
use Cwd 'abs_path';
require 5.008001; # Supporting 5.8.1+
-our $VERSION = '0.001005'; # 0.1.5
+our $VERSION = '0.001006'; # 0.1.6
$VERSION = eval $VERSION;
my @accessors = qw(
@@ -16,7 +16,7 @@ my @accessors = qw(
uid path gid scan_name stdout_file stderr_file pid_file fork data
lsb_start lsb_stop lsb_sdesc lsb_desc redirect_before_fork init_config
kill_timeout umask resource_dir help init_code
- prereq_no_process foreground
+ prereq_no_process foreground reload_signal stop_signals
);
my $cmd_opt = "[start|stop|restart|reload|status|show_warnings|get_init_file|help]";
@@ -74,6 +74,8 @@ sub new {
quiet => 0,
umask => 0,
foreground => 0,
+ reload_signal => 'HUP',
+ stop_signals => [ qw(TERM TERM INT KILL) ],
}, $class;
for my $accessor ( @accessors ) {
@@ -451,7 +453,7 @@ sub do_stop {
if ( $self->pid_running($start_pid) ) {
SIGNAL:
- foreach my $signal ( qw(TERM TERM INT KILL) ) {
+ foreach my $signal (@{ $self->stop_signals }) {
$self->trace( "Sending $signal signal to pid $start_pid..." );
kill $signal => $start_pid;
@@ -513,7 +515,7 @@ sub do_reload {
$self->read_pid;
if ( $self->pid && $self->pid_running ) {
- kill "SIGHUP", $self->pid;
+ kill $self->reload_signal, $self->pid;
$self->pretty_print( "Reloaded" );
return 0;
} else {
@@ -691,7 +693,7 @@ Write a program that describes the daemon:
use strict;
use Daemon::Control;
- Daemon::Control->new(
+ exit Daemon::Control->new(
name => "My Daemon",
lsb_start => '$syslog $remote_fs',
lsb_stop => '$syslog',
@@ -713,7 +715,7 @@ Write a program that describes the daemon:
By default C<run> will use @ARGV for the action, and exit with an LSB compatible
exit code. For finer control, you can use C<run_command>, which will return
the exit code, and accepts the action as an argument. This enables more programatic
-control, as well as running multiple instances of M<Daemon::Control> from one script.
+control, as well as running multiple instances of L<Daemon::Control> from one script.
my $daemon = Daemon::Control->new(
...
@@ -852,7 +854,7 @@ and STDERR will be redirected to C<stderr_file>. Setting this to 0 will disable
redirecting before a double fork. This is useful when you are using a code
reference and would like to leave the filehandles alone until you're in control.
-Call C<->redirect_filehandles> on the Daemon::Control instance your coderef is
+Call C<< ->redirect_filehandles >> on the Daemon::Control instance your coderef is
passed to redirect the filehandles.
=head2 stdout_file
@@ -983,6 +985,18 @@ If this boolean flag is set to a true value all output from the init script
$daemon->quiet( 1 );
+=head2 reload_signal
+
+The signal to send to the daemon when reloading it.
+Default signal is C<HUP>.
+
+=head2 stop_signals
+
+An array ref of signals that should be tried (in order) when
+stopping the daemon.
+Default signals are C<TERM>, C<TERM>, C<INT> and C<KILL> (yes, C<TERM>
+is tried twice).
+
=head1 METHODS
=head2 run_command
@@ -1013,7 +1027,7 @@ exits. Called by:
Is called when B<foreground> is given as an argument. Starts the
program or code reference and stays in the foreground -- no forking
is done, regardless of the compile-time arguments. Additionally,
-turns C<quiet> on to avoid showing M<Daemon::Control> output.
+turns C<quiet> on to avoid showing L<Daemon::Control> output.
/usr/bin/my_program_launcher.pl foreground
@@ -1033,8 +1047,8 @@ Called by:
=head2 do_reload
-Is called when reload is given as an argument. Sends a HUP signal to the
-daemon.
+Is called when reload is given as an argument. Sends the signal
+C<reload_signal> to the daemon.
/usr/bin/my_program_launcher.pl reload