kill hung procc with sudo and release port (#4882)

pull/4884/head
Medya Ghazizadeh 2019-07-26 13:23:15 -07:00 committed by Sharif Elgamal
parent 87802b2c77
commit 9db0757690
1 changed files with 4 additions and 1 deletions

View File

@ -161,9 +161,12 @@ kprocs=$(pgrep kubectl || true)
if [[ "${kprocs}" != "" ]]; then
echo "error: killing hung kubectl processes ..."
ps -f -p ${kprocs} || true
${SUDO_PREFIX} kill ${kprocs} || true
sudo -E kill ${kprocs} || true
fi
# clean up none drivers binding on 8443
lsof -P | grep ':8443' | awk '{print $2}' | xargs sudo -E kill -9
function cleanup_stale_routes() {
local show="netstat -rn -f inet"
local del="sudo route -n delete"