If an optical drive and the SATA controller support ATAPI asynchronous notification, then pressing the eject button doesn't cause HAL to unmount the disc and eject, as it should. At least it doesn't work reliably. When I hit eject, I get something like the output below from HAL. It seems that what's happening is that HAL gets the udev notification caused by the AN from the drive, and triggers hald-probe-storage. However, it seems like hald-probe-storage is missing the code from hald-addon-storage (which normally does media polling) to check if the eject button has been pressed using GET EVENT STATUS NOTIFICATION. Then hald-probe-storage interprets the change as meaning media was inserted, not that eject was pressed. This output is with HAL 0.5.12, but looking at the code in current git, it appears hald-probe-storage still doesn't do eject handling. 16:27:55.338 [I] osspec.c:247: SEQNUM=1573, ACTION=change, SUBSYSTEM=scsi, DEVPATH=/sys/devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0, DEVNAME=, IFINDEX=0 16:27:55.338 [I] hotplug.c:435: checking event /sys/devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0 16:27:55.338 [I] hotplug.c:121: /sys/devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0 is a device (store) 16:27:55.338 [I] device.c:4979: refresh_dev: subsys=scsi 16:27:55.338 [D] hotplug.c:453: events queued = 0, events in progress = 0 16:27:55.338 [D] hotplug.c:458: Hotplug-queue empty now ... no hotplug events in progress 16:27:55.487 [I] osspec.c:247: SEQNUM=1574, ACTION=change, SUBSYSTEM=block, DEVPATH=/sys/devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sr0, DEVNAME=/dev/sr0, IFINDEX=0 16:27:55.487 [I] hotplug.c:435: checking event /sys/devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sr0 16:27:55.487 [I] blockdev.c:1707: block_change: sysfs_path=/sys/devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sr0 16:27:55.487 [I] blockdev.c:1771: blockdev_rescan_device: udi=/org/freedesktop/Hal/devices/storage_model_iHAS324___A 16:27:55.488 [D] hotplug.c:453: events queued = 0, events in progress = 0 16:27:55.488 [D] hotplug.c:458: Hotplug-queue empty now ... no hotplug events in progress Run started hald-probe-storage (20000) (0) ! full path is '/usr/libexec/hald-probe-storage', program_dir is '/usr/libexec' woohoo [5847]: 16:27:55.490 [D] probe-storage.c:157: Doing probe-storage for /dev/sr0 (bus pci) (drive_type cdrom) (udi=/org/freedesktop/Hal/devices/storage_model_iHAS324___A) (--only-check-for-fs==1) [5847]: 16:27:55.491 [D] probe-storage.c:208: Doing open ("/dev/sr0", O_RDONLY | O_NONBLOCK) [5847]: 16:27:55.491 [D] probe-storage.c:214: Returned from open(2) [5847]: 16:27:55.496 [D] probe-storage.c:358: Checking for optical disc on /dev/sr0 [5847]: 16:27:55.496 [D] probe-storage.c:366: Doing open ("/dev/sr0", O_RDONLY | O_NONBLOCK | O_EXCL) [5847]: 16:27:55.497 [D] probe-storage.c:378: Open failed - Device Busy [5847]: 16:27:55.497 [D] probe-storage.c:387: Doing open ("/dev/sr0", O_RDONLY | O_NONBLOCK) [5847]: 16:27:55.498 [D] probe-storage.c:396: PROBE HAS EXCLUSIVE LOCK ON CDROM [5847]: 16:27:55.499 [D] probe-storage.c:438: media size = 437039104 [5847]: 16:27:55.499 [D] probe-storage.c:446: PROBE CLOSED LOCK ON CDROM 16:27:55.500 [I] hald_dbus.c:1342: storage.cdrom.read_speed -> 8468 16:27:55.500 [I] hald_dbus.c:1342: storage.cdrom.write_speed -> 1 16:27:55.500 [I] hald_dbus.c:1366: storage.removable.media_available -> True 16:27:55.500 [I] hald_dbus.c:1350: storage.removable.media_size -> 437039104 pid 5847: rc=2 signaled=0: /usr/libexec/hald-probe-storage 16:27:55.500 [I] blockdev.c:1727: hald-probe-storage --only-check-for-media returned 2 (exit_type=0) 16:27:55.500 [D] hotplug.c:453: events queued = 0, events in progress = 0 16:27:55.500 [D] hotplug.c:458: Hotplug-queue empty now ... no hotplug events in progress
Can you try, in a case where it fails, to call CheckForMedia() on the affected device via dbus_send? Something like that IIRC (you have to use the correct device path): dbus-send --system --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/storage_model_DVD__RW_UJ_857G org.freedesktop.Hal.Device.Storage.Removable.CheckForMedia Would help to know if this may eject the device.
Doesn't seem to help, after pressing the eject button in vain: dbus-send --system --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/storage_model_iHAS324___A org.freedesktop.Hal.Device.Storage.Removable.CheckForMedia method return sender=:1.0 -> dest=:1.356 reply_serial=2 boolean false I suspect something is swallowing up the notification without acting on it.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.