Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Roque
slapos
Commits
55cfe1bb
Commit
55cfe1bb
authored
Oct 25, 2016
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stack/monitor: Fix promise for the running process
Kill -0 were making the promise exit.
parent
78cc6e27
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
9 deletions
+7
-9
stack/monitor/buildout.cfg
stack/monitor/buildout.cfg
+1
-1
stack/monitor/instance-monitor.cfg.jinja2.in
stack/monitor/instance-monitor.cfg.jinja2.in
+6
-8
No files found.
stack/monitor/buildout.cfg
View file @
55cfe1bb
...
@@ -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 =
0955530291105a322f2972244caf307d
md5sum =
266f23bc836a938ac69ce0bc674f34fe
context =
context =
key apache_location apache:location
key apache_location apache:location
key gzip_location gzip:location
key gzip_location gzip:location
...
...
stack/monitor/instance-monitor.cfg.jinja2.in
View file @
55cfe1bb
...
@@ -373,16 +373,14 @@ check-secure = 1
...
@@ -373,16 +373,14 @@ 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
pidfile=${monitor-conf-parameters:pid-file}
PID=`cat ${monitor-conf-parameters:pid-file}`
COMMAND=monitor.bootstrap
if [ -s $pidfile ]; then
for i in {1..20}; do
for i in {1..20}; do
# wait for monitor bootstrap script to finish (max 10 seconds)
if pid=`pgrep -F $pidfile -f "$COMMAND" 2>/dev/null`; then
kill -0 "$PID" > /dev/null 2>&1
RETURN_CODE=$?
if [ $RETURN_CODE -eq 0 ] ; then
break
else
sleep 0.5
sleep 0.5
else
break
fi
fi
done
done
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment