summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2022-06-16 23:36:28 +0200
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2022-06-20 17:37:00 +0000
commit487689b35d0388e71464e7e384d60d321ca1ac16 (patch)
treec1f5498860c6b2f9f86f93b8396a275d8000be32
parentboost: use jfrog mirror instead of bintray (diff)
downloadnixpkgs-487689b35d0388e71464e7e384d60d321ca1ac16.tar.gz
nixos/prometheus-postfix-exporter: fixes for systemd integrationorigin/backport-177935-to-release-22.05
* Allow the service to read from the journal w/systemd.enable * Ensure that the service is started after postfix.service (cherry picked from commit 1f9375b92e8236b4881f080e3b43d8db8db2dc68)
-rw-r--r--nixos/modules/services/monitoring/prometheus/exporters/postfix.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/exporters/postfix.nix b/nixos/modules/services/monitoring/prometheus/exporters/postfix.nix
index 4d3c1fa267e5..53509b7a385b 100644
--- a/nixos/modules/services/monitoring/prometheus/exporters/postfix.nix
+++ b/nixos/modules/services/monitoring/prometheus/exporters/postfix.nix
@@ -74,11 +74,13 @@ in
};
};
serviceOpts = {
+ after = mkIf cfg.systemd.enable [ cfg.systemd.unit ];
serviceConfig = {
DynamicUser = false;
# By default, each prometheus exporter only gets AF_INET & AF_INET6,
# but AF_UNIX is needed to read from the `showq`-socket.
RestrictAddressFamilies = [ "AF_UNIX" ];
+ SupplementaryGroups = mkIf cfg.systemd.enable [ "systemd-journal" ];
ExecStart = ''
${pkgs.prometheus-postfix-exporter}/bin/postfix_exporter \
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \