Skip to content

Commit

Permalink
kill tail process on termination
Browse files Browse the repository at this point in the history
Signed-off-by: zhangzujian <[email protected]>
  • Loading branch information
zhangzujian committed May 21, 2024
1 parent 29c84d5 commit 1160996
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dist/images/start-ic-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 2 additions & 0 deletions dist/images/start-ovs-dpdk-v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions dist/images/start-ovs-dpdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions dist/images/start-ovs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Expand All @@ -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
Expand Down

0 comments on commit 1160996

Please sign in to comment.