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 = ...@@ -159,7 +159,7 @@ context =
[template-mariadb] [template-mariadb]
< = download-base < = download-base
filename = instance-mariadb.cfg.in filename = instance-mariadb.cfg.in
md5sum = 85826f72b4eac9cbaea2d34d73e6d445 md5sum = 99a9e71b599def71322c86c0bd02a21e
link-binary = link-binary =
${coreutils:location}/bin/basename ${coreutils:location}/bin/basename
${coreutils:location}/bin/cat ${coreutils:location}/bin/cat
...@@ -217,7 +217,7 @@ md5sum = e40e2e39f4941c6372f4357e8589a5cf ...@@ -217,7 +217,7 @@ md5sum = e40e2e39f4941c6372f4357e8589a5cf
# XXX: "template.cfg" is hardcoded in instanciation recipe # XXX: "template.cfg" is hardcoded in instanciation recipe
filename = template.cfg filename = template.cfg
template = ${:_profile_base_location_}/instance.cfg.in template = ${:_profile_base_location_}/instance.cfg.in
md5sum = 8ccd836753a44aa26d68f5fff00c2eff md5sum = ffe07d9516691dd57014e5af73b7443e
extra-context = extra-context =
key mariadb_link_binary template-mariadb:link-binary key mariadb_link_binary template-mariadb:link-binary
key zope_link_binary template-zope:link-binary key zope_link_binary template-zope:link-binary
...@@ -589,6 +589,7 @@ eggs = ...@@ -589,6 +589,7 @@ eggs =
slapos.toolbox[zodbpack] slapos.toolbox[zodbpack]
scripts = scripts =
is-local-tcp-port-opened
killpidfromfile killpidfromfile
onetimedownload onetimedownload
zodbpack zodbpack
...@@ -695,7 +696,7 @@ restkit = 4.2.2 ...@@ -695,7 +696,7 @@ restkit = 4.2.2
rtjp-eventlet = 0.3.2 rtjp-eventlet = 0.3.2
slapos.recipe.build = 0.12 slapos.recipe.build = 0.12
slapos.recipe.template = 2.5 slapos.recipe.template = 2.5
slapos.toolbox = 0.40.2 slapos.toolbox = 0.41.0
smmap = 0.8.2 smmap = 0.8.2
socketpool = 0.5.3 socketpool = 0.5.3
spyne = 2.11.0 spyne = 2.11.0
......
...@@ -213,10 +213,10 @@ log = ${:var}/log ...@@ -213,10 +213,10 @@ log = ${:var}/log
run = ${:var}/run run = ${:var}/run
[promise] [promise]
recipe = slapos.cookbook:check_port_listening recipe = slapos.cookbook:wrapper
path = ${directory:promise}/mariadb command-line = "{{ parameter_dict['bin-directory'] }}/is-local-tcp-port-opened" "${my-cnf-parameters:ip}" "${my-cnf-parameters:port}"
hostname = ${my-cnf-parameters:ip} wrapper-path = ${directory:promise}/mariadb
port = ${my-cnf-parameters:port} parameters-extra = true
[buildout] [buildout]
extends = extends =
......
...@@ -188,6 +188,7 @@ template-my-cnf = {{ template_my_cnf }} ...@@ -188,6 +188,7 @@ template-my-cnf = {{ template_my_cnf }}
template-mariadb-initial-setup = {{ template_mariadb_initial_setup }} template-mariadb-initial-setup = {{ template_mariadb_initial_setup }}
link-binary = {{ dumps(mariadb_link_binary) }} link-binary = {{ dumps(mariadb_link_binary) }}
instance-logrotate-cfg = {{ template_logrotate_base }} instance-logrotate-cfg = {{ template_logrotate_base }}
bin-directory = {{ bin_directory }}
[dynamic-template-mariadb] [dynamic-template-mariadb]
< = jinja2-template-base < = 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