Skip to content

Commit

Permalink
nscd service: fix ordering and start automatically
Browse files Browse the repository at this point in the history
During working on #150837 I discovered that `google-oslogin` test
started failing, and so did some of my development machines. Turns out
it was because nscd doesn't start by default; rather it's wanted by
NSS lookup targets, which are not always fired up.

To quote from section on systemd.special(7) on `nss-user-lookup.target`:

> All services which provide parts of the user/group database should be
> ordered before this target, and pull it in.

Following this advice and comparing our unit to official `sssd.service`
unit (which is a similar service), we now pull NSS lookup targets from
the service, while starting it with `multi-user.target`.
  • Loading branch information
abbradar committed Jan 10, 2022
1 parent 0ecf7d4 commit b451eca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nixos/modules/services/system/nscd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ in
systemd.services.nscd =
{ description = "Name Service Cache Daemon";

wantedBy = [ "nss-lookup.target" "nss-user-lookup.target" ];
before = [ "nss-lookup.target" "nss-user-lookup.target" ];
wants = [ "nss-lookup.target" "nss-user-lookup.target" ];
wantedBy = [ "multi-user.target" ];

environment = { LD_LIBRARY_PATH = nssModulesPath; };

Expand Down

0 comments on commit b451eca

Please sign in to comment.