From fc04efc82ffd12a02b2d0c54a71861c97da8b92d Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 7 Jul 2015 16:28:48 +0200 Subject: [PATCH] Re-added the errors logs when load enterprise file in server. --- pandora_server/lib/PandoraFMS/Tools.pm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index 5b567ec74b..fa2c408c62 100644 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -581,16 +581,24 @@ sub enterprise_load ($) { if ($^O eq 'MSWin32') { # If the Windows service dies the service is stopped, even inside an eval ($RUN is set to 0)! eval 'local $SIG{__DIE__}; require PandoraFMS::Enterprise;'; - } else { + } + else { eval 'require PandoraFMS::Enterprise;'; } + + # Ops - return 0 if ($@); - + if ($@) { + open (STDERR, ">> " . $pa_config->{'errorlogfile'}); + print STDERR $@; + close (STDERR); + return 0; + } + # Initialize the enterprise module. PandoraFMS::Enterprise::init($pa_config); - + return 1; }