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 1EdDyj-0001Hi-Vf for garchives@archives.gentoo.org; Fri, 18 Nov 2005 21:41:06 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.5/8.13.5) with SMTP id jAILe90O017997; Fri, 18 Nov 2005 21:40:09 GMT Received: from dbmail-mx1.orcon.net.nz (loadbalancer1.orcon.net.nz [219.88.242.3]) by robin.gentoo.org (8.13.5/8.13.5) with ESMTP id jAILYBAh011403 for ; Fri, 18 Nov 2005 21:34:12 GMT Received-SPF: none Received: from rout.dyndns.org (60-234-144-216.bitstream.orcon.net.nz [60.234.144.216]) by dbmail-mx1.orcon.net.nz (8.13.2/8.13.2/Debian-1) with SMTP id jAILYcnp007105 for ; Sat, 19 Nov 2005 10:34:38 +1300 Date: Sat, 19 Nov 2005 10:32:02 +1300 From: Nick Rout To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] how to find if a program is using a particular /dev device? Message-Id: <20051119103202.580d8ce5.nick@rout.co.nz> In-Reply-To: References: <200511180019.36886.electronerd@electronerdia.net> X-Mailer: Sylpheed version 2.0.1 (GTK+ 2.6.8; i686-pc-linux-gnu) 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 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.87, clamav-milter version 0.87 on dbmail-mx1.orcon.net.nz X-Virus-Status: Clean X-Archives-Salt: 168f3010-6a92-4a11-b457-e71f364570d6 X-Archives-Hash: d6bda2fd832d5b0390355a48f097c9fa 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