Ensure old k3s processes are clean up

Before starting up new k3s instance, make sure old ones are gone.
To fix issue  #7128

Signed-off-by: Liyi Meng <meng.mobile@gmail.com>
This commit is contained in:
Liyi Meng 2023-03-27 20:08:44 +08:00 committed by Liyi Meng
parent 01ea3ff27b
commit 13d07435fe

View File

@ -819,6 +819,7 @@ depend() {
} }
start_pre() { start_pre() {
(ps -ef | grep -E "k3s .*(server|agent)" | grep -E -v "(init|grep|channelserver|supervise-daemon)" | awk '{print $2}' | xargs kill 2>/dev/null) || true
rm -f /tmp/k3s.* rm -f /tmp/k3s.*
} }