summary refs log tree commit diff
path: root/nixos/modules/services/monitoring
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2017-03-22 00:08:41 +0100
committerJörg Thalheim <joerg@thalheim.io>2017-03-22 00:16:36 +0100
commitb4169bb8dde4a4afa829132703455e4def13a633 (patch)
tree72e20f79a4f1f44c6de17038ac013df610c6c290 /nixos/modules/services/monitoring
parent2e06a585bce2860c4a8bf6ae832b0dbdb4fbc3b7 (diff)
downloadnixlib-b4169bb8dde4a4afa829132703455e4def13a633.tar
nixlib-b4169bb8dde4a4afa829132703455e4def13a633.tar.gz
nixlib-b4169bb8dde4a4afa829132703455e4def13a633.tar.bz2
nixlib-b4169bb8dde4a4afa829132703455e4def13a633.tar.lz
nixlib-b4169bb8dde4a4afa829132703455e4def13a633.tar.xz
nixlib-b4169bb8dde4a4afa829132703455e4def13a633.tar.zst
nixlib-b4169bb8dde4a4afa829132703455e4def13a633.zip
munin: fix tests by replacing cron with systemd timer
Diffstat (limited to 'nixos/modules/services/monitoring')
-rw-r--r--nixos/modules/services/monitoring/munin.nix20
1 files changed, 16 insertions, 4 deletions
diff --git a/nixos/modules/services/monitoring/munin.nix b/nixos/modules/services/monitoring/munin.nix
index 364f18e7543d..b8c26a5c89ba 100644
--- a/nixos/modules/services/monitoring/munin.nix
+++ b/nixos/modules/services/monitoring/munin.nix
@@ -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
     '';
-
   })];
 }