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
Kwabena Antwi-Boasiako
slapos
Commits
df8edd35
Commit
df8edd35
authored
Sep 29, 2016
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monitor: bootstrap promise check wait for bootstrap to finish if it's running
parent
a2c96eb4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
14 deletions
+21
-14
stack/monitor/buildout.cfg
stack/monitor/buildout.cfg
+1
-1
stack/monitor/instance-monitor.cfg.jinja2.in
stack/monitor/instance-monitor.cfg.jinja2.in
+20
-13
No files found.
stack/monitor/buildout.cfg
View file @
df8edd35
...
@@ -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 =
84998b1ca3c29445dca70b495515c35b
md5sum =
c25e1c8206fb7c08924ae3d5c16521fc
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 @
df8edd35
...
@@ -115,7 +115,7 @@ ca-certs = ${ca-directory:certs}
...
@@ -115,7 +115,7 @@ ca-certs = ${ca-directory:certs}
ca-newcerts = ${ca-directory:newcerts}
ca-newcerts = ${ca-directory:newcerts}
ca-crl = ${ca-directory:crl}
ca-crl = ${ca-directory:crl}
[ca-httpd]
[ca-
monitor-
httpd]
<= certificate-authority
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
recipe = slapos.cookbook:certificate_authority.request
key-file = ${monitor-httpd-conf-parameter:key-file}
key-file = ${monitor-httpd-conf-parameter:key-file}
...
@@ -136,9 +136,8 @@ service-pid-folder = ${monitor-directory:pids}
...
@@ -136,9 +136,8 @@ service-pid-folder = ${monitor-directory:pids}
crond-folder = ${logrotate-directory:cron-entries}
crond-folder = ${logrotate-directory:cron-entries}
logrotate-folder = ${logrotate:logrotate-entries}
logrotate-folder = ${logrotate:logrotate-entries}
promise-runner = {{ monitor_runpromise }}
promise-runner = {{ monitor_runpromise }}
promise-folder-list =
promise-folder = ${directory:promises}
${directory:promises}
pid-file = ${monitor-directory:pids}/monitor-bootstrap.pid
${directory:monitor-promise}
public-path-list =
public-path-list =
private-path-list =
private-path-list =
...
@@ -370,15 +369,23 @@ curl_path = {{ curl_executable_location }}
...
@@ -370,15 +369,23 @@ curl_path = {{ curl_executable_location }}
check-secure = 1
check-secure = 1
[monitor-bootstrap-promise]
[monitor-bootstrap-promise]
recipe = slapos.recipe.template:jinja2
recipe = collective.recipe.template
template = {{ template_wrapper }}
rendered = ${directory:promises}/monitor-bootstrap-status
file = ${monitor-conf-parameters:promise-output-file}
file = ${monitor-conf-parameters:promise-output-file}
command = if [ ! -f "${:file}" ]; then echo "Monitor bootstrap exited with error." && exit 2; else echo "Bootstrap OK"; fi
input = inline:#!{{ dash_executable_location }}
mode = 0700
PID=`cat ${monitor-conf-parameters:pid-file}`
context =
for i in {1..20}; do
key content :command
# wait for monitor bootstrap script to finish (max 10 seconds)
raw dash_binary {{ dash_executable_location }}
kill -0 "$PID" > /dev/null 2>&1
RETURN_CODE=$?
if [ $RETURN_CODE -eq 0 ] ; then
break
else
sleep 0.5
fi
done
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
[monitor-base]
[monitor-base]
# create dependencies between required monitor parts
# create dependencies between required monitor parts
...
@@ -393,7 +400,7 @@ depends =
...
@@ -393,7 +400,7 @@ depends =
${certificate-authority:wrapper}
${certificate-authority:wrapper}
${monitor-conf:rendered}
${monitor-conf:rendered}
${start-monitor:wrapper-path}
${start-monitor:wrapper-path}
${ca-httpd:wrapper}
${ca-
monitor-
httpd:wrapper}
${monitor-httpd-promise:filename}
${monitor-httpd-promise:filename}
${monitor-status2rss-cron-entry:name}
${monitor-status2rss-cron-entry:name}
${monitor-bootstrap-promise:file}
${monitor-bootstrap-promise:file}
...
...
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