From 44da6aa643ea14f85327433f2fb56fac855bfa2e Mon Sep 17 00:00:00 2001 From: 70m6 <105207964+70m6@users.noreply.github.com> Date: Wed, 15 Jun 2022 17:04:00 +0200 Subject: [PATCH] properly handle signals while sleeping https://i.imgur.com/OpOvSut.png --- docker-entrypoint | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker-entrypoint b/docker-entrypoint index eb482bf..73b065f 100755 --- a/docker-entrypoint +++ b/docker-entrypoint @@ -90,7 +90,8 @@ if [ "$1" = "autoheal" ] && [ -e "$DOCKER_SOCK" ];then if [ "$AUTOHEAL_START_PERIOD" -gt 0 ] then echo "Monitoring containers for unhealthy status in $AUTOHEAL_START_PERIOD second(s)" - sleep "$AUTOHEAL_START_PERIOD" + sleep "$AUTOHEAL_START_PERIOD" & + wait $! fi while true @@ -121,7 +122,8 @@ if [ "$1" = "autoheal" ] && [ -e "$DOCKER_SOCK" ];then fi fi done - sleep "$AUTOHEAL_INTERVAL" + sleep "$AUTOHEAL_INTERVAL" & + wait $! done else