From b9775500fbc8fde2171d386b64459cfd8cb96d02 Mon Sep 17 00:00:00 2001 From: fruchti Date: Fri, 7 Apr 2023 14:00:05 +0200 Subject: [PATCH] Emitter: Try restarting burp-client a few times --- hosts/Emitter.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/hosts/Emitter.nix b/hosts/Emitter.nix index 85d7390..a19034c 100644 --- a/hosts/Emitter.nix +++ b/hosts/Emitter.nix @@ -117,7 +117,20 @@ }; }; services.statusEmail.enable = true; - systemd.services.burp-client.unitConfig.OnFailure = "status-email@%n.service"; + systemd.services.burp-client = let + retryDelay = 10 * 60; + maxRetries = 3; + in { + unitConfig = { + OnFailure = "status-email@%n.service"; + StartLimitIntervalSec = (maxRetries + 1) * retryDelay; + StartLimitBurst = maxRetries; + }; + serviceConfig = { + Restart = "on-failure"; + RestartSec = retryDelay; + }; + }; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions