On Mon, May 31, 2004 at 12:02:07PM +0200, David Zeuthen wrote: > I've just put some code in HAL to detect whether the eject button is > pressed (using MMC-2) so ideally HAL would relay this to gnome-vfs which > would emit a PreUnmount signal such that apps closes their files and > then it can do the unmount(1), eject(1) dance. Thing is, I don't know > how many drives correctly implement this MMC-2 bit, any insight? My Dad has an HP drive that does. Its the only one I've ever seen > Maybe it would be smarter to get HAL to use some of the volumagic code > [1], since I guess a similar technique can be used for partitions on a > USB drive to give safe removal when the drive is not in use. Would this > be a good idea? Or are there kernel changes on the horizon to solve all > of these problems? Volumagic takes a very different approach to the entire problem. Basically it looks like this /mnt/cdrom <---NFS--->volumagic daemon <--mount on demand--> CD iso fs It uses the unfsd code which has path persistant handles for a given volume so works even with the CD being mounted and unmounted by the nfs/volumagic daemon. I wrote it as a hack after Al Viro reckoned it could be done that way just to evaluate the idea. Really the same logic needs to be more kernel side so that streaming file I/O bypasses the mount daemon logic.