From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 9 20:55:07 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8ED85106566B for ; Thu, 9 Dec 2010 20:55:07 +0000 (UTC) (envelope-from chuckr@telenix.org) Received: from mail3.sea5.speakeasy.net (mail3.sea5.speakeasy.net [69.17.117.42]) by mx1.freebsd.org (Postfix) with ESMTP id 530078FC15 for ; Thu, 9 Dec 2010 20:55:07 +0000 (UTC) Received: (qmail 6337 invoked from network); 9 Dec 2010 20:55:05 -0000 Received: from april.chuckr.org (HELO april.telenix.org) (chuckr@[66.92.151.30]) (envelope-sender ) by mail3.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 9 Dec 2010 20:55:05 -0000 Message-ID: <4D01422C.9080206@telenix.org> Date: Thu, 09 Dec 2010 15:55:08 -0500 From: Chuck Robey User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.8) Gecko/20100907 Thunderbird/3.1.2 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <4D000448.1050606@telenix.org> <20101208230139.2097c2e8@core.draftnet> <4D0020D7.5080706@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: getting a list of open files versus PID nos.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 20:55:07 -0000 On 12/09/10 06:49, krad wrote: > On 9 December 2010 00:20, Andriy Gapon wrote: > >> on 09/12/2010 01:47 Matthew Fleming said the following: >>> On Wed, Dec 8, 2010 at 3:01 PM, Bruce Cran wrote: >>>> On Wed, 8 Dec 2010 14:54:57 -0800 >>>> Matthew Fleming wrote: >>>> >>>>> This is what lsof is for. I believe there's one in ports, but I have >>>>> never tried it. >>>> >>>> Is there any advantage to using lsof instead of fstat(1) (fstat -p pid)? >>> >>> I believe that lsof reports on all open files by all processes, >>> whereas fstat will only report on a specific provided pid. >> >> Just try running fstat without any options. >> Or procstat -a -f. Ahh, the procstat -a -f output was more clearly readable than even the suggested lsof. I found that enlightenment was opening 2,672 different /dev/apmNNNN devices. Man apm tells me it's to do with Advanced Power Mgm't, nearly all of these huge lumps of open files. How might I deal with getting these /dev/apmNNNN files to close themselves? Because I have little doubt that I am (at last!!) looking at the reason for my machine lockups.