Commit 2f6b0015 authored by Jérome Perrin's avatar Jérome Perrin

erp5: automatically reload backend apaches when configuration changes

Introduce an service to tell apache to reload its config.
This uses `hash-files` feature of slapos.cookbook:wrapper to get this
process restarted everytime something change in apache configuration
files.
This service wait forever to prevent reloading apache everytime slapos
node instance is running but only when something actually changed.
parent 8b116dd9
......@@ -66,7 +66,7 @@ md5sum = 0969fbb25b05c02ef3c2d437b2f4e1a0
[template]
filename = instance.cfg.in
md5sum = be1466bfce26211e1f0b9e5cee47fe44
md5sum = 0ef032bb7111930c4beb01f2ecd3478a
[monitor-template-dummy]
filename = dummy.cfg
......@@ -86,7 +86,7 @@ md5sum = d1257e7e942307be0a79e34aa4320e9f
[template-balancer]
filename = instance-balancer.cfg.in
md5sum = f0fd49c7d6d9f7c6936afba0d18b7691
md5sum = c880831c2b941c38417c647f8c01e243
[template-haproxy-cfg]
filename = haproxy.cfg.in
......
......@@ -225,6 +225,18 @@ wait-for-files =
${apache-conf-ssl:cert}
${apache-conf-ssl:key}
[{{ section('apache-reload-graceful') }}]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:services}/apache-graceful-reload
command-line =
{{ parameter_dict['bash'] }}/bin/bash -c "${apache-graceful:output} &&
{{ parameter_dict['coreutils'] }}/bin/sleep infinity"
hash-files =
${apache-conf-ssl:cert}
${apache-conf-ssl:key}
${apache-conf:rendered}
${apache:wrapper-path}
[apache-graceful]
recipe = collective.recipe.template
input = inline:
......
......@@ -56,6 +56,9 @@ openssl-location = {{ openssl_location }}
apache = {{ apache_location }}
openssl = {{ openssl_location }}
haproxy = {{ haproxy_location }}
bash = {{ bash_location }}
coreutils = {{ coreutils_location }}
bin-directory = {{ bin_directory }}
apachedex-location = {{ bin_directory }}/apachedex
run-apachedex-location = {{ bin_directory }}/runApacheDex
promise-check-apachedex-result = {{ bin_directory }}/check-apachedex-result
......
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