From owner-freebsd-questions@FreeBSD.ORG Tue May 27 12:21:02 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 A84251065674 for ; Tue, 27 May 2008 12:21:02 +0000 (UTC) (envelope-from michaek@mail.ru) Received: from big.innet.yaroslavl.su (big.innet.yaroslavl.su [217.15.134.73]) by mx1.freebsd.org (Postfix) with ESMTP id 15A6C8FC5B for ; Tue, 27 May 2008 12:21:01 +0000 (UTC) (envelope-from michaek@mail.ru) Received: from relay.innet.yaroslavl.su (relay.innet.yaroslavl.su [217.15.134.70]) by big.innet.yaroslavl.su (8.13.7/8.13.7) with ESMTP id m4RCKxcr078640; Tue, 27 May 2008 16:20:59 +0400 (MSD) Received: from reaper.yaroslavl.ru (reaper.yaroslavl.ru [85.113.195.205]) by relay.innet.yaroslavl.su (8.13.8/8.13.8) with ESMTP id m4RCKwPJ042950; Tue, 27 May 2008 16:20:59 +0400 (MSD) (envelope-from michaek@mail.ru) Received: from [127.0.0.1] (unknown [192.168.10.53]) by reaper.yaroslavl.ru (Postfix) with ESMTP id DA68C228F7; Tue, 27 May 2008 16:20:57 +0400 (MSD) Message-ID: <483BFCA9.9060705@mail.ru> Date: Tue, 27 May 2008 16:20:57 +0400 From: Michael Lednev User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: freebsd-questions@FreeBSD.ORG, michaek@mail.ru References: <200805271137.m4RBba1j036652@lurza.secnetix.de> In-Reply-To: <200805271137.m4RBba1j036652@lurza.secnetix.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: Subject: Re: strange ps behaviour 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, 27 May 2008 12:21:02 -0000 Oliver Fromme пишет: > Michael Lednev wrote: > > Oliver Fromme ?????: > > > Michael Lednev wrote: > > > > Oliver Fromme ?????: > > > > > Michael Lednev wrote: > > > > > > # pgrep radiusd > > > > > > 1105 > > > > > > 33738 > > > > > > # ps ax | grep radiusd > > > > > > 1105 ?? Ss 2:35,76 /usr/local/sbin/radiusd > > > > > > # ps 33738 > > > > > > PID TT STAT TIME COMMAND > > > > > > > > > > It seems that the second matching process exited before > > > > > the ps command was executed. > > > > > > > > It's repeatable. > > > > > > That means that the radiusd process kept forking short- > > > lived child processes, for whatever reason. > > > > keeping constant PID for children? > > OK, you didn't mention that it is the same PID every time. > In that case my first suspicion would be a bug in pgrep. > If it happens again, I suggest you use pgrep -lf. Maybe > the output gives a hint. > It happened again. # pgrep -lf radiusd 74847 /usr/local/sbin/radiusd 93248 radiusd There is no /proc/93248 directory, so I assume there's surely no such process. Am I right? > (Also note that ps cuts after 80 columns. Sometimes the > information you're looking for is after column 80, so I > recommend to always use -ww, especially when the output > is used for matching in scripts.) I use pgrep in my script. If I need ps I always use ww, but thanks for suggestion anyway.