Commit 04ff7a7c authored by Alain Takoudjou's avatar Alain Takoudjou

fix monitor boostratp status promise

parent c3efd062
......@@ -96,7 +96,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 = 870ff63cde9cc0f50fd7ad4b727bdf8c
md5sum = 5b6b7a96bfa1e0ca83310caa48ed7b20
context =
key apache_location apache:location
key gzip_location gzip:location
......
......@@ -374,10 +374,12 @@ recipe = collective.recipe.template
file = ${monitor-conf-parameters:promise-output-file}
input = inline:#!{{ dash_executable_location }}
pidfile=${monitor-conf-parameters:pid-file}
COMMAND=monitor.bootstrap
if [ -s $pidfile ]; then
for i in {1..20}; do
if pid=`pgrep -F $pidfile -f "$COMMAND" 2>/dev/null`; then
COUNTER=0
# Wait until max 20 seconds, the limit promise timeout
while [ $COUNTER -lt 20 ]; do
if [ -n "$(ps -p $(cat $pidfile) -o pid=)" ]; then
((COUNTER=COUNTER+1))
sleep 0.5
else
break
......
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