Merge "mariadb-clustercheck: Add a script handling signals"

This commit is contained in:
Zuul 2024-03-18 11:39:59 +00:00 committed by Gerrit Code Review
commit ff798d757b
2 changed files with 22 additions and 1 deletions

View File

@ -6,8 +6,10 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% block mariadb_clustercheck_header %}{% endblock %}
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 footer %}{% endblock %}

View 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"