aboutsummaryrefslogtreecommitdiff
path: root/docker/openvswitch/openvswitch-base/ovs_wrapper.sh
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2024-03-26 12:22:15 +0000
committerGerrit Code Review <review@openstack.org>2024-03-26 12:22:15 +0000
commit8f236dc8f408301cc7cb606840d23a2b7712fb79 (patch)
tree260692e2fb343071f90332c26729eae9b2c7f2ea /docker/openvswitch/openvswitch-base/ovs_wrapper.sh
parent2aa8d9544ec39b14c767f6f83139ed1d8867f77a (diff)
parent426744a271b1a081b6967c071815b1ed9c49108c (diff)
downloadkolla-8f236dc8f408301cc7cb606840d23a2b7712fb79.tar.gz
kolla-8f236dc8f408301cc7cb606840d23a2b7712fb79.zip
Merge "openvswitch: Add ovs_wrapper for handling TERM"
Diffstat (limited to 'docker/openvswitch/openvswitch-base/ovs_wrapper.sh')
-rw-r--r--docker/openvswitch/openvswitch-base/ovs_wrapper.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/docker/openvswitch/openvswitch-base/ovs_wrapper.sh b/docker/openvswitch/openvswitch-base/ovs_wrapper.sh
new file mode 100644
index 000000000..552c496ac
--- /dev/null
+++ b/docker/openvswitch/openvswitch-base/ovs_wrapper.sh
@@ -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"