munin: fix tests by replacing cron with systemd timer

This commit is contained in:
Jörg Thalheim
2017-03-22 00:16:36 +01:00
parent 2e06a585bc
commit b4169bb8dd
2 changed files with 17 additions and 4 deletions
+16 -4
View File
@@ -193,14 +193,26 @@ in
}) (mkIf cronCfg.enable {
services.cron.systemCronJobs = [
"*/5 * * * * munin ${pkgs.munin}/bin/munin-cron --config ${muninConf}"
];
systemd.timers.munin-cron = {
description = "batch Munin master programs";
wantedBy = [ "timers.target" ];
timerConfig.OnCalendar = "*:0/5";
};
systemd.services.munin-cron = {
description = "batch Munin master programs";
unitConfig.Documentation = "man:munin-cron(8)";
serviceConfig = {
Type = "oneshot";
User = "munin";
ExecStart = "${pkgs.munin}/bin/munin-cron --config ${muninConf}";
};
};
system.activationScripts.munin-cron = stringAfter [ "users" "groups" ] ''
mkdir -p /var/{run,log,www,lib}/munin
chown -R munin:munin /var/{run,log,www,lib}/munin
'';
})];
}