From owner-freebsd-current@FreeBSD.ORG Tue Mar 30 06:01:18 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4771D16A4D5; Tue, 30 Mar 2004 06:01:18 -0800 (PST) Received: from smtp1.server.rpi.edu (smtp1.server.rpi.edu [128.113.2.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC58D43D1F; Tue, 30 Mar 2004 06:01:17 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp1.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2UE1GtO025423; Tue, 30 Mar 2004 09:01:17 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20040330090619.GA49822@cat.robbins.dropbear.id.au> References: <20040330084711.GA44887@nagual.pp.ru> <20040330090619.GA49822@cat.robbins.dropbear.id.au> Date: Tue, 30 Mar 2004 09:01:12 -0500 To: Tim Robbins , Andrey Chernov , gad@freebsd.org, current@freebsd.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) Subject: Re: pgrep strangeness X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2004 14:01:18 -0000 At 7:06 PM +1000 3/30/04, Tim Robbins wrote: >On Tue, Mar 30, 2004 at 12:47:11PM +0400, Andrey Chernov wrote: > >> See the picture below. Why it print PID found 3 times? >> Is it because too many 'sentinel's in the command line? > > It looks like some analog of 'sort -u' should be performed > > (qsort(3)?) > > >> # pgrep sentinel >> 547 >> 547 >> 547 >> # ps ax | grep sentinel >> 547 ?? Ss 7:48,83 /usr/local/sbin/sentinel -v1 -c >>/usr/local/etc/sentinel > >I think this is the same bug I fixed in killall a while ago -- it >uses KERN_PROC_ALL, which returns an entry for each thread in the >process, instead of KERN_PROC_PROC. I actually asked if I should change that to use KERN_PROC_PROC in some mailing list or another, but I don't think anyone replied. I don't do much of anything with threads, so they're about the same for me. I'll change it to KERN_PROC_PROC. Thanks. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu