Commit 402b2607 authored by Tristan Cavelier's avatar Tristan Cavelier

erp5 stack: fix mariadb host blocking

- Use latest slapos.toolbox (0.41.0)
- stack/erp5/buildout.cfg add script is-local-tcp-port-opened
- Change instance-mariadb promise to use is-local-tcp-port-opened

The monitor runs promises every 5 minutes.
The previous mariadb promise check for listening tcp port by openning
a socket and closing it, causing mariadb to block the host after a
defined amount of time.

The new script `is-local-tcp-port-opened` checks for opened tcp port
on current machine by reading /proc/net/tcp{,6}. No socket is opened.
Maria should not block hosts anymore.
parent 30a69af0
......@@ -170,7 +170,7 @@ mode = 0644
[template-mariadb]
< = download-base
filename = instance-mariadb.cfg.in
md5sum = 9bf570924391ceb5fc0332a614955c2a
md5sum = 77dd2e49636edb830e8a60cfd3e8288f
link-binary =
${coreutils:location}/bin/basename
${coreutils:location}/bin/cat
......@@ -228,7 +228,7 @@ md5sum = e40e2e39f4941c6372f4357e8589a5cf
# XXX: "template.cfg" is hardcoded in instanciation recipe
filename = template.cfg
template = ${:_profile_base_location_}/instance.cfg.in
md5sum = 510df07237978939660364a70b79158c
md5sum = c49460630f8315adf7af03d2500c6ea7
extra-context =
key mariadb_link_binary template-mariadb:link-binary
key zope_link_binary template-zope:link-binary
......@@ -609,6 +609,7 @@ eggs =
slapos.toolbox[zodbpack]
scripts =
is-local-tcp-port-opened
killpidfromfile
onetimedownload
zodbpack
......@@ -715,7 +716,7 @@ restkit = 4.2.2
rtjp-eventlet = 0.3.2
slapos.recipe.build = 0.12
slapos.recipe.template = 2.5
slapos.toolbox = 0.40.2
slapos.toolbox = 0.41.0
smmap = 0.8.2
socketpool = 0.5.3
spyne = 2.11.0
......
......@@ -214,10 +214,10 @@ log = ${:var}/log
run = ${:var}/run
[promise]
recipe = slapos.cookbook:check_port_listening
path = ${directory:promise}/mariadb
hostname = ${my-cnf-parameters:ip}
port = ${my-cnf-parameters:port}
recipe = slapos.cookbook:wrapper
command-line = "{{ parameter_dict['bin-directory'] }}/is-local-tcp-port-opened" "${my-cnf-parameters:ip}" "${my-cnf-parameters:port}"
wrapper-path = ${directory:promise}/mariadb
parameters-extra = true
[{{ section('monitor-current-log-access') }}]
< = monitor-directory-access
......
......@@ -190,6 +190,7 @@ template-mariadb-initial-setup = {{ template_mariadb_initial_setup }}
link-binary = {{ dumps(mariadb_link_binary) }}
instance-logrotate-cfg = {{ template_logrotate_base }}
template-monitor = {{ template_monitor }}
bin-directory = {{ bin_directory }}
[dynamic-template-mariadb]
< = jinja2-template-base
......
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