-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
nixos/nfsd: run rpc-statd as a normal user #96844
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
Conversation
Out of curiosity what user does this run on other distros like Arch, Debian, Gentoo, RedHat, etc...? |
Debian uses "statd", so maybe we just use that.
|
This is somewhat confusing if you aren't familiar with the internals of If we look at the If we merge this PR now as is would you have capacity to either work on or review a PR which replaced the |
aea3ef7
to
b3596db
Compare
Very good points - I totally missed those |
# /var/lib/nfs | ||
systemd.tmpfiles.rules = [ | ||
"d /var/lib/nfs 0700 ${rpcUser} ${rpcUser} - -" | ||
"d /var/lib/nfs/recovery 0755 root root - -" |
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.
Does this throw a silent runtime error with systemd-tmpfiles
stating unsafe transition? I'm thinking it will... 🤔
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.
Why would it do that?
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.
Found another |
It works here though. I just tried shutting down the nfs service, remove the directory and reboot the nas. This is what is created: # ls -la nfs
total 8
drwx------ 1 statd statd 132 Sep 7 20:22 .
drwxr-xr-x 1 root root 256 Sep 7 20:22 ..
-rw-r--r-- 1 root root 207 Sep 7 20:22 etab
-rw------- 1 root root 0 Sep 7 20:22 .etab.lock
-rw-r--r-- 1 root root 0 Sep 7 20:22 export-lock
drwxr-xr-x 1 root root 0 Sep 7 20:22 recovery
dr-xr-xr-x 11 root root 0 Sep 7 20:22 rpc_pipefs
drwxr-xr-x 1 root root 0 Sep 7 20:22 sm
drwxr-xr-x 1 root root 0 Sep 7 20:22 sm.bak
-rw-r--r-- 1 root root 4 Sep 7 20:22 state
drwxr-xr-x 1 root root 0 Sep 7 20:22 v4recovery |
This is admittedly with this PR applied to 20.03 which uses systemd 243. I don't know if anything changed since then. |
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.
Great, glad to hear this is fine. I can't recall the details of what systemd
classifies as an unsafe transition but this is working so... LGTM 👍
@GrahamcOfBorg eval |
This merge breaks a test #97582 (I checked a local revert). Unless we have a fix very soon (say, today), I suggest to revert it until the issue is resolved. |
Thanks for handling this - things were working perfectly fine here. I'll get this fixed later. |
Motivation for this change
Instead of running it as root, use a dedicated user.
Been running with it here for a while without any issues.
Closes #63756
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)