-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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/nscd: start in early boot #154928
nixos/nscd: start in early boot #154928
Conversation
Thanks, I can confirm this fixes the issue with Before:
After:
|
I highly recommend |
Source: We have been doing so in our downstream repo for ~1 year and have had no issues since then |
@@ -474,6 +476,13 @@ sub filterUnits { | |||
print STDERR "setting up tmpfiles\n"; | |||
system("@systemd@/bin/systemd-tmpfiles", "--create", "--remove", "--exclude-prefix=/dev") == 0 or $res = 3; | |||
|
|||
# We need to start nscd before any other service, since they might need |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of yet another special case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a way around it without that does not involve getting rid of nscd.
Also it may be helpful to just fix nscd.service instead:
Of course stc will not start nscd if nobody wants the service… |
This also has the big downside that nss changes no longer are applied until reboot. |
This is a foot gun at best. Non one expects a dependency on nscd when using |
If we don't fix this I would consider DynamicUser not as fit for purpose in NixOS. |
revert if NixOS#154928 or a similar fix gets applied
Would it be a footgun if the module (systemd unit generator) automatically did it for you? That wouldn't work for units coming from |
Maybe but I feel this is more code/complexity in all of nixpkgs than just having them in the activation script. Also we can no longer use some of the upstream systemd units as is. |
Can we drop this in favor of #155655? With this in, requests before nscd is up should still work. |
@flokli: It's common practice to use the stable NixOS release for the system modules and run services with binaries from unstable on top of that. When the glibc minor release differs between stable and unstable, #155655 won't work for these services. |
But I'd assume we can revert this after #155655 is merged, or in a followup PR, to get closer with upstream again? |
For systems that have services using different glibc minor versions, #155655 is no replacement for this PR. |
rebased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything appears in order. @Mic92 is it ready for merge? I can pull the trigger if so.
Still not a fan at all. Adding yet another special case to stc that could also be implemented by native systemd functionality. A fix that would involve only systemd logic would be to add the But do what you think is best. |
You suggestion sounds reasonable to me.I'll leave open for a bit to give time for consideration. |
Services that have dynamic users require nscd to resolve users via pam_systemd. Those services might not even create their own dynamic users itself i.e. iptables. To make sure nscd is always started when this is happening we move nscd to sysinit.target and make sure that it is always started before starting/reloading/restarting any other service.
Rebased. |
Also I will check if #154620 is enough. |
this is what I proposed in #105354, but it was rejected. |
Isn't this already fixed by #154320? |
I had the issue on 2022-05-12 on a system updated daily. |
I highly doubt it |
Services that have dynamic users require nscd to resolve users
via pam_systemd. Those services might not even create
their own dynamic users itself i.e. iptables.
To make sure nscd is always started when this is happening we move
nscd to sysinit.target and make sure that it is always started before
starting/reloading/restarting any other service.
Motivation for this change
This pr was original opened here: #106336
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes