[Nix-dev] getent LD_LIBRARY_PATH

Rickard Nilsson rickard.nilsson at telia.com
Mon Dec 10 16:39:14 CET 2012


Hi,

I investigated an issue I have with getent, where LDAP entries don't show  
up when I run 'getent passwd'. It turns out, in that case, getent reads  
/etc/nsswitch.conf, finds "passwd: files ldap", loads libnss_files.so  
(from glibc), prints the local users, and then tries to load  
libnss_ldap.so from glibc. But since I use the nslcd daemon (nixos option  
users.ldap.daemon.enable), that nss module is provided by the  
nss-pam-ldapd package which is not in getent's LD_LIBRARY_PATH. Therefore,  
no LDAP users are listed by getent.

However, nss-pam-ldapd is in systemPackages (added by  
users.ldap.daemon.enable), so if I "export  
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/run/current-system/sw/lib" everything  
works fine.

Why is /run/current-system/sw/lib not in LD_LIBRARY_PATH by default? In  
NixOS' default environment,  
LD_LIBRARY_PATH=/run/opengl-driver/lib:/run/opengl-driver-32/lib.

Or should this be solved by setting LD_LIBRARY_PATH specifically for  
getent? But how can that be done? I wouldn't want to introduce a  
dependency on nss-pam-ldapd in glibc...


Best regards,
   Rickard Nilsson


More information about the nix-dev mailing list