diff --git a/contrib/stop-k8e.sh b/contrib/stop-k8e.sh index 0f86c8631..c0dc6f320 100644 --- a/contrib/stop-k8e.sh +++ b/contrib/stop-k8e.sh @@ -1,34 +1,14 @@ #!/bin/sh +set -e echo "stop k8e process" - -pschildren() { - ps -e -o ppid= -o pid= | \ - sed -e 's/^\s*//g; s/\s\s*/\t/g;' | \ - grep -w "^$1" | \ - cut -f2 -} -pstree() { - for pid in $@; do - echo $pid - for child in $(pschildren $pid); do - pstree $child - done - done -} - killtree() { - kill -9 $( - { set +x; } 2>/dev/null; - pstree $@; - set -x; - ) 2>/dev/null + kill -9 $@ 2>/dev/null } getshims() { - ps axu|grep k8e|grep -v grep|awk '{print $2}' + ps axu|grep k8e|grep -v grep|grep -v containerd|awk '{print $2}' } killtree $({ set +x; } 2>/dev/null; getshims; set -x) -