Nscd necachuje?
Miroslav Prýmek
m.prymek at gmail.com
Sun Sep 7 15:10:17 CEST 2014
Ahoj,
nevim, co delam blbe, ale nejak mi porad nefunguje nscd i kdyz mam
vsechno (snad) spravne nastavene.
Jde o fileserver se samba4 jako AD DC, ale misto winbind pouzivam
primy pristup k ldap atributum pomoci nss-pam-ldapd-0.8.14_2.
------------------------ /etc/nsswitch.conf
group: cache files ldap
passwd: cache files ldap
hosts: files dns
networks: files
shells: files
services: compat
services_compat: nis
protocols: files
rpc: files
------------------------
------------------------ /etc/nscd.conf
enable-cache passwd yes
enable-cache group yes
enable-cache hosts yes
enable-cache services yes
enable-cache protocols yes
enable-cache rpc yes
enable-cache networks yes
------------------------
Pri dotazu na adresar se spoustou ruznych vlastniku bezi samba jako o
zivot a casy jsou tragicky:
# time ls -l /home >/dev/null
real 0m5.365s
user 0m0.001s
sys 0m0.047s
Pri opakovanych dotazech je to porad stejny, takze do nscd se imho
vubec nic neulozi, nechapu proc.
Kdyz "ldap" z nsswitch.conf vyhodim, vypada to nasledovne:
# time ls -l /home >/dev/null
real 0m0.010s
user 0m0.001s
sys 0m0.009s
Kdyz spustim nscd v debug modu, tak vypise jenom inicializacni hlasky
a pak uz nikdy nic, at delam, co delam:
# nscd -nst
M1 from main: request agents registered successfully
M2 from cache: cache was successfully initialized
M2 from runtime environment: using socket /var/run/nscd
M2 from runtime environment: successfully initialized
M1 from main: working in single-threaded mode
[.... dal nic ....]
Napadlo me i ze by treba byl problem v pravech k /var/run/nscd, ale taky nic:
# ls -l /var/run/nscd
srw-rw-rw- 1 root wheel 0 Sep 7 14:46 /var/run/nscd
Jeste jsem ze zoufalosti zkusil "truss ls -l /" a je tam jedna pasaz,
ktera mi prijde podezrela:
------------------------
stat("/etc/nsswitch.conf",{ mode=-r--r--r--
,inode=4487,size=522,blksize=4096 }) = 0 (0x0)
socket(PF_LOCAL,0x10000001,0) = 5 (0x5)
connect(5,{ AF_UNIX "/var/run/nscd" },15) = 0 (0x0)
fcntl(5,F_SETFL,O_NONBLOCK) = 0 (0x0)
kqueue(0x8018ac000,0x801016bd8,0x10,0x80063f108,0x8018ac010,0x2) = 6 (0x6)
kevent(6,{0x5,EVFILT_WRITE,EV_ADD,0,0x0,0x0},1,0x0,0,0x0) = 0 (0x0)
kqueue(0x6,0x7fffffffcb28,0x1,0x0,0x0,0x0) = 7 (0x7)
kevent(7,{0x5,EVFILT_READ,EV_ADD,0,0x0,0x0},1,0x0,0,0x0) = 0 (0x0)
kevent(6,{0x5,EVFILT_WRITE,EV_ADD,1,0x4,0x0},1,0x0,0,0x0) = 0 (0x0)
kevent(6,0x0,0,{0x5,EVFILT_WRITE,EV_EOF,0,0x2000,0x0},1,0x0) = 1 (0x1)
sendmsg(0x5,0x7fffffffca80,0x20000,0x1,0x1,0x0) ERR#32 'Broken pipe'
kevent(6,{0x5,EVFILT_WRITE,EV_ADD,0,0x0,0x0},1,0x0,0,0x0) = 0 (0x0)
close(5) = 0 (0x0)
close(7) = 0 (0x0)
close(6) = 0 (0x0)
------------------------
Tahle cela pasaz (krome prvniho radku) se tam objevuje jenom pri
zapnutym nscd v nsswitch.conf. A ten broken pipe mi prijde krajne
podezerelej teda :)
Pritom nscd zda se na socketu posloucha:
------------------------
# sockstat | grep nscd
root nscd 15950 4 stream /var/run/nscd
------------------------
Nejak ted nevim, jak dal - prozkoumat, jakej protokol se pouziva pri
komunikaci pres socket /var/run/nscd a zkoumat, proc a jak
(ne)odpovida? Do toho se mi teda zatracene nechce :) a pokud existuje
nejaka jina cesta, beru vsema deseti :)
Netusite nekdo, kde by mohl byt zakopanej pes? Neresili jste to uz nekdy?
Budu rad za jakykoli nasmerovani, uz fakt nevim, kam dal koukat...
diky
Mirek
More information about the Users-l
mailing list