2014-08-12 Koichiro Kikuchi <koichiro@rworks.jp>
* bin/pandora_server: Fixed issue that pandora_server failed to shut down properly on non-Linux systems. Merged r10335 from branch 5.0. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10402 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
78d80911f5
commit
9f2dca728e
|
@ -1,3 +1,10 @@
|
|||
2014-08-12 Koichiro Kikuchi <koichiro@rworks.jp>
|
||||
|
||||
* bin/pandora_server: Fixed issue that pandora_server failed to
|
||||
shut down properly on non-Linux systems.
|
||||
|
||||
Merged r10335 from branch 5.0.
|
||||
|
||||
2014-08-12 Koichiro Kikuchi <koichiro@rworks.jp>
|
||||
|
||||
* pandora_server_installer: Refactord implementation, added
|
||||
|
|
|
@ -47,11 +47,22 @@ my %Config :shared;
|
|||
my @Servers;
|
||||
my $DBH;
|
||||
my $RUN :shared = 1;
|
||||
my $MainThread = threads->self;
|
||||
|
||||
########################################################################################
|
||||
# Server shutdown. Handler to do a controlled shutdown.
|
||||
########################################################################################
|
||||
sub pandora_shutdown () {
|
||||
my $signal = shift;
|
||||
|
||||
logger (\%Config, 'Pandora FMS Server \'' . $Config{'servername'} . '\' Caught SIG' . $signal . ' by thread(' . threads->self()->tid() . ')', 10);
|
||||
|
||||
if (!threads->self->equal($MainThread)) {
|
||||
# deliver signal to the main thread since no other threads than main thread
|
||||
# could disconnet $DBH properly
|
||||
$MainThread->kill($signal);
|
||||
return;
|
||||
}
|
||||
logger (\%Config, 'Pandora FMS Server \'' . $Config{'servername'} . '\' Shutdown by signal ', 1);
|
||||
|
||||
# Stop servers
|
||||
|
|
Loading…
Reference in New Issue