1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

Merge pull request #1146 from emilazy/push-ylsrzmyxtlor

prometheus-node-exporter: fix log permissions
This commit is contained in:
Emily 2024-11-05 04:09:18 +00:00 committed by GitHub
commit 0e3f3f017c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -81,7 +81,8 @@ in {
users.users._prometheus-node-exporter = {
uid = config.ids.uids._prometheus-node-exporter;
gid = config.ids.gids._prometheus-node-exporter;
home = "/var/empty";
home = "/var/lib/prometheus-node-exporter";
createHome = true;
shell = "/usr/bin/false";
description = "System user for the Prometheus Node exporter";
};
@ -104,11 +105,14 @@ in {
++ (map (collector: "--collector.${collector}") cfg.enabledCollectors)
++ (map (collector: "--no-collector.${collector}") cfg.disabledCollectors)
) + escapeShellArgs cfg.extraFlags;
serviceConfig = {
serviceConfig = let
logPath = config.users.users._prometheus-node-exporter.home
+ "/prometheus-node-exporter.log";
in {
KeepAlive = true;
RunAtLoad = true;
StandardErrorPath = "/var/log/prometheus-node-exporter.log";
StandardOutPath = "/var/log/prometheus-node-exporter.log";
StandardErrorPath = logPath;
StandardOutPath = logPath;
GroupName = "_prometheus-node-exporter";
UserName = "_prometheus-node-exporter";
};