Merge "openvswitch: Add ovs_wrapper for handling TERM"
This commit is contained in:
commit
8f236dc8f4
|
@ -33,10 +33,12 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
COPY extend_start.sh /usr/local/bin/kolla_extend_start
|
COPY extend_start.sh /usr/local/bin/kolla_extend_start
|
||||||
|
COPY ovs_wrapper.sh /usr/local/bin/ovs_wrapper
|
||||||
|
|
||||||
# NOTE(hrw): Upstream moved tcpdump to /usr/bin/ in 4.99 version (used in Debian)
|
# NOTE(hrw): Upstream moved tcpdump to /usr/bin/ in 4.99 version (used in Debian)
|
||||||
RUN if [ -e /usr/sbin/tcpdump ]; then mv /usr/sbin/tcpdump /usr/bin/tcpdump; fi \
|
RUN if [ -e /usr/sbin/tcpdump ]; then mv /usr/sbin/tcpdump /usr/bin/tcpdump; fi \
|
||||||
&& touch /usr/local/bin/kolla_openvswitch_extend_start \
|
&& touch /usr/local/bin/kolla_openvswitch_extend_start \
|
||||||
&& chmod 644 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_openvswitch_extend_start
|
&& chmod 644 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_openvswitch_extend_start \
|
||||||
|
&& chmod 755 /usr/local/bin/ovs_wrapper
|
||||||
|
|
||||||
{% block openvswitch_base_footer %}{% endblock %}
|
{% block openvswitch_base_footer %}{% endblock %}
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
catch_term() {
|
||||||
|
ovs-appctl -T1 -t /run/openvswitch/$1.$child.ctl exit
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
catch_quit() {
|
||||||
|
ovs-appctl -T1 -t /run/openvswitch/$1.$child.ctl exit
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
trap catch_term SIGTERM
|
||||||
|
trap catch_quit SIGQUIT
|
||||||
|
|
||||||
|
"$@" &
|
||||||
|
|
||||||
|
child=$!
|
||||||
|
wait "$child"
|
Loading…
Reference in New Issue