mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-10 18:01:03 +01:00
Improve PID
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user