From de5a69c9187bf2a89f649dc7a9b4deb3ccb2d0d4 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 28 Apr 2021 21:02:11 +0200 Subject: [PATCH] nixos/promtail: Set TimeoutStopSec=10 On reboots and shutdowns promtail blocks for at least 90 seconds, because it would still try to deliver log messages for loki, which isn't possible when the network has already gone down. Upstreams example unit also uses a ten seconds timeout, something which has worked pretty well for me as well. --- nixos/modules/services/logging/promtail.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/services/logging/promtail.nix b/nixos/modules/services/logging/promtail.nix index 19b12daa415..34211687dc1 100644 --- a/nixos/modules/services/logging/promtail.nix +++ b/nixos/modules/services/logging/promtail.nix @@ -40,6 +40,7 @@ in { serviceConfig = { Restart = "on-failure"; + TimeoutStopSec = 10; ExecStart = "${pkgs.grafana-loki}/bin/promtail -config.file=${prettyJSON cfg.configuration} ${escapeShellArgs cfg.extraFlags}";