Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3d8f94e

Browse files
committed
Merge pull request #8040 from nak3/terminate-child-process-local-up-cluster
Terminate child process by cleanup() in local-up-cluster.sh
2 parents 6bf5acd + e39f29c commit 3d8f94e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

hack/local-up-cluster.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,17 @@ cleanup_dockerized_kubelet()
109109
cleanup()
110110
{
111111
echo "Cleaning up..."
112-
[[ -n "${APISERVER_PID-}" ]] && sudo kill "${APISERVER_PID}"
113-
[[ -n "${CTLRMGR_PID-}" ]] && sudo kill "${CTLRMGR_PID}"
112+
[[ -n "${APISERVER_PID-}" ]] && sudo kill $(ps --ppid=${APISERVER_PID} --pid=${APISERVER_PID} | cut -d' ' -f1)
113+
[[ -n "${CTLRMGR_PID-}" ]] && sudo kill $(ps --ppid=${CTLRMGR_PID} --pid=${CTLRMGR_PID} | cut -d' ' -f1)
114114

115115
if [[ -n "$DOCKERIZE_KUBELET" ]]; then
116116
cleanup_dockerized_kubelet
117117
else
118-
[[ -n "${KUBELET_PID-}" ]] && sudo kill "${KUBELET_PID}"
118+
[[ -n "${KUBELET_PID-}" ]] && sudo kill $(ps --ppid=${KUBELET_PID} --pid=${KUBELET_PID} | cut -d' ' -f1)
119119
fi
120120

121-
[[ -n "${PROXY_PID-}" ]] && sudo kill "${PROXY_PID}"
122-
[[ -n "${SCHEDULER_PID-}" ]] && sudo kill "${SCHEDULER_PID}"
121+
[[ -n "${PROXY_PID-}" ]] && sudo kill $(ps --ppid=${PROXY_PID} --pid=${PROXY_PID} | cut -d' ' -f1)
122+
[[ -n "${SCHEDULER_PID-}" ]] && sudo kill $(ps --ppid=${SCHEDULER_PID} --pid=${SCHEDULER_PID} | cut -d' ' -f1)
123123

124124
[[ -n "${ETCD_PID-}" ]] && kube::etcd::stop
125125
[[ -n "${ETCD_DIR-}" ]] && kube::etcd::clean_etcd_dir

0 commit comments

Comments
 (0)