From 563af10ae5ca88ffa3f6a41d1a8505e19197ac75 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Thu, 5 Dec 2024 11:48:49 +0100 Subject: [PATCH] Improve PID --- .templates/ha_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.templates/ha_entrypoint.sh b/.templates/ha_entrypoint.sh index 9f91ea2a8..18f47c928 100755 --- a/.templates/ha_entrypoint.sh +++ b/.templates/ha_entrypoint.sh @@ -59,7 +59,7 @@ if [ "$$" -eq 1 ]; then echo "Termination signal received, forwarding to subprocesses..." # Gracefully terminate open subprocesses - for pid in $(ls /proc/*/cmdline 2>/dev/null | grep -oP '/proc/\K[0-9]+'); do + for pid in $(grep -l "/etc/cont-init.d" /proc/*/cmdline 2>/dev/null | grep -oP '/proc/\K[0-9]+'); do echo "Terminating PID $pid" kill -TERM "$pid" 2>/dev/null || true done