Unmounting and 'eject' press
eikke at eikke.com
Sun May 30 13:56:15 PDT 2004
> It is correct that when using g-v-m and HAL, the disc isn't ejected when
> the user presses the eject button, sorry.
> As you point out it would indeed be nice if HAL could intercept the fact
> that the user pressed the eject button and relay this to e.g. gnome-vfs
> through a HAL DeviceCondition on the HalDevice representing the disc.
> The right thing in GNOME would be for gnome-vfs to catch this and emit a
> preunmount signal (it can do this today AFAIK), applications would close
> their files and acknowledge, and finally gnome-vfs would issue the
> umount(1), eject(1) and the right thing would happen. Oh, layers upon
> layers, but that is the way it is :-)
I'd like my prog to be DE-agnostic, thats right why I'm writing it
(otherwise GVM is sufficient). So gnome-vfs isn't really an option.
> But I haven't found a way to get HAL to detect that the eject button is
Me neither. In fact, I don't think it is possible at all.
> Of course the right thing would be to have the kernel events layer Robert
> talking about to broadcast this on the system message bus. Does anyone
> know if it's possible today? Kernel people?
That would be great, but not possible I'm affraid. Even the kernel doesnt
know when the button is pressed AFAIK.
I've been looking into the submount sources too, but didn't find something
What could be a solution: don't lock the station at all (using an ioctl,
theres a define in cdrom.h I think), catch the HAL event when the cdrom is
ejected (volume disapears), and call umount. But this is a bad solution
because the user will be able to eject when the drive is in use too...
hal mailing list
hal at freedesktop.org
More information about the Hal