|
|
@ -194,9 +194,10 @@ sub new |
|
|
|
$anvil->data->{ENV_VALUES}{START_TIME} = Time::HiRes::time; |
|
|
|
$anvil->data->{ENV_VALUES}{START_TIME} = Time::HiRes::time; |
|
|
|
|
|
|
|
|
|
|
|
# Set passed parameters if needed. |
|
|
|
# Set passed parameters if needed. |
|
|
|
my $debug = 3; |
|
|
|
my $debug = 2; |
|
|
|
my $on_sig_int; |
|
|
|
my $on_sig_int; |
|
|
|
my $on_sig_term; |
|
|
|
my $on_sig_term; |
|
|
|
|
|
|
|
my $on_sig_alarm; |
|
|
|
if (ref($parameter) eq "HASH") |
|
|
|
if (ref($parameter) eq "HASH") |
|
|
|
{ |
|
|
|
{ |
|
|
|
# Local parameters... |
|
|
|
# Local parameters... |
|
|
@ -215,6 +216,7 @@ sub new |
|
|
|
|
|
|
|
|
|
|
|
$on_sig_int = $parameter->{on_sig_int}; |
|
|
|
$on_sig_int = $parameter->{on_sig_int}; |
|
|
|
$on_sig_term = $parameter->{on_sig_term}; |
|
|
|
$on_sig_term = $parameter->{on_sig_term}; |
|
|
|
|
|
|
|
$on_sig_alarm = $parameter->{on_sig_alarm}; |
|
|
|
} |
|
|
|
} |
|
|
|
elsif ($parameter) |
|
|
|
elsif ($parameter) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -234,6 +236,11 @@ sub new |
|
|
|
|
|
|
|
|
|
|
|
$anvil->catch_sig({signal => "TERM"}); |
|
|
|
$anvil->catch_sig({signal => "TERM"}); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
$SIG{ALARM} = sub { |
|
|
|
|
|
|
|
$on_sig_term->({ debug => $debug }) if (ref($on_sig_alarm) eq "CODE"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$anvil->catch_sig({signal => "ALARM"}); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
# This sets the environment this program is running in. |
|
|
|
# This sets the environment this program is running in. |
|
|
|
if ($ENV{SERVER_NAME}) |
|
|
|
if ($ENV{SERVER_NAME}) |
|
|
|