Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
bb3aca18
Commit
bb3aca18
authored
Oct 15, 2019
by
Erik Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup killall and uninstall
parent
25c81f3c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
install.sh
install.sh
+12
-3
No files found.
install.sh
View file @
bb3aca18
...
...
@@ -463,27 +463,36 @@ pstree() {
}
killtree() {
[
$#
-ne 0 ] && kill
$(
set
+x
;
pstree
$@
;
set
-x
)
kill -9
$(
{
set
+x
;
}
2>/dev/null
;
pstree
$@
;
set
-x
)
2>/dev/null
}
killtree
$(
lsof |
sed
-e
's/^[^0-9]*//g; s/ */\t/g'
|
grep
-w
'k3s/data/[^/]*/bin/containerd-shim'
|
cut
-f1
|
sort
-n
-u
)
getshims() {
lsof | sed -e 's/^[^0-9]*//g; s/ */\t/g' | grep -w 'k3s/data/[^/]*/bin/containerd-shim' | cut -f1 | sort -n -u
}
killtree
$(
{
set
+x
;
}
2>/dev/null
;
getshims
;
set
-x
)
do_unmount() {
{ set +x; } 2>/dev/null
MOUNTS=
while read ignore mount ignore; do
MOUNTS="
$mount
\n
$MOUNTS
"
done </proc/self/mounts
MOUNTS=
$(
printf
$MOUNTS
|
grep
"^
$1
"
|
sort
-r
)
if [ -n "
${
MOUNTS
}
" ]; then
set -x
umount
${
MOUNTS
}
else
set -x
fi
}
do_unmount '/run/k3s'
do_unmount '/var/lib/rancher/k3s'
do_unmount '/run/netns/cni-'
# Delete network interface(s) that match 'master cni0'
ip link show | grep 'master cni0' | while read ignore iface ignore; do
ip link show
2>/dev/null
| grep 'master cni0' | while read ignore iface ignore; do
iface=
${
iface
%%@*
}
[ -z "
$iface
" ] || ip link delete
$iface
done
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment