From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.50) id 1EdZx7-0006FR-76 for garchives@archives.gentoo.org; Sat, 19 Nov 2005 21:08:53 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.5/8.13.5) with SMTP id jAJL81jF031015; Sat, 19 Nov 2005 21:08:01 GMT Received: from mail.magrittesystems.com (adsl-64-173-154-114.dsl.snfc21.pacbell.net [64.173.154.114]) by robin.gentoo.org (8.13.5/8.13.5) with ESMTP id jAJL4G76024790 for ; Sat, 19 Nov 2005 21:04:17 GMT Received: by mail.magrittesystems.com (Postfix, from userid 1000) id DFB723C0078; Sat, 19 Nov 2005 13:03:22 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mail.magrittesystems.com (Postfix) with ESMTP id D30603C0077 for ; Sat, 19 Nov 2005 13:03:22 -0800 (PST) Date: Sat, 19 Nov 2005 13:03:22 -0800 (PST) From: michael@michaelshiloh.com X-X-Sender: michael@mail.magrittesystems.com To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] how to find if a program is using a particular /dev device? In-Reply-To: <20051119103202.580d8ce5.nick@rout.co.nz> Message-ID: References: <200511180019.36886.electronerd@electronerdia.net> <20051119103202.580d8ce5.nick@rout.co.nz> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Archives-Salt: fac1023d-2944-4258-abb0-b566d8de81cc X-Archives-Hash: cc3f86d72c9abf2cc04343d9c314260f Excellent. That's very helpful as well. Michael On Sat, 19 Nov 2005, Nick Rout wrote: > On Fri, 18 Nov 2005 00:48:19 -0800 (PST) > michael@michaelshiloh.com wrote: > >> That was it. Thanks! >> M > > you could also try > > strace -eopen programname > > It will give a pretty verbose account of what files are opened by > programname. (and of course devices, like everything else, are files) > >> >> >> On Fri, 18 Nov 2005, John Myers wrote: >> >>> On Thursday 17 November 2005 23:54, michael@michaelshiloh.com wrote: >>>> I have a custom device driver in /dev/ that can only be used by one >>>> program at a time. Since the device is /dev/ttyUSB0, I can see if anyone >>>> is using it by: >>>> >>>> ls -l /proc/*/fd/* | grep ttyUSB0 >>>> >>>> Is there a utility or other better way I can discover which process, or >>>> better, which program, is using a particular device? >>>> >>>> Thanks, >>>> Michael >>> try lsof >>> >> -- >> gentoo-user@gentoo.org mailing list >> > -- > gentoo-user@gentoo.org mailing list > > -- gentoo-user@gentoo.org mailing list