Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lsof output

Status
Not open for further replies.

icecubegr

Programmer
Jul 27, 2006
26
Hi,

I want to find the opened files for a process. I type the command lsof -p pid but I have the following problems:
1. Instead of getting the real file name, I get the file system name.
2. The inode file for files in a specific file system is '0', but for other file system are displayed.

== Example ==============================
$lsof -p98778
lsof: WARNING: compiled for AIX version 5.1.0.0; this is 5.3.0.0.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
jsh 98778 r07close cwd VDIR 42,4 0 0 /gl (/dev/fslv01)
jsh 98778 r07close 1w VREG 42,4 0 0 /gl (/dev/fslv01)
jsh 98778 r07close 3u VREG 42,2 21120 108577 /db5 (/dev/lv00)
jsh 98778 r07close 4u VREG 42,2 0 108579 /db5 (/dev/lv00)
jsh 98778 r07close 6u VREG 42,2 87 92161 /db5 (/dev/lv00)
jsh 98778 r07close 11u VREG 42,4 0 0 /gl (/dev/fslv01)
===========================

Can anyone help me on those problems?

Regards,
George
 
Hi George,

I just wanna say that i have the same output as yours as well! Never though of why to be honest!

I usually refer to this link for the lsof explaination! it seems that there are something missing!


I will be looking into this and will let you know once i find something related!

Thanks for bringing this out!

Regards,
Khalid
 
Could it be for this reason?
Code:
lsof: WARNING: compiled for AIX version 5.1.0.0; this is 5.3.0.0.

coz mine shows the same warning message! I guess we both have the same version of lsof!

Regards,
Khalid
 
Ok i just had a work around!

Code:
# lsof /usr | more
lsof: WARNING: compiled for AIX version 5.1.0.0; this is 5.2.0.0.
COMMAND     PID     USER   FD   TYPE DEVICE     SIZE/OFF NODE NAME
inetd     20538     root   19r  VREG   10,5   4295131556    0 /usr (/dev/hd2)
errdemon  21780     root    3r  VREG   10,5   4295131556    0 /usr (/dev/hd2)
cron      23954     root    3r  VDIR   10,5  17179951615    0 /usr (/dev/hd2)

So i took the first PID 20538 and used the ps command to get the file opened by this PID:

Code:
# ps -ef | grep 20538
    root 20538 23008   0   Sep 28      -  2:01 /usr/sbin/inetd 
    root 87140 20538   0 08:58:41      -  0:00 smbd 
    root 94752 20538   0 15:12:17      -  0:00 telnetd -a 
    root 96204 95256   0 09:59:26  pts/3  0:00 grep 20538

Regards,
Khalid
 
Hi,

I am not sure because I am just a programmer and not the admin in the server, but I have noticed something strange. The one displaying the inode is logical volume, but the other one is possibly file system under logical volume. Maybe this is lucky... maybe not.

George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top