Mike Gerdts wrote:
> On Tue, Jul 15, 2008 at 8:05 AM, Richard L. Hamilton <[EMAIL PROTECTED]> 
> wrote:
>> # List open files with link count < 1 (which could account
>> # for du != df).  This is just part of it, the whole list is
>> # too long.  Also, there aren't any really large ones just
>> # now, so it's not an actual concern at the moment.  And of
>> # course, Jive messed up the columns; in reality, they do line up.
> 
> Without lsof, you can do this with:
> 
> # find /proc/*/fd -type f -links 0 -ls
> 
> If you want to look inside the file to get an idea of what it is:
> 
> # less /proc/$pid/fd/$fd
> 
> If you want to truncate that 1 GB log file that has been deleted:
> 
> # cp /dev/null /proc/$pid/fd/$fd
> 
> This is not meant to lessen the importance of having lsof (really,
> lsof not some almost work-a-like) in OpenSolaris.  It is a very
> helpful tool and is a common part of the known tool set of third party
> support organizations.  That is, having this tool makes it so that ISV
> and freeware software is more easily supportable on OpenSolaris.
> 
> I understand that lsof does bad things to get the data that it gets.
> It would likely stop doing that just about the time that stable
> interfaces are provided to make it unnecessary to go prodding around
> in /dev/kmem.  I guess since I am complaining, I should add this to
> the list of projects for me to look into in the future...

The main problem with lsof is that it will break often as kernel 
structures, etc. change.

It might be easiest to find a wrapper script that emulates lsof to put 
around pfiles.

-- 
Shawn Walker | Solaris Kernel | [EMAIL PROTECTED] | blogs.sun.com/srw
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to