From 6ae1804a9d39acb79426e9ba4672c496dea06c7c Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Wed, 24 Apr 2024 11:30:28 +0200 Subject: [PATCH] Remove waiting loop for piler-app to be active in configure-module/80start_services --- imageroot/actions/configure-module/80start_services | 10 ---------- imageroot/systemd/user/piler-app.service | 1 + 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/imageroot/actions/configure-module/80start_services b/imageroot/actions/configure-module/80start_services index 75522d9..93f081a 100755 --- a/imageroot/actions/configure-module/80start_services +++ b/imageroot/actions/configure-module/80start_services @@ -9,13 +9,3 @@ systemctl --user enable piler.service systemctl --user restart piler.service - -# before to send the action add-relay-rule or aler-relay-rule we need to wait until the service is active -# does not work as expected in systemd post startup -for ((i = 0; i < 60; i++)); do - if podman exec piler-app /etc/init.d/rc.piler status | grep 'piler is running'; then - break - fi - echo "Waiting for piler-app to be active..." - sleep 1 -done diff --git a/imageroot/systemd/user/piler-app.service b/imageroot/systemd/user/piler-app.service index df4618e..8a1390e 100644 --- a/imageroot/systemd/user/piler-app.service +++ b/imageroot/systemd/user/piler-app.service @@ -31,6 +31,7 @@ ExecStart=/usr/bin/podman run --conmon-pidfile %t/piler-app.pid \ --env PILER_HOSTNAME=${TRAEFIK_HOST} \ --env MEMCACHED_HOST=127.0.0.1 \ ${PILER_IMAGE} +ExecStartPost=/usr/bin/bash -c "while ! podman exec piler-app /etc/init.d/rc.piler status | grep 'piler is running' ; do sleep 5 && echo "Wait after piler-app...." ; done" ExecStop=/usr/bin/podman stop --ignore --cidfile %t/piler-app.ctr-id -t 10 ExecReload=/usr/local/bin/runagent expand-configuration ExecReload=/usr/bin/podman kill -s HUP piler-app