A place where the Joyent community can gather, help each other out, and stay informed.
You are not logged in.
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)
Offline
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.htmlLast edited by rsimplicio (2006-10-18 00:11:09)
Offline
it is there ... but not there
[z0002:/var/log] root# lsof
lsof: can't stat(/devices): No such file or directory
thanks will look into fuser
Offline
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??
Offline
man proc
Then read about pfiles.
pfiles PID
Then wonder why lsof is so lame.
Offline
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 ... )
Offline
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.
Offline
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
Offline
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
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
For example, the output from when i ssh into a box, sudo and restart apache looks like
Offline