nixos/prometheus-postfix-exporter: use socket activation
Run postfix_exporter with `--web.systemd-socket` and move the listen-address/port configuration into a companion `.socket` unit.
This commit is contained in:
@@ -85,6 +85,7 @@ in
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
serviceOpts = {
|
||||
after = mkIf cfg.systemd.enable [ cfg.systemd.unit ];
|
||||
serviceConfig = {
|
||||
@@ -95,7 +96,7 @@ in
|
||||
SupplementaryGroups = mkIf cfg.systemd.enable [ "systemd-journal" ];
|
||||
ExecStart = ''
|
||||
${lib.getExe cfg.package} \
|
||||
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
|
||||
--web.systemd-socket \
|
||||
--web.telemetry-path ${cfg.telemetryPath} \
|
||||
--postfix.showq_path ${escapeShellArg cfg.showqPath} \
|
||||
${concatStringsSep " \\\n " (
|
||||
@@ -115,4 +116,8 @@ in
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
socketOpts = {
|
||||
socketConfig.ListenStream = "${cfg.listenAddress}:${toString cfg.port}";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user