get rid of debugging and turn of extra logReInit

This commit is contained in:
Isaac Connor 2018-06-08 14:21:27 -04:00
parent 5cdbc85dcc
commit 374123f9c2
1 changed files with 2 additions and 12 deletions

View File

@ -373,9 +373,7 @@ sub run {
#print( "Select timed out\n" ); #print( "Select timed out\n" );
} }
Debug("restartPending");
restartPending(); restartPending();
Debug("check_for_processes_to_kill");
check_for_processes_to_kill(); check_for_processes_to_kill();
} # end while } # end while
@ -404,7 +402,6 @@ sub dPrint {
my $logLevel = shift; my $logLevel = shift;
# One thought here, if no client exists to read these... does it block? # One thought here, if no client exists to read these... does it block?
if ( fileno(CLIENT) ) { if ( fileno(CLIENT) ) {
Debug("Have fileno for CLIENT, printing ");
print CLIENT @_ print CLIENT @_
} }
if ( $logLevel == ZoneMinder::Logger::DEBUG ) { if ( $logLevel == ZoneMinder::Logger::DEBUG ) {
@ -440,14 +437,10 @@ sub start {
my $sigset = POSIX::SigSet->new; my $sigset = POSIX::SigSet->new;
my $blockset = POSIX::SigSet->new(SIGCHLD); my $blockset = POSIX::SigSet->new(SIGCHLD);
Debug("Blocking SIGCHLD");
sigprocmask(SIG_BLOCK, $blockset, $sigset) or Fatal("Can't block SIGCHLD: $!"); sigprocmask(SIG_BLOCK, $blockset, $sigset) or Fatal("Can't block SIGCHLD: $!");
Debug("forking");
if ( my $cpid = fork() ) { if ( my $cpid = fork() ) {
Debug("before logReinit");
# This logReinit is required. Not sure why. # This logReinit is required. Not sure why.
logReinit(); #logReinit();
Debug("aftere logReinit");
$process->{pid} = $cpid; $process->{pid} = $cpid;
$process->{started} = time(); $process->{started} = time();
@ -460,7 +453,6 @@ sub start {
$cmd_hash{$process->{command}} = $pid_hash{$cpid} = $process; $cmd_hash{$process->{command}} = $pid_hash{$cpid} = $process;
sigprocmask(SIG_SETMASK, $sigset) or Fatal("Can't restore SIGCHLD: $!"); sigprocmask(SIG_SETMASK, $sigset) or Fatal("Can't restore SIGCHLD: $!");
Debug("unblocking child");
} elsif ( defined($cpid) ) { } elsif ( defined($cpid) ) {
# Force reconnection to the db. # Force reconnection to the db.
$dbh = zmDbConnect(1); $dbh = zmDbConnect(1);
@ -523,7 +515,7 @@ sub send_stop {
.strftime('%y/%m/%d %H:%M:%S', localtime()) .strftime('%y/%m/%d %H:%M:%S', localtime())
."\n" ."\n"
); );
sigprocmask(SIG_UNBLOCK, $blockset) or die "dying at unblock...\n"; sigprocmask(SIG_UNBLOCK, $blockset) or die "dying at unblock...\n";
return(); return();
} }
@ -715,7 +707,6 @@ sub reaper {
} # end while waitpid } # end while waitpid
$SIG{CHLD} = \&reaper; $SIG{CHLD} = \&reaper;
$! = $saved_status; $! = $saved_status;
Debug("Leaving reaper");
} }
sub restartPending { sub restartPending {
@ -727,7 +718,6 @@ sub restartPending {
start($process->{daemon}, @{$process->{args}}); start($process->{daemon}, @{$process->{args}});
} }
} }
Debug("done restartPending");
} }
sub shutdownAll { sub shutdownAll {