Commit 6f11404d 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 f23c8bfc
......@@ -159,7 +159,7 @@ context =
[template-mariadb]
< = download-base
filename = instance-mariadb.cfg.in
md5sum = 85826f72b4eac9cbaea2d34d73e6d445
md5sum = 99a9e71b599def71322c86c0bd02a21e
link-binary =
${coreutils:location}/bin/basename
${coreutils:location}/bin/cat
......@@ -217,7 +217,7 @@ md5sum = e40e2e39f4941c6372f4357e8589a5cf
# XXX: "template.cfg" is hardcoded in instanciation recipe
filename = template.cfg
template = ${:_profile_base_location_}/instance.cfg.in
md5sum = 8ccd836753a44aa26d68f5fff00c2eff
md5sum = ffe07d9516691dd57014e5af73b7443e
extra-context =
key mariadb_link_binary template-mariadb:link-binary
key zope_link_binary template-zope:link-binary
......@@ -589,6 +589,7 @@ eggs =
slapos.toolbox[zodbpack]
scripts =
is-local-tcp-port-opened
killpidfromfile
onetimedownload
zodbpack
......@@ -695,7 +696,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
......
......@@ -213,10 +213,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
[buildout]
extends =
......
......@@ -188,6 +188,7 @@ template-my-cnf = {{ template_my_cnf }}
template-mariadb-initial-setup = {{ template_mariadb_initial_setup }}
link-binary = {{ dumps(mariadb_link_binary) }}
instance-logrotate-cfg = {{ template_logrotate_base }}
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