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.
This commit is contained in:
Martin Weinelt 2021-04-28 21:02:11 +02:00
parent dab2173285
commit de5a69c918
No known key found for this signature in database
GPG key ID: 87C1E9888F856759

View file

@ -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}";