From 151a22a66c0e360be18888fb0b877b807aaa0c4f Mon Sep 17 00:00:00 2001
From: Erik Alexandre Pucci <eap08@c3sl.ufpr.br>
Date: Wed, 27 Jul 2011 11:08:55 -0300
Subject: [PATCH] bootstrap-install: Added a check for the agent execution

Now the installer will check the result of the agent execution. In case of
error, the installer will collect agent and system information before
exiting. The collected data can be sent to the developers by the user.

Signed-off-by: Erik Alexandre Pucci <eap08@c3sl.ufpr.br>
Acked-by: Josiney de Souza <josineys@c3sl.ufpr.br>
Acked-by: Klismann Smoger Mottin <ksm09@inf.ufpr.br>
---
 bootstraps/bootstrap-install | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bootstraps/bootstrap-install b/bootstraps/bootstrap-install
index 1693900..d7fe259 100644
--- a/bootstraps/bootstrap-install
+++ b/bootstraps/bootstrap-install
@@ -198,6 +198,11 @@ fi
 # Export a variable to inform the agent that this is its first execution
 export FIRST_EXECUTION=1
 
-su -c "bash SEED2/agent.sh" seed_mec
+# Run the agent and check if its execution was alright, exiting in case of error
+if ! su -c "bash ${AGENT_DIR}/agent.sh" seed_mec; then
+    printf "ERRO: Falha na execução do novo agente.\n"
+    collect_information
+    exit 6
+fi
 
 exit 0
-- 
GitLab