Sorry if I missed the obvious, but I've googled up and down the problem without any success.
I need to ensure to perform some data integrity check/update/erasing whenever unmounting a particular device (it's "shall" be in a consistent state, but it's not a hostile environment, so the approach is robust enough - I cannot do this after mount, since the consistency is relevant to a 3rd system)
The simple way to do that for umount is a udev rule that "fixes" the mount_options to uhelper=my_integrity_check, where the helper is a simple script which checks and does the relevant things and then calls "umount -i"
The problem are the GUI tools which invoke udisks2 via dbus to umount the device what apparently (didn't really check what happens) calls /sbin/umount.udisks2 directly - not even an fstab entry (which i'd like to avoid) could prevent that "removing safely" happily ignores the uhelper entry.
So, what would be could was if either the udisks daemon would check and invoke the uhelper option or (might even be better) would allow me to configure or unconditionally invoke a local script to perform this custom clean-up.
(Bonus points for vendor/id/system matching, but I can completely detect the relevant device from userspace.