Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/prometheus-exporters: replace nobody/nogroup #65810

Merged
merged 5 commits into from Aug 2, 2019

Conversation

WilliButz
Copy link
Member

Motivation for this change

Long overdue removal of nobody/nogroup from the exporters module.

Things done

When possible, exporters should use systemds DynamicUser, this is now the default for all exporters.
Because some exporters need filesystem access and such, they might still need a "real" user. For these scenarios it is possible to set DynamicUser = false and a user with a corresponding group will be created for that exporter to use, both following the pattern <exporter-name>-exporter (e.g. varnish-exporter).
This way neither nobody/nogroup nor root is used and multiple exporters don't need to be run under one shared user, keeping their access to metric sources separated.

Also replaced script by ExecStart for the wireguard exporter.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS (x86_64-linux & aarch64-linux)
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

/cc #55370

@WilliButz
Copy link
Member Author

@GrahamcOfBorg test prometheus-exporters.bind prometheus-exporters.blackbox prometheus-exporters.collectd prometheus-exporters.dnsmasq prometheus-exporters.dovecot prometheus-exporters.fritzbox prometheus-exporters.json prometheus-exporters.mail prometheus-exporters.minio prometheus-exporters.nginx prometheus-exporters.node prometheus-exporters.postfix prometheus-exporters.postgres prometheus-exporters.snmp prometheus-exporters.surfboard prometheus-exporters.tor prometheus-exporters.unifi prometheus-exporters.varnish prometheus-exporters.wireguard

@Ma27 Ma27 merged commit 2eda061 into NixOS:master Aug 2, 2019
@Ma27
Copy link
Member

Ma27 commented Aug 2, 2019

@WilliButz awesome, thanks!

@WilliButz WilliButz deleted the prometheus-exporters-replace-nobody branch August 2, 2019 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants