fix reload server update to license pandora_enterprise#12178
This commit is contained in:
parent
d5b780ee99
commit
c6a662a070
|
@ -1510,7 +1510,14 @@ class ConsoleSupervisor
|
|||
{
|
||||
global $config;
|
||||
|
||||
$types_sql = '';
|
||||
$types_sql = sprintf(
|
||||
' AND (
|
||||
`server_type` != %d AND
|
||||
`server_type` != %d
|
||||
)',
|
||||
SERVER_TYPE_AUTOPROVISION,
|
||||
SERVER_TYPE_MIGRATION
|
||||
);
|
||||
if (is_metaconsole() === true && isset($config['ndbh']) === false) {
|
||||
$types_sql = sprintf(
|
||||
' AND (
|
||||
|
|
|
@ -631,7 +631,14 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
|||
$select_id = ' AND id_server IN ('.(int) $id_server.')';
|
||||
}
|
||||
|
||||
$types_sql = '';
|
||||
$types_sql = sprintf(
|
||||
' AND (
|
||||
`server_type` != %d AND
|
||||
`server_type` != %d
|
||||
)',
|
||||
SERVER_TYPE_AUTOPROVISION,
|
||||
SERVER_TYPE_MIGRATION
|
||||
);
|
||||
if (is_metaconsole() === true && isset($config['ndbh']) === false) {
|
||||
$types_sql = sprintf(
|
||||
' AND (
|
||||
|
|
|
@ -58,6 +58,9 @@ my $Restart = 0;
|
|||
# Controlled exit
|
||||
my $Running = 0;
|
||||
|
||||
# License
|
||||
my $License;
|
||||
|
||||
########################################################################
|
||||
# Print the given message with a preceding timestamp.
|
||||
########################################################################
|
||||
|
@ -359,6 +362,27 @@ sub ha_update_server($$) {
|
|||
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Restart pandora server on demand.
|
||||
###############################################################################
|
||||
sub ha_restart_server($$) {
|
||||
my ($config, $dbh) = @_;
|
||||
my $OSNAME = $^O;
|
||||
|
||||
my $current_license;
|
||||
if (!defined($License)) {
|
||||
$License = get_db_value($dbh, 'SELECT `value` FROM `tupdate_settings` WHERE `key` = "customer_key"');
|
||||
$current_license = $License;
|
||||
} else {
|
||||
$current_license = get_db_value($dbh, 'SELECT `value` FROM `tupdate_settings` WHERE `key` = "customer_key"');
|
||||
}
|
||||
|
||||
if($License ne $current_license) {
|
||||
ha_restart_pandora($config);
|
||||
$License = $current_license;
|
||||
}
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Dump the list of known databases to disk.
|
||||
################################################################################
|
||||
|
@ -691,6 +715,9 @@ sub ha_main_pandora($) {
|
|||
# Check if there are updates pending.
|
||||
ha_update_server($conf, $dbh);
|
||||
|
||||
# Check restart server on demand.
|
||||
ha_restart_server($conf, $dbh);
|
||||
|
||||
# Keep pandora running
|
||||
ha_keep_pandora_running($conf, $dbh);
|
||||
|
||||
|
|
Loading…
Reference in New Issue