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