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

nscd/nscnd socket access errors #259352

Closed
nicolaslt opened this issue Oct 6, 2023 · 4 comments
Closed

nscd/nscnd socket access errors #259352

nicolaslt opened this issue Oct 6, 2023 · 4 comments
Assignees
Labels
0.kind: bug Something is broken

Comments

@nicolaslt
Copy link

Describe the bug

Both nscd and nsncd are failing to create/write/access the socket over at /var/run/nscd/socket.

I'm on a fresh 23.05 install.

Relevant nsncd logs:

Oct 03 12:20:52 niconix nsncd[717]: Oct 03 12:20:52.637 INFO started, handoff_timeout: 3s, worker_count: 8, path: "/var/run/nscd/socket"
Oct 03 12:20:52 niconix nsncd[717]: Error: Read-only file system (os error 30)

The /var/run/nscd folder does not exist. Creating it and giving permissions (either setting nscd as owner, or even going as far as making it world read+write), changes the error slightly:

Oct 06 09:57:38 niconix nsncd[1325]: Oct 06 09:57:38.078 INFO started, handoff_timeout: 3s, worker_count: 8, path: "/var/run/nscd/socket"
Oct 06 09:57:38 niconix nsncd[1325]: Error: could not bind to socket
Oct 06 09:57:38 niconix nsncd[1325]: Caused by:
Oct 06 09:57:38 niconix nsncd[1325]:     Read-only file system (os error 30)

Side note: I found this nsncd issue comment that seems to indicate /var/run should be a symlink to /run but I have no such symlink, and there is contents under /var/run for lightdm and NetworkManager so I'm not sure I'm safe to manually move everything over.

Switching back to nscd shows the same type of error happening:

Steps To Reproduce

Not quite sure at this stage

Expected behavior

nscnd should not fail to manage its socket.

Screenshots

N/A

Additional context

Worth pointing out that I fell victim of this issue. I applied the workaround and reran the script without error eventually. I'm mentioning in case there is a slight chance that the symlink creation not happening could be a side effect of that unexpected initial interruption

Notify maintainers

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.55, NixOS, 23.05 (Stoat), 23.05.3976.32dcb45f66c0`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.5`
 - channels(root): `"nixos-23.05"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@nicolaslt nicolaslt added the 0.kind: bug Something is broken label Oct 6, 2023
@flokli
Copy link
Contributor

flokli commented Oct 6, 2023

In my case, /var/run is a symlink to ../run, so /run.

@nicolaslt
Copy link
Author

Finally had the time to look at this again, I've manually created the symlink: it works now.

I have no idea why the symlink was missing still, and why it works with the symlink but doesn't without!

In any case, I'm going to close this issue. Thanks for your input @flokli

@Princemachiavelli
Copy link
Contributor

I'm not sure what normally creates the /var/run symlink but we should just add a tmpfiles.d rule so that it's always created. We should not depend on long lived filesystem state e.g the rootfs could be tmpfs.

@Princemachiavelli Princemachiavelli self-assigned this Dec 6, 2024
@flokli
Copy link
Contributor

flokli commented Dec 7, 2024

#344901 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

3 participants