Skip to content
Snippets Groups Projects
Commit aafe8d6a authored by Edileuton Henrique de Oliveira's avatar Edileuton Henrique de Oliveira
Browse files

bootstraps: Fix lastexec access permission denied

parent 87a3b2f1
No related branches found
No related tags found
1 merge request!1Fix Lastexec Permission Denied
...@@ -261,6 +261,15 @@ rm -rf "${AGENT_DIR}" &> /dev/null ...@@ -261,6 +261,15 @@ rm -rf "${AGENT_DIR}" &> /dev/null
tar xzf "${FILE}" &> /dev/null tar xzf "${FILE}" &> /dev/null
rm -rf "${FILE}" &> /dev/null rm -rf "${FILE}" &> /dev/null
# Restore last-exec.tmp
if ! test -z ${LASTEXECBACKUP};then
echo ${LASTEXECBACKUP} > ${LASTEXEC}
fi
# Restore net-last-exec.tmp
if ! test -z ${NETLASTEXECBACKUP};then
echo ${NETLASTEXECBACKUP} > ${NETLASTEXEC}
fi
# Change files' owner # Change files' owner
if ! chown -R seed_mec:seed_mec "${SEED_MEC_HOME}"; then if ! chown -R seed_mec:seed_mec "${SEED_MEC_HOME}"; then
rm -rf "${SEED_MEC_HOME}" &> /dev/null rm -rf "${SEED_MEC_HOME}" &> /dev/null
...@@ -272,15 +281,6 @@ fi ...@@ -272,15 +281,6 @@ fi
# Export a variable to inform the agent that this is its first execution # Export a variable to inform the agent that this is its first execution
export FIRST_EXECUTION=1 export FIRST_EXECUTION=1
# Restore last-exec.tmp
if ! test -z ${LASTEXECBACKUP};then
echo ${LASTEXECBACKUP} > ${LASTEXEC}
fi
# Restore net-last-exec.tmp
if ! test -z ${NETLASTEXECBACKUP};then
echo ${NETLASTEXECBACKUP} > ${NETLASTEXEC}
fi
# Run the agent and check if its execution went alright, exiting in case of # Run the agent and check if its execution went alright, exiting in case of
# error # error
if ! su -c "bash ${AGENT_DIR}/update.sh" seed_mec || if ! su -c "bash ${AGENT_DIR}/update.sh" seed_mec ||
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment