Bug 94112 - umount.udisks2 should support last-action scripts
Summary: umount.udisks2 should support last-action scripts
Status: NEW
Alias: None
Product: udisks
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium enhancement
Assignee: Martin Pitt
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-12 15:22 UTC by Thomas Lübking
Modified: 2016-02-12 15:22 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Thomas Lübking 2016-02-12 15:22:10 UTC
Sorry if I missed the obvious, but I've googled up and down the problem without any success.

---

Task:
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)

Approach:
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"

Problem:
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.

Suggested solution:
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.


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.