aboutsummaryrefslogtreecommitdiff
path: root/kolla/docker/openvswitch/openvswitch-base/ovs_wrapper.sh
diff options
context:
space:
mode:
Diffstat (limited to 'kolla/docker/openvswitch/openvswitch-base/ovs_wrapper.sh')
-rw-r--r--kolla/docker/openvswitch/openvswitch-base/ovs_wrapper.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/kolla/docker/openvswitch/openvswitch-base/ovs_wrapper.sh b/kolla/docker/openvswitch/openvswitch-base/ovs_wrapper.sh
new file mode 100644
index 000000000..552c496ac
--- /dev/null
+++ b/kolla/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"