Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release-1.27] - rke2-killall.sh script fails to kill containers when run on narrow terminal #6027

Closed
brandond opened this issue May 28, 2024 · 1 comment
Assignees

Comments

@brandond
Copy link
Member

Backport fix for rke2-killall.sh script fails to kill containers when run on narrow terminal

@fmoral2
Copy link
Contributor

fmoral2 commented Jun 10, 2024

Validated on Version:

-$  rke2 version v1.27.14+dev.916f7501 (916f7501c7390092d1d1fd6adf112813e406b7af)
 

Environment Details

Infrastructure
Cloud EC2 instance

Node(s) CPU architecture, OS, and Version:
rhel
AMD

Cluster Configuration:
-1 node server

Steps to validate the fix

  1. Install rke2
  2. export COLUMNS=40 to simulate a narrow terminal
  3. Run killall script
  4. Validate that will not kill all the processes
  5. Run killall script again
  6. Validate that will kill all the processes

Reproduction Issue:

 rke2 version v1.30.1 (c727b365ea6cb0d8b70fdcaac648d79950b9591b)

getshims() {
     COLUMNS=40  ps -e -o pid= -o args= | sed -e 's/^ *//; s/\s\s*/\t/;' | grep -w 'rke2/data/[^/]*/bin/containerd-shim' | cut -f1
}

$ sudo  /usr/local/bin/rke2-killall.sh


 AFTER script some processes are still running  -------

 ps -e -o pid= -o args= | sed -e 's/^ *//; s/\s\s*/\t/;' | grep -w 'rke2/data/[^/]*/bin/containerd-shim' | cut -f1
102983
103085
103335
103672
103701
103763
103936
103983
104014
104148
104151
104198
104634
104645
104657
104881
105405
105984


Validation Results:

 
 
$ sudo  /usr/local/bin/rke2-killall.sh
+ killtree 102248 102507 102668 102673 102703 103365 104968 118133 118297 118395 118471 118540 118577 119185 119337 119409 119883 119971



$  ps -e -o pid= -o args= | sed -e 's/^ *//; s/\s\s*/\t/;' | grep -w 'rke2/data/[^/]*/bin/containerd-shim' | cut -f1
<EMPTY>

@fmoral2 fmoral2 closed this as completed Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants