nixos/ntpd-rs: fix metrics service

This commit is contained in:
Franz Pletz 2024-01-17 14:56:49 +01:00
parent 842d9d80cf
commit 35c015ff91
No known key found for this signature in database
GPG Key ID: 846FDED7792617B4
2 changed files with 8 additions and 6 deletions

View File

@ -74,13 +74,13 @@ in
};
};
systemd.services.ntp-rs-metrics = lib.mkIf cfg.metrics.enable {
systemd.services.ntpd-rs-metrics = lib.mkIf cfg.metrics.enable {
wantedBy = [ "multi-user.target" ];
serviceConfig = {
User = "";
Group = "";
DynamicUser = true;
ExecStart = [ "" "${lib.makeBinPath [ cfg.package ]}/bin/ntp-metrics-exporter --config=${configFile}" ];
ExecStart = [ "" "${lib.makeBinPath [ cfg.package ]}/ntp-metrics-exporter --config=${configFile}" ];
};
};
};

View File

@ -41,9 +41,11 @@ import ./make-test-python.nix ({ lib, ... }:
testScript = { nodes, ... }: ''
start_all()
server.wait_for_unit('multi-user.target')
client.wait_for_unit('multi-user.target')
server.succeed('systemctl is-active ntpd-rs.service')
client.succeed('systemctl is-active ntpd-rs.service')
for machine in (server, client):
machine.wait_for_unit('multi-user.target')
machine.succeed('systemctl is-active ntpd-rs.service')
machine.succeed('systemctl is-active ntpd-rs-metrics.service')
machine.succeed('curl http://localhost:9975/metrics | grep ntp_uptime_seconds')
'';
})