From 1987dbe35db2e28aca3f7dfe2b7e4d091397c55c Mon Sep 17 00:00:00 2001 From: matt1432 Date: Fri, 18 Oct 2024 20:29:10 -0400 Subject: [PATCH] fix(caddy): add timeout before starting service --- devices/cluster/modules/caddy.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/devices/cluster/modules/caddy.nix b/devices/cluster/modules/caddy.nix index de9818d0..7c492e0b 100644 --- a/devices/cluster/modules/caddy.nix +++ b/devices/cluster/modules/caddy.nix @@ -17,13 +17,16 @@ in { boot.kernel.sysctl."net.ipv4.ip_nonlocal_bind" = 1; - systemd.services.caddy.serviceConfig = { - EnvironmentFile = secrets.caddy-cloudflare.path; + systemd.services.caddy = { + preStart = "sleep 30"; + serviceConfig = { + EnvironmentFile = secrets.caddy-cloudflare.path; - # For some reason the service - # doesn't shutdown normally - KillSignal = "SIGKILL"; - RestartKillSignal = "SIGKILL"; + # For some reason the service + # doesn't shutdown normally + KillSignal = "SIGKILL"; + RestartKillSignal = "SIGKILL"; + }; }; services.caddy = {