diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index 1209922537..a367eb7bca 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -97,9 +97,6 @@ sub pandora_startup () { # Grab config tokens shared with the console and not in the .conf pandora_get_sharedconfig (\%Config, $DBH); - - # Generate the encryption key after reading the passphrase. - $Config{"encryption_key"} = enterprise_hook('pandora_get_encryption_key', [\%Config, $Config{"encryption_passphrase"}]); # Kill any running server threads. stop_server_threads(); @@ -211,7 +208,9 @@ sub pandora_crash () { } $full_error .= $error_line; } - + + # Could crash before parse configuration. + $Config{'rb_product_name'} = 'PandoraFMS' unless defined($Config{'rb_product_name'}) && $Config{'rb_product_name'} ne ''; logger (\%Config, $Config{'rb_product_name'} . ' Server \'' . $Config{'servername'} . '\' unhandled error.', 1); # It's interesting show by console problems, not only in logs. This helps diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 5ddf95d22d..7d496e6642 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -1206,6 +1206,9 @@ sub pandora_load_config { } # end of loop for parameter # + # Generate the encryption key after reading the passphrase. + $pa_config->{"encryption_key"} = enterprise_hook('pandora_get_encryption_key', [$pa_config, $pa_config->{"encryption_passphrase"}]); + # Set to RDBMS' standard port if (!defined($pa_config->{'dbport'})) { if ($pa_config->{'dbengine'} eq "mysql") {