munin: fix tests by replacing cron with systemd timer

+17 -4
+16 -4
nixos/modules/services/monitoring/munin.nix
··· 193 193 194 194 }) (mkIf cronCfg.enable { 195 195 196 - services.cron.systemCronJobs = [ 197 - "*/5 * * * * munin ${pkgs.munin}/bin/munin-cron --config ${muninConf}" 198 - ]; 196 + systemd.timers.munin-cron = { 197 + description = "batch Munin master programs"; 198 + wantedBy = [ "timers.target" ]; 199 + timerConfig.OnCalendar = "*:0/5"; 200 + }; 201 + 202 + systemd.services.munin-cron = { 203 + description = "batch Munin master programs"; 204 + unitConfig.Documentation = "man:munin-cron(8)"; 205 + 206 + serviceConfig = { 207 + Type = "oneshot"; 208 + User = "munin"; 209 + ExecStart = "${pkgs.munin}/bin/munin-cron --config ${muninConf}"; 210 + }; 211 + }; 199 212 200 213 system.activationScripts.munin-cron = stringAfter [ "users" "groups" ] '' 201 214 mkdir -p /var/{run,log,www,lib}/munin 202 215 chown -R munin:munin /var/{run,log,www,lib}/munin 203 216 ''; 204 - 205 217 })]; 206 218 }
+1
nixos/tests/munin.nix
··· 29 29 startAll; 30 30 31 31 $one->waitForUnit("munin-node.service"); 32 + $one->succeed('systemctl start munin-cron'); 32 33 $one->waitForFile("/var/lib/munin/one/one-uptime-uptime-g.rrd"); 33 34 $one->waitForFile("/var/www/munin/one/index.html"); 34 35 '';