Commit 6fc62811 authored by sehidcan's avatar sehidcan 🙃

Merge branch 'testing' into 'master'

extra exec parameters

See merge request !14
parents 4feff86a 94d539e4
This diff is collapsed.
......@@ -31,11 +31,11 @@ logthis(){
rm -rf ${egemlog}.backup &>/dev/null
# backup current log file
mv ${egemlog} ${egemlog}.backup &>/dev/null
mv ${egemlog} ${egemlog}.backup &>/dev/null
# create a new/empty log file
touch ${egemlog}
fi
touch ${egemlog}
fi
fi
echo ${tag}${msg2log} >> ${egemlog}
......@@ -75,13 +75,12 @@ fetch_variables(){
shall_we_wait(){
wait_time="0"
for x in "https://git.egem.io/team/${script_repo_name}" "${dir_scripts}/${nodemanager}" "/usr/bin/${nodemanager}"
do
if [ ! -z "$(pgrep -f ${x})" ]; then
wait_time="2"
break
fi
done
pid_of_process="$(ps -ef | grep ${nodemanager} | grep -v $$ | grep -v grep | awk '{print $2}' | xargs)"
# pid_of_process="$(pgrep -x ${nodemanager} -d ' ')"
if [ ! -z "${pid_of_process//[[:blank:]]/}" ]; then
wait_time="2"; break
fi
}
check_version_script(){
......@@ -273,10 +272,8 @@ do
if [ "${action}" == "STOP" ]; then
if [ ! -f ${HOME}/chain.reset ]; then
if [ -z "$(pgrep -f ${nodemanager} | grep '--reset-chain' | grep -v $$)" ]; then
logthis "(delete) Deleting old chaindata according to dev-team instructions..."
run_nodemanager_with "--reset-chain"
fi
{ pgrep -f "${nodemanager} --reset-chain" | grep -v $$ &>/dev/null; } || \
{ logthis "(delete) Deleting old chaindata according to dev-team instructions..."; run_nodemanager_with "--reset-chain"; }
else
logthis "(skip) Chain has been reset previously, skipping that step..."
fi
......@@ -314,7 +311,7 @@ do
shall_we_wait
if [ "${wait_time}" -gt 0 ]; then
if [ "${total_wait_time}" -lt 60 ]; then
if [ "${total_wait_time}" -lt 20 ]; then
logthis "(wait) There is an on-going installation/update."
logthis "(wait) Waiting ${wait_time} minutes to see if it finishes..."
......@@ -325,7 +322,7 @@ do
node_uptime=$((node_uptime + wait_time))
break
else
logthis "(move-on) Background installations/updates took longer than expected (30+ minutes). Terminating them and moving on..."
logthis "(move-on) Background installations/updates took longer than expected (20+ minutes). Terminating them and moving on..."
wait_time="0"
total_wait_time="0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment