From owner-freebsd-current@FreeBSD.ORG Tue Mar 30 01:04:34 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 73B0E16A4F5; Tue, 30 Mar 2004 01:04:34 -0800 (PST) Received: from smtp02.syd.iprimus.net.au (smtp02.syd.iprimus.net.au [210.50.76.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id 40FC843D46; Tue, 30 Mar 2004 01:04:34 -0800 (PST) (envelope-from tim@robbins.dropbear.id.au) Received: from robbins.dropbear.id.au (210.50.204.41) by smtp02.syd.iprimus.net.au (7.0.024) id 402CF87000F210D1; Tue, 30 Mar 2004 19:04:32 +1000 Received: by robbins.dropbear.id.au (Postfix, from userid 1000) id 474AC41BD; Tue, 30 Mar 2004 19:06:19 +1000 (EST) Date: Tue, 30 Mar 2004 19:06:19 +1000 From: Tim Robbins To: Andrey Chernov , gad@freebsd.org, current@freebsd.org Message-ID: <20040330090619.GA49822@cat.robbins.dropbear.id.au> References: <20040330084711.GA44887@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040330084711.GA44887@nagual.pp.ru> User-Agent: Mutt/1.4.1i 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 09:04:34 -0000 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. Tim