Merge pull request #148471 from Ma27/postfix-exporter-hardening
This commit is contained in:
commit
42ae887b23
@ -76,6 +76,9 @@ in
|
||||
serviceOpts = {
|
||||
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" ];
|
||||
ExecStart = ''
|
||||
${pkgs.prometheus-postfix-exporter}/bin/postfix_exporter \
|
||||
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
|
||||
|
@ -861,6 +861,9 @@ let
|
||||
wait_for_unit("prometheus-postfix-exporter.service")
|
||||
wait_for_file("/var/lib/postfix/queue/public/showq")
|
||||
wait_for_open_port(9154)
|
||||
wait_until_succeeds(
|
||||
"curl -sSf http://localhost:9154/metrics | grep 'postfix_up{path=\"/var/lib/postfix/queue/public/showq\"} 1'"
|
||||
)
|
||||
succeed(
|
||||
"curl -sSf http://localhost:9154/metrics | grep 'postfix_smtpd_connects_total 0'"
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user