Re: nautilus and fam... the saga continues
On Sun, 2004-01-25 at 04:37, Mpiktas wrote:
> > You see, the "problem" is that when you try to eject certain media, it
> > will complaint saying that the device is busy. Which indeed is the case
> > because FAM is locking it for whatever reason. The simplest way to see
> > this happening is to insert a CD with a movie, open it with nautilus, if
> > you setup Totem to do the video-thumbnails for you, you will see a icon
> > with a picture from a frame of the movie... Double-click to play the
> > movie. Close totem and then umount or eject the CD. If you see the
> > "device is busy" error (sometimes it works and you don't see this
> > error), then use "lsof" to see what's open...
> > Describing the process is long, and excuse me for my vague example, but
> > I'm sure this has happen to every single person using Gnome and
> > Nautilus+Fam in a Debian system -- especially if you mount lots of
> > remote media from SMB, NFS, CD, Floppy, Zip, etc...
> > Just to make a nice analogy, in my iMac running MacOS X 10.3 I'm always
> > able to eject any media no matter what I was doing with it. NFS mounts,
> > SAMBA, whatever, you name it... Now that's how things should be with
> > Gnome. Just work.
> Funny thing it used to work under Gnome 2.2. Now it does work when you restart
> FAM. If Nautilus and FAM combination does not release mounted media, restart
> FAM with /etc/init.d/fam restart and then Nautilus and FAM works like a charm.
> Mount media play a movie then unmount with Nautilus window open and it kills
> the window and unmounts the media.
And then when it can't unmount the media again, restart FAM again and it
should work like a charm
goto to BEGIN
It would be best to see what the source of the problem is and fix it so
that you don't EVER see this type of error. My propose solution can be
as simple as:
* Right click on Nautilus desktop and user choose to mount a media
* Nautilus knows the user mounted this disk
* User does whatever with disk and decides to eject it
* Nautilus knows the user wants to eject a disk he/she mounted and
ejects it -- no questions ask. i.e. kill the processes/fam locks that
you have to kill but get the media out
Of course, this is what nautilus is doing right now, except for being
*not* nice to FAM in the last step. Unless of course, there are other
things holding a disk... like an open Gnome-Terminal that somebody used
to "cd" into the mounted media. I figure this information is in the
output of "lsof" somewhere and nautilus could simply check if the user
ejecting the media is in fact the user holding some kind of lock on the
open media. Yep, it starts to look complicated but, if it works on the
Mac it means it can be done. When an open terminal in the Mac or any
other application, is doing something in a media and the user ejects it,
that path is simply taken out from the running application.
As an illustration, in Disk Utility (MacOS X), do a new image from a
CD/DVD. You will see the mounted media in Disk Utility (Panther) and the
newly created media, in the left-hand-side pane. Now eject the media and
it does get ejected and the icon for it gets taken away from Disk
Utility. Also, if you delete the image from the desktop (or wherever you
saved it to), it gets removed from the pane in Disk Utility.
Now, that's consistency.
P.S. for those wondering why don't I simply use the Mac and forget about
Linux, that's not the point. I use my Linux box for everything and my
Mac just to give me inspiration on what software to write for linux, or
what linux lacks in general that should be there. Also, I do love the
ability to tinker with a gazillion settings or simply do things by hand.
Doing this on the Mac would defeat its purpose as it will make it very
System Administrator/Web Developer
"We think basically you watch television to turn your brain off, and you work on your computer when you want to turn your brain on" -- Steve Jobs in an interview for MacWorld Magazine 2004-Feb