Commit 1cfa4150 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 8d98db74
...@@ -66,7 +66,7 @@ md5sum = 0969fbb25b05c02ef3c2d437b2f4e1a0 ...@@ -66,7 +66,7 @@ md5sum = 0969fbb25b05c02ef3c2d437b2f4e1a0
[template] [template]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = a5e8278067899081239d4366cf2b9eae md5sum = 2e0808aeade1ad21bc02a73c40867d30
[monitor-template-dummy] [monitor-template-dummy]
filename = dummy.cfg filename = dummy.cfg
...@@ -86,7 +86,7 @@ md5sum = 5c5f193fb30837327bea361172c5dc96 ...@@ -86,7 +86,7 @@ md5sum = 5c5f193fb30837327bea361172c5dc96
[template-balancer] [template-balancer]
filename = instance-balancer.cfg.in filename = instance-balancer.cfg.in
md5sum = b8764919f5785599079ee81ba265fd6e md5sum = e7d73cd2063d6880f5c736da99fbc806
[template-haproxy-cfg] [template-haproxy-cfg]
filename = haproxy.cfg.in filename = haproxy.cfg.in
......
...@@ -226,6 +226,18 @@ wait-for-files = ...@@ -226,6 +226,18 @@ wait-for-files =
${apache-conf-ssl:cert} ${apache-conf-ssl:cert}
${apache-conf-ssl:key} ${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] [apache-graceful]
recipe = collective.recipe.template recipe = collective.recipe.template
input = inline: input = inline:
......
...@@ -51,6 +51,8 @@ openssl-location = {{ openssl_location }} ...@@ -51,6 +51,8 @@ openssl-location = {{ openssl_location }}
apache = {{ apache_location }} apache = {{ apache_location }}
openssl = {{ openssl_location }} openssl = {{ openssl_location }}
haproxy = {{ haproxy_location }} haproxy = {{ haproxy_location }}
bash = {{ bash_location }}
coreutils = {{ coreutils_location }}
bin-directory = {{ bin_directory }} bin-directory = {{ bin_directory }}
apachedex-location = {{ bin_directory }}/apachedex apachedex-location = {{ bin_directory }}/apachedex
run-apachedex-location = {{ bin_directory }}/runApacheDex run-apachedex-location = {{ bin_directory }}/runApacheDex
......
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