The Joyent Community

A place where the Joyent community can gather, help each other out, and stay informed.

You are not logged in.

#1 2006-10-17 23:41:55

lderezinski
Happy Camper
From: Essex, Maryland USA
Registered: 2006-04-14
Posts: 4312
Website  Expertise

how do I get lsof information??

I tried to use the lsof command and it didn't work. (trying to get a list of open files on the system)

How do I get this information?

What happened to me today was that our machine was in the weeds ... just being really sluggish. So I ran top and found that tar was taking up 25% of the CPU ... not a good thing.

first thing I tried was lsof ... but that doesn't appear to work in for an container Accelerator.

so I killed the offending tar process ... still wondering what it was trying to do. We run a couple of cron jobs to rotate logs, do backups, etc. I did search for huge files but didn't find anything ...

any thoughts or suggestions on how to debug this situation would be greatly appreciated ... hoping that there isn't going to be one ... yea right ...

Last edited by lderezinski (2007-09-11 18:07:06)


The greatest oak was once a little nut who held its ground.
MG->3ML->Premiere (Lithographer) + Accelerati + Joyeur (Yes, I work here, we are hiring)

Offline

 

#2 2006-10-18 00:06:17

rsimplicio
Unapologetic Solopreneur
From: Chicago
Registered: 2005-05-11
Posts: 997
Website  Expertise

Re: how do I get lsof information??

May not be installed. It's not included in the distribution.

Maybe you can use fuser? Need to be logged on as root to run fuser though.

http://www.uwsg.iu.edu/UAU/advcomm/lsof.html

Last edited by rsimplicio (2006-10-18 00:11:09)

Offline

 

#3 2006-10-18 00:13:40

lderezinski
Happy Camper
From: Essex, Maryland USA
Registered: 2006-04-14
Posts: 4312
Website  Expertise

Re: how do I get lsof information??

it is there ... but not there

Code:

[z0002:/var/log] root# lsof
lsof: can't stat(/devices): No such file or directory


thanks will look into fuser


The greatest oak was once a little nut who held its ground.
MG->3ML->Premiere (Lithographer) + Accelerati + Joyeur (Yes, I work here, we are hiring)

Offline

 

#4 2006-10-18 00:26:56

lderezinski
Happy Camper
From: Essex, Maryland USA
Registered: 2006-04-14
Posts: 4312
Website  Expertise

Re: how do I get lsof information??

looked at fuser and it appears to give a list of processes which have open files. In my case I knew it was pid 1000 (I got that from top) But I don't see a way to get the list of open files for a specific process. Am I missing something here??


The greatest oak was once a little nut who held its ground.
MG->3ML->Premiere (Lithographer) + Accelerati + Joyeur (Yes, I work here, we are hiring)

Offline

 

#5 2006-10-18 04:44:05

ryanschwartz
Joyeur Emeritus
From: Madison, Wisconsin
Registered: 2004-06-01
Posts: 1991
Website  Expertise

Re: how do I get lsof information??

man proc

Then read about pfiles.

pfiles PID

Then wonder why lsof is so lame.

Offline

 

#6 2006-10-18 10:42:42

lderezinski
Happy Camper
From: Essex, Maryland USA
Registered: 2006-04-14
Posts: 4312
Website  Expertise

Re: how do I get lsof information??

ryanschwartz wrote:

pfiles PID


Yes, that is what I was looking for. Thanks

ryanschwartz wrote:

Then wonder why lsof is so lame.


awwww don't be so hard on it ... it would have answered my question of if/which cron job had gone nuts.

There is another function which used to use alot and I am unable to recall the name. It also takes a pid and then prints out all of the system calls as they happen. (Still brushing off the dust ... it's been a while since I used solaris ... back when sparc ultra 1 seemed really, really fast ... )


The greatest oak was once a little nut who held its ground.
MG->3ML->Premiere (Lithographer) + Accelerati + Joyeur (Yes, I work here, we are hiring)

Offline

 

#7 2006-10-18 13:01:22

Nick
Member
From: Deepest, darkest England
Registered: 2004-06-11
Posts: 532
Website  Expertise

Re: how do I get lsof information??

lderezinski wrote:

There is another function which used to use alot and I am unable to recall the name. It also takes a pid and then prints out all of the system calls as they happen. (Still brushing off the dust ... it's been a while since I used solaris ... back when sparc ultra 1 seemed really, really fast ... )


Have a look at Ben's introduction to Solaris .. you'll probably be wanting one of vmstat, mpstat, pstack or dtrace.

Take a good look at dtrace in particular. I'm told it's teh hotness.


Read on || WhiteInk

Offline

 

#8 2006-10-18 13:11:39

lderezinski
Happy Camper
From: Essex, Maryland USA
Registered: 2006-04-14
Posts: 4312
Website  Expertise

Re: how do I get lsof information??

Nick wrote:

Have a look at Ben's introduction to Solaris ..


now that is just too funnny I just printed out both articles. I was browsing through the forums and had just found which mentions both parts

yes ben rocks!! welcome aboard


The greatest oak was once a little nut who held its ground.
MG->3ML->Premiere (Lithographer) + Accelerati + Joyeur (Yes, I work here, we are hiring)

Offline

 

#9 2006-10-18 17:49:07

rsimplicio
Unapologetic Solopreneur
From: Chicago
Registered: 2005-05-11
Posts: 997
Website  Expertise

Re: how do I get lsof information??

Glad you got what you needed! Seeing as I actually have no access to Solaris (nor have I ever), I'm glad Ryan was around to give you advice!

Offline

 

#10 2007-09-11 18:00:40

JustinG
Member
Registered: 2007-02-28
Posts: 42
Website  Expertise

Re: how do I get lsof information??

I hit the same problem (trying to use lsof and getting that error message). I'm now reading through the articles mentioned above :). Just to note, it looks like the problem with lsof is that it can't be run from within a solaris zone.

Offline

 

#11 2007-09-12 00:01:47

jason
a chief (i started this place)
From: San Francisco
Registered: 2004-06-01
Posts: 8814
Website  Expertise

Re: how do I get lsof information??

dtrace -n 'syscall::open*:entry { printf("%s %s",execname,copyinstr(arg0)); }'

Offline

 

#12 2007-09-12 00:04:31

jason
a chief (i started this place)
From: San Francisco
Registered: 2004-06-01
Posts: 8814
Website  Expertise

Re: how do I get lsof information??

For example, the output from when i ssh into a box, sudo and restart apache looks like

http://textsnippets.com/posts/show/1208

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson