-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
Fix systemd resolved nsswitch loading and clearly state NSS module's dependency on nscd #26967
Fix systemd resolved nsswitch loading and clearly state NSS module's dependency on nscd #26967
Conversation
When |
Regarding the 2nd commit, can we add an assertion instead of a comment (or in addition)? |
@bjornfor Any idea for a good assertion? Failing an assertion would be nice, but just „if this option is used, assert nscd.enable = true;“ would currently mean all of nsswitch would always fail if nscd is disabled, because it is using this option itself when adding the systemd nss modules: We could make that conditional on whether nscd is enabled, then. But then this still would not fail if a user enables |
@florianjacob: No idea. I didn't look at the code. I was just hoping there was some NixOS option that could be checked at evaluation time. |
I think what we can do would be:
Does that seem sensible? It operates on the assumption that any of these services are not really useful without nsswitch.conf, but I guess that's the case. I think I'll try to write the code for that. |
9495cef
to
8c89834
Compare
this had the effect of not being able to load nss-resolve and falling back to dns module in all cases.
8c89834
to
4a9fa18
Compare
@bjornfor Assertions added! Should work that way. 😄 Now also includes a proposal commit to only add external stuff to nsswitch.conf when nscd is enabled. |
4a9fa18
to
e370e97
Compare
Identified @Mic92 as potential reviewer from the |
Thanks. |
@Mic92 Thanks for your time. 👍 |
Motivation for this change
nss-resolve
fails silently to get loaded whenresolved
is enabled because of a typo.I spent way too much time investigating the source DNS issue leading to this typo because the first thing I did was disabling nscd to exclude cashing problems, therefore the note that nscd is required for any not-included modules to be loaded.
I thought about only adding the dynamic modules only if their respective service like
resolved
andnscd
is enabled to make potential issues more obvious when looking at/etc/nsswitch.conf
which then would not contain modules that it cannot load, but I'm not sure about that and wanted to discuss it first.Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)