From f195e7a6f770d97857b5340e308de462b2369eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 23 Sep 2026 06:58:50 +0300 Subject: [PATCH] fix: retry a failed compose-up instead of staying down Keep Type=oneshot and `up -d`. systemd 259 honors Restart=on-failure for oneshot (measured: the restart counter advanced). Attached `podman compose up` does not: podman-compose 1.6 only runs down on SIGINT, and a container start failure exits 0, so Type=simple Restart= would never see the failure. RestartSec=1500s is past the longest deploy health gate (rag, 960s), so a background retry cannot undo a rollback. --- deploy/hezarfen_backend_compose.service | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/deploy/hezarfen_backend_compose.service b/deploy/hezarfen_backend_compose.service index fb94ce2..81ef890 100644 --- a/deploy/hezarfen_backend_compose.service +++ b/deploy/hezarfen_backend_compose.service @@ -26,6 +26,13 @@ # Env-only restart (restart re-runs `compose up -d`, recreating containers # whose environment changed): # systemctl --user restart hezarfen_backend_compose +# +# A failed ExecStart (boot-time `compose up`, or a restart) is retried after +# 1500s until one succeeds. systemd 259 honors Restart= on Type=oneshot. +# Attached `podman compose up` is not used: podman-compose 1.6 only runs +# `down` on SIGINT, and a container that fails to start exits 0, so Restart= +# would never see that failure. 1500s is past the longest deploy health gate +# (rag, 960s) so a background retry cannot undo a rollback. [Unit] Description=Hezarfen backend compose stack (postgres + backend + openobserve) @@ -35,6 +42,8 @@ Wants=network-online.target [Service] Type=oneshot RemainAfterExit=yes +Restart=on-failure +RestartSec=1500s WorkingDirectory=%h/hezarfen_backend # ORTAM IKI KANALDAN GELIR -- bu bir tercih degil, saglayicinin siniridir: # * operatorun ayar dosyasi -> `EnvironmentFile=` (systemd dosyayi unit'in