diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index ee63b73f8c..316e9ca69c 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -350,7 +350,7 @@ sub win32_install_service() { # Configure and install the service. my $service_path = $0; - my $service_params = "-S run \"$ARGV[0]\""; + my $service_params = "-S run \"" . $Config{'pandora_path'} ."\""; my %service_hash = ( machine => '', name => 'PANDORAFMSSRV', diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index 2c74e272c3..1ddadf6702 100644 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -494,8 +494,12 @@ sub enterprise_load ($) { #return 1 if (is_loaded ('PandoraFMS::Enterprise')); # Try to load the module - # eval 'local $SIG{__DIE__}; require PandoraFMS::Enterprise;'; - eval 'require PandoraFMS::Enterprise;'; + 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 { + eval 'require PandoraFMS::Enterprise;'; + } # Ops return 0 if ($@);