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/networking.nix: make /etc/netgroup empty #68671

Closed
wants to merge 1 commit into from

Conversation

matthewbauer
Copy link
Member

nscd complains when we say to cache /etc/netgroup but it doesn’t
actually exist. To silence these (apparently harmless) warning, just
make /etc/netgroup empty on activation.

Fixes #68603

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • 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.
Notify maintainers

cc @

nscd complains when we say to cache /etc/netgroup but it doesn’t
actually exist. To silence these (apparently harmless) warning, just
make /etc/netgroup empty on NixOS

Fixes NixOS#68603
@@ -37,6 +37,10 @@ in
###### implementation

config = mkIf cfg.enable {
system.activationScripts.netgroup = ''
touch /etc/netgroup
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

systemd.tmpfiles.rules is preferred here. If we ever want to manage this file or a user would it not be better to use environment.etc."netgroup"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding was it could be generated by some tools similar to how resolv.conf works. But unclear on that, and probably need someone who actually uses this file to provide some input. This was just the easiest way to silence that warning.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like following should work too:

systemd.tmpfiles.rules = [ "f /etc/netgroup" ];

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.

nscd complaining about not finding /etc/netgroup
2 participants