diff --git a/dist/images/start-ic-db.sh b/dist/images/start-ic-db.sh index 2c9b4d937a0a..3de40cdb0c4d 100755 --- a/dist/images/start-ic-db.sh +++ b/dist/images/start-ic-db.sh @@ -18,6 +18,10 @@ function get_leader_ip { function quit { /usr/share/ovn/scripts/ovn-ctl stop_ic_ovsdb + if [ "$ENABLE_OVN_LEADER_CHECK" != "true" ]; then + # kill the tail process + pkill -P $$ + fi exit 0 } diff --git a/dist/images/start-ovs-dpdk-v2.sh b/dist/images/start-ovs-dpdk-v2.sh index e0fe13d567ff..9fd3b8e4397e 100755 --- a/dist/images/start-ovs-dpdk-v2.sh +++ b/dist/images/start-ovs-dpdk-v2.sh @@ -34,6 +34,8 @@ export PATH=$PATH:/usr/share/ovn/scripts function quit { ovs-ctl stop ovn-ctl stop_controller + # kill the tail process + pkill -P $$ exit 0 } trap quit EXIT diff --git a/dist/images/start-ovs-dpdk.sh b/dist/images/start-ovs-dpdk.sh index 23341d2af431..43605f58324f 100755 --- a/dist/images/start-ovs-dpdk.sh +++ b/dist/images/start-ovs-dpdk.sh @@ -4,6 +4,8 @@ set -euo pipefail function quit { ovs-ctl stop ovn-ctl stop_controller + # kill the tail process + pkill -P $$ exit 0 } trap quit EXIT diff --git a/dist/images/start-ovs.sh b/dist/images/start-ovs.sh index b2213b42882b..c33b0f0cb0c2 100755 --- a/dist/images/start-ovs.sh +++ b/dist/images/start-ovs.sh @@ -50,6 +50,7 @@ function cgroup_match { } function quit { + set -x gen_name=$(kubectl -n "${POD_NAMESPACE}" get pod "${POD_NAME}" -o jsonpath='{.metadata.generateName}') revision_hash=$(kubectl -n "${POD_NAMESPACE}" get pod "${POD_NAME}" -o jsonpath='{.metadata.labels.controller-revision-hash}') revision=$(kubectl -n "${POD_NAMESPACE}" get controllerrevision "${gen_name}${revision_hash}" --ignore-not-found -o jsonpath='{.revision}') @@ -69,6 +70,8 @@ function quit { if cgroup_match "${pid}" self; then /usr/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server stop fi + # kill the tail process + pkill -P $$ fi exit 0