2012-08-15 Junichi Satoh <junichi@rworks.jp>

* pandora_agent: Changed not to use thread library when agent_threads
	is set to 1 or undefined. This change is to avoid RHEL/CentOS 5 perl
	thread library bug.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6861 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
jsatoh 2012-08-15 02:06:52 +00:00
parent 435d77d55f
commit ac75db97e6
2 changed files with 27 additions and 13 deletions

View File

@ -1,3 +1,9 @@
2012-08-15 Junichi Satoh <junichi@rworks.jp>
* pandora_agent: Changed not to use thread library when agent_threads
is set to 1 or undefined. This change is to avoid RHEL/CentOS 5 perl
thread library bug.
2012-08-01 Sergio Martin <sergio.martin@artica.es>
* pandora_agent: Add the macros support in module_exec

View File

@ -40,19 +40,6 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
# Load thread support
eval {
local $SIG{__DIE__};
require threads;
require threads::shared;
require Thread::Semaphore;
};
if (!$@) {
$Sem = Thread::Semaphore->new;
threads::shared::share (\$Xml);
threads::shared::share (\$Sem);
}
use constant AGENT_VERSION => '5.0dev';
use constant AGENT_BUILD => '120621';
@ -1787,6 +1774,27 @@ error ("Temporal directory '" . $Conf{'temporal'} . "' does not exist.") unless
$Conf{'server_path'} = fix_directory ($Conf{'server_path'});
$Conf{'secondary_server_path'} = fix_directory ($Conf{'secondary_server_path'});
# Load thread support if agent_threads is greater than 1.
if ($Conf{'agent_threads'} > 1) {
eval {
local $SIG{__DIE__};
require threads;
require threads::shared;
require Thread::Semaphore;
};
if (!$@) {
$Sem = Thread::Semaphore->new;
threads::shared::share (\$Xml);
threads::shared::share (\$Sem);
log_message ('log', 'Using thread library.');
} else {
log_message ('log', 'Thread library is not available. agent_threads is set to 1 (disabled).');
$Conf{'agent_threads'} = 1;
}
} else {
log_message ('log', 'Thread is disabled.');
}
# Startup delay
log_message ('log', 'Sleeping for ' . $Conf{'delayed_startup'} . ' seconds.') if ($Conf{'delayed_startup'} > 0);
sleep ($Conf{'delayed_startup'});