GNOME Bugzilla – Bug 548221
After inserting a blank CD, a dialog won't pop up
Last modified: 2008-09-01 11:54:21 UTC
Please describe the problem: In previous releases, after inserting a blank CD, a dialog with the following text will pop up,"You have inserted a blank disc. What would you like to do?". But at the present, the dialog won't pop up. After making enable_automount=yes in gnome-volume-manager, the dialog will pop up. But in gnome-volume-manger's configure.in, it set enable_automount to no by default and it has such a line: dnl Enable automount support (disabled by default now that Nautilus handles this). Will nautilus be responsible for pop up such a dialog? Or is it just a small feature not implemented? I found this problem on Solaris with nautilus 2.23.6.1 and gnome-volume-manger 2.22.5. Ubuntu 8.04 also won't pop up this dialog. Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
As I said, this is done in Nautilus as of Gnome 2.22. Questions 1. does automount/autorun work with other kinds of media (e.g. usb stick etc.) 2. please attach - output of lshal before inserting the media - output of 'lshal --monitor' when inserting the media - output of lshal after inserting the media 3. in the Nautilus preferences, under the Media Tab, what is Nautilus configured to do for e.g. "Blank CD"? It should look like this http://people.freedesktop.org/~david/nautilus-blank-cd-action.png David
Created attachment 116892 [details] [review] Make nautilus 2.22 default to asking what to do Also keep in mind that stock Nautilus 2.22.x DOES NOT DEFAULT to asking what to do; this is changed in Nautilus 2.23.x where the default is to ask. For Nautilus 2.22.x you probably want to patch the defaults in your Nautilus package. I've attached that patch we're using in Fedora 9.
(In reply to comment #1) > As I said, this is done in Nautilus as of Gnome 2.22. Questions > > 1. does automount/autorun work with other kinds of media (e.g. usb stick etc.) > I tested it using a usb stick, a audio disc and a data disc, it doesn't work with all these 3 media. > 2. please attach > - output of lshal before inserting the media See attachment: lshal-before. > - output of 'lshal --monitor' when inserting the media See attachment:lshal-monitor > - output of lshal after inserting the media See attachment: lshal-after > 3. in the Nautilus preferences, under the Media Tab, what is Nautilus > configured to do for e.g. "Blank CD"? It should look like this > http://people.freedesktop.org/~david/nautilus-blank-cd-action.png Here Solaris has a bug. On Solaris, for Other Media->Type and Other Media->Action, the lists are null, there's no way to set them as the above picture configured. Maybe the bug impacts automount/autorun? > > David >
Created attachment 116941 [details] lshal output before inserting the blank CD
Created attachment 116942 [details] lshal -m output at inserting the blank CD
Created attachment 116943 [details] lshal output after inserting the blank CD
(In reply to comment #3) > > 3. in the Nautilus preferences, under the Media Tab, what is Nautilus > > configured to do for e.g. "Blank CD"? It should look like this > > http://people.freedesktop.org/~david/nautilus-blank-cd-action.png > Here Solaris has a bug. On Solaris, for Other Media->Type and Other > Media->Action, the lists are null, there's no way to set them as the above > picture configured. Maybe the bug impacts automount/autorun? Yes this would definitely impact automount/autorun. So if I was you, I'd look at how to resolve that problem - you probably also want to insert debug traces into libnautilus-private/nautilus-autorun.c to figure out what's going on. David
(In reply to comment #7) > (In reply to comment #3) > > > 3. in the Nautilus preferences, under the Media Tab, what is Nautilus > > > configured to do for e.g. "Blank CD"? It should look like this > > > http://people.freedesktop.org/~david/nautilus-blank-cd-action.png > > Here Solaris has a bug. On Solaris, for Other Media->Type and Other > > Media->Action, the lists are null, there's no way to set them as the above > > picture configured. Maybe the bug impacts automount/autorun? > > Yes this would definitely impact automount/autorun. So if I was you, I'd look > at how to resolve that problem - you probably also want to insert debug traces > into libnautilus-private/nautilus-autorun.c to figure out what's going on. > > David > After fixing this problem and configuring nautilus as you said, the dialog still won't pop up for a blank CD. After reading the codes, I discovered that the signal "mount_added" triggered to pop up the dialog. However, gio won't send out a mount_added signal for the blank CD.
(In reply to comment #8) > After fixing this problem and configuring nautilus as you said, the dialog > still won't pop up for a blank CD. What was the problem? > After reading the codes, I discovered that the signal "mount_added" triggered > to pop up the dialog. However, gio won't send out a mount_added signal for the > blank CD. Is the gvfs hal monitor volume running at all? On 2.22 it's loaded into each process using gio, on 2.24 it's out of process. Try sprinkling the source with debug statements to see what's going on. Also, try testing with other things than just blank CD's, for example data CD's, usb storage devices etc.
(In reply to comment #9) > (In reply to comment #8) > > After fixing this problem and configuring nautilus as you said, the dialog > > still won't pop up for a blank CD. > > What was the problem? The problem described in the bug description. That is, after fixing the problem about Nautilus configure and configuring it as the picture you attached do, the dialog that pops up in previous releases still doesn't pop up. Here I mean the greeting dialog with the following text "You have inserted a blank disc. What would you like to do?". > > > After reading the codes, I discovered that the signal "mount_added" triggered > > to pop up the dialog. However, gio won't send out a mount_added signal for the > > blank CD. > > Is the gvfs hal monitor volume running at all? On 2.22 it's loaded into each > process using gio, on 2.24 it's out of process. Try sprinkling the source with > debug statements to see what's going on. Also, try testing with other things > than just blank CD's, for example data CD's, usb storage devices etc. Yes, the gvfs hal monitor volume is running at all. I tried audio CD and data CD. The responses are different from blank CD's. mount_added signal is emitted, but still doesn't work, and there's a warning message "Unabled to guess content type for mount: mount doesn't implement content type guessing". For the detailed info, please see http://bugzilla.gnome.org/show_bug.cgi?id=548963.
(In reply to comment #10) > (In reply to comment #9) > > (In reply to comment #8) > > > After fixing this problem and configuring nautilus as you said, the dialog > > > still won't pop up for a blank CD. > > > > What was the problem? The problem is that shared-mime-info I used is old. After bumping shared-mime-info to the latest version,0.5.1, the problem is fixed. My last reply here is confused. Sorry for the confusion. > The problem described in the bug description. > That is, after fixing the problem about Nautilus configure and configuring it > as the picture you attached do, the dialog that pops up in previous releases > still doesn't pop up. Here I mean the greeting dialog with the following text > "You have inserted a blank disc. What would you like to do?". > > > > > > > After reading the codes, I discovered that the signal "mount_added" triggered > > > to pop up the dialog. However, gio won't send out a mount_added signal for the > > > blank CD. > > > > Is the gvfs hal monitor volume running at all? On 2.22 it's loaded into each > > process using gio, on 2.24 it's out of process. Try sprinkling the source with > > debug statements to see what's going on. Also, try testing with other things > > than just blank CD's, for example data CD's, usb storage devices etc. > Yes, the gvfs hal monitor volume is running at all. > I tried audio CD and data CD. The responses are different from blank CD's. > mount_added signal is emitted, but still doesn't work, and there's a warning > message "Unabled to guess content type for mount: mount doesn't implement > content type guessing". For the detailed info, please see > http://bugzilla.gnome.org/show_bug.cgi?id=548963. >
(In reply to comment #11) > The problem is that shared-mime-info I used is old. After bumping > shared-mime-info to the latest version,0.5.1, the problem is fixed. So can we close this bug as INVALID or there's something else that needs to be fixed?
For a blank CD, the return value of g_volume_can_mount() is false. While for data CD and audio CD, its return value is true. And the return value of g_volume_can_mount() is checked to decide finally if a data is set to allow autorun for a volume in nautilus_allow_autorun_for_volume(). So the current result is that the data is set for a audio CD and data CD but not for a blank CD, which caused the greeting dialog pops up for a audio CD and a data CD, but not for a blank CD. Does it make sense to check the return value of g_volume_can_mount() in volume_added_callback()?
Created attachment 117435 [details] [review] patch Just remove the check of g_volume_can_mount's return value in volume_added_callback()
Jerry: Thanks for the analysis. I seem to be able to reproduce it with Nautilus/GVFS/glib trunk, and an Ubuntu Hardy base distribution (probably outdated HAL). It may totally be the case that we experience the issue due to mixing stable and unstable systems and conflicting GVFS daemons. However, with your patch you are trying to mount a non-mountable volume, and this is very odd. I'd like to add a few aspects to your analysis, and describe my experiences: 1) device/mount layout gvfs-ls -i -l output: Drive(0): CD-RW/DVD-ROM Drive ... can_mount=0 ... Mount(0): Leere CD-R -> burn:/// can_unmount=0 can_eject=1 2) empty volumes are always mounted It looks like a mount (i.e. burn:/// map) is added automatically (cf. [1)])- maybe by a volume monitor, since it is added even if the Nautilus' media_automount preference is set to FALSE. 3) automount vs. autorun nautilus_autorun() is only called as the mount is attempted, i.e. if nautilus_file_operations_mount_volume() is called. It should however also be able to run if mounting is NOT possible (due to g_volume_can_mount() being FALSE), and the mount is added programmatically [cf. 2)]. I'll attach a patch. 4) more issues? Even with the patch under [3)], I have (nautilus:18476): GVFS-RemoteVolumeMonitor-WARNING **: invoking IsSupported() failed for remote volume monitor with dbus name org.gtk.Private.HalVolumeMonitor: org.freedesktop.DBus.Error.Spawn.ChildSignaled: Process /opt/gtk/libexec/gvfs-hal-volume-monitor received signal 11 [on Nautilus startup] ** (nautilus:1931): WARNING **: Unabled to guess content type for mount: mount doesn't implement content type guessing Manually trying to run gvfs-hal-volume-monitor in my /opt prefix yields: (process:17594): GLib-GObject-WARNING **: Two different plugins tried to register 'HalDevice'. (process:17594): GLib-GObject-WARNING **: Two different plugins tried to register 'HalPool'. (process:17594): GLib-GObject-WARNING **: Two different plugins tried to register 'GHalVolumeMonitor'. (process:17594): GLib-GIO-WARNING **: Tried to register an extension of the type (null) to extension point gio-native-volume-monitor. Expected type is GNativeVolumeMonitor. (process:17594): GLib-GObject-WARNING **: cannot register existing type `GHalDrive' (process:17594): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed (process:17594): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed (process:17594): GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed Segmentation fault The HAL monitor from /usr is probably preferred over my custom /opt one.
Created attachment 117715 [details] [review] proposed patch Assuming that even with the most recent volume monitors, a mount is added programmatically for an un-mountable device, this patch is required to make autorun work for them.
Issue 4 was a duplicate of 546270. My proposed attachment was not correct because it only allowed autorun if an automount was possible. I committed a different patch: http://svn.gnome.org/viewvc/nautilus?view=revision&revision=14557 Thanks for your efforts Jerry, closing.