tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
munin: fix tests by replacing cron with systemd timer
Jörg Thalheim
9 years ago
b4169bb8
2e06a585
+17
-4
2 changed files
expand all
collapse all
unified
split
nixos
modules
services
monitoring
munin.nix
tests
munin.nix
+16
-4
nixos/modules/services/monitoring/munin.nix
···
193
193
194
194
}) (mkIf cronCfg.enable {
195
195
196
196
-
services.cron.systemCronJobs = [
197
197
-
"*/5 * * * * munin ${pkgs.munin}/bin/munin-cron --config ${muninConf}"
198
198
-
];
196
196
+
systemd.timers.munin-cron = {
197
197
+
description = "batch Munin master programs";
198
198
+
wantedBy = [ "timers.target" ];
199
199
+
timerConfig.OnCalendar = "*:0/5";
200
200
+
};
201
201
+
202
202
+
systemd.services.munin-cron = {
203
203
+
description = "batch Munin master programs";
204
204
+
unitConfig.Documentation = "man:munin-cron(8)";
205
205
+
206
206
+
serviceConfig = {
207
207
+
Type = "oneshot";
208
208
+
User = "munin";
209
209
+
ExecStart = "${pkgs.munin}/bin/munin-cron --config ${muninConf}";
210
210
+
};
211
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
204
-
205
217
})];
206
218
}
+1
nixos/tests/munin.nix
···
29
29
startAll;
30
30
31
31
$one->waitForUnit("munin-node.service");
32
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
'';