From 3c131f853d24a08349fd55a8bbcce2bc4b6f6078 Mon Sep 17 00:00:00 2001 From: Dov Alperin Date: Fri, 2 Sep 2022 23:14:10 +0000 Subject: [PATCH] Use pkill by default for autostop feature (#1707) --- files/autostop/stop.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/autostop/stop.sh b/files/autostop/stop.sh index 2629e2fa..7a559f6b 100755 --- a/files/autostop/stop.sh +++ b/files/autostop/stop.sh @@ -6,4 +6,8 @@ if isTrue "${DEBUG_AUTOSTOP}"; then fi logAutostopAction "Stopping Java process" -kill -SIGTERM 1 +if isTrue "${AUTOSTOP_PKILL_USE_SUDO:-false}"; then + sudo pkill -f --signal SIGTERM mc-server-runner +else + pkill -f --signal SIGTERM mc-server-runner +fi