Fixed non-restart if pending bug.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@791 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
7b1fb30990
commit
111db75a18
|
@ -343,6 +343,11 @@ if ( !connect( CLIENT, $saddr ) )
|
||||||
|
|
||||||
$SIG{CHLD} = \&reaper;
|
$SIG{CHLD} = \&reaper;
|
||||||
|
|
||||||
|
if ( $cpid < 0 )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
my $process = $pid_hash{$cpid};
|
my $process = $pid_hash{$cpid};
|
||||||
delete( $pid_hash{$cpid} );
|
delete( $pid_hash{$cpid} );
|
||||||
|
|
||||||
|
@ -375,13 +380,14 @@ if ( !connect( CLIENT, $saddr ) )
|
||||||
|
|
||||||
if ( $process->{keepalive} )
|
if ( $process->{keepalive} )
|
||||||
{
|
{
|
||||||
if ( !$process->{delay} || $process->{runtime} > (10*$process->{delay}) )
|
if ( !$process->{delay} || ($process->{runtime} > (10*$process->{delay})) )
|
||||||
{
|
{
|
||||||
start( $process->{daemon}, @{$process->{args}} );
|
start( $process->{daemon}, @{$process->{args}} );
|
||||||
$process->{delay} = 5;
|
$process->{delay} = 5;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$cmd_hash{$process->{command}} = $process;
|
||||||
$process->{pending} = $process->{stopped}+$process->{delay};
|
$process->{pending} = $process->{stopped}+$process->{delay};
|
||||||
$process->{delay} *= 2;
|
$process->{delay} *= 2;
|
||||||
# Limit the start delay to 15 minutes max
|
# Limit the start delay to 15 minutes max
|
||||||
|
|
Loading…
Reference in New Issue