mariadb-clustercheck: Add a script handling signals
Since socat does not rewrite SIGTERM to exit 0 (see [1]) - let's fix it in a different way. [1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809633 Change-Id: If27d93c509496651f8aa5e49a7d63b24eda91a8e
This commit is contained in:
parent
9ebd51f799
commit
dd3e46cd83
@ -6,8 +6,10 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
|
|||||||
{% block mariadb_clustercheck_header %}{% endblock %}
|
{% block mariadb_clustercheck_header %}{% endblock %}
|
||||||
|
|
||||||
COPY extend_start.sh /usr/local/bin/kolla_extend_start
|
COPY extend_start.sh /usr/local/bin/kolla_extend_start
|
||||||
|
COPY socat_wrapper.sh /usr/local/bin/socat_wrapper
|
||||||
|
|
||||||
RUN chmod 644 /usr/local/bin/kolla_extend_start
|
RUN chmod 644 /usr/local/bin/kolla_extend_start && \
|
||||||
|
chmod 755 /usr/local/bin/socat_wrapper
|
||||||
|
|
||||||
{% block mariadb_clustercheck_footer %}{% endblock %}
|
{% block mariadb_clustercheck_footer %}{% endblock %}
|
||||||
{% block footer %}{% endblock %}
|
{% block footer %}{% endblock %}
|
||||||
|
19
docker/mariadb/mariadb-clustercheck/socat_wrapper.sh
Normal file
19
docker/mariadb/mariadb-clustercheck/socat_wrapper.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
catch_term() {
|
||||||
|
kill -TERM "$child" 2>/dev/null
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
catch_quit() {
|
||||||
|
kill -QUIT "$child" 2>/dev/null
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
trap catch_term SIGTERM
|
||||||
|
trap catch_quit SIGQUIT
|
||||||
|
|
||||||
|
socat "$@" &
|
||||||
|
|
||||||
|
child=$!
|
||||||
|
wait "$child"
|
Loading…
Reference in New Issue
Block a user