forge
Explore
Log in

Don't you dare go Hollow

Retry a failed compose-up instead of staying down

Browse files at this commit

134740844e514ae38639b754127844773368d9fcAhmet Kaan GümüşParent: e0d5111
  • fix
    • retry a failed compose-up instead of staying down
Show full message
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_frontend_compose.servicemodified+4 -1
@@ -26,7 +26,8 @@
26 # systemctl --user restart hezarfen_frontend_compose26 # systemctl --user restart hezarfen_frontend_compose
27 #27 #
28 # Reboots heal themselves: the user session lingers (`loginctl enable-linger`)28 # Reboots heal themselves: the user session lingers (`loginctl enable-linger`)
29-# and this unit runs compose again at boot.29+# and this unit runs compose again at boot. A failed compose-up is retried
30+# (Restart=on-failure, RestartSec=1500s) so it does not wait for a hand restart.
30 31
31 [Unit]32 [Unit]
32 Description=Hezarfen frontend compose stack (Bun static server + /api proxy)33 Description=Hezarfen frontend compose stack (Bun static server + /api proxy)
@@ -36,6 +37,8 @@ Wants=network-online.target
36 [Service]37 [Service]
37 Type=oneshot38 Type=oneshot
38 RemainAfterExit=yes39 RemainAfterExit=yes
40+Restart=on-failure
41+RestartSec=1500s
39 WorkingDirectory=%h/hezarfen_frontend42 WorkingDirectory=%h/hezarfen_frontend
40 # Later --env-file wins for duplicate keys: the operator's knobs file first,43 # Later --env-file wins for duplicate keys: the operator's knobs file first,
41 # the deploy-owned stack.env (HEZARFEN_TAG) second.44 # the deploy-owned stack.env (HEZARFEN_TAG) second.