pandora_db only runs on the master server.

Ref. pandora_enterprise#6315
This commit is contained in:
Ramon Novoa 2020-09-22 12:17:29 +02:00
parent 6a525deeea
commit 262655516e
1 changed files with 7 additions and 0 deletions

View File

@ -1069,6 +1069,13 @@ if ($conf{'_history_db_enabled'} eq '1') {
}
}
# Only run on master servers.
pandora_set_master(\%conf, $dbh);
if ($conf{'_force'} == 0 && pandora_is_master(\%conf) == 0) {
log_message ('', " [*] Not a master server.\n\n");
exit 1;
}
# Get a lock
my $lock = db_get_lock ($dbh, 'pandora_db');
if ($lock == 0 && $conf{'_force'} == 0) {