From bd5d827ba9e68f226a88c945de07f049ac241364 Mon Sep 17 00:00:00 2001 From: darode Date: Thu, 22 Aug 2013 17:04:00 +0000 Subject: [PATCH] 2013-08-22 Dario Rodriguez * pandora_agent_installer: Merged improvements from 4.1 branch to fix several bugs related to custom installation. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8688 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/unix/ChangeLog | 5 +++++ pandora_agents/unix/pandora_agent_installer | 24 ++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/pandora_agents/unix/ChangeLog b/pandora_agents/unix/ChangeLog index 9d525d3b4e..0718ee4414 100644 --- a/pandora_agents/unix/ChangeLog +++ b/pandora_agents/unix/ChangeLog @@ -1,3 +1,8 @@ +2013-08-22 Dario Rodriguez + + * pandora_agent_installer: Merged improvements from 4.1 branch + to fix several bugs related to custom installation. + 2013-07-10 Ramon Novoa * pandora_agent: Changed the regexp used to retrieve ip addresses to diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index a1c4bb8b98..f4fc9a1790 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -241,6 +241,9 @@ install () { # Alter dynamically the daemon launcher and setup the new path # if PANDORA_BASE is customized. + AGENT_CFG=$OS_NAME/pandora_agent.conf + AGENT_CFG_TEMP=$OS_NAME/pandora_agent.conf.temp + if [ ! -z "$PANDORA_BASE" ] then if [ "$OS_NAME" = "FreeBSD" ] @@ -339,7 +342,6 @@ install () { sed -e "s/.*pandora_user .*/pandora_user $PANDORA_USER/" $AGENT_CFG > $AGENT_CFG_TEMP 2> /dev/null && \ mv $AGENT_CFG_TEMP $AGENT_CFG chmod 755 pandora_agent_daemon - chown -R $PANDORA_USER $PANDORA_BASE fi # Create logfile @@ -450,6 +452,26 @@ install () { chmod -R 770 $PANDORA_BASE$PANDORA_TEMP chmod 775 $PANDORA_BASE$PANDORA_TEMP fi + + #chown each directory one by one to avoid erros when no pandora_base and pandora_use is given + chown -R $PANDORA_USER $PANDORA_BASE/var/log + chown -R $PANDORA_USER $PANDORA_BASE/$PANDORA_MAN/man1 + + if [ "$OS_NAME" = "FreeBSD" ] + then + chown -R $PANDORA_USER $PANDORA_BASE/usr/local/bin + else + chown -R $PANDORA_USER $PANDORA_BASE/usr/bin + fi + + chown -R $PANDORA_USER $PANDORA_BASE$PANDORA_HOME + + chown -R $PANDORA_USER $PANDORA_BASE/tmp + chown -R $PANDORA_USER $PANDORA_BASE$PANDORA_TEMP/data_out + chown -R $PANDORA_USER $PANDORA_BASE$PANDORA_CFG + chown -R $PANDORA_USER $PANDORA_BASE$PANDORA_LOG_DIR + chown -R $PANDORA_USER $PANDORA_BASE$PANDORA_HOME/collections + chown -R $PANDORA_USER $PANDORA_BASE$PANDORA_HOME/plugins echo "Copying default agent configuration to $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf"