By using external helper, umount command will redirect request to udevil.
This mechanism should work by adding uhelper=udevil mount option to mounts and adding /sbin/umount.udevil binary.
From umount man:
The syntax of external unmount helpers is:
/sbin/umount.suffix {directory|device} [-flnrv] [-t type.subtype]
where suffix is the filesystem type or a value from a "uhelper=" or
"helper=" mtab option. The -t option can be used for filesystems with
subtypes support (for example /sbin/mount.fuse -t fuse.sshfs).
The uhelper= (unprivileged unmount helper) mount option can be used
when non-root users need to be able to unmount a mountpoint which is
not defined in /etc/fstab (e.g. devices mounted by udisk).
The helper= mount option redirects all unmount requests to the
/sbin/umount.type helper independently of UID.
Options for helper (from umount.nfs help):
-f force unmount
-v verbose
-n Do not update /etc/mtab
-r remount
-l lazy unmount
So if user or something in the system decides to unmount udevil-controlled mountpoint with simple umount command, it would be actually unmounted with udevil (cleaning dir, etc).
By using external helper, umount command will redirect request to udevil.
This mechanism should work by adding uhelper=udevil mount option to mounts and adding /sbin/umount.udevil binary.
From umount man:
Options for helper (from umount.nfs help):
So if user or something in the system decides to unmount udevil-controlled mountpoint with simple umount command, it would be actually unmounted with udevil (cleaning dir, etc).