summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2022-01-10 21:30:15 +0300
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2022-01-11 17:52:50 +0000
commitb7d57edccecf89cdc9b00dd0ded8a0377d4dc8db (patch)
treeb0f214c82c5843cc69f129e9bc3d94bf139251f3
parentspamassassin: support for fetching rules over HTTPS (diff)
downloadnixpkgs-origin/backport-154320-to-release-21.11.tar.gz
nscd service: fix ordering and start automaticallyorigin/backport-154320-to-release-21.11
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`. (cherry picked from commit b451eca621d8cd52345e2094e46e970719b6a902)
-rw-r--r--nixos/modules/services/system/nscd.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/nixos/modules/services/system/nscd.nix b/nixos/modules/services/system/nscd.nix
index d720f254b813..00a87e788dc4 100644
--- a/nixos/modules/services/system/nscd.nix
+++ b/nixos/modules/services/system/nscd.nix
@@ -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; };