From owner-freebsd-stable@FreeBSD.ORG Thu Jun 8 05:01:39 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1311816A9CF for ; Thu, 8 Jun 2006 02:26:11 +0000 (UTC) (envelope-from zbeeble@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5706B43D49 for ; Thu, 8 Jun 2006 02:26:10 +0000 (GMT) (envelope-from zbeeble@gmail.com) Received: by ug-out-1314.google.com with SMTP id h2so491734ugf for ; Wed, 07 Jun 2006 19:26:08 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=oc1at5Faix9F6VkWRaYHBIWxzxHX1PR89dYEPOgDDH5W5M/6Wv88V7dzHhgwVkkYf5KAMVdj17LVxYScoMONeej1If/dCDmrMZBzH0yOG87J2uHK95ZoOW7jfRrVunktKUB1yBoF5gkPEHhjPtizWpc/Zxt+Ssr63RjD2lz/+F8= Received: by 10.66.216.20 with SMTP id o20mr1113102ugg; Wed, 07 Jun 2006 19:19:58 -0700 (PDT) Received: by 10.67.96.5 with HTTP; Wed, 7 Jun 2006 19:19:58 -0700 (PDT) Message-ID: <5f67a8c40606071919v4b253808ge5993a1b640d1942@mail.gmail.com> Date: Wed, 7 Jun 2006 22:19:58 -0400 From: "Zaphod Beeblebrox" To: freebsd-stable@freebsd.org In-Reply-To: <20060607195726.GD25975@riverside.org> MIME-Version: 1.0 References: <4486574F.9040108@bitfreak.org> <57d710000606070820j6291f74el6b6880e681899904@mail.gmail.com> <20060607195726.GD25975@riverside.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: How can I know which files a proccess is accessing? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jun 2006 05:01:43 -0000 Note that problems with lsof are generally fixed by recompiling it. It doesn't take well to upgrades of the OS underneath it. On 6/7/06, Michael Hall wrote: > > On Wed, Jun 07, 2006 at 08:20:03AM -0700, pete wright wrote: > > > On 6/6/06, Darren Pilgrim wrote: > > >Eduardo Meyer wrote: > > >> Hello, > > >> > > >> I need to know which files under /var a proccess (httpd here) is > > >> acessing. It is not logs because I have a different partition for > > >> logs. > > >> > > >> gstat tells me that slice ad0s1h (my /var) is 100% frequently, and in > > >> fact with fstat I can see a number of httpd proccesses running > > >> accesing that. But fstat only shows me inodes and the mount point. > > >> > > >> I need to know which files the proccesses are acessing. > > > > > >find(1) can match inodes. A quick example: > > > > > > > fstat | grep 'httpd.*/var ' | awk '{print $6}' | xargs -n 1 sudo > find > > >-x /var -inum | sort -u > > >/var/log/httpd-error.log > > >/var/run/accept.lock.# > > >/var/tmp/apr8530d5 > > >/var/tmp/aprF2Zs0e > > > > > > > Thanks for the oneliner Darren, that's going in my scripts dir right now > ;) > > Yes, it does look handy, another new usage for 'find'. > > Typically a 'grep ... | awk ...' can be combined, resulting in a small > improvement: > > fstat | awk '/httpd.*\/var/ { print $6 }' | xargs ... > > -- > Why doesn't "Buick" rhyme with "quick"? > > Mike Hall > San Juan Island, WA > > System Admin - Rock Island Communications > System Admin - riverside.org, ssdd.org > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" >