From owner-freebsd-questions@FreeBSD.ORG Tue Jul 22 15:28:18 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86E7F1065678 for ; Tue, 22 Jul 2008 15:28:18 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.freebsd.org (Postfix) with ESMTP id 4E6788FC18 for ; Tue, 22 Jul 2008 15:28:18 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.3/8.14.2) with ESMTP id m6MFSH6j095350 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 22 Jul 2008 10:28:17 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.3/8.14.2/Submit) id m6MF6hin044208; Tue, 22 Jul 2008 10:06:43 -0500 (CDT) (envelope-from dan) Date: Tue, 22 Jul 2008 10:06:43 -0500 From: Dan Nelson To: freebsd-questions@freebsd.org Message-ID: <20080722150642.GG19044@dan.emsphone.com> References: <4885C723.3000708@rowyerboat.com> <447ibec72v.fsf@be-well.ilk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <447ibec72v.fsf@be-well.ilk.org> X-OS: FreeBSD 7.0-STABLE User-Agent: Mutt/1.5.18 (2008-05-17) Cc: Stephen Allen Subject: Re: Problem running 'top' when ldap is around X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2008 15:28:18 -0000 In the last episode (Jul 22), Lowell Gilbert said: > Stephen Allen writes: > > I've noticed that with "files ldap" in nsswitch.conf, if I try to > > run "top" and the ldap server is not available, it takes about a > > minute to start showing information, whereas normally it's > > instantaneous. > > > > The problem seems to be the mapping of uid numbers to usernames > > (the -u options prevents this). The man page says: > > > > "Normally, top will read as much of the file "/etc/passwd" as is > > necessary to map all the user id numbers it encounters into login > > names" > > The man page is misleading. If LDAP or NIS are present, top seems to > grab all of the entries from there. Changes to the man page should > be submitted upstream, if you're interested in that aspect. > > > So my question is, top must be finding a uid number that it can't > > match in /etc/passwd, then going on to search ldap. How can this > > be? > > I'm not sure that top follows nsswitch.conf (but I didn't spend > enough time looking to be sure). It does. I recommend enabling nscd and editing your nsswitch.conf passwd and group lines to "files cache ldap". That way only your first top invocation will be slow, and the rest will pull from nscd. -- Dan Nelson dnelson@allantgroup.com