about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2019-07-12 12:07:45 -0700
committerJamey Sharp <jamey@minilop.net>2019-07-12 12:07:45 -0700
commitd79584c90253107d8d29869de0951545a567554a (patch)
tree29b16a7f3aeeb3715987ec9bd0ce518039c66084 /nixos
parentf7c776760babb4f2d5d4341a5dbd882bf7751e9c (diff)
downloadnixlib-d79584c90253107d8d29869de0951545a567554a.tar
nixlib-d79584c90253107d8d29869de0951545a567554a.tar.gz
nixlib-d79584c90253107d8d29869de0951545a567554a.tar.bz2
nixlib-d79584c90253107d8d29869de0951545a567554a.tar.lz
nixlib-d79584c90253107d8d29869de0951545a567554a.tar.xz
nixlib-d79584c90253107d8d29869de0951545a567554a.tar.zst
nixlib-d79584c90253107d8d29869de0951545a567554a.zip
nixos/nscd: document why it is configured this way
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/system/nscd.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/nixos/modules/services/system/nscd.nix b/nixos/modules/services/system/nscd.nix
index c2d0cd5d0eb0..e11f7e049d8f 100644
--- a/nixos/modules/services/system/nscd.nix
+++ b/nixos/modules/services/system/nscd.nix
@@ -52,6 +52,12 @@ in
           config.environment.etc."nscd.conf".source
         ];
 
+        # We use DynamicUser because in default configurations nscd doesn't
+        # create any files that need to survive restarts. However, in some
+        # configurations, nscd needs to be started as root; it will drop
+        # privileges after all the NSS modules have read their configuration
+        # files. So prefix the ExecStart command with "!" to prevent systemd
+        # from dropping privileges early. See ExecStart in systemd.service(5).
         serviceConfig =
           { ExecStart = "!@${pkgs.glibc.bin}/sbin/nscd nscd";
             Type = "forking";