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