As now uam does mounts on CD/DVD media changes, it would be useful if it could handle eject requests as well. This probably means introducing a new uam-eject.sh script or adding a new feature to uam-umount.sh. The script has to unmount the device (without -f/-l) and eject it if the unmount succeeded. Otherwise, it would wait for an another eject request.
From my very limited understanding of the architecture of uam, my best guess is: -ACTION=="change", RUN+="/lib/udev/uam/uam-mount.sh" +ACTION=="change", RUN+="/lib/udev/uam/uam-remount.sh" where uam-remount.sh would just run uam-umount.sh and then uam-mount.sh. I assume this is the nature of udev CDROM events -- that the state of media being present has changed but in an unknown way? Also, uam-remount.sh could first check if the media present is still the same as it used to be and then noop. Sorry, I don't use uam myself though I probably should try it out ;-). And it seems much more convenient of a way to mount flashdrives...
(In reply to comment #1) > From my very limited understanding of the architecture of uam, my best guess > is: > > -ACTION=="change", RUN+="/lib/udev/uam/uam-mount.sh" > +ACTION=="change", RUN+="/lib/udev/uam/uam-remount.sh" > > where uam-remount.sh would just run uam-umount.sh and then uam-mount.sh. I > assume this is the nature of udev CDROM events -- that the state of media being > present has changed but in an unknown way? Also, uam-remount.sh could first > check if the media present is still the same as it used to be and then noop. Well, the trick is that when media change event occurs, the CD is no longer mounted. It seems that either eject or the kernel unmounts it beforehand. Though it may be a good idea to run an orphan scan there.
Fixed in two commits: - 27f8832 [1] to cleanup orphans when media ejected using 'eject' program, - d016417 [2] to unmount filesystems when using the 'eject' button. I think this is going to be released as 0.2. [1]:https://github.com/mgorny/uam/commit/27f8832 [2]:https://github.com/mgorny/uam/commit/d016417
Ok, this was fixed in uam-0.2.