pw groupadd/useradd fail when the nscd cache is used for name/group resolution

Gavin Atkinson gavin at FreeBSD.org
Tue Jul 14 13:03:02 UTC 2009


On Mon, 2009-07-13 at 13:43 -0400, Adam McDougall wrote:
> Michael Proto wrote:
> > On Mon, Jul 13, 2009 at 12:57 PM, Ulrich Spörlein<uqs at spoerlein.net> wrote:
> >   
> >> On Thu, 09.07.2009 at 16:13:25 +0300, Vlad Galu wrote:
> >>     
> >>> I've stumbled upon this while installing postgres. In
> >>> /etc/nsswitch.conf I had "group: cache files compat" and "passwd:
> >>> cache files compat". Once I commented them out things started working
> >>> again. Before the change, this is how it looked like:
> >>>
> >>> -- cut here --
> >>> [root at vgalu /usr/ports/databases/postgresql84-server]# pw group add pgsql -g 70
> >>> pw: group disappeared during update
> >>> [root at vgalu /usr/ports/databases/postgresql84-server]# pw group add pgsql -g 70
> >>> pw: group 'pgsql' already exists
> >>> [root at vgalu /usr/ports/databases/postgresql84-server]#
> >>> -- and here --
> >>>
> >>> Shouldn't 'files' be used upon a cache miss? If this is a PEBKAC,
> >>> sorry for the noise.
> >>>       
> >> Just a me too. This is most likely because nscd is also caching negative
> >> lookups. The usual workaround would be to restart it using
> >> /etc/rc.d/nscd restart
> >>
> >>     
> > A slightly lower-impact alternative would be to use "nscd -i passwd"
> > to invalidate the password cache.
> >
> >
> I was intending to report this soon as well (its been on my list for a 
> while) as a problematic
> issue while installing ports.  The other issue I had was Java would 
> crash immediately if I had
> nscd running (configured to cache YP).  I plan to report that soon if it 
> still happens with 1.6.
> I probably tested with 1.4 or 1.5. 

This is a known problem with nscd(8), see ports/125330 and bin/119695.
If you have any further information (or even a patch) it's probably best
to append it to the second of those PRs.

Thanks,

Gavin


More information about the freebsd-stable mailing list