From 64653f5ce1caa0ee7414f11502c10d3b2d4d32e8 Mon Sep 17 00:00:00 2001 From: Roman Podoliaka Date: Mon, 23 Dec 2024 09:32:29 +0000 Subject: [PATCH] Add a dependency on postgresql.service to xsnippet-api.service xsnippet-api tries to connect to PostgreSQL on start and will fail if it's not available. Declare this dependency in systemd, so that the services always come up in the right order. --- roles/xsnippet_api/templates/systemd.service.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/xsnippet_api/templates/systemd.service.j2 b/roles/xsnippet_api/templates/systemd.service.j2 index 080f534..bd3e868 100644 --- a/roles/xsnippet_api/templates/systemd.service.j2 +++ b/roles/xsnippet_api/templates/systemd.service.j2 @@ -1,7 +1,7 @@ [Unit] Description = XSnippet API -After = network.target network-online.target -Wants = network-online.target +After = network.target network-online.target postgresql.service +Wants = network-online.target postgresql.service StartLimitIntervalSec = 0 [Service]