From 426744a271b1a081b6967c071815b1ed9c49108c Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Wed, 10 Jan 2024 07:59:11 +0100 Subject: openvswitch: Add ovs_wrapper for handling TERM Partial-Bug: #2048130 Change-Id: I81eba2644eda6edd38c541f798bead04c2fa6578 --- docker/openvswitch/openvswitch-base/ovs_wrapper.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 docker/openvswitch/openvswitch-base/ovs_wrapper.sh (limited to 'docker/openvswitch/openvswitch-base/ovs_wrapper.sh') 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" -- cgit v1.2.3