! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Unmount + eject volume if HAL sends eject signal (button on device) no longer...
Status:
RESOLVED: FIXED

Comments

Description Jason Park 2007-03-03 17:41:36 CET
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20070225 Firefox/2.0.0.2
Build Identifier: 

This was and added feature from http://bugzilla.xfce.org/show_bug.cgi?id=2759

I get the following error when pressing the eject button.

Failed to eject "/org/freedesktop/Hal/devices/storage_model_DVD_RW_ND_2510A".
Given device "/org/freedesktop/Hal/devices/storage_model_DVD_RW_ND_2510A" is not a volume or drive.

It looks like Thunar calls exo-eject with the device udi and exo-eject displays the error.  I can run exo-eject -e -h org/freedesktop/Hal/devices/storage_model_DVD_RW_ND_2510A from a terminal and get the same error.  If I run exo-eject -e -d /dev/sr0 it ejects.

I have nothing in /etc/fstab for my optical drives and thunar volume manager is enabled.

Here is the output from lshal -m, dbus-monitor --system and dbus-monitor while inserting a DVD, then pressing eject once it is mounted.

Start monitoring devicelist:
-------------------------------------------------
storage_model_DVD_RW_ND_2510A property storage.removable.media_available = true
volume_label_ROBINHOOD added
volume_label_ROBINHOOD property volume.mount_point = '/media/ROBINHOOD'
volume_label_ROBINHOOD property volume.is_mounted_read_only = true
volume_label_ROBINHOOD property volume.is_mounted = true
storage_model_DVD_RW_ND_2510A condition EjectPressed = 

dbus-monitor --system
signal sender=org.freedesktop.DBus -> dest=:1.32 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.32"
signal sender=:1.0 -> dest=(null destination) path=/org/freedesktop/Hal/devices/storage_model_DVD_RW_ND_2510A; interface=org.freedesktop.Hal.Device; member=PropertyModified
   int32 1
   array [
      struct {
         string "storage.removable.media_available"
         boolean false
         boolean false
      }
   ]
signal sender=:1.0 -> dest=(null destination) path=/org/freedesktop/Hal/Manager; interface=org.freedesktop.Hal.Manager; member=DeviceAdded
   string "/org/freedesktop/Hal/devices/volume_label_ROBINHOOD"
signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.33"
   string ""
   string ":1.33"
signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.34"
   string ""
   string ":1.34"
signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.35"
   string ""
   string ":1.35"
signal sender=:1.0 -> dest=(null destination) path=/org/freedesktop/Hal/devices/volume_label_ROBINHOOD; interface=org.freedesktop.Hal.Device; member=PropertyModified
   int32 3
   array [
      struct {
         string "volume.mount_point"
         boolean false
         boolean false
      }
      struct {
         string "volume.is_mounted_read_only"
         boolean false
         boolean false
      }
      struct {
         string "volume.is_mounted"
         boolean false
         boolean false
      }
   ]
signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.35"
   string ":1.35"
   string ""
signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.34"
   string ":1.34"
   string ""
signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.33"
   string ":1.33"
   string ""
signal sender=:1.0 -> dest=(null destination) path=/org/freedesktop/Hal/devices/storage_model_DVD_RW_ND_2510A; interface=org.freedesktop.Hal.Device; member=Condition
   string "EjectPressed"
   string ""
signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.36"
   string ""
   string ":1.36"
signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.36"
   string ":1.36"
   string ""

 
dbus-monitor 
signal sender=org.freedesktop.DBus -> dest=:1.23 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.23"
method call sender=:1.23 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='method_call'"
method call sender=:1.23 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='method_return'"
method call sender=:1.23 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='error'"
signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.24"
   string ""
   string ":1.24"
method call sender=:1.24 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method call sender=:1.24 -> dest=org.xfce.Thunar path=/org/xfce/FileManager; interface=org.xfce.Thunar; member=LaunchFiles
   string "/home/jason"
   array [
      string "/media/ROBINHOOD"
   ]
   string ":0.0"
signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.24"
   string ":1.24"
   string ""








Reproducible: Always

Steps to Reproduce:
1. Insert disc, let thunar automount volume.
2. Press eject button on device
Actual Results:  
Failed to eject "/org/freedesktop/Hal/devices/storage_model_DVD_RW_ND_2510A".
Given device "/org/freedesktop/Hal/devices/storage_model_DVD_RW_ND_2510A" is not a volume or drive.

Expected Results:  
Unmount and eject volume.

using 

Arch Linux
XFCE 4.4.0
Thunar 0.8.0
exo 0.3.2
hal 0.5.8.1
dbus 1.0.2
Comment 1 Andy 2007-09-08 09:24:21 CEST
Same problem here, see also: 

http://forums.gentoo.org/viewtopic-t-580643.html
Comment 2 Alex V. Myltsev 2007-09-12 16:09:26 CEST
Created attachment 1358 
fix for exo_mount_hal_device_from_udi to avoid this issue

When the eject button is pushed, thunar-volmanager calls exo-eject with the disc drive device as the parameter. exo-mount tries to find the actual *volume* to unmount. However, it seems to rely on the assumption that the *drive device* does not implement any HAL interfaces at all. This is now wrong, as the drive usually implements the Storage interface (though not the Volume interface).

The fix is therefore trivial: if the given device does not implement the Volume interface, always try to search for its children that *do* implement it.

Unfortunately, exo_mount_hal_device_from_udi had a very convoluted control flow (several GOTOs that jumped wildly between labels) and at least one memory leak. That's why the attached patch is rather intrusive.
Comment 3 Alex V. Myltsev 2007-09-14 14:14:18 CEST
Created attachment 1360 
new version of the patch

A slightly better version of the patch. It handles (rare) D-Bus errors better.
Comment 4 Jani Monoses 2007-09-30 21:54:40 CEST
Affects Xubuntu 7.04 and 7.10 as well
https://bugs.launchpad.net/ubuntu/+bug/94416
Comment 5 Jani Monoses 2007-10-03 13:12:23 CEST
Created attachment 1380 
a hacky patch

Another way is to make thunar only call exo-eject with a valid udi.
Here's a patch that does that and the one I uploaded to Xubuntu. It's a hack but I could see no clean way of doing this without messing with HAL volume stuff from the upper volman layer.

The code is copied from gnome-volume-manager
Comment 6 Benedikt Meurer editbugs 2007-12-01 23:36:11 CET
Aye, seems to make sense. But why didn't you simply fix exo-eject here?
Comment 7 Alex V. Myltsev 2007-12-02 00:01:32 CET
(In reply to comment #6)
> Aye, seems to make sense. But why didn't you simply fix exo-eject here?
My patch above does just that. I wonder why Jani did not apply it.
Comment 8 Jani Monoses 2007-12-02 09:20:01 CET
fixing exo eject would have been more intrusive, see Alex's patch.
In xubuntu we're using gnome-mount/umount/eject, it works well, no longer has gnome deps and has the benefit of being already maintained upstream and by ubuntu devs so we have less issues.
Comment 9 Josh Saddler 2008-02-22 00:56:16 CET
The newer patch posted by Alex works on my system. I'm using Thunar 0.9.0-r1 and exo-0.3.4. I experienced the same errors as everyone else on my Thinkpad R61i's UltraBay optical drive.

Can this patch be merged into a new exo release? It works fine for me; in fact, it's the only way that I can eject CDs/DVDs without opening up a terminal and becoming root.

Thanks.
Comment 10 Yves-Alexis Perez editbugs 2008-03-05 06:48:06 CET
(In reply to comment #8)
> fixing exo eject would have been more intrusive, see Alex's patch.
> In xubuntu we're using gnome-mount/umount/eject, it works well, no longer has
> gnome deps and has the benefit of being already maintained upstream and by
> ubuntu devs so we have less issues.
> 
gnome-mount without gnome dependencies? I don't get it: http://packages.ubuntu.com/hardy/gnome-mount
Comment 11 Yves-Alexis Perez editbugs 2008-03-05 07:00:13 CET
(In reply to comment #6)
> Aye, seems to make sense. But why didn't you simply fix exo-eject here?

Hey Benny,

could you comment on the two patches (or even better, fix this directly in the concerned package, but I know you're quite busy atm)

Cheers,
Comment 12 Yves-Alexis Perez editbugs 2008-03-28 10:44:25 CET
(In reply to comment #11)
> (In reply to comment #6)
> > Aye, seems to make sense. But why didn't you simply fix exo-eject here?
> 
> Hey Benny,
> 
> could you comment on the two patches (or even better, fix this directly in the
> concerned package, but I know you're quite busy atm)

Hmhm, any news on this?
Comment 13 Robby Workman editbugs 2008-05-26 01:23:03 CEST
Benny,
I too would like some comment on this if possible - if one of the two patches is "accepted" and/or you can provide one that is, I'd love to get this into the Slackware packages.
Comment 14 Jayson King 2008-10-27 06:04:26 CET
The patch from comment #3 fixes the problem for me, too.
Comment 15 Glenn Matthys 2008-12-06 10:06:21 CET
Has this fix been included in some release, and if not, why hasn't it been included?
Comment 16 Jacek Sowiński 2009-07-28 15:31:10 CEST
Simple question: Is this bug ever going to be fixed, and if not, why?
Comment 17 Robby Workman editbugs 2009-08-10 13:40:51 CEST
*** Bug 3128 has been marked as a duplicate of this bug. ***
Comment 18 Kevin Fenzi 2009-09-26 02:18:33 CEST
I'd love to see this fixed in Thunar as well.
Comment 19 Jeremy Olexa 2009-10-09 15:00:32 CEST
Nick, in Gentoo we were applying the first patch above to exo. But it doesn't apply anymore to exo-0.3.103. Can we get a resolution for exo/thunar here?

Downstream bug: http://bugs.gentoo.org/199615
Comment 20 Jacek Sowiński 2009-10-09 18:07:56 CEST
Just for the record: does anybody from Xfce team read messages under this bug? Maybe we should fill new bug-report under: 'Product: Exo' to be  heard?
Comment 21 Nick Schermer editbugs 2009-10-09 18:59:47 CEST
Fixed, next time move the bug to exo, because I'm not tracking thunar bugs.
Comment 22 Nick Schermer editbugs 2009-10-09 19:01:55 CEST
Wait, you guys can try the patch. You can find it here:

http://git.xfce.org/xfce/exo/commit/?id=42d4c9befb7e32d4675976093c435fc198977d95
Comment 23 Nick Schermer editbugs 2009-10-09 19:08:57 CEST
*** Bug 3593 has been marked as a duplicate of this bug. ***
Comment 24 Nick Schermer editbugs 2009-10-10 08:26:09 CEST
For easier testing, the patch is in the xfce-4.6 branch too and you can download a testing packages here: http://foo-projects.org/~nick/packages/exo-0.3.103git-5f3da21.tar.bz2

If 2 or more people can verify the bug is fixed, I'll do a 0.3.104 release right away, because this can indeed be a quite frustrating issue.
Comment 25 Jacek Sowiński 2009-10-10 12:18:02 CEST
(In reply to comment #24)
> For easier testing, the patch is in the xfce-4.6 branch too and you can
> download a testing packages here:
> http://foo-projects.org/~nick/packages/exo-0.3.103git-5f3da21.tar.bz2

There is also exo-0.3.103-r1.ebuild in Gentoo with your patch from comment #22.

> If 2 or more people can verify the bug is fixed, I'll do a 0.3.104 release
> right away, because this can indeed be a quite frustrating issue.

For me it's fixed. Unmounting with eject button works well here (tried with about 10 CDs).
Comment 26 Nick Schermer editbugs 2009-10-10 15:55:23 CEST
It fixed the problem for Yves-Alexis too, so that is good enough for me. Expect the 0.3.104 release in a couple of minutes.

Bug #2968

Reported by:
Jason Park
Reported on: 2007-03-03
Last modified on: 2009-10-10
Duplicates (2):
  • 3128 thunar-volman does not unmount the cd/dvd device if i press the eject button on drive
  • 3593 No auto-unmounting of optical discs

People

Assignee:
Nick Schermer
CC List:
19 users

Version

Version:
0.3.103

Attachments

fix for exo_mount_hal_device_from_udi to avoid this issue (6.29 KB, patch)
2007-09-12 16:09 CEST , Alex V. Myltsev
no flags
new version of the patch (6.54 KB, patch)
2007-09-14 14:14 CEST , Alex V. Myltsev
no flags
a hacky patch (3.08 KB, patch)
2007-10-03 13:12 CEST , Jani Monoses
no flags

Additional information