From 2e06a585bce2860c4a8bf6ae832b0dbdb4fbc3b7 Mon Sep 17 00:00:00 2001 From: ndowens Date: Tue, 21 Mar 2017 16:41:38 -0500 Subject: [PATCH 1/2] munin: 2.0.30 -> 2.0.33; for CVE-2017-6188 --- pkgs/servers/monitoring/munin/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/monitoring/munin/default.nix b/pkgs/servers/monitoring/munin/default.nix index 5d7d2e787735..7882572b6c88 100644 --- a/pkgs/servers/monitoring/munin/default.nix +++ b/pkgs/servers/monitoring/munin/default.nix @@ -3,14 +3,14 @@ }: stdenv.mkDerivation rec { - version = "2.0.30"; + version = "2.0.33"; name = "munin-${version}"; src = fetchFromGitHub { owner = "munin-monitoring"; repo = "munin"; rev = version; - sha256 = "1sxsdfq9a5d8b13jigr06gs7n4m3c95645sfyyl49bkfy0n5cxrg"; + sha256 = "0rs05b7926mjd58sdry33i91m1h3v3svl0wg2gmhljl8wqidac5w"; }; buildInputs = [ From b4169bb8dde4a4afa829132703455e4def13a633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 22 Mar 2017 00:08:41 +0100 Subject: [PATCH 2/2] munin: fix tests by replacing cron with systemd timer --- nixos/modules/services/monitoring/munin.nix | 20 ++++++++++++++++---- nixos/tests/munin.nix | 1 + 2 files changed, 17 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 ''; - })]; } diff --git a/nixos/tests/munin.nix b/nixos/tests/munin.nix index 50746d17b451..40fafc625146 100644 --- a/nixos/tests/munin.nix +++ b/nixos/tests/munin.nix @@ -29,6 +29,7 @@ import ./make-test.nix ({ pkgs, ...} : { startAll; $one->waitForUnit("munin-node.service"); + $one->succeed('systemctl start munin-cron'); $one->waitForFile("/var/lib/munin/one/one-uptime-uptime-g.rrd"); $one->waitForFile("/var/www/munin/one/index.html"); '';