Comment 32 for bug 306673

Revision history for this message
In , Andreas Bartels (andreas-bartels) wrote :

I've same feature but use sshfs with autofs.

The very difference is nautilus is not keeping open the directory that it is watching at and but thats the major fault, if the drive gets unmounted it is not trying to get the directory again. Its only falling back to the mountpoint.

So I think there are 4 ways ob solving this problem.

a.
  keep the directory open that lsof will find a reportable connection to the drive and because of it autofs won't unmount.

b.
  check how does nautilus gets informed about the unmount. If this is done by autofs or the kernel, tell the guys of autofs, to use this function as well for sensoring used disks.

c.
  touch all the time you are in a directory this in between x seconds so that there will be all x seconds a use of this directory and do not use timouts for autofs shorter than x+1 seconds to make sure that autofs doesn't cansel the connection at all if a directory is opened by nautilus

d.
  do not set nautilus back to the mountpoint until nautilus hasn't tried to connect the drive twice if someone does any operation to the window. Because it is not nessesary to tell the unmount before not anybody tries to use the actual directory. If no connection is possible to the drive - automount doesn't reconnect - react as it was before but this won't be a problem, as than there is no way to access or read the directory at all and it is wright to jump back to the first possible point - the mountpoint.

I don't know how nautilus is doing it but I know that lsof doesn't tells anythin open and that nautilus is than by reading a dir opening lots of files short - maybe to get previews on them, but after them it is closing all open connections. (Think this isn't bad. as long as you do not reset the possition of noutilus without trying to connect the unmounted directory again if someone like to do something to it or its content) Best only react if someone tries to do something to the one item of the directory or the directory it self. If he does try to reread it and if that isn't possible jump back. This means nautilus isn't reacting in that moment while a drive is unmouted by changing its shown directory eaven if it might show the change in the sidebar.