From 486749d68674c300abc63d4ef707d094171e0c5f Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Fri, 5 Nov 2010 14:07:42 +0000 Subject: [PATCH] 2010-11-05 Ramon Novoa * installer/pandora.mpi: Updated installation messages. * pandora_windows_service.cc: startup_delay after the service is started, not before. Read all secondary server parameters. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3543 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/win32/ChangeLog | 7 ++++ pandora_agents/win32/installer/pandora.mpi | 4 +-- .../win32/pandora_windows_service.cc | 33 ++++++++++++++----- 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/pandora_agents/win32/ChangeLog b/pandora_agents/win32/ChangeLog index 21b82e1072..5caab365c4 100644 --- a/pandora_agents/win32/ChangeLog +++ b/pandora_agents/win32/ChangeLog @@ -1,3 +1,10 @@ +2010-11-05 Ramon Novoa + + * installer/pandora.mpi: Updated installation messages. + + * pandora_windows_service.cc: startup_delay after the service is + started, not before. Read all secondary server parameters. + 2010-11-03 Ramon Novoa * bin/util/tentacle_client.exe: Updated the tentacle client. diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index cfa002d7ef..bc628fa96b 100755 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -2429,7 +2429,7 @@ StopPandoraService } ::msgcat::mcmset en { 1957048E-B498-4FFF-A8BA-F2DF640463B1,Message -{This program will install <%AppName%> v<%Version%> in your computer. When you finish this installation, probably you will need to edit the agent configuration file to add aditional modules or review main setup parameters. +{This program will install <%AppName%> (build <%Version%>) in your computer. When you finish this installation, probably you will need to edit the agent configuration file to add aditional modules or review main setup parameters. Please click on Next button to continue, or Cancel to exit this setup. } @@ -2650,7 +2650,7 @@ StopPandoraService } ::msgcat::mcmset es { 1957048E-B498-4FFF-A8BA-F2DF640463B1,Message -{Este programa instalarĂ¡ <%AppName%> v<%Version%> en su equipo. +{Este programa instalarĂ¡ <%AppName%> (build <%Version%>) en su equipo. Se recomienda cerrar las demas aplicaciones antes de continuar. diff --git a/pandora_agents/win32/pandora_windows_service.cc b/pandora_agents/win32/pandora_windows_service.cc index c5bdc91cf8..2b676a44ec 100644 --- a/pandora_agents/win32/pandora_windows_service.cc +++ b/pandora_agents/win32/pandora_windows_service.cc @@ -117,7 +117,6 @@ void Pandora_Windows_Service::pandora_init () { string conf_file, interval, debug, transfer_interval, util_dir, path, env; string udp_server_enabled, udp_server_port, udp_server_addr, udp_server_auth_addr; - int startup_delay = 0; setPandoraDebug (true); @@ -164,13 +163,6 @@ Pandora_Windows_Service::pandora_init () { srand ((unsigned) time (0)); this->setSleepTime (this->interval); - /* Sleep if a startup delay was specified */ - startup_delay = atoi (conf->getValue ("startup_delay").c_str ()) * 1000; - if (startup_delay > 0) { - pandoraLog ("Delaying startup %d miliseconds", startup_delay); - Sleep (startup_delay); - } - pandoraLog ("Pandora agent started"); /* Launch UDP Server */ @@ -460,11 +452,24 @@ Pandora_Windows_Service::copyDataFile (string filename) copy_to_secondary = 1; } - // Copy the file to the secondary server if needed + // Exit unless we have to send the file to a secondary server if (copy_to_secondary == 0) { return rc; } + // Read secondary server configuration + mode = conf->getValue ("secondary_transfer_mode"); + host = conf->getValue ("secondary_server_ip"); + remote_path = conf->getValue ("secondary_server_path"); + + // Fix remote path + if (mode != "local" && remote_path[remote_path.length () - 1] != '/') { + remote_path += "/"; + } else if (mode == "local" && remote_path[remote_path.length () - 1] != '\\') { + remote_path += "\\"; + } + + // Send the file to the secondary server if (mode == "ftp") { rc = copyFtpDataFile (host, remote_path, filename, conf->getValue ("secondary_server_pwd")); } else if (mode == "tentacle" || mode == "") { @@ -1152,11 +1157,21 @@ void Pandora_Windows_Service::pandora_run () { Pandora_Agent_Conf *conf = NULL; string server_addr; + int startup_delay = 0; + static unsigned char delayed = 0; pandoraDebug ("Run begin"); conf = this->getConf (); + /* Sleep if a startup delay was specified */ + startup_delay = atoi (conf->getValue ("startup_delay").c_str ()) * 1000; + if (startup_delay > 0 && delayed == 0) { + delayed = 1; + pandoraLog ("Delaying startup %d miliseconds", startup_delay); + Sleep (startup_delay); + } + /* Check for configuration changes */ if (getPandoraDebug () == false) { this->checkConfig ();