Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Jan 2008 14:17:11 +0300
From:      Michael Bushkov <bushman@freebsd.org>
To:        Denis Barov <dindin@yandex-team.ru>
Cc:        stable@freebsd.org
Subject:   Re: nscd again
Message-ID:  <242ACF9B-7B89-49F2-8F20-F2D51104574B@freebsd.org>
In-Reply-To: <20080117185547.GA85161@sepulca.yandex.ru>
References:  <20080117185547.GA85161@sepulca.yandex.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Denis,
Several things:
1. You definitely can't use cache for *_compat sources. I mean lines  
like "group_compat: cache nis" aren't supported.
2. Cache should work ok with the configuration you've mentioned in  
your first example, i.e.: "group: cache compat". Just checking - why  
do you think that cache isn't working? The correct way to determine it  
is to perform the same query twice. During the first pass (when query  
is not cached), the request will be processed by NIS module and you'll  
have all the NIS-related stuff in the logs. On the second pass the  
request should be handled by scd module - and you shouldn't see any  
activity in NIS logs. It would be great to see the debug log (with  
nscd log turned on) separately - for the first and the second pass. It  
would help to find the error in nscd, if there is one.

With best regards,
Michael Bushkov

On Jan 17, 2008, at 9:55 PM, Denis Barov wrote:

> Hello!
>
> I found some strange behaviour of NIS/nscd when NIS in compat mode. In
> /etc/nsswitch.conf I have:
>
> netgroup:         cache compat
> passwd:           cache compat
> group:            cache compat
> #group_compat:     cache nis
> #passwd_compat:    cache nis
>
> in /etc/nscd.conf:
> #nscd.conf
> threads 16
>
> enable-cache passwd yes
> keep-hot-count passwd 20480
> positive-time-to-live passwd 36000
>
> enable-cache group yes
> keep-hot-count group 20480
> positive-time-to-live group 36000
>
> enable-cache group_compat yes
> keep-hot-count group_compat 20480
> positive-time-to-live group.byname 36000
>
> enable-cache passwd_compat yes
> keep-hot-count passwd_compat 20480
> positive-time-to-live passwd_compat 36000
>
> enable-cache netgroup yes
> keep-hot-count netgroup 20480
> positive-time-to-live netgroup 36000
>
>
> But, when I do some actions on NIS-client host (host with ypbind),  
> host
> ignoring cached data. In ypserv debug log:
>
> ...
> ypserv: retrieving next key, previous was: [XXX]
> ypserv: result of lookup: key: [XXXXXXXXX] data: [XXXXXX:*:1168:]
> ypserv: procedure ypproc_next called from XXX.XXX.XXX.XXX:739
> ypserv: client is referencing map "group.byname".
> ypserv: retrieving next key, previous was: [XXXXXXXXXXX]
> ypserv: result of lookup: key: [baytin] data: [XXXXXX:*:1220:]
> ypserv: procedure ypproc_next called from XXX.XXX.XXX.XXX:739
> ypserv: client is referencing map "group.byname".
> ypserv: retrieving next key, previous was: [XXXXXX]
> ypserv: result of lookup: key: [XXXX] data: [XXXX:*:3012:]
> ypserv: procedure ypproc_next called from XXX.XXX.XXX.XXX:739
> ypserv: client is referencing map "group.byname".
> ypserv: retrieving next key, previous was: [XXXX]
> ypserv: result of lookup: key: [XXX] data: [XXX:*:3021:]
> ypserv: procedure ypproc_next called from XXX.XXX.XXX.XXX:739
> ypserv: client is referencing map "group.byname".
> ypserv: retrieving next key, previous was: [XXX]
> ypserv: result of lookup: key: [vereschagin] data: [XXXXXXXXXXX:*: 
> 3024:]
> ypserv: procedure ypproc_next called from XXX.XXX.XXX.XXX:739
> ypserv: client is referencing map "group.byname".
> ypserv: retrieving next key, previous was: [XXXXXXXXXXX]
> ...
>
> If I set in nsswitch.conf:
> netgroup:         cache compat
> passwd:           cache compat
> group:            cache compat
> group_compat:     cache nis
> passwd_compat:    cache nis
>
> I have other errors:
>
> Jan 17 21:53:13 mfas002 sudo: NSSWITCH(nss_method_lookup): cache,
> passwd_compat, setpwent, not found
> Jan 17 21:53:15 mfas002 sudo: NSSWITCH(nss_method_lookup): cache,
> group_compat, setgrent, not found
> Jan 17 21:53:15 mfas002 sudo: NSSWITCH(nss_method_lookup): cache,
> group_compat, getgrent_r, not found
> Jan 17 21:53:15 mfas002 last message repeated 197 times
> Jan 17 21:53:15 mfas002 sudo: NSSWITCH(nss_method_lookup): cache,
> group_compat, endgrent, not found
> Jan 17 21:53:15 mfas002 sudo: NSSWITCH(nss_method_lookup): cache,
> passwd_compat, endpwent, not found
> Jan 17 21:53:15 mfas002 sudo: NSSWITCH(nss_method_lookup): cache,
> group_compat, endgrent, not found
>
>
> Seems group_compat and passwd_compat databases can't operate with  
> cache
> sourse. Is that true?
> -- 
> Denis Barov                            |  /"\
> Yandex WEB-Search Administration Team  |  \ /  ASCII Ribbon Campaign
> phone: : +7 (495) 739-70-00 add. 7154  |   X   NO HTML/RTF in e-mail
> e-mail: dindin@yandex-team.ru          |  / \  NO Word docs in e-mail




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?242ACF9B-7B89-49F2-8F20-F2D51104574B>