Close the db before forking in start()

This commit is contained in:
Isaac Connor 2018-06-14 14:54:00 -04:00
parent f2d00b6af5
commit fef88107e1
1 changed files with 4 additions and 0 deletions

View File

@ -431,7 +431,11 @@ sub start {
my $sigset = POSIX::SigSet->new;
my $blockset = POSIX::SigSet->new(SIGCHLD);
sigprocmask(SIG_BLOCK, $blockset, $sigset) or Fatal("Can't block SIGCHLD: $!");
# Apparently the child closing the db connection can affect the parent.
zmDbDisconnect();
if ( my $cpid = fork() ) {
$dbh = zmDbConnect(1);
# This logReinit is required. Not sure why.
logReinit();