• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2643
  • Last Modified:

why is lsof trying to access .gvfs? How do I stop it?

I run lsof as a non-root user in a completely different location... why is it complaining about not being about to read /root/.gvfs?   How do I stop this so lsof will work?


/usr1/cfmc/v85/qff % lsof j570.qff
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /root/.gvfs
      Output information may be incomplete.
/usr1/cfmc/v85/qff %
0
Xetroximyn
Asked:
Xetroximyn
  • 8
  • 3
  • 3
3 Solutions
 
Gerwin Jansen, EE MVETopic Advisor Commented:
You could just redirect that output by adding 2>/dev/null to your command.

You can try adding the full path to your j570.qff file instead of just the filename (see man).

Which Unix/Linux is this btw?
0
 
Brian UtterbackPrinciple Software EngineerCommented:
It seems that the system thinks that there is a Gnome Virtual Filesystem mounted at /root/.gvfs, but it also seems that the FUSE daemon that is responsible for it is not running. My guess is that the FUSE daemon exited without cleaning up and unmounted the mount point.
0
 
XetroximynAuthor Commented:
this is RedHat 6.1.   redirecting output wont help...  lsof is not  giving the error along with results -- it is failing to tell me what is accessing the file at all....

I have no idea why it is try to look in /root/.gvfs anyway... I am asking it to tell me what is accessing a file in a completely different location...

/usr1/cfmc/v85/qff % lsof /usr1/cfmc/v85/qff/j547s.qff
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /root/.gvfs
      Output information may be incomplete.
/usr1/cfmc/v85/qff % 

Open in new window


FYI - the gvfs is not listed in fstab or when I df from root -- but there is mentioned of it when I df from


df from root
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup_ID_22366-LogVol1
                       3031760   1120696   1757056  39% /
tmpfs                 24773000       300  24772700   1% /dev/shm
/dev/sda2               198337     75420    112677  41% /boot
/dev/mapper/VolGroup_ID_22366-LogVol2
                       9482464    153316   8847460   2% /tmp
/dev/mapper/VolGroup_ID_22366-LogVol5
                      33188664   3230280  28272472  11% /usr
/dev/mapper/VolGroup_ID_22366-LogVol4
                       9418096   1872472   7067212  21% /var
/dev/mapper/VolGroup_ID_22366-LogVolHome
                      32318340   2810396  27866268  10% /home
/dev/mapper/VolGroup_ID_22366-usr1
                     1348984988 175844620 1104615928  14% /usr1
192.168.1.7:/usr1     64602112  31993408  32608704  50% /usr1/aix
//192.168.1.9/acronis
                     5649071100 1686733668 3962337432  30% /usr1/ztemp.backup.test
[root@oaccati ~]#

Open in new window



df from user cfmc
/usr1/cfmc % df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup_ID_22366-LogVol1
                       3031760   1120688   1757064  39% /
tmpfs                 24773000       300  24772700   1% /dev/shm
/dev/sda2               198337     75420    112677  41% /boot
/dev/mapper/VolGroup_ID_22366-LogVol2
                       9482464    153316   8847460   2% /tmp
/dev/mapper/VolGroup_ID_22366-LogVol5
                      33188664   3230280  28272472  11% /usr
/dev/mapper/VolGroup_ID_22366-LogVol4
                       9418096   1872424   7067260  21% /var
/dev/mapper/VolGroup_ID_22366-LogVolHome
                      32318340   2810396  27866268  10% /home
df: `/root/.gvfs': Permission denied
/dev/mapper/VolGroup_ID_22366-usr1
                     1348984988 175842968 1104617580  14% /usr1
192.168.1.7:/usr1     64602112  31993184  32608928  50% /usr1/aix
//192.168.1.9/acronis
                     5649071100 1686720548 3962350552  30% /usr1/ztemp.backup.test
/usr1/cfmc %

Open in new window

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Gerwin Jansen, EE MVETopic Advisor Commented:
Did you first logon as root and then logon (through) to the non-root user? When I try the other way around (non-root first, then su) I get the same message but for the root.

The first logged-on user in that session apparantly runs the gvfs-fuse-daemon that accesses /home/<user>/.gvfs -> that is where your 'current' user has no access to, check with "ls -ld .gvfs".

Right are:

dr-x------ <user> <user>

where both user and group are your non-root user.

So lsof simply has no access to .gvfs and gives you a correct error message (that you can redirect to /dev/null if you like).
0
 
XetroximynAuthor Commented:
but why is it trying to access gvfs?  I am in a different folder asking it to tell me who is accessing a file that has nothing to do with gvfs!   Why does it fail to tell me who is accessing a file in another location?


FYI -- I am not su'd  -- just logged in directly
0
 
Brian UtterbackPrinciple Software EngineerCommented:
When it does a stat of the file, it gets a certain device name for the filesystem it is on. A file is defined by the inode and filesystem, not either alone. So, once it gets the inode and fielsystem device number, it needs to go through the list of all mounted filesystems and find out the device number of each to determine which filesystem it is on when it checks the open file table. The problem is that the .gvfs filesystem is listed as mounted, but the FUSE daemon is not responding to the file system requests.
0
 
XetroximynAuthor Commented:
thanks for the explanation!

Any idea why it does not show when in df from root then?

Either way -- can I forcibly dismount it?  any risk with that?
0
 
Brian UtterbackPrinciple Software EngineerCommented:
Don't know. Clearly the way df gets the list is different from the way lsofs gets it.

I don't think it should hurt to dismount it, since it seems like it is dead anyway.
0
 
XetroximynAuthor Commented:
OK -- I did a umount and now lsof does not give error - -but it still does not tell me who is accessing the file... I have to log into root to see who is accessing... can I change that somehow?
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
Did you try logging in the other way around like I suggested? In my case .gvfs is owned by the user instead of root.
0
 
XetroximynAuthor Commented:
logging in the other way around?  you mean log in as root and then su to the user?  Same thing happens then.

What I want is to be able to login as a non-root user, and run lsof to see what is accessing files.   Is that possible?  

(the.gvfs issue is gone now that I umounted it)
0
 
XetroximynAuthor Commented:
fuser also only seems to work logged in as root... lsof and fuser always just come back with nothing otherwise...
0
 
XetroximynAuthor Commented:
I needed to set user id to get them to work for non-root users

You should in both cases see an "s" in the 4th column, like

-r-sr-xr-x    1 root     system      244233 Apr 01 2009  /usr/sbin/lsof
-r-sr-xr-x    1 root     system       36630 Apr 18 00:07 /usr/sbin/fuser

If it's not there try to find out why/by whom is has been removed. Check your other (still working) machines (if any). Does it look the same there?

To set the SUID bit issue

chmod u+s $(which fuser)  $(which lsof)

Here is more about SUID:
http://en.wikipedia.org/wiki/Setuid
0
 
XetroximynAuthor Commented:
includes relevant helpful info
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 8
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now