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/avahi: fix nss module #99530

Merged
merged 1 commit into from Oct 11, 2020
Merged

nixos/avahi: fix nss module #99530

merged 1 commit into from Oct 11, 2020

Conversation

@lopsided98
Copy link
Contributor

@lopsided98 lopsided98 commented Oct 4, 2020

mdns_minimal must be placed before resolve in nsswitch.conf. This was broken by #86940 or #87016, when the config was split up into multiple modules and the ordering was lost. This PR uses mkOrder to restore the correct ordering.

This PR ends up placing mymachines between mdns_minimal and resolve, but I believe this is fine. My understanding of the problem is that resolve responds to all hostnames, so .local domains currently never make it to mdns_minimal. On the other hand, mdns_minimal only responds to .local domains and all other are passed on to the next module. So as long as a systemd container doesn't have a .local domain there shouldn't be a problem.

Fixes #98050.

cc @flokli

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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.
mdns_minimal must be placed before resolve in nsswitch.conf
Copy link
Contributor

@doronbehar doronbehar left a comment

Works for me.

@arianvp
Copy link
Member

@arianvp arianvp commented Oct 5, 2020

Hmm I need to give this a bit of thought, resolved/networkd has its own MDNS resolver built-in; and this will actually break when people want to use resolved's built-in support for resolving mDNS (which allows you to configure mDNS per interface using .network files).

If you don't explicitly disable the responder (by setting MulticastDNS=resolve or MulticastDNS=false) other things will break in combination with Avahi too I think.

@lopsided98 if you set MulticastDNS=false

Also see the notes about this in the Arch wiki : https://wiki.archlinux.org/index.php/Avahi

OTOH the arch wiki has the same order as you're proposing here; so this is probably fine?

@lopsided98
Copy link
Contributor Author

@lopsided98 lopsided98 commented Oct 5, 2020

I don't think resolved's mDNS support is on by default, is it? The per-link setting defaults to off. I have Avahi enabled without touching resolved's settings and it works fine.

In any case, this PR just means that Avahi will preferred over resolved for mDNS resolution if both are enabled.

@bjornfor bjornfor merged commit 8294af0 into NixOS:master Oct 11, 2020
16 checks passed
16 checks passed
tests tests
Details
action
Details
Evaluation Performance Report Evaluator Performance Report
Details
Wait for ofborg
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6d636ab"; rev="6d636ab15a4febf2d8769bbd8d9a4f4ead2029dc"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6d636ab"; rev="6d636ab15a4febf2d8769bbd8d9a4f4ead2029dc"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6d636ab"; rev="6d636ab15a4febf2d8769bbd8d9a4f4ead2029dc"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6d636ab"; rev="6d636ab15a4febf2d8769bbd8d9a4f4ead2029dc"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6d636ab"; rev="6d636ab15a4febf2d8769bbd8d9a4f4ead2029dc"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6d636ab"; rev="6d636ab15a4febf2d8769bbd8d9a4f4ead2029dc"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6d636ab"; rev="6d636ab15a4febf2d8769bbd8d9a4f4ead2029dc"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
flokli added a commit that referenced this pull request Oct 11, 2020
This allows testing avahi works with resolved being enabled, as a
regression test for #99530.
@flokli flokli mentioned this pull request Oct 11, 2020
1 of 10 tasks complete
@lopsided98 lopsided98 deleted the lopsided98:avahi-nss branch Oct 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.