diff --git a/pandora_agents/win32/ChangeLog b/pandora_agents/win32/ChangeLog index 7947ae3219..ed01eb3123 100644 --- a/pandora_agents/win32/ChangeLog +++ b/pandora_agents/win32/ChangeLog @@ -1,3 +1,9 @@ +2009-04-02 Ramon Novoa + + * modules/pandora_module_proc.cc, + modules/pandora_module_proc.h: Fixed module_startdelay and + module_retrydelay behavior. + 2009-03-24 Esteban Sanchez * udp_server/udp_server.cc, udp_server/udp_server.h: Replaced diff --git a/pandora_agents/win32/modules/pandora_module_proc.cc b/pandora_agents/win32/modules/pandora_module_proc.cc index 1b76f7e77e..96663278ce 100644 --- a/pandora_agents/win32/modules/pandora_module_proc.cc +++ b/pandora_agents/win32/modules/pandora_module_proc.cc @@ -49,9 +49,9 @@ Pandora_Module_Proc::Pandora_Module_Proc (string name, string process_name) this->watchdog = false; this->start_command = ""; - this->retries = INT_MAX; - this->start_delay = MIN_DELAY; - this->retry_delay = MIN_DELAY; + this->retries = 3; + this->start_delay = 5000; + this->retry_delay = 2000; } string @@ -104,7 +104,7 @@ Pandora_Module_Proc::setRetries (int retries) { void Pandora_Module_Proc::setStartDelay (int mseconds) { - if (mseconds < MIN_DELAY) { + if (mseconds < 0) { return; } @@ -113,7 +113,7 @@ Pandora_Module_Proc::setStartDelay (int mseconds) { void Pandora_Module_Proc::setRetryDelay (int mseconds) { - if (mseconds < MIN_DELAY) { + if (mseconds < 0) { return; } @@ -136,7 +136,6 @@ async_run (Pandora_Module_Proc *module) { Sleep (module->getStartDelay ()); while (1) { - Sleep (module->getStartDelay ()); processes = getProcessHandles (module->getProcessName ()); if (processes == NULL) { if (module->isWatchdog ()) { @@ -145,15 +144,14 @@ async_run (Pandora_Module_Proc *module) { continue; } - /* Retrying... */ - if (counter > 0) { - Sleep (module->getRetryDelay ()); - } - + Sleep (module->getRetryDelay ()); Pandora_Wmi::runProgram (module->getStartCommand ()); + Sleep (module->getStartDelay ()); counter++; + continue; } - Sleep (module->getRetryDelay ()); + + Sleep (2000); continue; } diff --git a/pandora_agents/win32/modules/pandora_module_proc.h b/pandora_agents/win32/modules/pandora_module_proc.h index 6ca28ae84c..60615f189a 100644 --- a/pandora_agents/win32/modules/pandora_module_proc.h +++ b/pandora_agents/win32/modules/pandora_module_proc.h @@ -23,8 +23,6 @@ #include "pandora_module.h" -#define MIN_DELAY 2000 /* Minimum process start/retry delay */ - namespace Pandora_Modules { /** * Module to check that a process is running on the system.