From a56d982475996cd0ba0742e7dd63baa19071afe4 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 16 Apr 2009 09:18:18 +0000 Subject: [PATCH] 2009-04-16 Ramon Novoa * lib/PandoraFMS/ReconServer.pm: Fixed a typo that made the server go down. * bin/pandora_server: Prevent alarm from bombing the main thread when called within a thread. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1621 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 8 ++++++++ pandora_server/bin/pandora_server | 3 +++ pandora_server/lib/PandoraFMS/ReconServer.pm | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index e615282343..a2fbc6748d 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,11 @@ +2009-04-16 Ramon Novoa + + * lib/PandoraFMS/ReconServer.pm: Fixed a typo that made the server go + down. + + * bin/pandora_server: Prevent alarm from bombing the main thread when + called within a thread. + 2009-04-14 Ramon Novoa * pandora_ctl, pandora_network, pandora_wmi, pandora_plugin, diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index b26ba8377e..90755dc83b 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -60,6 +60,9 @@ sub pandora_shutdown () { $SIG{'TERM'} = 'pandora_shutdown'; $SIG{'INT'} = 'pandora_shutdown'; +# Prevent alarm from bombing the main thread when called within a thread +$SIG{'ALRM'} = 'IGNORE'; + # Initialize pandora_init(\%Config, 'Pandora FMS Server'); pandora_load_config (\%Config); diff --git a/pandora_server/lib/PandoraFMS/ReconServer.pm b/pandora_server/lib/PandoraFMS/ReconServer.pm index 3edf638091..3b9bb69147 100644 --- a/pandora_server/lib/PandoraFMS/ReconServer.pm +++ b/pandora_server/lib/PandoraFMS/ReconServer.pm @@ -220,7 +220,7 @@ sub icmp_scan ($$) { # TCP scan the given host/port. Returns 1 if successful, 0 otherwise. ############################################################################## sub tcp_scan ($$$) { - my ($host, $timeout, $port) = $@; + my ($host, $timeout, $port) = @_; my $rc = 0; eval {