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 not starting on boot #154306

Closed
sylvainf911 opened this issue Jan 10, 2022 · 1 comment
Closed

nscd not starting on boot #154306

sylvainf911 opened this issue Jan 10, 2022 · 1 comment
Labels
0.kind: bug Something is broken

Comments

@sylvainf911
Copy link

Describe the bug

The nscd.service is not started on boot.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Boot a recent NixOS 21.11 with an LDAP configuration
  2. Do id user_in_ldap and get id: ‘user_in_ldap’: no such user
  3. systemctl status nscd returns Active: inactive (dead)

My LDAP configuration:

    ldap = {
      enable = true;                                    
      daemon.enable = true;             
      base = "dc=example,dc=com";
      bind = {
        distinguishedName = "uid=ldapread,ou=People,dc=example,dc=com";
        policy = "soft";                     
        timeLimit = 5;
        passwordFile = ''${pkgs.writeText "ldap-bind" "readonlypassword"}'';
      };                                             
      server = "ldap://ldap.example.com";               
                 
      daemon.extraConfig = ''
        map passwd loginShell "/run/current-system/sw/bin/bash"
      '';
    };

Expected behavior

nscd should start on boot like it was before the upgrade.

Additional context

On NixOS 21.11.334027.e34c5379866 (with systemd 249.5) nscd started normally.
On NixOS 21.11.335119.79c7b6a353e (with systemd 249.7), the service does not start on boot anymore.

On my NixOS desktop with an up to date version, nscd starts normally but I don't use LDAP.

I am not really familiar with systemd details but a difference I see is that commit ec0131d
by Arian van Putten talks about removing nss-lookup.target and nss-user-lookup.target from multi-user.target.wants.
I can see on the working server that /etc/systemd/system/multi-user.target.wants/nss-user-lookup.target is present
but not on the problematic one. When I search in journalctl -b to see any trace of nscd, I don't see any on the problematic server.
I see Starting Name Service Cache Daemon... and Reached target User and Group Name Lookups. on the working server.

It is like nss-user-lookup.target is nerver reached on the problematic server and so nscd.service is not started.
I added systemd.services.nscd.wantedBy = ["multi-user.target"]; in my configuration.nix as a temporary fix and it now starts on boot.

Notify maintainers

@arianvp

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.10.90, NixOS, 21.11 (Porcupine)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.16`
 - channels(root): `"nixos-21.11.335119.79c7b6a353e"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@sylvainf911 sylvainf911 added the 0.kind: bug Something is broken label Jan 10, 2022
@abbradar
Copy link
Member

Fixed by #154320.

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

2 participants