From owner-freebsd-questions Wed Sep 17 20:54:46 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id UAA02783 for questions-outgoing; Wed, 17 Sep 1997 20:54:46 -0700 (PDT) Received: from freebie.lemis.com (gregl1.lnk.telstra.net [139.130.136.133]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id UAA02773 for ; Wed, 17 Sep 1997 20:54:40 -0700 (PDT) Received: (from grog@localhost) by freebie.lemis.com (8.8.7/8.8.5) id NAA15585 for questions@FreeBSD.org; Thu, 18 Sep 1997 13:24:37 +0930 (CST) Resent-Message-Id: <199709180354.NAA15585@freebie.lemis.com> Message-ID: <19970918132146.48861@lemis.com> Date: Thu, 18 Sep 1997 13:21:46 +0930 From: Greg Lehey To: "Rodney W. Grimes" Cc: question@lemis.com Subject: Re: sorry to ask a freebsd-question question! References: <199709171427.HAA08519@GndRsh.aac.dev.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.81e In-Reply-To: <199709171427.HAA08519@GndRsh.aac.dev.com>; from Rodney W. Grimes on Wed, Sep 17, 1997 at 07:27:09AM -0700 Organisation: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8250 Fax: +61-8-8388-8250 Mobile: +61-41-739-7062 WWW-Home-Page: http://www.lemis.com/~grog Fight-Spam-Now: http://www.cauce.org Resent-From: grog@lemis.com Resent-Date: Thu, 18 Sep 1997 13:24:37 +0930 Resent-To: FreeBSD Questions Sender: owner-freebsd-questions@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk On Wed, Sep 17, 1997 at 07:27:09AM -0700, Rodney W. Grimes wrote: >> On Wed, 17 Sep 1997, xiyuan qian wrote: >> >>> Hi, I know "ps -ax | grep ppp" can find the ppp running's pid, but when I do >>> that, it sometimes show me >>> 616 .... ppp >>> 716 .... ps -ax | grep ppp >>> or sometimes it only show me >>> 616 ....ppp >>> Why? How can I deny the "ps -ax | grep ppp" showing out? >> >> ps -ax | fgrep ppp | fgrep -v fgrep > > Stop with the silliness, just go get pppd's pid(s) from /var/run/ppp*.pid You're assuming that's all he wants to know. There are really two questions here. One has been answered to death. The other one is "why do I sometimes get the grep process listed and sometimes not?". The answer is that it's a race condition in the process table. I still can't understand why it happens so often, though. Greg