From 54642538196b6df8174e89e82b270a03f85c10c9 Mon Sep 17 00:00:00 2001 From: ramonn Date: Mon, 29 Nov 2010 12:50:14 +0000 Subject: [PATCH] 2010-11-29 Ramon Novoa * pandora_agent_installer: Remove all init symbolic links. * plugins/pandora_update: Give the agent daemon some time to stop. Necessary on Windows. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3640 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/unix/ChangeLog | 7 +++++++ pandora_agents/unix/pandora_agent_installer | 14 ++++++++++++++ pandora_agents/unix/plugins/pandora_update | 6 +++++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/pandora_agents/unix/ChangeLog b/pandora_agents/unix/ChangeLog index d7b9f48221..0c80df28cb 100644 --- a/pandora_agents/unix/ChangeLog +++ b/pandora_agents/unix/ChangeLog @@ -1,3 +1,10 @@ +2010-11-29 Ramon Novoa + + * pandora_agent_installer: Remove all init symbolic links. + + * plugins/pandora_update: Give the agent daemon some time to stop. + Necessary on Windows. + 2010-11-25 Miguel de Dios * pandora_agent.spec: change version number. diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 8bdf7c5d63..6589fb47a0 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -110,7 +110,21 @@ uninstall () { rm -Rf $PANDORA_BASE/etc/rc.pandora_agent_daemon 2> /dev/null rm -Rf $PANDORA_BASE/etc/rc?.d/S90pandora_agent_daemon 2> /dev/null rm -Rf $PANDORA_BASE/sbin/rc?.d/S90pandora_agent_daemon 2> /dev/null + rm -Rf $PANDORA_BASE/etc/rc?.d/S90pandora_agent 2> /dev/null + rm -Rf $PANDORA_BASE/sbin/rc?.d/S90pandora_agent 2> /dev/null + rm -Rf $PANDORA_BASE/etc/rc.d/rc?.d/S90pandora_agent_daemon 2> /dev/null + rm -Rf $PANDORA_BASE/etc/rc.d/rc?.d/S90pandora_agent 2> /dev/null rm -Rf $PANDORA_BASE/usr/local/etc/rc.d/pandora_agent 2> /dev/null + rm -Rf /etc/init.d/pandora_agent_daemon 2> /dev/null + rm -Rf /sbin/init.d/pandora_agent_daemon 2> /dev/null + rm -Rf /etc/rc.pandora_agent_daemon 2> /dev/null + rm -Rf /etc/rc?.d/S90pandora_agent_daemon 2> /dev/null + rm -Rf /sbin/rc?.d/S90pandora_agent_daemon 2> /dev/null + rm -Rf /etc/rc?.d/S90pandora_agent 2> /dev/null + rm -Rf /sbin/rc?.d/S90pandora_agent 2> /dev/null + rm -Rf /etc/rc.d/rc?.d/S90pandora_agent_daemon 2> /dev/null + rm -Rf /etc/rc.d/rc?.d/S90pandora_agent 2> /dev/null + rm -Rf /usr/local/etc/rc.d/pandora_agent 2> /dev/null rm -Rf $PANDORA_BASE$PANDORA_HOME 2> /dev/null rm -Rf $PANDORA_BASE$PANDORA_LOG_DIR 2> /dev/null diff --git a/pandora_agents/unix/plugins/pandora_update b/pandora_agents/unix/plugins/pandora_update index c259b10af2..7453d1608b 100755 --- a/pandora_agents/unix/plugins/pandora_update +++ b/pandora_agents/unix/plugins/pandora_update @@ -12,6 +12,9 @@ use File::Copy; use FindBin; use Digest::MD5 qw(md5); +# Time to wait before the service stops +use constant SERVICE_STOP_WAIT => 5; + # This tool is intented to be used to update pandora agent binaries using # the file collection feature. This will work using a module like this: @@ -139,7 +142,8 @@ if (compare_twofiles ($running_binary, $updated_binary) == 0 ){ close (FILE3); my $output = `$stop_pandora`; - copy($updated_binary, $running_binary) or die "Problems updating binary from $updated_binary"; + sleep SERVICE_STOP_WAIT; + copy($updated_binary, $running_binary) or unlink $local_log; $output = `$start_pandora`; } else {