From 8cef7eec93fb18bf40aa5a83bd0760ea2934f0e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Mon, 15 Aug 2022 13:18:03 +0200 Subject: [PATCH] nixos/nscd: Add requiredBy for the nss targets This is to ensure the targets are stopped when nscd is stopped to prevent races on switch. Example interaction: nscd is stopped, some service that requires nss-user-lookup.target is restarted. Without this PR, nss-user-lookup.target would still be active, hence the service would start without nscd running. --- nixos/modules/services/system/nscd.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/services/system/nscd.nix b/nixos/modules/services/system/nscd.nix index c3046a5b4cf..3e1d274a3cc 100644 --- a/nixos/modules/services/system/nscd.nix +++ b/nixos/modules/services/system/nscd.nix @@ -62,6 +62,7 @@ in before = [ "nss-lookup.target" "nss-user-lookup.target" ]; wants = [ "nss-lookup.target" "nss-user-lookup.target" ]; wantedBy = [ "multi-user.target" ]; + requiredBy = [ "nss-lookup.target" "nss-user-lookup.target" ]; environment = { LD_LIBRARY_PATH = nssModulesPath; };