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
e810ee16
Unverified
Commit
e810ee16
authored
Oct 26, 2019
by
Erik Wilson
Committed by
GitHub
Oct 26, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #967 from erikwilson/killall-cleanup
Cleanup k3s-killall
parents
b18cc986
ef9c1f23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
install.sh
install.sh
+16
-5
No files found.
install.sh
View file @
e810ee16
...
@@ -437,13 +437,14 @@ create_killall() {
...
@@ -437,13 +437,14 @@ create_killall() {
info
"Creating killall script
${
BIN_DIR
}
/
${
KILLALL_K3S_SH
}
"
info
"Creating killall script
${
BIN_DIR
}
/
${
KILLALL_K3S_SH
}
"
$SUDO
tee
${
BIN_DIR
}
/
${
KILLALL_K3S_SH
}
>
/dev/null
<<
\
EOF
$SUDO
tee
${
BIN_DIR
}
/
${
KILLALL_K3S_SH
}
>
/dev/null
<<
\
EOF
#!/bin/sh
#!/bin/sh
set -x
[
$(
id
-u
)
-eq 0 ] || exec sudo
$0
$@
[
$(
id
-u
)
-eq 0 ] || exec sudo
$0
$@
for bin in /var/lib/rancher/k3s/data/**/bin/; do
for bin in /var/lib/rancher/k3s/data/**/bin/; do
[ -d
$bin
] && export PATH=
$bin
:
$PATH
[ -d
$bin
] && export PATH=
$bin
:
$PATH
done
done
set -x
for service in /etc/systemd/system/k3s*.service; do
for service in /etc/systemd/system/k3s*.service; do
[ -s
$service
] && systemctl stop
$(
basename
$service
)
[ -s
$service
] && systemctl stop
$(
basename
$service
)
done
done
...
@@ -452,18 +453,28 @@ for service in /etc/init.d/k3s*; do
...
@@ -452,18 +453,28 @@ for service in /etc/init.d/k3s*; do
[ -x
$service
] &&
$service
stop
[ -x
$service
] &&
$service
stop
done
done
pschildren() {
ps -e -o ppid= -o pid= | \
sed -e 's/^\s*//g; s/\s\s*/\t/g;' | \
grep -w "^
$1
" | \
cut -f2
}
pstree() {
pstree() {
for pid in
$@
; do
for pid in
$@
; do
echo
$pid
echo
$pid
# Find and show pstree for child processes of
$pid
for child in
$(
pschildren
$pid
)
; do
ps -o ppid= -o pid= | while read parent child; do
pstree
$child
[
$parent
-ne
$pid
] || pstree
$child
done
done
done
done
}
}
killtree() {
killtree() {
kill -9
$(
{
set
+x
;
}
2>/dev/null
;
pstree
$@
;
set
-x
)
2>/dev/null
kill -9
$(
{
set
+x
;
}
2>/dev/null
;
pstree
$@
;
set
-x
;
)
2>/dev/null
}
}
getshims() {
getshims() {
...
...
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