Commit d6d873c4 authored by Alain Takoudjou's avatar Alain Takoudjou

monitor: bootstrap promise don't fail if pid file doesn't exists

parent 89b6630e
......@@ -93,7 +93,7 @@ recipe = slapos.recipe.template:jinja2
filename = template-monitor.cfg
template = ${:_profile_base_location_}/instance-monitor.cfg.jinja2.in
rendered = ${buildout:directory}/template-monitor.cfg
md5sum = c25e1c8206fb7c08924ae3d5c16521fc
md5sum = 61734742e3a01a8a1d512f491b2190cc
context =
key apache_location apache:location
key gzip_location gzip:location
......
......@@ -372,17 +372,19 @@ check-secure = 1
recipe = collective.recipe.template
file = ${monitor-conf-parameters:promise-output-file}
input = inline:#!{{ dash_executable_location }}
PID=`cat ${monitor-conf-parameters:pid-file}`
for i in {1..20}; do
# wait for monitor bootstrap script to finish (max 10 seconds)
kill -0 "$PID" > /dev/null 2>&1
RETURN_CODE=$?
if [ $RETURN_CODE -eq 0 ] ; then
break
else
sleep 0.5
fi
done
if [ -f "${monitor-conf-parameters:pid-file}" ]; then
PID=`cat ${monitor-conf-parameters:pid-file}`
for i in {1..20}; do
# wait for monitor bootstrap script to finish (max 10 seconds)
kill -0 "$PID" > /dev/null 2>&1
RETURN_CODE=$?
if [ $RETURN_CODE -eq 0 ] ; then
break
else
sleep 0.5
fi
done
fi
if [ ! -f "${:file}" ]; then echo "Monitor bootstrap exited with error." && exit 2; else echo "Bootstrap OK"; fi
output = ${directory:promises}/monitor-bootstrap-status
mode = 700
......
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